Archived
Publish fixed calibration postfit implementation and pre-score review binding
This commit is contained in:
1 parent
d67da6382b
commit
1960762d2d
18 files changed
+70002
No files matched your search
@@ -0,0 +1,20 @@
|
||||
"""Exact semantic PASS and immutable source/contract identity before custody."""
|
||||
import json
|
||||
from pathlib import Path
|
||||
from phase2_h1_worker_v2 import sha,checked
|
||||
from phase2_home_freeze_io import verify
|
||||
|
||||
def read(p):return json.loads(Path(p).read_text())
|
||||
def validate_review(root):
|
||||
root=Path(root);c=read(root/'contract.json');proof=verify(root,'implementation');binding=read(root/'expected-review-binding.json');review=read(root/'review.json')
|
||||
expected=dict(reviewed_commit=proof['commit'],contract_sha256=sha(root/'contract.json'),implementation_proof_sha256=sha(root/'implementation-git-freeze.json'),comparison_contract_sha256=c['comparison_contract_sha256'],code_sha256=c['code_sha256'])
|
||||
if binding!=expected:raise PermissionError('Review binding differs from implementation')
|
||||
if review.get('verdict')!='PASS':raise PermissionError('Actual exact PASS required')
|
||||
for name,value in expected.items():
|
||||
if review.get(name)!=value:raise PermissionError('Review identity mismatch: '+name)
|
||||
checked(c['comparison_contract'],expected['comparison_contract_sha256'])
|
||||
for p,h in expected['code_sha256'].items():checked(p,h)
|
||||
frozen=verify(root,'implementation-review')
|
||||
for p in [root/'review.json',root/'expected-review-binding.json',root/'contract.json']:
|
||||
if frozen['files'].get(str(p.resolve()))!=sha(p):raise PermissionError('Review freeze does not include exact required file')
|
||||
return review
|
||||
Reference in new issue
Block a user