P04-01: 同時発生の更新規約

This commit is contained in:
Agent Control Runner
2026-10-18 11:16:06 +09:00
parent 20d0ae5990
commit 1b08d6b0fc
7 changed files with 377 additions and 34 deletions
+12 -15
View File
@@ -35,11 +35,9 @@ OWNER_BINDINGS = {
) for ref in refs
}
MAIN_ANCHOR = 'c0ea009b28a7649aca6a433a1a24dc0be5e7ab81'
# Required evidence content, not an invented Runner API. Root must supply the
# independently authoritative receipt path/hash contract before C can qualify.
# Neither an index nor a commit with matching parents/tree can supply authority.
NORMAL_C_RECEIPT_CONTRACT = None
NORMAL_C_RECEIPT_FIELDS = frozenset({
# Documentation only: external Runner prepare_integration/integrate and Root
# normal_c_join joins after final. The checker never consumes this roster.
NORMAL_C_PROVENANCE_JOIN = frozenset({
'candidate_commit', 'candidate_tree', 'first_parent', 'second_parent',
'tested_tree', 'prepare_integration_receipt', 'independent_review_receipt',
'validation_receipt', 'source_manifest_sha256', 'settings_sha256',
@@ -342,6 +340,7 @@ def verify_roles(index, directory):
"""Infer roles from Git, never from an index or a caller's stage label."""
require(not ({'candidate_commit', 'candidate_tree', 'code_only', 'candidate', 'phase'} & index.keys()),
'candidate/code-only/phase declarations are not evidence')
candidate = None
commit, actual_tree, actual = actual_checkout()
require(_GIT_ENV is not None, 'isolated object store required')
if not ancestor(MAIN_ANCHOR, commit):
@@ -369,7 +368,7 @@ def verify_roles(index, directory):
'unknown source hidden as metadata: ' + path)
if role == 'integration/final':
require(actual_tree == composed and actual == target, 'actual merge differs from composition')
qualify_normal_candidate(commit, actual_tree, main, submitted, composed)
candidate = qualify_normal_candidate(commit, actual_tree, main, submitted, composed)
require(target[CHECKER_PATH] == patch[CHECKER_PATH] == actual[CHECKER_PATH],
'checker blob differs from submission')
for path in patch:
@@ -419,25 +418,23 @@ def verify_roles(index, directory):
require(runner_paths, 'runner inputs missing')
require(index['versions'] == {'registered': REGISTERED_COMMIT, 'execution_origin': EXECUTION_ORIGIN,
'tested': tested}, 'evidence version roles')
return composed, {'role': role, 'actual_head': commit, 'actual_tree': actual_tree,
return composed, {'candidate_structure': candidate, 'role': role, 'actual_head': commit, 'actual_tree': actual_tree,
'submission': submitted, 'main': main, 'existing_metadata': metadata,
'manifest_sha256': manifest_digest(product), 'runner_paths': runner_paths,
'tested_product': tested, 'product_file_count': len(product), 'selected_file_count': len(selected_product)}
def qualify_normal_candidate(commit, tree, main, submitted, composed):
"""Fail closed until the actual Root/Runner authority contract is supplied.
"""Qualify structure only; Runner and Root verify provenance externally.
The field roster above records the required joins. It intentionally is not
a self-issued attestation format that a synthetic commit can satisfy.
The documentation roster is never consumed. Structure grants no provenance
verification or original credit.
"""
require(tree == composed and main == MAIN_ANCHOR and commit != submitted,
'normal candidate identity mismatch')
require(NORMAL_C_RECEIPT_CONTRACT is not None,
'normal C qualification context gap: authoritative Root/Runner receipt '
'path, SHA256 and provenance verification contract are not supplied')
# No authority implementation is inferred from a caller-supplied object.
raise ValueError('normal C receipt authority verifier is not implemented')
return {'structure_qualified': True, 'provenance_verified_by_checker': False,
'provenance_owner': 'actual Runner.prepare_integration/integrate and Root normal_c_join AFTER final before original credit',
'join': {'C': commit, 'S': submitted, 'M': main, 'C_tree': tree, 'Q': composed}}
def function_bytes(data):