fix(01): WR-01 preserve validated capability history in checkpoint viewer
This commit is contained in:
1 parent
6e5ee0bd25
commit
548c97aa58
4 files changed
+57
-2
No files matched your search
@@ -26,7 +26,7 @@ def ready(checkpoint):
|
||||
raise ValueError('Synthetic checkpoint is tooling-only, not final materials')
|
||||
names = {entry['path'] for entry in manifest['files']}
|
||||
required = set(MATERIALS) | {'protocol/scenarios.json', 'protocol/capabilities.json',
|
||||
'protocol/agenda.json', 'protocol/settings-template.json',
|
||||
'protocol/agenda.json', 'protocol/settings-template.json', 'protocol/capability-ledger.json',
|
||||
'protocol/annotation-template.json', 'review/index.html', 'review/viewer.mjs',
|
||||
'review/review.json'}
|
||||
if required - names:
|
||||
@@ -50,6 +50,11 @@ def ready(checkpoint):
|
||||
# Exported ledger links are already normalized by the exporter. Recheck
|
||||
# every active link against the sealed actual materials at final handoff.
|
||||
ledger = read_json(root / 'review/review.json')['ledger']
|
||||
expected_ledger = read_json(root / 'protocol/capability-ledger.json')
|
||||
for field in ('current', 'history'):
|
||||
if [(row['id'], row.get(field)) for row in ledger['capabilities']] != [
|
||||
(row['id'], row[field]) for row in expected_ledger['capabilities']]:
|
||||
raise ValueError('Malformed viewer ledger projection: ' + field)
|
||||
for capability in ledger['capabilities']:
|
||||
for link in capability.get('source_links', []):
|
||||
if link.get('href'):
|
||||
|
||||
@@ -19,6 +19,7 @@ from fidelity_receipts import (canonical_bytes, contained_path, identify_file,
|
||||
utc_now, validate_receipt, validate_scenario_contract, verify_inventory,
|
||||
_id, _write_json)
|
||||
from fidelity_review import export_review
|
||||
from fidelity_ledger import export_ledger
|
||||
|
||||
PROJECT = Path(__file__).resolve().parents[2]
|
||||
RIDS = ('linux-x64', 'win-x64')
|
||||
@@ -164,7 +165,9 @@ def prepare_checkpoint(original, original_manifest, packages, output, tooling=Fa
|
||||
_copy_file(original_manifest, temporary / 'protocol/original-manifest.json')
|
||||
for name in ('scenarios.json', 'capabilities.json'):
|
||||
_copy_file(PROJECT / 'docs/evidence' / name, temporary / 'protocol' / name)
|
||||
export_review(None, None, temporary / 'review', PROJECT / 'docs/evidence/capabilities.json')
|
||||
ledger = temporary / 'protocol/capability-ledger.json'
|
||||
_write_json(ledger, export_ledger(read_json(PROJECT / 'docs/evidence/capabilities.json'), PROJECT))
|
||||
export_review(None, None, temporary / 'review', ledger)
|
||||
for name in MUTABLE:
|
||||
(temporary / name).mkdir()
|
||||
# All 80 Windows obligations are prepared; Linux's remaining40 use the same protocol.
|
||||
|
||||
Reference in new issue
Block a user