fix(device-deploy): prove r46 rollback and version empty DNS fingerprints
This commit is contained in:
@@ -174,5 +174,29 @@ class DeploymentQueue:
|
||||
self.db.execute("UPDATE runs SET phase=?,receipt=? WHERE id=?", (phase, receipt, identity))
|
||||
self.transaction(apply)
|
||||
|
||||
def reconcile_r46(self, identity, *, digest, artifact, receipt):
|
||||
"""Exact terminal blocked -> failed recovery after canonical proof.
|
||||
|
||||
This never makes the failed artifact ready again. The caller verifies
|
||||
the immutable failed evidence and the separate successful recovery.
|
||||
"""
|
||||
sha = 'e30a6dd2a1eae306d811977188f5d118aefed4ab'
|
||||
expected_receipt = 'canonical-reconciled:device-core-release-r46-reconciliation-v1-20261105-001'
|
||||
if (type(identity) is not int or identity != 46
|
||||
or digest != 'b985f67bf160014a7e81679e072fc164d69e9ea21feb8165af0163fbed10adba'
|
||||
or artifact != 'nodedc-device-core-release-v1-r46-'+sha+'.tgz'
|
||||
or receipt != expected_receipt):
|
||||
raise QueueError('r46_reconciliation_identity_mismatch')
|
||||
def apply():
|
||||
row = self.db.execute('SELECT * FROM runs WHERE id=?', (identity,)).fetchone()
|
||||
if row is None or tuple(row[k] for k in ('number','sha','event','branch','workflow','digest','artifact')) != (39,sha,'push','main',WORKFLOW,digest,artifact):
|
||||
raise QueueError('r46_reconciliation_row_mismatch')
|
||||
if row['phase'] == 'failed' and row['receipt'] == receipt:
|
||||
return
|
||||
if row['phase'] != 'blocked' or row['receipt'] != 'canonical-rollback-unconfirmed':
|
||||
raise QueueError('r46_reconciliation_predecessor_mismatch')
|
||||
self.db.execute("UPDATE runs SET phase='failed',receipt=? WHERE id=?", (receipt,identity))
|
||||
self.transaction(apply)
|
||||
|
||||
def snapshot(self):
|
||||
return [dict(row) for row in self.db.execute("SELECT * FROM runs ORDER BY number")]
|
||||
|
||||
Reference in New Issue
Block a user