Prove CMS r39 restoration and version runtime fingerprints

This commit is contained in:
DCCONSTRUCTIONS
2026-11-04 23:21:52 +03:00
parent 3abfce339d
commit 0998d76428
12 changed files with 779 additions and 9 deletions
+24
View File
@@ -174,5 +174,29 @@ class DeploymentQueue:
self.db.execute("UPDATE runs SET phase=?,receipt=? WHERE id=?", (phase, receipt, identity))
self.transaction(apply)
def reconcile_r39(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 = 'c9d8f0ae59211ce3443300acfea311907508261a'
expected_receipt = 'canonical-reconciled:dc-cms-r39-runtime-reconciliation-v2-20261104-001'
if (type(identity) is not int or identity != 39
or digest != '3d3ca8ced21aa694d18bbbcf62c93058f2660b3e84aed3292f7e6f21b9d03029'
or artifact != 'nodedc-dc-cms-release-v1-r39-'+sha+'.tgz'
or receipt != expected_receipt):
raise QueueError('r39_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')) != (1,sha,'push','master',WORKFLOW,digest,artifact):
raise QueueError('r39_reconciliation_row_mismatch')
if row['phase'] == 'failed' and row['receipt'] == receipt:
return
if row['phase'] != 'blocked' or row['receipt'] != 'canonical-rollback-unconfirmed':
raise QueueError('r39_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")]