P24-02: 操作と通知の全受入
This commit is contained in:
@@ -146,6 +146,7 @@ def _validate_condition_artifact_content(
|
||||
evidence_dir: Path,
|
||||
root_data: dict,
|
||||
validated_artifacts: dict,
|
||||
validated_roster: list = None,
|
||||
) -> tuple[bool, str]:
|
||||
if not isinstance(art_data, dict):
|
||||
return False, f"Artifact content for condition '{cond}' must be a JSON object"
|
||||
@@ -428,10 +429,24 @@ def _validate_condition_artifact_content(
|
||||
if seen_suites != set(required_suites):
|
||||
return False, f"Full roster execution missing required suites: {sorted(list(missing_from_roster))[:5]}"
|
||||
|
||||
# Hand the exact successfully validated objects to correspondence; never
|
||||
# re-read a different list from the index or a coverage receipt.
|
||||
if validated_roster is not None:
|
||||
validated_roster.extend(suite_entries)
|
||||
|
||||
return True, ""
|
||||
|
||||
|
||||
def _verify_evidence(index_path: Path) -> bool:
|
||||
def validate_condition_stage(condition, row, mode):
|
||||
correspondence.stage_report(mode)
|
||||
if condition == 'final_validation_review' and mode == 'normal_validation':
|
||||
correspondence.require(row.get('passed') is False and row.get('status') == 'prerequisites-only',
|
||||
'normal_validation final group must be prerequisites-only, passed=false')
|
||||
else:
|
||||
correspondence.require(row.get('passed') is True, 'condition requires passed=true plus actual evidence: '+condition)
|
||||
|
||||
|
||||
def _verify_evidence(index_path: Path, roles: dict, composition_result: dict) -> bool:
|
||||
print(f"Reading evidence index from: {index_path}")
|
||||
try:
|
||||
data = json.loads(index_path.read_text(encoding="utf-8"))
|
||||
@@ -654,6 +669,7 @@ def _verify_evidence(index_path: Path) -> bool:
|
||||
print(f"ERROR: Unknown invented conditions present in evidence index: {sorted(invented)}", file=sys.stderr)
|
||||
return False
|
||||
|
||||
validated_roster = []
|
||||
condition_to_artifacts = {}
|
||||
for cond in REQUIRED_CONDITIONS:
|
||||
cond_data = conditions[cond]
|
||||
@@ -661,13 +677,10 @@ def _verify_evidence(index_path: Path) -> bool:
|
||||
print(f"ERROR: Condition '{cond}' must be a structured JSON object with evidence details, not bare boolean or primitive", file=sys.stderr)
|
||||
return False
|
||||
|
||||
passed_val = cond_data.get("passed")
|
||||
if isinstance(passed_val, bool):
|
||||
if passed_val is not True:
|
||||
print(f"ERROR: Condition '{cond}' explicitly marked not passed", file=sys.stderr)
|
||||
return False
|
||||
else:
|
||||
print(f"ERROR: Condition '{cond}' missing strict boolean 'passed': true (value={passed_val!r})", file=sys.stderr)
|
||||
try:
|
||||
validate_condition_stage(cond, cond_data, roles['mode'])
|
||||
except ValueError as exc:
|
||||
print(f"ERROR: {exc}", file=sys.stderr)
|
||||
return False
|
||||
|
||||
cond_art_ids = cond_data.get("artifact_ids")
|
||||
@@ -704,6 +717,7 @@ def _verify_evidence(index_path: Path) -> bool:
|
||||
evidence_dir,
|
||||
data,
|
||||
validated_artifacts,
|
||||
validated_roster,
|
||||
)
|
||||
if ok:
|
||||
content_verified = True
|
||||
@@ -716,12 +730,16 @@ def _verify_evidence(index_path: Path) -> bool:
|
||||
return False
|
||||
|
||||
try:
|
||||
correspondence.verify(data, validated_artifacts, composition.root_context(evidence_dir, data), ROOT)
|
||||
correspondence.verify(data, validated_artifacts, roles, ROOT,
|
||||
validated_roster=validated_roster, composition_result=composition_result)
|
||||
except (ValueError, KeyError, TypeError, OSError, IndexError) as exc:
|
||||
print(f"ERROR: correspondence: {exc}", file=sys.stderr)
|
||||
return False
|
||||
|
||||
print("SUCCESS: All 8 required conditions, candidate version, scope manifest, and OS execution artifacts strictly verified.")
|
||||
if roles['mode'] == 'normal_validation':
|
||||
print("SUCCESS: Source/runtime/OS/full-roster prerequisites verified. P24-02 NOT complete; independent runtime review and integration-final are not-yet-applicable. All 8 remain unaccepted.")
|
||||
else:
|
||||
print("SUCCESS: All 8 required condition evidence groups including typed review/integration records strictly verified. Independent formal acceptance remains separate.")
|
||||
return True
|
||||
|
||||
|
||||
@@ -731,14 +749,19 @@ def verify_evidence(index_path: Path) -> bool:
|
||||
composition.root_identity(ROOT, Path.cwd())
|
||||
data = composition.strict_json(index_path.read_bytes())
|
||||
roles = composition.root_context(index_path.parent, data)
|
||||
print(json.dumps(correspondence.stage_report(roles.get('mode')), sort_keys=True))
|
||||
composition.require(data.get('inputs', {}).get(composition.SPEC) == EXPECTED_SPEC_SHA256, 'frozen spec input SHA mismatch')
|
||||
required_helpers = {_HELPER.relative_to(ROOT).as_posix(), _HELPER.with_name('correspondence.py').relative_to(ROOT).as_posix()}
|
||||
composition.require(required_helpers <= set(data['inputs']), 'missing checker helper input pins')
|
||||
composition.verify_composition(ROOT, roles, data.get('source_hashes'), data.get('inputs'),
|
||||
composition_result = composition.verify_composition(ROOT, roles, data.get('source_hashes'), data.get('inputs'),
|
||||
EXPECTED_BASE_COMMIT, REQUIRED_SCOPE_FILES + ['docs/plans/original-completion-2026-10-02/execution/p24-02/**'])
|
||||
print("Source/composition prerequisites: verified; runtime/OS/roster prerequisites: verification pending; P24-02 NOT complete.")
|
||||
with composition.tested_checkout(ROOT, roles['T']) as view:
|
||||
VERIFIED_ROOT = view
|
||||
return _verify_evidence(index_path)
|
||||
verified = _verify_evidence(index_path, roles, composition_result)
|
||||
if not verified:
|
||||
print("Runtime/OS/roster or applicable later prerequisites: NOT VERIFIED; P24-02 NOT complete.")
|
||||
return verified
|
||||
except (ValueError, KeyError, TypeError, OSError, IndexError) as exc:
|
||||
print(f"ERROR: composition: {exc}", file=sys.stderr)
|
||||
return False
|
||||
@@ -761,6 +784,7 @@ def main() -> int:
|
||||
if not index_file:
|
||||
print("ERROR: Could not locate p24-operations-evidence index.json.", file=sys.stderr)
|
||||
print("Ensure BUILD_OUTPUT_DIR is set or provide --index <path>.", file=sys.stderr)
|
||||
print("Source/runtime prerequisites NOT VERIFIED; stage not established; P24-02 NOT complete.")
|
||||
return 1
|
||||
|
||||
if not verify_evidence(index_file):
|
||||
|
||||
Reference in New Issue
Block a user