From c05b979b01af15cc19add27e81ce9e7ea8103a71 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Sun, 8 Nov 2026 19:09:27 +0800 Subject: [PATCH] Bind repair execution receipts to the reviewed plan hash --- paper_atlas/ingestion/joint_editions.py | 2 ++ tests/test_joint_editions.py | 1 + 2 files changed, 3 insertions(+) diff --git a/paper_atlas/ingestion/joint_editions.py b/paper_atlas/ingestion/joint_editions.py index bd5a576..ff44857 100644 --- a/paper_atlas/ingestion/joint_editions.py +++ b/paper_atlas/ingestion/joint_editions.py @@ -181,6 +181,8 @@ def run(db, out, *, pg_service=None, pg_schema=None, plan=None, plan_sha256=None raise ValueError('Plan belongs to another database/schema') report = apply_plan(c, expected) if expected is not None else inspect(c) report['database'] = identity + if expected is not None: + report['plan_sha256'] = plan_sha256 if expected is not None: c.commit() except BaseException: diff --git a/tests/test_joint_editions.py b/tests/test_joint_editions.py index 9a86a07..1732589 100644 --- a/tests/test_joint_editions.py +++ b/tests/test_joint_editions.py @@ -108,6 +108,7 @@ class JointEditionTests(unittest.TestCase): result=run(self.db,Path(self.tmp.name)/'applied.json',plan=out,plan_sha256=sha) again=run(self.db,Path(self.tmp.name)/'retry.json',plan=out,plan_sha256=sha) self.assertEqual(result['updated_editions'],2);self.assertEqual(again['updated_editions'],0) + self.assertEqual(result['plan_sha256'],sha);self.assertEqual(again['plan_sha256'],sha) altered=json.loads(raw);altered['database']['path']='another.sqlite' bad=Path(self.tmp.name)/'wrong-db.json';bad.write_text(json.dumps(altered)) with self.assertRaisesRegex(ValueError,'another database'):