diff --git a/research/h25-full-caller-readable-inputs/.gitattributes b/research/h25-full-caller-readable-inputs/.gitattributes new file mode 100644 index 0000000000..fa1385d99a --- /dev/null +++ b/research/h25-full-caller-readable-inputs/.gitattributes @@ -0,0 +1 @@ +* -text diff --git a/research/h25-full-caller-readable-inputs/ACTIVITY-BREAKDOWN-v16.json b/research/h25-full-caller-readable-inputs/ACTIVITY-BREAKDOWN-v16.json new file mode 100644 index 0000000000..ec76d4cf74 --- /dev/null +++ b/research/h25-full-caller-readable-inputs/ACTIVITY-BREAKDOWN-v16.json @@ -0,0 +1,1857 @@ +{ + "F3_financial_DATA_source_case_progress": { + "cases_authored": 135, + "cases_executed": 0, + "cases_source_accepted": 135, + "full_stated_source_rows": 20, + "native_qualified": 0, + "not_original_212_component_census": true, + "partial_source_rows": 9, + "unexercised_rows": 1 + }, + "accepted_source_repairs_since_previous_snapshot": [], + "active_source_work": [ + "areas/fresh-round-reusable-record-implementation-v1", + "areas/fresh-round-original-record-writer-v1", + "areas/reusable-financial-frame-controls-v1" + ], + "activity_changes_since_previous_snapshot": [], + "activity_remaining_notes_updated_ids": [ + "S04.03", + "S06.03", + "S06.05", + "S07.04", + "S10.04" + ], + "baseline_overall_gate_percent": 10, + "baseline_rubric": { + "path": "control/hourly-progress/RUBRIC-v1.json", + "sha256": "9f987e10fc6a5027985741c2bf0e7a6e39a4103e6439e2321116034e8e4a4ea1" + }, + "baseline_stage_gate_percent": 20, + "component_source_progress": { + "census": { + "bodyless": 147, + "candidate_source_units": 115, + "conditionally_source_complete": 7, + "partial": 58, + "runtime_qualified": 0, + "total": 212 + }, + "delta": { + "path": "control/COMPONENT-SOURCE-CENSUS-DELTA-RP21-v2.json", + "sha256": "d63767ac07811da51cb82e02e2568d90392a3e1afc04b434cc13fe010fd2030e" + } + }, + "core_execution_preparation": { + "RP21_finite_source_review": { + "path": "review/replay-foreign-owner-control-v2/REVIEW.json", + "sha256": "429234aba44dee74bc4d5dabb3f95aef464b5b55578ecb44c97da4eeb190d61a" + }, + "RP21_v1_source_rejection": { + "path": "review/replay-foreign-owner-control-v1/REVIEW.json", + "sha256": "356e898167380cfeda40f7d2bb51b5e3fecc6639f9d5489f604ae0681fa28533" + }, + "RP21_v2_packet_pending_review": { + "path": "areas/replay-foreign-owner-control-v2/FINAL-READBACK.json", + "sha256": "455cf33add6b345ab1b5502725ba52a3145cd9d7d73d4b70cdbc050e47a8bd2a" + }, + "RP21_v2_review_pending": false, + "active_owner_reservation_protocol_complete": false, + "active_owner_source_review": { + "path": "review/fresh-round-active-owner-v1/REVIEW.json", + "sha256": "a37551cbe6225eaddf7c70ea4349e31b178bbedea74e1aa38a848a9b429d5bb4" + }, + "active_owner_source_scoped_accepted": true, + "activity_evidence_static_recheck": { + "path": "control/ACTIVITY-EVIDENCE-RECHECK-v1.json", + "sha256": "007cb89cb9d7247028bb1388989a7c980c12d0962a147eb2e50ec208a5d26c06" + }, + "actual_current_EX_verified": false, + "actual_funding_DATA_callbacks": 0, + "actual_funding_DATA_cases_passed": 62, + "actual_new_guarded_attempts": 3, + "actual_new_guarded_attempts_this_hour": 0, + "actual_new_metadata_probe_runs": 1, + "actual_new_scientific_runs": 0, + "capture_observability": { + "path": "review/capture-failure-observability-v2/REVIEW.json", + "sha256": "e009c5f78d2471670620c9f91bb0a1bd2fc3ad51b631459403a2a73cc4ef1226" + }, + "configured_scientific_route_complete": false, + "consumer_v1_source_rejection": { + "path": "review/fresh-round-consumer-integration-v1/REVIEW.json", + "sha256": "b0843595c9ddd57ffdfbb1c06445738133211744d6a8892cf45b87fc140e535a" + }, + "consumer_v2_partial_source_review": { + "path": "review/fresh-round-consumer-integration-v2/REVIEW.json", + "sha256": "7e3345129681d9c49540e8d21fe3c76da4f0ab1c2ad947272fe9a16338d9832d" + }, + "consumer_v2_source_repair_active": false, + "controller_C2_source_review": { + "path": "review/fresh-controller-composition-v2/REVIEW.json", + "sha256": "6d7bc2365b46202366124c7462fd859b045429098a211e196bcc2ce73b39049e" + }, + "current_F2_DATA_cases_independently_accepted": 72, + "current_opening_F2_A2_source_review": { + "path": "review/fresh-round-current-opening-v2/REVIEW.json", + "sha256": "da25355e69f066cf9994be96148b3f758a6a032efeed71c5a2d7159268c2dbfa" + }, + "current_opening_F2_actual72_outcome": { + "path": "review/current-opening-control-outcome-v1/REVIEW.json", + "sha256": "49772d0b1ee9e63a9231b531193a6fb88f2e29237c3cff417825da0f990a649a" + }, + "current_opening_binding_complete": false, + "current_opening_inputs": { + "path": "control/FRESH-ROUND-OPENING-INPUTS-v1.json", + "sha256": "3211df77fdda79a9c4e0927c0e4395d0a526e3803fe72db999e84455b614258d" + }, + "current_opening_source_packet": { + "path": "areas/fresh-round-current-opening-v1/FINAL-READBACK.json", + "sha256": "48e8aff90124a72c034595df906779b9d51c585ef41743af066f44c1ed253131" + }, + "current_opening_source_review_pending": true, + "current_opening_v1_source_review": { + "path": "review/fresh-round-current-opening-v1/REVIEW.json", + "sha256": "2c15d7bd4f4fbfc58feaff126cbb05bb5d4feff7e3e35dc9a5f583c8dfb751f8" + }, + "current_opening_v2_source_repair_active": false, + "current_round_state": { + "path": "control/fresh-metered-round-v1/STATE-005.json", + "sha256": "46fc97bcbad51b5b026054647c369aa3f780d2922019f3b070817a28377b00a9" + }, + "current_third_schema_gap": { + "path": "areas/fresh-round-current-opening-v3-data/SCHEMA-GAP.json", + "sha256": "c038b30f470a65a05818246a394f97b6e7a7c91b906f7acb0a85866e52b7b172" + }, + "driver_source_review": { + "path": "review/fresh-full-driver-binding-v1/REVIEW.json", + "sha256": "a026792a55e1ce55d4d302c14086f792436903aa608d8de281c85dd07ee24e0f" + }, + "failed_cost_audit": { + "path": "review/failed-capture-cost-recovery-v1/REVIEW.json", + "sha256": "8e10c7f07a6d618f15db6e7d1309ca087eff26f3345ecad220af8cca43788703" + }, + "fixed_bootstrap_transport_runtime_qualified": false, + "fixed_bootstrap_transport_source_review": { + "path": "review/fresh-round-bootstrap-loader-v2/REVIEW.json", + "sha256": "ad027d790a034ac004f10d1855841e6e31d1fd35b80440f58dc6561df6db1703" + }, + "four_layer_successor_guard_source_review": { + "path": "review/fresh-successor-eligibility-v1/REVIEW.json", + "sha256": "d6f3aa7445502cd2ec46c1370a4fd6231da18d30c8bd413830e8149fc97b8bdf" + }, + "fresh_ownership_observation_source": { + "path": "review/fresh-ownership-observation-source-v2/REVIEW.json", + "sha256": "eaaee59083d1975e30ec944dd4797201fbe43827b7d978b2a854a5cb3a50c8d7" + }, + "fresh_round_owner_outcome": { + "path": "review/fresh-round-owner-outcome-v1/REVIEW.json", + "sha256": "a69bbb1153eb39cede20af533b330586b647c4eb6a6db709d81925e6e77be463" + }, + "fresh_round_state": { + "path": "control/fresh-metered-round-v1/STATE-003.json", + "sha256": "12adff386bf4b4d35604fdd695428085f13729a912d163503c27bf3b082b17c5" + }, + "funding_DATA_independent_outcome": { + "path": "review/fresh-round-funding-outcome-v1/REVIEW.json", + "sha256": "f32482d40607347e54ba5b0a0262d7b35ee4aa8693bf6e3c4b27e8483e395d0c" + }, + "gnu_observation_parser": { + "path": "review/gnu-usage-observation-parser-v1/REVIEW.json", + "sha256": "3849c6aef02104e70c622ed76405f4305839a4ed0129f074fb6cc4ec814fb825" + }, + "goal_service_resume": { + "path": "control/FRESH-ROUND-GOAL-RESUME-READBACK-v1.json", + "sha256": "a87fab2662d4362d848f1a14feca0cd7d20d60bda24917f8b00af5c3ff22595e" + }, + "guard_mode_metadata_erratum": { + "path": "control/SUCCESSOR-GUARD-CONTRACT-MODE-ERRATUM-v1.json", + "sha256": "a9baefde67559e45d2da04b21265d55ea9abda7c37f1b7af0f7b25cf31410a3f" + }, + "known_case_recovery_contract": { + "path": "review/known-pre-root-quarantine-recovery-v1/REVIEW.json", + "sha256": "f77462cf9a52732592efb3883355923dded602b223f2ac2e7c80d106e29dc9e3" + }, + "new_round_funding_data_source_review": { + "path": "review/fresh-round-funding-source-v1/REVIEW.json", + "sha256": "92c9dcdee1661a1eb2bc6a1dcc7acb2fc4d9623524e30bf48cc84a35016a9e42" + }, + "new_round_state": { + "path": "control/fresh-metered-round-v1/STATE-003.json", + "sha256": "12adff386bf4b4d35604fdd695428085f13729a912d163503c27bf3b082b17c5" + }, + "next_execution_readiness": { + "path": "control/NEXT-EXECUTION-READINESS-v7.json", + "sha256": "cd24a48e890a02b4a1693c28f9c3cbe240103c63ea367c9715f16204acda84d9" + }, + "normal_metadata_policy_exception_selected": true, + "original_marker_policy_metadata_probe_exception_admitted": false, + "outer_binder_source_repair_active": true, + "owner_normal_provider": { + "path": "review/owner-normal-provider-v1/REVIEW.json", + "sha256": "27a44efe46e4c34ac55eccfc529e8ee6e6cdbb6b57be323d6b9e566290628893" + }, + "scoped_metadata_body_meter_executed": true, + "scoped_metadata_body_meter_source_review": { + "path": "review/fresh-round-outer-meter-v2/REVIEW.json", + "sha256": "a2f9311f4a59233b4540b869194e63329e4d582eb87a1e4d4df58e43b996e0c8" + }, + "shared_backing_observation": { + "path": "review/owner-normal-shared-backing-v1/REVIEW.json", + "sha256": "b6e30d81e02044ed28bb039b59f96f1347b1b0d401c10b84980c070cf200eda6" + }, + "strict_provenance_bridge_active": true, + "successor_next_completion": { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v5.json", + "sha256": "4136ecadcab4cff2d279f941055aa6ac91cd4dee76f1dc63c15db5acb0483a41" + }, + "user_budget_decision": { + "approved_additional_seconds": 2400, + "authorization": { + "path": "control/FRESH-METERED-ROUND-AUTHORIZATION-v1.json", + "sha256": "28bc04ad98151cf6a52607e4271b4dcbcbd645d0c8c538a35bc37e3d5194d50f" + }, + "initial_feasibility_seconds": 600, + "old_cap_compliance_not_claimed": true, + "old_cost_unknown_preserved": true, + "proposal": { + "path": "control/FRESH-METERED-ROUND-DECISION-v1.md", + "sha256": "70366fed56a9997f3ff8dc79b79fd72b73b93d63f971c64543769fabeb0029c6" + }, + "proposed_additional_seconds": 2400, + "status": "APPROVED_DIRECT_HUMAN_AUTHORIZATION" + }, + "whole_outer_meter_admitted": false + }, + "created_utc": "2026-10-30T18:39:11.998066+00:00", + "current_round_state": { + "path": "control/fresh-metered-round-v1/STATE-005.json", + "sha256": "46fc97bcbad51b5b026054647c369aa3f780d2922019f3b070817a28377b00a9" + }, + "goal_service_status": "active", + "goal_status_readback": { + "path": "control/FRESH-ROUND-GOAL-RESUME-READBACK-v1.json", + "sha256": "a87fab2662d4362d848f1a14feca0cd7d20d60bda24917f8b00af5c3ff22595e" + }, + "goal_unchanged_scope": "All six areas, complete original/new controls, full assertion-on caller, current full costs/measurements, reproducible export and Chrome upstream delivery. Any reproducible positive gain accepted; no15percent minimum.", + "groups": [ + { + "activities": [ + { + "activity": "Pin the exact PR6029 comparison source and immutable stage.", + "complete": true, + "completion_test": "Pin the exact PR6029 comparison source and immutable stage.", + "evidence": [ + { + "path": "stages/predecessor-pr6029-v1/STAGE.json", + "sha256": "9e63ce3e9799e150fa144ff01c1684468404363fd4222aef98442a87c2210d12" + } + ], + "id": "S01.01", + "remaining": "", + "status": "complete" + }, + { + "activity": "Document preservation of all originals, failures, exact outputs and independent references.", + "complete": true, + "completion_test": "Document preservation of all originals, failures, exact outputs and independent references.", + "evidence": [ + { + "path": "control/PLAN-before-granular-progress-v1.md", + "sha256": "62d95b37fb62c3302403a7c7d933ae1058651fec31636c8322ca1cd4dc356e0e" + } + ], + "id": "S01.02", + "remaining": "", + "status": "complete" + }, + { + "activity": "Fix the guarded budget, time/memory/output caps and failure charging rules.", + "complete": true, + "completion_test": "Fix the guarded budget, time/memory/output caps and failure charging rules.", + "evidence": [ + { + "path": "control/EXECUTION-PHASE.json", + "sha256": "77fc9f89a2b3c572a3bfe52b35ba234532ab9298dd3a08c8b75c17a7a6661db4" + } + ], + "id": "S01.03", + "remaining": "", + "status": "complete" + }, + { + "activity": "Document disjoint source ownership and the single parent execution queue.", + "complete": true, + "completion_test": "Document disjoint source ownership and the single parent execution queue.", + "evidence": [ + { + "path": "control/PLAN-before-granular-progress-v1.md", + "sha256": "62d95b37fb62c3302403a7c7d933ae1058651fec31636c8322ca1cd4dc356e0e" + }, + { + "path": "control/EXECUTION-PHASE.json", + "sha256": "77fc9f89a2b3c572a3bfe52b35ba234532ab9298dd3a08c8b75c17a7a6661db4" + } + ], + "id": "S01.04", + "remaining": "", + "status": "complete" + } + ], + "activity_percent": 100.0, + "complete_count": 4, + "id": "S01", + "name": "Baseline, preservation and execution contract", + "stage_weight_percent": 10, + "total_count": 4 + }, + { + "activities": [ + { + "activity": "Implement bounded retained-log processing and streaming hash/count behavior.", + "complete": true, + "completion_test": "Implement bounded retained-log processing and streaming hash/count behavior.", + "evidence": [ + { + "path": "review/log-handling-v1-execution/REVIEW.json", + "sha256": "bce18e269d06e2f2ca0e518996e5ea8186bdba2b610375b82030df175ef8a7fa" + } + ], + "id": "S02.01", + "remaining": "", + "status": "complete" + }, + { + "activity": "Obtain independent source acceptance of the log repair.", + "complete": true, + "completion_test": "Obtain independent source acceptance of the log repair.", + "evidence": [ + { + "path": "review/log-handling-v1-execution/REVIEW.json", + "sha256": "bce18e269d06e2f2ca0e518996e5ea8186bdba2b610375b82030df175ef8a7fa" + } + ], + "id": "S02.02", + "remaining": "", + "status": "complete" + }, + { + "activity": "Pass real file/process normal, binary, stderr and exit-failure controls.", + "complete": true, + "completion_test": "Pass real file/process normal, binary, stderr and exit-failure controls.", + "evidence": [ + { + "path": "review/log-handling-v1-execution/REVIEW.json", + "sha256": "bce18e269d06e2f2ca0e518996e5ea8186bdba2b610375b82030df175ef8a7fa" + } + ], + "id": "S02.03", + "remaining": "", + "status": "complete" + }, + { + "activity": "Validate oversize/post-exit handling and install the repaired runner in its real consumer.", + "complete": true, + "completion_test": "Validate oversize/post-exit handling and install the repaired runner in its real consumer.", + "evidence": [ + { + "path": "review/log-handling-v1-execution/REVIEW.json", + "sha256": "bce18e269d06e2f2ca0e518996e5ea8186bdba2b610375b82030df175ef8a7fa" + } + ], + "id": "S02.04", + "remaining": "", + "status": "complete" + } + ], + "activity_percent": 100.0, + "complete_count": 4, + "id": "S02", + "name": "Installed bounded log handling", + "stage_weight_percent": 10, + "total_count": 4 + }, + { + "activities": [ + { + "activity": "Independently review construction union reuse and index-lifetime source.", + "complete": true, + "completion_test": "Independently review construction union reuse and index-lifetime source.", + "evidence": [ + { + "path": "review/construction-v2-source/REVIEW.json", + "sha256": "e5d6291b8118b79220d12f777f2f2ea43076053b948aa8f2234fd4d11555f1ea" + } + ], + "id": "S03.01", + "remaining": "Runtime/full-caller validation is a separate open requirement.", + "status": "complete" + }, + { + "activity": "Independently review bounded exact serializer source.", + "complete": true, + "completion_test": "Independently review bounded exact serializer source.", + "evidence": [ + { + "path": "review/serialization-v3-source/REVIEW.json", + "sha256": "9f7c7f5abcdb8c8421b82a51020afef3969ad1e2fccb4f1bbcb8484380415555" + } + ], + "id": "S03.02", + "remaining": "Complete artifact/RSS/cost validation remains open.", + "status": "complete" + }, + { + "activity": "Demonstrate independently accepted immutable archive and exact restoration on the fixed historical domain.", + "complete": true, + "completion_test": "Demonstrate independently accepted immutable archive and exact restoration on the fixed historical domain.", + "evidence": [ + { + "path": "review/historical-retention-v7-execution/REVIEW.json", + "sha256": "e08f0e406cd10280ea5806f6dc9582ff17552c2add6471a65be6f0f51121e605" + } + ], + "id": "S03.03", + "remaining": "This does not establish automatic retention or reclaim original workspace bytes.", + "status": "complete" + }, + { + "activity": "Independently review the frozen cache production mechanism source.", + "complete": true, + "completion_test": "Independently review the frozen cache production mechanism source.", + "evidence": [ + { + "path": "review/cache-epoch-products-v5/REVIEW.json", + "sha256": "58840b7fd3dfe6021db42778c39be238baec6d8f8d80f0d53f92e54122e5b503" + } + ], + "id": "S03.04", + "remaining": "Conditional Python source acceptance only; later oracle erratum and genuine full contexts remain open.", + "status": "complete" + }, + { + "activity": "Independently review same-call digest reuse and immutable rank-observation source.", + "complete": true, + "completion_test": "Independently review same-call digest reuse and immutable rank-observation source.", + "evidence": [ + { + "path": "review/hashing-traces-v1-source/REVIEW.json", + "sha256": "6e88c9890002edf8581f7cbe4cc32a668843c1b64b47a8b06f2a059923df9db8" + } + ], + "id": "S03.05", + "remaining": "Full ordered outputs and costs remain unqualified.", + "status": "complete" + }, + { + "activity": "Close the bounded-log source contract.", + "complete": true, + "completion_test": "Close the bounded-log source contract.", + "evidence": [ + { + "path": "review/log-handling-v1-execution/REVIEW.json", + "sha256": "bce18e269d06e2f2ca0e518996e5ea8186bdba2b610375b82030df175ef8a7fa" + } + ], + "id": "S03.06", + "remaining": "", + "status": "complete" + }, + { + "activity": "Close the production automatic-retention issuer/hook contract.", + "complete": false, + "completion_test": "Close the production automatic-retention issuer/hook contract.", + "evidence": [ + { + "path": "review/historical-retention-v7-execution/REVIEW.json", + "sha256": "e08f0e406cd10280ea5806f6dc9582ff17552c2add6471a65be6f0f51121e605" + }, + { + "path": "areas/retention-current-parent-feasibility-v7/FINAL-READBACK.json", + "sha256": "2ad68f06683001a419bf76f7ff22668a5fa22bf4dcf824e11806cd9c5bf3cd5c" + } + ], + "id": "S03.07", + "remaining": "V7 same-parent feasibility remains NO-GO: immutable completed-source seal/monotone phase/actual adapter/full writer closure and failure exclusion remain open; no hook implementation.", + "status": "open" + }, + { + "activity": "Close genuine full cache/P08 caller contracts and all outstanding source/control corrections.", + "complete": false, + "completion_test": "Close genuine full cache/P08 caller contracts and all outstanding source/control corrections.", + "evidence": [ + { + "path": "review/cache-epoch-products-v5/REVIEW.json", + "sha256": "58840b7fd3dfe6021db42778c39be238baec6d8f8d80f0d53f92e54122e5b503" + }, + { + "path": "areas/cache-full-contract-completion-v1/FINAL-READBACK.json", + "sha256": "6fe938a4daa0e4fc546c311997934ddaecf91a960051f41ca8e8f6174bf5f9d5" + }, + { + "path": "review/cache-full-contract-owner-correction-v1/REVIEW.json", + "sha256": "a3d1814dd652f1c1197d9b5373354831e40121a69eb17b33273357ede60ce976" + } + ], + "id": "S03.08", + "remaining": "Owner-access correction is independently source-accepted; genuine FULL/EPOCH_FULL/P08/native/full caller contracts and actual adoption remain open.", + "status": "open" + } + ], + "activity_percent": 75.0, + "complete_count": 6, + "id": "S03", + "name": "Implementation mechanisms and remaining source contracts", + "stage_weight_percent": 10, + "total_count": 8 + }, + { + "activities": [ + { + "activity": "Inventory and independently review the model/payload source and its explicit fit gaps.", + "complete": true, + "completion_test": "Inventory and independently review the model/payload source and its explicit fit gaps.", + "evidence": [ + { + "path": "review/model-v6-source-fit-v1/REVIEW.json", + "sha256": "8cffbacbaf405bb6d062078310baa69ffc38d737acf123c69f9eae25492900dc" + } + ], + "id": "S04.01", + "remaining": "Source-scope acceptance does not establish full fit.", + "status": "complete" + }, + { + "activity": "Assemble the complete required payload without replacing it with the finite prefix.", + "complete": false, + "completion_test": "Assemble the complete required payload without replacing it with the finite prefix.", + "evidence": [ + { + "path": "review/model-v6-source-fit-v1/REVIEW.json", + "sha256": "8cffbacbaf405bb6d062078310baa69ffc38d737acf123c69f9eae25492900dc" + } + ], + "id": "S04.02", + "remaining": "Complete original/new payload and concrete dependencies required.", + "status": "open" + }, + { + "activity": "Establish a complete resource/action bill fitting all declared caps.", + "complete": false, + "completion_test": "Establish a complete resource/action bill fitting all declared caps.", + "evidence": [ + { + "path": "review/full-control-union-feasibility-v1/CENSUS-INDEX.json", + "sha256": "f17ac66cf3c0d239bb62fbd918d7190321dbc4195bc58f8fcf492631509aabea" + }, + { + "path": "review/failed-capture-cost-recovery-v1/REVIEW.json", + "sha256": "8e10c7f07a6d618f15db6e7d1309ca087eff26f3345ecad220af8cca43788703" + }, + { + "path": "review/fresh-round-funding-source-v1/REVIEW.json", + "sha256": "92c9dcdee1661a1eb2bc6a1dcc7acb2fc4d9623524e30bf48cc84a35016a9e42" + }, + { + "path": "review/fresh-round-active-owner-v1/REVIEW.json", + "sha256": "a37551cbe6225eaddf7c70ea4349e31b178bbedea74e1aa38a848a9b429d5bb4" + }, + { + "path": "review/fresh-round-funding-outcome-v1/REVIEW.json", + "sha256": "f32482d40607347e54ba5b0a0262d7b35ee4aa8693bf6e3c4b27e8483e395d0c" + }, + { + "path": "control/fresh-metered-round-v1/STATE-003.json", + "sha256": "12adff386bf4b4d35604fdd695428085f13729a912d163503c27bf3b082b17c5" + }, + { + "path": "control/FRESH-ROUND-OPENING-INPUTS-v1.json", + "sha256": "3211df77fdda79a9c4e0927c0e4395d0a526e3803fe72db999e84455b614258d" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v2.json", + "sha256": "f1b26faef0f8095f63f478296a791a79b6faf30dd630bab64ef41ed6de565cb1" + }, + { + "path": "review/fresh-round-bootstrap-loader-v2/REVIEW.json", + "sha256": "ad027d790a034ac004f10d1855841e6e31d1fd35b80440f58dc6561df6db1703" + }, + { + "path": "areas/fresh-round-current-opening-v1/FINAL-READBACK.json", + "sha256": "48e8aff90124a72c034595df906779b9d51c585ef41743af066f44c1ed253131" + }, + { + "path": "review/fresh-round-consumer-integration-v1/REVIEW.json", + "sha256": "b0843595c9ddd57ffdfbb1c06445738133211744d6a8892cf45b87fc140e535a" + }, + { + "path": "areas/replay-foreign-owner-control-v2/FINAL-READBACK.json", + "sha256": "455cf33add6b345ab1b5502725ba52a3145cd9d7d73d4b70cdbc050e47a8bd2a" + }, + { + "path": "review/replay-foreign-owner-control-v1/REVIEW.json", + "sha256": "356e898167380cfeda40f7d2bb51b5e3fecc6639f9d5489f604ae0681fa28533" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v3.json", + "sha256": "2e26c9208e71d3b5237ede19561bd271f4d1d2be1500f355940278d5fe4d0295" + }, + { + "path": "review/fresh-round-current-opening-v2/REVIEW.json", + "sha256": "da25355e69f066cf9994be96148b3f758a6a032efeed71c5a2d7159268c2dbfa" + }, + { + "path": "review/current-opening-control-outcome-v1/REVIEW.json", + "sha256": "49772d0b1ee9e63a9231b531193a6fb88f2e29237c3cff417825da0f990a649a" + }, + { + "path": "control/fresh-metered-round-v1/STATE-005.json", + "sha256": "46fc97bcbad51b5b026054647c369aa3f780d2922019f3b070817a28377b00a9" + }, + { + "path": "review/fresh-controller-composition-v2/REVIEW.json", + "sha256": "6d7bc2365b46202366124c7462fd859b045429098a211e196bcc2ce73b39049e" + }, + { + "path": "review/fresh-full-driver-binding-v1/REVIEW.json", + "sha256": "a026792a55e1ce55d4d302c14086f792436903aa608d8de281c85dd07ee24e0f" + }, + { + "path": "review/fresh-capture-publisher-composition-v1/REVIEW.json", + "sha256": "78d39495241d0a5b1e06a4173270becbde389a6c30723e4e3fabb735c74b8103" + }, + { + "path": "areas/fresh-round-current-opening-v3-data/SCHEMA-GAP.json", + "sha256": "c038b30f470a65a05818246a394f97b6e7a7c91b906f7acb0a85866e52b7b172" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v5.json", + "sha256": "4136ecadcab4cff2d279f941055aa6ac91cd4dee76f1dc63c15db5acb0483a41" + }, + { + "path": "review/fresh-round-provenance-bridge-v1/REVIEW.json", + "sha256": "ed8517ad6b627b4f849de7f7eb0eaa8782d68460c59afe8258f5cf086f5ac052" + }, + { + "path": "review/fresh-capture-publisher-composition-v2/REVIEW.json", + "sha256": "30669eb059e71e6a6dad50981ec7a628d48d0cc394e8c71c34659a8d8a0d5716" + }, + { + "path": "review/fresh-round-bootstrap-loader-v3/REVIEW.json", + "sha256": "e4227ab84ccdbcc3e836bcdff13b50cc1d6216a75546d3ee71d2c0205086326f" + }, + { + "path": "review/composed-stage-config-v1/REVIEW.json", + "sha256": "77d65c49c0383dcda8f56533d76b903a218af30a5bde57815f76c2c5743fe3a4" + }, + { + "path": "review/composed-stage-source-install-v1/REVIEW.json", + "sha256": "dcc0250ba2621fc68d451e5c770d0a416d1c157eb5ce5a6e4390b86cc8943253" + }, + { + "path": "review/fresh-round-reusable-record-family-v1/REVIEW.json", + "sha256": "d9a01dc288f69773bc412d8fcfda574454acf45b683b98a97fa82eddffce23eb" + }, + { + "path": "review/fresh-round-reusable-record-family-v2/REVIEW.json", + "sha256": "264366510558f6248cad049f0d3b68f06c64db81b338f279000b26854eaebbdd" + } + ], + "id": "S04.03", + "remaining": "V2 reusable financial specification accepted for construction. F4/A4 implementation, original-record writer, full payload/forest/resource bill and complete actual fit remain open.", + "status": "open" + }, + { + "activity": "Demonstrate complete normal-mode payload fit under current source/runtime conditions.", + "complete": false, + "completion_test": "Demonstrate complete normal-mode payload fit under current source/runtime conditions.", + "evidence": [], + "id": "S04.04", + "remaining": "No qualifying complete fit execution.", + "status": "open" + }, + { + "activity": "Demonstrate complete optimized-mode payload fit under current source/runtime conditions.", + "complete": false, + "completion_test": "Demonstrate complete optimized-mode payload fit under current source/runtime conditions.", + "evidence": [], + "id": "S04.05", + "remaining": "No qualifying complete fit execution.", + "status": "open" + } + ], + "activity_percent": 20.0, + "complete_count": 1, + "id": "S04", + "name": "Complete payload and resource fit", + "stage_weight_percent": 10, + "total_count": 5 + }, + { + "activities": [ + { + "activity": "Document original/new control obligations and known coverage gaps.", + "complete": true, + "completion_test": "Document original/new control obligations and known coverage gaps.", + "evidence": [ + { + "path": "review/full-control-union-feasibility-v1/CENSUS-INDEX.json", + "sha256": "f17ac66cf3c0d239bb62fbd918d7190321dbc4195bc58f8fcf492631509aabea" + }, + { + "path": "review/cache-epoch-products-v5/REVIEW.json", + "sha256": "58840b7fd3dfe6021db42778c39be238baec6d8f8d80f0d53f92e54122e5b503" + }, + { + "path": "control/COMPONENT-SOURCE-CENSUS-DELTA-RP10-v2.json", + "sha256": "c6e10e4585b3432e725af5246fd3499b51abdeb7d7964c1566a16d0f33f1b081" + } + ], + "id": "S05.01", + "remaining": "The census does not constitute runnable complete coverage.", + "status": "complete" + }, + { + "activity": "Independently review the existing conditional STOP-composition source.", + "complete": true, + "completion_test": "Independently review the existing conditional STOP-composition source.", + "evidence": [ + { + "path": "review/component-control-stop-composition-v1/REVIEW.json", + "sha256": "a4901673ab6e1037de031aaba00ab1c9e8337863a0c0dc86cbbb8834bfa02d7f" + } + ], + "id": "S05.02", + "remaining": "Only the known source subset; actual runtime profiles and full union remain open.", + "status": "complete" + }, + { + "activity": "Implement every missing required original/new control body.", + "complete": false, + "completion_test": "Implement every missing required original/new control body.", + "evidence": [ + { + "path": "review/full-control-union-feasibility-v1/CENSUS-INDEX.json", + "sha256": "f17ac66cf3c0d239bb62fbd918d7190321dbc4195bc58f8fcf492631509aabea" + }, + { + "path": "review/replay-audit-head-control-v2/REVIEW.json", + "sha256": "ed05d3a7cd499179b04603b8eca739b63d07d9cc3a720a0d75f68ea5ccb2d910" + }, + { + "path": "review/fresh-round-active-owner-v1/REVIEW.json", + "sha256": "a37551cbe6225eaddf7c70ea4349e31b178bbedea74e1aa38a848a9b429d5bb4" + }, + { + "path": "review/fresh-round-funding-outcome-v1/REVIEW.json", + "sha256": "f32482d40607347e54ba5b0a0262d7b35ee4aa8693bf6e3c4b27e8483e395d0c" + }, + { + "path": "control/fresh-metered-round-v1/STATE-003.json", + "sha256": "12adff386bf4b4d35604fdd695428085f13729a912d163503c27bf3b082b17c5" + }, + { + "path": "control/FRESH-ROUND-OPENING-INPUTS-v1.json", + "sha256": "3211df77fdda79a9c4e0927c0e4395d0a526e3803fe72db999e84455b614258d" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v2.json", + "sha256": "f1b26faef0f8095f63f478296a791a79b6faf30dd630bab64ef41ed6de565cb1" + }, + { + "path": "review/fresh-round-bootstrap-loader-v2/REVIEW.json", + "sha256": "ad027d790a034ac004f10d1855841e6e31d1fd35b80440f58dc6561df6db1703" + }, + { + "path": "areas/fresh-round-current-opening-v1/FINAL-READBACK.json", + "sha256": "48e8aff90124a72c034595df906779b9d51c585ef41743af066f44c1ed253131" + }, + { + "path": "review/fresh-round-consumer-integration-v1/REVIEW.json", + "sha256": "b0843595c9ddd57ffdfbb1c06445738133211744d6a8892cf45b87fc140e535a" + }, + { + "path": "areas/replay-foreign-owner-control-v2/FINAL-READBACK.json", + "sha256": "455cf33add6b345ab1b5502725ba52a3145cd9d7d73d4b70cdbc050e47a8bd2a" + }, + { + "path": "review/replay-foreign-owner-control-v1/REVIEW.json", + "sha256": "356e898167380cfeda40f7d2bb51b5e3fecc6639f9d5489f604ae0681fa28533" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v3.json", + "sha256": "2e26c9208e71d3b5237ede19561bd271f4d1d2be1500f355940278d5fe4d0295" + }, + { + "path": "review/replay-foreign-owner-control-v2/REVIEW.json", + "sha256": "429234aba44dee74bc4d5dabb3f95aef464b5b55578ecb44c97da4eeb190d61a" + }, + { + "path": "review/fresh-round-consumer-integration-v2/REVIEW.json", + "sha256": "7e3345129681d9c49540e8d21fe3c76da4f0ab1c2ad947272fe9a16338d9832d" + }, + { + "path": "review/fresh-round-current-opening-v1/REVIEW.json", + "sha256": "2c15d7bd4f4fbfc58feaff126cbb05bb5d4feff7e3e35dc9a5f583c8dfb751f8" + }, + { + "path": "control/COMPONENT-SOURCE-CENSUS-DELTA-RP21-v2.json", + "sha256": "d63767ac07811da51cb82e02e2568d90392a3e1afc04b434cc13fe010fd2030e" + }, + { + "path": "control/SOURCE-FREEZE-MODE-ERRATA-v1.json", + "sha256": "bdab5308d6cff843c413445c266bef61a7d3ce2d717464d814d20a8753cea761" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v4.json", + "sha256": "03770b938a9547e3f0d7e976f3bc49c349ddcc55e4e6bb488e7aa08ed77b6865" + }, + { + "path": "review/fresh-round-current-opening-v2/REVIEW.json", + "sha256": "da25355e69f066cf9994be96148b3f758a6a032efeed71c5a2d7159268c2dbfa" + }, + { + "path": "review/current-opening-control-outcome-v1/REVIEW.json", + "sha256": "49772d0b1ee9e63a9231b531193a6fb88f2e29237c3cff417825da0f990a649a" + }, + { + "path": "control/fresh-metered-round-v1/STATE-005.json", + "sha256": "46fc97bcbad51b5b026054647c369aa3f780d2922019f3b070817a28377b00a9" + }, + { + "path": "review/fresh-controller-composition-v2/REVIEW.json", + "sha256": "6d7bc2365b46202366124c7462fd859b045429098a211e196bcc2ce73b39049e" + }, + { + "path": "review/fresh-full-driver-binding-v1/REVIEW.json", + "sha256": "a026792a55e1ce55d4d302c14086f792436903aa608d8de281c85dd07ee24e0f" + }, + { + "path": "review/fresh-capture-publisher-composition-v1/REVIEW.json", + "sha256": "78d39495241d0a5b1e06a4173270becbde389a6c30723e4e3fabb735c74b8103" + }, + { + "path": "areas/fresh-round-current-opening-v3-data/SCHEMA-GAP.json", + "sha256": "c038b30f470a65a05818246a394f97b6e7a7c91b906f7acb0a85866e52b7b172" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v5.json", + "sha256": "4136ecadcab4cff2d279f941055aa6ac91cd4dee76f1dc63c15db5acb0483a41" + }, + { + "path": "review/current-opening-control-harness-v3/REVIEW.json", + "sha256": "68856a29d64dec2a6553d712ddcb2d43eb5917da4a7f0b62a5c6061baecc73c5" + } + ], + "id": "S05.03", + "remaining": "F3 financial DATA harness135 cases independently source-accepted after B01 repair; all unexecuted and separate from original212 component families. Full old/new control union remains incomplete.", + "status": "open" + }, + { + "activity": "Reconcile every original/new control identity and its concrete execution mapping.", + "complete": false, + "completion_test": "Reconcile every original/new control identity and its concrete execution mapping.", + "evidence": [ + { + "path": "review/full-control-union-feasibility-v1/CENSUS-INDEX.json", + "sha256": "f17ac66cf3c0d239bb62fbd918d7190321dbc4195bc58f8fcf492631509aabea" + } + ], + "id": "S05.04", + "remaining": "Unresolved original names and complete mapping remain.", + "status": "open" + }, + { + "activity": "Obtain independent acceptance of the complete control-body union.", + "complete": false, + "completion_test": "Obtain independent acceptance of the complete control-body union.", + "evidence": [], + "id": "S05.05", + "remaining": "No subset or passive predicate replacement.", + "status": "open" + } + ], + "activity_percent": 40.0, + "complete_count": 2, + "id": "S05", + "name": "Complete control union", + "stage_weight_percent": 10, + "total_count": 5 + }, + { + "activities": [ + { + "activity": "Select and document the operating runtime/source trust roles.", + "complete": true, + "completion_test": "Select and document the operating runtime/source trust roles.", + "evidence": [ + { + "path": "control/INDEPENDENT-DATA-OPERATING-TCB-SELECTION-v1.json", + "sha256": "f34d4fb2e96924ae54de33c476d4adc1ee085fa1a072e166c64dd34bd0c25467" + } + ], + "id": "S06.01", + "remaining": "A role selection is not actual runtime or loaded-image qualification.", + "status": "complete" + }, + { + "activity": "Complete and independently validate the three parent-directory permission repairs.", + "complete": true, + "completion_test": "Complete and independently validate the three parent-directory permission repairs.", + "evidence": [ + { + "path": "review/independent-data-parent-normalization-outcome-v1/REVIEW.json", + "sha256": "f428deeedd7555677e3850ccd350c3861bc080173cffce8d0e0ada33d051c3a2" + } + ], + "id": "S06.02", + "remaining": "", + "status": "complete" + }, + { + "activity": "Qualify current owner/bootstrap requirements in both normal and optimized modes.", + "complete": false, + "completion_test": "Qualify current owner/bootstrap requirements in both normal and optimized modes.", + "evidence": [ + { + "path": "control/FAILED-DATA-FRESH-OWNED-OBSERVER-v1.json", + "sha256": "584ef0b447b7341f424166c886d4f5ef54e2939046a111eafe9b70781773f4f5" + }, + { + "path": "areas/independent-data-owned-stop-triage-v1/FINAL-READBACK.json", + "sha256": "c3ea46c75e90cd83e85efe8568b9a7279410898fe8fd0adc67ac29177dcffbf6" + }, + { + "path": "review/independent-data-owned-stop-triage-v1/REVIEW.json", + "sha256": "1298de858294536d499f6d2dfee61d0f839eba98e2471997b2200c6ed3b95b26" + }, + { + "path": "review/stdlib-readonly-owner-role-v1/REVIEW.json", + "sha256": "2e4177e712e94b8a4342ab31ee34028b99cd36a5a380bc7520c46a835ceb6d72" + }, + { + "path": "review/owner-normal-provider-v1/REVIEW.json", + "sha256": "27a44efe46e4c34ac55eccfc529e8ee6e6cdbb6b57be323d6b9e566290628893" + }, + { + "path": "review/owner-normal-shared-backing-v1/REVIEW.json", + "sha256": "b6e30d81e02044ed28bb039b59f96f1347b1b0d401c10b84980c070cf200eda6" + }, + { + "path": "review/fresh-round-owner-outcome-v1/REVIEW.json", + "sha256": "a69bbb1153eb39cede20af533b330586b647c4eb6a6db709d81925e6e77be463" + }, + { + "path": "review/fresh-successor-eligibility-v1/REVIEW.json", + "sha256": "d6f3aa7445502cd2ec46c1370a4fd6231da18d30c8bd413830e8149fc97b8bdf" + }, + { + "path": "review/fresh-round-funding-source-v1/REVIEW.json", + "sha256": "92c9dcdee1661a1eb2bc6a1dcc7acb2fc4d9623524e30bf48cc84a35016a9e42" + }, + { + "path": "review/fresh-round-active-owner-v1/REVIEW.json", + "sha256": "a37551cbe6225eaddf7c70ea4349e31b178bbedea74e1aa38a848a9b429d5bb4" + }, + { + "path": "review/fresh-round-funding-outcome-v1/REVIEW.json", + "sha256": "f32482d40607347e54ba5b0a0262d7b35ee4aa8693bf6e3c4b27e8483e395d0c" + }, + { + "path": "control/fresh-metered-round-v1/STATE-003.json", + "sha256": "12adff386bf4b4d35604fdd695428085f13729a912d163503c27bf3b082b17c5" + }, + { + "path": "control/FRESH-ROUND-OPENING-INPUTS-v1.json", + "sha256": "3211df77fdda79a9c4e0927c0e4395d0a526e3803fe72db999e84455b614258d" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v2.json", + "sha256": "f1b26faef0f8095f63f478296a791a79b6faf30dd630bab64ef41ed6de565cb1" + }, + { + "path": "review/fresh-round-bootstrap-loader-v2/REVIEW.json", + "sha256": "ad027d790a034ac004f10d1855841e6e31d1fd35b80440f58dc6561df6db1703" + }, + { + "path": "areas/fresh-round-current-opening-v1/FINAL-READBACK.json", + "sha256": "48e8aff90124a72c034595df906779b9d51c585ef41743af066f44c1ed253131" + }, + { + "path": "review/fresh-round-consumer-integration-v1/REVIEW.json", + "sha256": "b0843595c9ddd57ffdfbb1c06445738133211744d6a8892cf45b87fc140e535a" + }, + { + "path": "areas/replay-foreign-owner-control-v2/FINAL-READBACK.json", + "sha256": "455cf33add6b345ab1b5502725ba52a3145cd9d7d73d4b70cdbc050e47a8bd2a" + }, + { + "path": "review/replay-foreign-owner-control-v1/REVIEW.json", + "sha256": "356e898167380cfeda40f7d2bb51b5e3fecc6639f9d5489f604ae0681fa28533" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v3.json", + "sha256": "2e26c9208e71d3b5237ede19561bd271f4d1d2be1500f355940278d5fe4d0295" + }, + { + "path": "review/replay-foreign-owner-control-v2/REVIEW.json", + "sha256": "429234aba44dee74bc4d5dabb3f95aef464b5b55578ecb44c97da4eeb190d61a" + }, + { + "path": "review/fresh-round-consumer-integration-v2/REVIEW.json", + "sha256": "7e3345129681d9c49540e8d21fe3c76da4f0ab1c2ad947272fe9a16338d9832d" + }, + { + "path": "review/fresh-round-current-opening-v1/REVIEW.json", + "sha256": "2c15d7bd4f4fbfc58feaff126cbb05bb5d4feff7e3e35dc9a5f583c8dfb751f8" + }, + { + "path": "control/COMPONENT-SOURCE-CENSUS-DELTA-RP21-v2.json", + "sha256": "d63767ac07811da51cb82e02e2568d90392a3e1afc04b434cc13fe010fd2030e" + }, + { + "path": "control/SOURCE-FREEZE-MODE-ERRATA-v1.json", + "sha256": "bdab5308d6cff843c413445c266bef61a7d3ce2d717464d814d20a8753cea761" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v4.json", + "sha256": "03770b938a9547e3f0d7e976f3bc49c349ddcc55e4e6bb488e7aa08ed77b6865" + }, + { + "path": "review/fresh-round-current-opening-v2/REVIEW.json", + "sha256": "da25355e69f066cf9994be96148b3f758a6a032efeed71c5a2d7159268c2dbfa" + }, + { + "path": "review/current-opening-control-outcome-v1/REVIEW.json", + "sha256": "49772d0b1ee9e63a9231b531193a6fb88f2e29237c3cff417825da0f990a649a" + }, + { + "path": "control/fresh-metered-round-v1/STATE-005.json", + "sha256": "46fc97bcbad51b5b026054647c369aa3f780d2922019f3b070817a28377b00a9" + }, + { + "path": "review/fresh-controller-composition-v2/REVIEW.json", + "sha256": "6d7bc2365b46202366124c7462fd859b045429098a211e196bcc2ce73b39049e" + }, + { + "path": "review/fresh-full-driver-binding-v1/REVIEW.json", + "sha256": "a026792a55e1ce55d4d302c14086f792436903aa608d8de281c85dd07ee24e0f" + }, + { + "path": "review/fresh-capture-publisher-composition-v1/REVIEW.json", + "sha256": "78d39495241d0a5b1e06a4173270becbde389a6c30723e4e3fabb735c74b8103" + }, + { + "path": "areas/fresh-round-current-opening-v3-data/SCHEMA-GAP.json", + "sha256": "c038b30f470a65a05818246a394f97b6e7a7c91b906f7acb0a85866e52b7b172" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v5.json", + "sha256": "4136ecadcab4cff2d279f941055aa6ac91cd4dee76f1dc63c15db5acb0483a41" + }, + { + "path": "review/fresh-round-provenance-bridge-v1/REVIEW.json", + "sha256": "ed8517ad6b627b4f849de7f7eb0eaa8782d68460c59afe8258f5cf086f5ac052" + }, + { + "path": "review/fresh-round-bootstrap-loader-v3/REVIEW.json", + "sha256": "e4227ab84ccdbcc3e836bcdff13b50cc1d6216a75546d3ee71d2c0205086326f" + }, + { + "path": "review/composed-fixed-role-entry-v1/REVIEW.json", + "sha256": "5a7be0f18f2e0377e2b3674e470630e0b2c77aca34052bb3b5f239c05e408a0d" + }, + { + "path": "review/fresh-round-reusable-record-family-v2/REVIEW.json", + "sha256": "264366510558f6248cad049f0d3b68f06c64db81b338f279000b26854eaebbdd" + } + ], + "id": "S06.03", + "remaining": "V2 distinct closer/initializer source-private phase specification accepted; actual F4/A4 code, source review, real IO/EX/currentness and both normal/O profiles remain unqualified.", + "status": "open" + }, + { + "activity": "Qualify all required native/FFI/build and fault-control runtime profiles.", + "complete": false, + "completion_test": "Qualify all required native/FFI/build and fault-control runtime profiles.", + "evidence": [], + "id": "S06.04", + "remaining": "Native/header expansion remains parked; no requirements waived.", + "status": "open" + }, + { + "activity": "Resolve genuine terminal cleanup, failed-attempt accounting and the final timing/publication boundary.", + "complete": false, + "completion_test": "Resolve genuine terminal cleanup, failed-attempt accounting and the final timing/publication boundary.", + "evidence": [ + { + "path": "control/FAILED-DATA-FRESH-OWNED-OBSERVER-v1.json", + "sha256": "584ef0b447b7341f424166c886d4f5ef54e2939046a111eafe9b70781773f4f5" + }, + { + "path": "review/failed-capture-cost-recovery-v1/REVIEW.json", + "sha256": "8e10c7f07a6d618f15db6e7d1309ca087eff26f3345ecad220af8cca43788703" + }, + { + "path": "review/capture-failure-observability-v2/REVIEW.json", + "sha256": "e009c5f78d2471670620c9f91bb0a1bd2fc3ad51b631459403a2a73cc4ef1226" + }, + { + "path": "review/gnu-usage-observation-parser-v1/REVIEW.json", + "sha256": "3849c6aef02104e70c622ed76405f4305839a4ed0129f074fb6cc4ec814fb825" + }, + { + "path": "review/fresh-round-owner-outcome-v1/REVIEW.json", + "sha256": "a69bbb1153eb39cede20af533b330586b647c4eb6a6db709d81925e6e77be463" + }, + { + "path": "review/fresh-successor-eligibility-v1/REVIEW.json", + "sha256": "d6f3aa7445502cd2ec46c1370a4fd6231da18d30c8bd413830e8149fc97b8bdf" + }, + { + "path": "review/fresh-round-funding-source-v1/REVIEW.json", + "sha256": "92c9dcdee1661a1eb2bc6a1dcc7acb2fc4d9623524e30bf48cc84a35016a9e42" + }, + { + "path": "review/fresh-round-active-owner-v1/REVIEW.json", + "sha256": "a37551cbe6225eaddf7c70ea4349e31b178bbedea74e1aa38a848a9b429d5bb4" + }, + { + "path": "review/fresh-round-funding-outcome-v1/REVIEW.json", + "sha256": "f32482d40607347e54ba5b0a0262d7b35ee4aa8693bf6e3c4b27e8483e395d0c" + }, + { + "path": "control/fresh-metered-round-v1/STATE-003.json", + "sha256": "12adff386bf4b4d35604fdd695428085f13729a912d163503c27bf3b082b17c5" + }, + { + "path": "control/FRESH-ROUND-OPENING-INPUTS-v1.json", + "sha256": "3211df77fdda79a9c4e0927c0e4395d0a526e3803fe72db999e84455b614258d" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v2.json", + "sha256": "f1b26faef0f8095f63f478296a791a79b6faf30dd630bab64ef41ed6de565cb1" + }, + { + "path": "review/fresh-round-bootstrap-loader-v2/REVIEW.json", + "sha256": "ad027d790a034ac004f10d1855841e6e31d1fd35b80440f58dc6561df6db1703" + }, + { + "path": "areas/fresh-round-current-opening-v1/FINAL-READBACK.json", + "sha256": "48e8aff90124a72c034595df906779b9d51c585ef41743af066f44c1ed253131" + }, + { + "path": "review/fresh-round-consumer-integration-v1/REVIEW.json", + "sha256": "b0843595c9ddd57ffdfbb1c06445738133211744d6a8892cf45b87fc140e535a" + }, + { + "path": "areas/replay-foreign-owner-control-v2/FINAL-READBACK.json", + "sha256": "455cf33add6b345ab1b5502725ba52a3145cd9d7d73d4b70cdbc050e47a8bd2a" + }, + { + "path": "review/replay-foreign-owner-control-v1/REVIEW.json", + "sha256": "356e898167380cfeda40f7d2bb51b5e3fecc6639f9d5489f604ae0681fa28533" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v3.json", + "sha256": "2e26c9208e71d3b5237ede19561bd271f4d1d2be1500f355940278d5fe4d0295" + }, + { + "path": "review/fresh-round-current-opening-v2/REVIEW.json", + "sha256": "da25355e69f066cf9994be96148b3f758a6a032efeed71c5a2d7159268c2dbfa" + }, + { + "path": "review/current-opening-control-outcome-v1/REVIEW.json", + "sha256": "49772d0b1ee9e63a9231b531193a6fb88f2e29237c3cff417825da0f990a649a" + }, + { + "path": "control/fresh-metered-round-v1/STATE-005.json", + "sha256": "46fc97bcbad51b5b026054647c369aa3f780d2922019f3b070817a28377b00a9" + }, + { + "path": "review/fresh-controller-composition-v2/REVIEW.json", + "sha256": "6d7bc2365b46202366124c7462fd859b045429098a211e196bcc2ce73b39049e" + }, + { + "path": "review/fresh-full-driver-binding-v1/REVIEW.json", + "sha256": "a026792a55e1ce55d4d302c14086f792436903aa608d8de281c85dd07ee24e0f" + }, + { + "path": "review/fresh-capture-publisher-composition-v1/REVIEW.json", + "sha256": "78d39495241d0a5b1e06a4173270becbde389a6c30723e4e3fabb735c74b8103" + }, + { + "path": "areas/fresh-round-current-opening-v3-data/SCHEMA-GAP.json", + "sha256": "c038b30f470a65a05818246a394f97b6e7a7c91b906f7acb0a85866e52b7b172" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v5.json", + "sha256": "4136ecadcab4cff2d279f941055aa6ac91cd4dee76f1dc63c15db5acb0483a41" + }, + { + "path": "review/fresh-capture-publisher-composition-v2/REVIEW.json", + "sha256": "30669eb059e71e6a6dad50981ec7a628d48d0cc394e8c71c34659a8d8a0d5716" + }, + { + "path": "review/fresh-round-reusable-record-family-v1/REVIEW.json", + "sha256": "d9a01dc288f69773bc412d8fcfda574454acf45b683b98a97fa82eddffce23eb" + }, + { + "path": "review/fresh-round-reusable-record-family-v2/REVIEW.json", + "sha256": "264366510558f6248cad049f0d3b68f06c64db81b338f279000b26854eaebbdd" + } + ], + "id": "S06.05", + "remaining": "Specification resolves the closer ownership/accounting contradiction, with separate target/own reservations and verified commit. Implementation and all actual cleanup/timing remain open; historical/current complete physical totals remain unknown and OPEN_NOT_ZERO.", + "status": "open" + } + ], + "activity_percent": 40.0, + "complete_count": 2, + "id": "S06", + "name": "Runtime, ownership, cleanup and accounting", + "stage_weight_percent": 10, + "total_count": 5 + }, + { + "activities": [ + { + "activity": "Independently review the exact parent capture/launch source route.", + "complete": true, + "completion_test": "Independently review the exact parent capture/launch source route.", + "evidence": [ + { + "path": "review/independent-data-fresh-parent-capture-v1/REVIEW.json", + "sha256": "9c9945e8764177d231b03a98889af64202561a637433b3c369d4e9f574b1af1f" + }, + { + "path": "review/fresh-successor-eligibility-v1/REVIEW.json", + "sha256": "d6f3aa7445502cd2ec46c1370a4fd6231da18d30c8bd413830e8149fc97b8bdf" + }, + { + "path": "review/fresh-round-funding-source-v1/REVIEW.json", + "sha256": "92c9dcdee1661a1eb2bc6a1dcc7acb2fc4d9623524e30bf48cc84a35016a9e42" + }, + { + "path": "review/fresh-round-active-owner-v1/REVIEW.json", + "sha256": "a37551cbe6225eaddf7c70ea4349e31b178bbedea74e1aa38a848a9b429d5bb4" + }, + { + "path": "review/fresh-round-funding-outcome-v1/REVIEW.json", + "sha256": "f32482d40607347e54ba5b0a0262d7b35ee4aa8693bf6e3c4b27e8483e395d0c" + }, + { + "path": "control/fresh-metered-round-v1/STATE-003.json", + "sha256": "12adff386bf4b4d35604fdd695428085f13729a912d163503c27bf3b082b17c5" + }, + { + "path": "control/FRESH-ROUND-OPENING-INPUTS-v1.json", + "sha256": "3211df77fdda79a9c4e0927c0e4395d0a526e3803fe72db999e84455b614258d" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v2.json", + "sha256": "f1b26faef0f8095f63f478296a791a79b6faf30dd630bab64ef41ed6de565cb1" + }, + { + "path": "review/fresh-round-bootstrap-loader-v2/REVIEW.json", + "sha256": "ad027d790a034ac004f10d1855841e6e31d1fd35b80440f58dc6561df6db1703" + }, + { + "path": "areas/fresh-round-current-opening-v1/FINAL-READBACK.json", + "sha256": "48e8aff90124a72c034595df906779b9d51c585ef41743af066f44c1ed253131" + }, + { + "path": "review/fresh-round-consumer-integration-v1/REVIEW.json", + "sha256": "b0843595c9ddd57ffdfbb1c06445738133211744d6a8892cf45b87fc140e535a" + }, + { + "path": "areas/replay-foreign-owner-control-v2/FINAL-READBACK.json", + "sha256": "455cf33add6b345ab1b5502725ba52a3145cd9d7d73d4b70cdbc050e47a8bd2a" + }, + { + "path": "review/replay-foreign-owner-control-v1/REVIEW.json", + "sha256": "356e898167380cfeda40f7d2bb51b5e3fecc6639f9d5489f604ae0681fa28533" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v3.json", + "sha256": "2e26c9208e71d3b5237ede19561bd271f4d1d2be1500f355940278d5fe4d0295" + }, + { + "path": "review/replay-foreign-owner-control-v2/REVIEW.json", + "sha256": "429234aba44dee74bc4d5dabb3f95aef464b5b55578ecb44c97da4eeb190d61a" + }, + { + "path": "review/fresh-round-consumer-integration-v2/REVIEW.json", + "sha256": "7e3345129681d9c49540e8d21fe3c76da4f0ab1c2ad947272fe9a16338d9832d" + }, + { + "path": "review/fresh-round-current-opening-v1/REVIEW.json", + "sha256": "2c15d7bd4f4fbfc58feaff126cbb05bb5d4feff7e3e35dc9a5f583c8dfb751f8" + }, + { + "path": "control/COMPONENT-SOURCE-CENSUS-DELTA-RP21-v2.json", + "sha256": "d63767ac07811da51cb82e02e2568d90392a3e1afc04b434cc13fe010fd2030e" + }, + { + "path": "control/SOURCE-FREEZE-MODE-ERRATA-v1.json", + "sha256": "bdab5308d6cff843c413445c266bef61a7d3ce2d717464d814d20a8753cea761" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v4.json", + "sha256": "03770b938a9547e3f0d7e976f3bc49c349ddcc55e4e6bb488e7aa08ed77b6865" + }, + { + "path": "review/fresh-round-current-opening-v2/REVIEW.json", + "sha256": "da25355e69f066cf9994be96148b3f758a6a032efeed71c5a2d7159268c2dbfa" + }, + { + "path": "review/current-opening-control-outcome-v1/REVIEW.json", + "sha256": "49772d0b1ee9e63a9231b531193a6fb88f2e29237c3cff417825da0f990a649a" + }, + { + "path": "control/fresh-metered-round-v1/STATE-005.json", + "sha256": "46fc97bcbad51b5b026054647c369aa3f780d2922019f3b070817a28377b00a9" + }, + { + "path": "review/fresh-controller-composition-v2/REVIEW.json", + "sha256": "6d7bc2365b46202366124c7462fd859b045429098a211e196bcc2ce73b39049e" + }, + { + "path": "review/fresh-full-driver-binding-v1/REVIEW.json", + "sha256": "a026792a55e1ce55d4d302c14086f792436903aa608d8de281c85dd07ee24e0f" + }, + { + "path": "review/fresh-capture-publisher-composition-v1/REVIEW.json", + "sha256": "78d39495241d0a5b1e06a4173270becbde389a6c30723e4e3fabb735c74b8103" + }, + { + "path": "areas/fresh-round-current-opening-v3-data/SCHEMA-GAP.json", + "sha256": "c038b30f470a65a05818246a394f97b6e7a7c91b906f7acb0a85866e52b7b172" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v5.json", + "sha256": "4136ecadcab4cff2d279f941055aa6ac91cd4dee76f1dc63c15db5acb0483a41" + } + ], + "id": "S07.01", + "remaining": "Originalstatedcapturecredit unchanged. NewcontrollerC2resourcecheck390/30restoredanddriverpathsourceacceptedconditionally. OuterbinderCPC-B01 callbackgate repair stillopen; no completeconfiguredcaller/admission.", + "status": "complete" + }, + { + "activity": "Freeze the complete combined stage with all six compatible changes.", + "complete": false, + "completion_test": "Freeze the complete combined stage with all six compatible changes.", + "evidence": [], + "id": "S07.02", + "remaining": "A selected DATA prefix is insufficient.", + "status": "open" + }, + { + "activity": "Bind genuine cache/full caller context and automatic retention to their actual consumers.", + "complete": false, + "completion_test": "Bind genuine cache/full caller context and automatic retention to their actual consumers.", + "evidence": [], + "id": "S07.03", + "remaining": "Both full contracts and real caller integration remain open.", + "status": "open" + }, + { + "activity": "Reconcile all current source, helper, driver and native closure bindings in the complete stage.", + "complete": false, + "completion_test": "Reconcile all current source, helper, driver and native closure bindings in the complete stage.", + "evidence": [ + { + "path": "review/fresh-round-active-owner-v1/REVIEW.json", + "sha256": "a37551cbe6225eaddf7c70ea4349e31b178bbedea74e1aa38a848a9b429d5bb4" + }, + { + "path": "review/fresh-round-funding-outcome-v1/REVIEW.json", + "sha256": "f32482d40607347e54ba5b0a0262d7b35ee4aa8693bf6e3c4b27e8483e395d0c" + }, + { + "path": "control/fresh-metered-round-v1/STATE-003.json", + "sha256": "12adff386bf4b4d35604fdd695428085f13729a912d163503c27bf3b082b17c5" + }, + { + "path": "control/FRESH-ROUND-OPENING-INPUTS-v1.json", + "sha256": "3211df77fdda79a9c4e0927c0e4395d0a526e3803fe72db999e84455b614258d" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v2.json", + "sha256": "f1b26faef0f8095f63f478296a791a79b6faf30dd630bab64ef41ed6de565cb1" + }, + { + "path": "review/fresh-round-bootstrap-loader-v2/REVIEW.json", + "sha256": "ad027d790a034ac004f10d1855841e6e31d1fd35b80440f58dc6561df6db1703" + }, + { + "path": "areas/fresh-round-current-opening-v1/FINAL-READBACK.json", + "sha256": "48e8aff90124a72c034595df906779b9d51c585ef41743af066f44c1ed253131" + }, + { + "path": "review/fresh-round-consumer-integration-v1/REVIEW.json", + "sha256": "b0843595c9ddd57ffdfbb1c06445738133211744d6a8892cf45b87fc140e535a" + }, + { + "path": "areas/replay-foreign-owner-control-v2/FINAL-READBACK.json", + "sha256": "455cf33add6b345ab1b5502725ba52a3145cd9d7d73d4b70cdbc050e47a8bd2a" + }, + { + "path": "review/replay-foreign-owner-control-v1/REVIEW.json", + "sha256": "356e898167380cfeda40f7d2bb51b5e3fecc6639f9d5489f604ae0681fa28533" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v3.json", + "sha256": "2e26c9208e71d3b5237ede19561bd271f4d1d2be1500f355940278d5fe4d0295" + }, + { + "path": "review/replay-foreign-owner-control-v2/REVIEW.json", + "sha256": "429234aba44dee74bc4d5dabb3f95aef464b5b55578ecb44c97da4eeb190d61a" + }, + { + "path": "review/fresh-round-consumer-integration-v2/REVIEW.json", + "sha256": "7e3345129681d9c49540e8d21fe3c76da4f0ab1c2ad947272fe9a16338d9832d" + }, + { + "path": "review/fresh-round-current-opening-v1/REVIEW.json", + "sha256": "2c15d7bd4f4fbfc58feaff126cbb05bb5d4feff7e3e35dc9a5f583c8dfb751f8" + }, + { + "path": "control/COMPONENT-SOURCE-CENSUS-DELTA-RP21-v2.json", + "sha256": "d63767ac07811da51cb82e02e2568d90392a3e1afc04b434cc13fe010fd2030e" + }, + { + "path": "control/SOURCE-FREEZE-MODE-ERRATA-v1.json", + "sha256": "bdab5308d6cff843c413445c266bef61a7d3ce2d717464d814d20a8753cea761" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v4.json", + "sha256": "03770b938a9547e3f0d7e976f3bc49c349ddcc55e4e6bb488e7aa08ed77b6865" + }, + { + "path": "review/fresh-round-current-opening-v2/REVIEW.json", + "sha256": "da25355e69f066cf9994be96148b3f758a6a032efeed71c5a2d7159268c2dbfa" + }, + { + "path": "review/current-opening-control-outcome-v1/REVIEW.json", + "sha256": "49772d0b1ee9e63a9231b531193a6fb88f2e29237c3cff417825da0f990a649a" + }, + { + "path": "control/fresh-metered-round-v1/STATE-005.json", + "sha256": "46fc97bcbad51b5b026054647c369aa3f780d2922019f3b070817a28377b00a9" + }, + { + "path": "review/fresh-controller-composition-v2/REVIEW.json", + "sha256": "6d7bc2365b46202366124c7462fd859b045429098a211e196bcc2ce73b39049e" + }, + { + "path": "review/fresh-full-driver-binding-v1/REVIEW.json", + "sha256": "a026792a55e1ce55d4d302c14086f792436903aa608d8de281c85dd07ee24e0f" + }, + { + "path": "review/fresh-capture-publisher-composition-v1/REVIEW.json", + "sha256": "78d39495241d0a5b1e06a4173270becbde389a6c30723e4e3fabb735c74b8103" + }, + { + "path": "areas/fresh-round-current-opening-v3-data/SCHEMA-GAP.json", + "sha256": "c038b30f470a65a05818246a394f97b6e7a7c91b906f7acb0a85866e52b7b172" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v5.json", + "sha256": "4136ecadcab4cff2d279f941055aa6ac91cd4dee76f1dc63c15db5acb0483a41" + }, + { + "path": "review/composed-stage-config-v1/REVIEW.json", + "sha256": "77d65c49c0383dcda8f56533d76b903a218af30a5bde57815f76c2c5743fe3a4" + }, + { + "path": "review/composed-stage-source-install-v1/REVIEW.json", + "sha256": "dcc0250ba2621fc68d451e5c770d0a416d1c157eb5ce5a6e4390b86cc8943253" + }, + { + "path": "review/composed-fixed-role-entry-v1/REVIEW.json", + "sha256": "5a7be0f18f2e0377e2b3674e470630e0b2c77aca34052bb3b5f239c05e408a0d" + }, + { + "path": "review/fresh-round-reusable-record-family-v2/REVIEW.json", + "sha256": "264366510558f6248cad049f0d3b68f06c64db81b338f279000b26854eaebbdd" + } + ], + "id": "S07.04", + "remaining": "Literal C2/F3/A3 fixed entry source acceptance is retained. Future F4/A4 version integration needs fresh source/pin/profile review; complete all-six caller closure remains open.", + "status": "open" + }, + { + "activity": "Obtain independent acceptance of the complete combined stage and installation order.", + "complete": false, + "completion_test": "Obtain independent acceptance of the complete combined stage and installation order.", + "evidence": [], + "id": "S07.05", + "remaining": "No complete-stage admission exists.", + "status": "open" + } + ], + "activity_percent": 20.0, + "complete_count": 1, + "id": "S07", + "name": "Complete integration and source bindings", + "stage_weight_percent": 10, + "total_count": 5 + }, + { + "activities": [ + { + "activity": "Admit the complete current normal-mode control command and prerequisites.", + "complete": false, + "completion_test": "Admit the complete current normal-mode control command and prerequisites.", + "evidence": [], + "id": "S08.01", + "remaining": "All original/new controls required.", + "status": "open" + }, + { + "activity": "Execute the complete normal-mode control union within the guarded queue.", + "complete": false, + "completion_test": "Execute the complete normal-mode control union within the guarded queue.", + "evidence": [], + "id": "S08.02", + "remaining": "Earlier finite/subset runs cannot satisfy current complete execution.", + "status": "open" + }, + { + "activity": "Verify every normal-mode exact output, rejection, order and cleanup outcome.", + "complete": false, + "completion_test": "Verify every normal-mode exact output, rejection, order and cleanup outcome.", + "evidence": [], + "id": "S08.03", + "remaining": "Preserve all failed evidence and independent references.", + "status": "open" + }, + { + "activity": "Obtain independent acceptance of the complete normal-mode outcome.", + "complete": false, + "completion_test": "Obtain independent acceptance of the complete normal-mode outcome.", + "evidence": [], + "id": "S08.04", + "remaining": "Complete source-bound runtime evidence required.", + "status": "open" + } + ], + "activity_percent": 0.0, + "complete_count": 0, + "id": "S08", + "name": "Complete normal-mode controls", + "stage_weight_percent": 10, + "total_count": 4 + }, + { + "activities": [ + { + "activity": "Admit the complete current optimized-mode control command and prerequisites.", + "complete": false, + "completion_test": "Admit the complete current optimized-mode control command and prerequisites.", + "evidence": [], + "id": "S09.01", + "remaining": "All original/new controls required.", + "status": "open" + }, + { + "activity": "Execute the complete optimized-mode control union within the guarded queue.", + "complete": false, + "completion_test": "Execute the complete optimized-mode control union within the guarded queue.", + "evidence": [], + "id": "S09.02", + "remaining": "Earlier finite/subset runs cannot satisfy current complete execution.", + "status": "open" + }, + { + "activity": "Verify every optimized-mode exact output, rejection, order and cleanup outcome.", + "complete": false, + "completion_test": "Verify every optimized-mode exact output, rejection, order and cleanup outcome.", + "evidence": [], + "id": "S09.03", + "remaining": "Preserve all failed evidence and independent references.", + "status": "open" + }, + { + "activity": "Obtain independent acceptance of the complete optimized-mode outcome.", + "complete": false, + "completion_test": "Obtain independent acceptance of the complete optimized-mode outcome.", + "evidence": [], + "id": "S09.04", + "remaining": "Complete source-bound runtime evidence required.", + "status": "open" + } + ], + "activity_percent": 0.0, + "complete_count": 0, + "id": "S09", + "name": "Complete optimized-mode controls", + "stage_weight_percent": 10, + "total_count": 4 + }, + { + "activities": [ + { + "activity": "Freeze the complete comparison protocol and its explicit funding/admission conditions.", + "complete": true, + "completion_test": "Freeze the complete comparison protocol and its explicit funding/admission conditions.", + "evidence": [ + { + "path": "control/MEASUREMENT-PROTOCOL-v2.json", + "sha256": "883c4b51c2d07413bc8ed600b48780cd4617ac1dd1e09681de9c03b84332f390" + } + ], + "id": "S10.01", + "remaining": "The frozen protocol is not funded or executed.", + "status": "complete" + }, + { + "activity": "Independently review the baseline launcher source.", + "complete": true, + "completion_test": "Independently review the baseline launcher source.", + "evidence": [ + { + "path": "review/field-baseline-launcher-source-v2/REVIEW.json", + "sha256": "af587f26bc5ea3e7f4e3841431a2bb1af6910f8144a331c1182715a003f137c3" + } + ], + "id": "S10.02", + "remaining": "Six outer runtime/admission gates remain open.", + "status": "complete" + }, + { + "activity": "Assemble and independently review the complete candidate caller with assertions enabled.", + "complete": false, + "completion_test": "Assemble and independently review the complete candidate caller with assertions enabled.", + "evidence": [], + "id": "S10.03", + "remaining": "Complete original checks and exact output equality required.", + "status": "open" + }, + { + "activity": "Establish current funding and full wall/CPU/RSS cost coverage for the complete comparison.", + "complete": false, + "completion_test": "Establish current funding and full wall/CPU/RSS cost coverage for the complete comparison.", + "evidence": [ + { + "path": "control/FAILED-DATA-FRESH-OWNED-OBSERVER-v1.json", + "sha256": "584ef0b447b7341f424166c886d4f5ef54e2939046a111eafe9b70781773f4f5" + }, + { + "path": "control/MEASUREMENT-PROTOCOL-v2.json", + "sha256": "883c4b51c2d07413bc8ed600b48780cd4617ac1dd1e09681de9c03b84332f390" + }, + { + "path": "review/fresh-round-active-owner-v1/REVIEW.json", + "sha256": "a37551cbe6225eaddf7c70ea4349e31b178bbedea74e1aa38a848a9b429d5bb4" + }, + { + "path": "review/fresh-round-funding-outcome-v1/REVIEW.json", + "sha256": "f32482d40607347e54ba5b0a0262d7b35ee4aa8693bf6e3c4b27e8483e395d0c" + }, + { + "path": "control/fresh-metered-round-v1/STATE-003.json", + "sha256": "12adff386bf4b4d35604fdd695428085f13729a912d163503c27bf3b082b17c5" + }, + { + "path": "control/FRESH-ROUND-OPENING-INPUTS-v1.json", + "sha256": "3211df77fdda79a9c4e0927c0e4395d0a526e3803fe72db999e84455b614258d" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v2.json", + "sha256": "f1b26faef0f8095f63f478296a791a79b6faf30dd630bab64ef41ed6de565cb1" + }, + { + "path": "review/fresh-round-bootstrap-loader-v2/REVIEW.json", + "sha256": "ad027d790a034ac004f10d1855841e6e31d1fd35b80440f58dc6561df6db1703" + }, + { + "path": "areas/fresh-round-current-opening-v1/FINAL-READBACK.json", + "sha256": "48e8aff90124a72c034595df906779b9d51c585ef41743af066f44c1ed253131" + }, + { + "path": "review/fresh-round-consumer-integration-v1/REVIEW.json", + "sha256": "b0843595c9ddd57ffdfbb1c06445738133211744d6a8892cf45b87fc140e535a" + }, + { + "path": "areas/replay-foreign-owner-control-v2/FINAL-READBACK.json", + "sha256": "455cf33add6b345ab1b5502725ba52a3145cd9d7d73d4b70cdbc050e47a8bd2a" + }, + { + "path": "review/replay-foreign-owner-control-v1/REVIEW.json", + "sha256": "356e898167380cfeda40f7d2bb51b5e3fecc6639f9d5489f604ae0681fa28533" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v3.json", + "sha256": "2e26c9208e71d3b5237ede19561bd271f4d1d2be1500f355940278d5fe4d0295" + }, + { + "path": "review/fresh-round-current-opening-v2/REVIEW.json", + "sha256": "da25355e69f066cf9994be96148b3f758a6a032efeed71c5a2d7159268c2dbfa" + }, + { + "path": "review/current-opening-control-outcome-v1/REVIEW.json", + "sha256": "49772d0b1ee9e63a9231b531193a6fb88f2e29237c3cff417825da0f990a649a" + }, + { + "path": "control/fresh-metered-round-v1/STATE-005.json", + "sha256": "46fc97bcbad51b5b026054647c369aa3f780d2922019f3b070817a28377b00a9" + }, + { + "path": "review/fresh-controller-composition-v2/REVIEW.json", + "sha256": "6d7bc2365b46202366124c7462fd859b045429098a211e196bcc2ce73b39049e" + }, + { + "path": "review/fresh-full-driver-binding-v1/REVIEW.json", + "sha256": "a026792a55e1ce55d4d302c14086f792436903aa608d8de281c85dd07ee24e0f" + }, + { + "path": "review/fresh-capture-publisher-composition-v1/REVIEW.json", + "sha256": "78d39495241d0a5b1e06a4173270becbde389a6c30723e4e3fabb735c74b8103" + }, + { + "path": "areas/fresh-round-current-opening-v3-data/SCHEMA-GAP.json", + "sha256": "c038b30f470a65a05818246a394f97b6e7a7c91b906f7acb0a85866e52b7b172" + }, + { + "path": "control/FRESH-SUCCESSOR-NEXT-COMPLETION-v5.json", + "sha256": "4136ecadcab4cff2d279f941055aa6ac91cd4dee76f1dc63c15db5acb0483a41" + }, + { + "path": "control/FRESH-METERED-ROUND-AUTHORIZATION-v1.json", + "sha256": "28bc04ad98151cf6a52607e4271b4dcbcbd645d0c8c538a35bc37e3d5194d50f" + }, + { + "path": "review/fresh-round-reusable-record-family-v1/REVIEW.json", + "sha256": "d9a01dc288f69773bc412d8fcfda574454acf45b683b98a97fa82eddffce23eb" + }, + { + "path": "review/fresh-round-reusable-record-family-v2/REVIEW.json", + "sha256": "264366510558f6248cad049f0d3b68f06c64db81b338f279000b26854eaebbdd" + } + ], + "id": "S10.04", + "remaining": "Fresh allowance remains authorized;6.980533479/2400policyseconds charged. Source construction is active but no actual command is admitted before implementation/writer/control and exact operation review.", + "status": "open" + }, + { + "activity": "Admit the complete source-bound caller and measurement/resource protocol for execution.", + "complete": false, + "completion_test": "Admit the complete source-bound caller and measurement/resource protocol for execution.", + "evidence": [], + "id": "S10.05", + "remaining": "This stage gate is admission; full measurements and delivery remain later overall requirements.", + "status": "open" + } + ], + "activity_percent": 40.0, + "complete_count": 2, + "id": "S10", + "name": "Full caller and comparison protocol admission", + "stage_weight_percent": 10, + "total_count": 5 + } + ], + "installed_source_copy_independent_review": { + "path": "review/composed-stage-source-install-v1/REVIEW.json", + "sha256": "dcc0250ba2621fc68d451e5c770d0a416d1c157eb5ce5a6e4390b86cc8943253" + }, + "method": "Keep original ten stage gates at equal10percent weight. Within each group, credit only fully evidenced explicit activities, equally weighted within that group. Source tasks may complete only their stated source scope. An activity score does not complete its parent gate or imply runtime/performance qualification. No effort/time/ETA claim.", + "new_authored_repairs_pending_independent_review": [], + "new_completion_credit": false, + "new_independent_rejections": [ + { + "path": "review/fresh-round-reusable-record-family-v1/REVIEW.json", + "sha256": "d9a01dc288f69773bc412d8fcfda574454acf45b683b98a97fa82eddffce23eb" + } + ], + "new_independent_specification_acceptance": { + "path": "review/fresh-round-reusable-record-family-v2/REVIEW.json", + "sha256": "264366510558f6248cad049f0d3b68f06c64db81b338f279000b26854eaebbdd" + }, + "new_source_case_credit": false, + "per_group_counts": [ + { + "complete": 4, + "group": "S01", + "total": 4 + }, + { + "complete": 4, + "group": "S02", + "total": 4 + }, + { + "complete": 6, + "group": "S03", + "total": 8 + }, + { + "complete": 1, + "group": "S04", + "total": 5 + }, + { + "complete": 2, + "group": "S05", + "total": 5 + }, + { + "complete": 2, + "group": "S06", + "total": 5 + }, + { + "complete": 1, + "group": "S07", + "total": 5 + }, + { + "complete": 0, + "group": "S08", + "total": 4 + }, + { + "complete": 0, + "group": "S09", + "total": 4 + }, + { + "complete": 2, + "group": "S10", + "total": 5 + } + ], + "positive_activity_evidence_hashes_verified": 45, + "predecessor": { + "path": "control/hourly-progress/ACTIVITY-BREAKDOWN-v15.json", + "sha256": "00ec7b97ae421b28d1c6977eddeb8e7a67cbaa2c9290ede6134e09f4bab53e24" + }, + "retention_feasibility_NO_GO_preserved": { + "path": "areas/retention-current-parent-feasibility-v7/FINAL-READBACK.json", + "sha256": "2ad68f06683001a419bf76f7ff22668a5fa22bf4dcf824e11806cd9c5bf3cd5c" + }, + "revision_reason": "V2 reusable record specification accepted at construction-only scope; F4/A4, writer and independent controls source work active. No complete activity, full gate or runtime credit.", + "schema": "h25-stage-activity-breakdown-v16", + "source_preparation_active_by_direct_user_authority": true, + "stage_id": "G2_G3_INTEGRATION_CONTROL_QUALIFICATION", + "summary": { + "complete_activities": 22, + "fully_qualified_stage_gates": 2, + "overall_gate_percent": 10, + "overall_milestones_complete": 1, + "overall_milestones_total": 10, + "qualified_stage_gate_percent": 20, + "stage_gates_total": 10, + "total_activities": 49, + "weighted_activity_percent": 43.5 + }, + "unchanged_positive_credit_evidence_audit": { + "path": "control/hourly-progress/ACTIVITY-BREAKDOWN-v14.json", + "sha256": "dedd730d6c53fffda5644e1d650ffceec59d22635dea065b216d7784693c7728" + }, + "update_policy": "Preserve v1 snapshot. Append new versioned snapshots with changed activity IDs/evidence and a delta log. Keep definitions/weights/denominators fixed unless the user requests a documented refinement; preserve earlier snapshots. Revoke completed credit when its evidence no longer applies. Original full milestone gates retain their original criteria.", + "user_requested_reporting_refinement": true +} diff --git a/research/h25-full-caller-readable-inputs/LICENSE-APACHE-2.0.txt b/research/h25-full-caller-readable-inputs/LICENSE-APACHE-2.0.txt new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/h25-full-caller-readable-inputs/LICENSE-APACHE-2.0.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/h25-full-caller-readable-inputs/LICENSE-CPYTHON.txt b/research/h25-full-caller-readable-inputs/LICENSE-CPYTHON.txt new file mode 100644 index 0000000000..f26bcf4d2d --- /dev/null +++ b/research/h25-full-caller-readable-inputs/LICENSE-CPYTHON.txt @@ -0,0 +1,279 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see https://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see https://opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +Python software and documentation are licensed under the +Python Software Foundation License Version 2. + +Starting with Python 3.8.6, examples, recipes, and other code in +the documentation are dual licensed under the PSF License Version 2 +and the Zero-Clause BSD license. + +Some software incorporated into Python is under different licenses. +The licenses are listed with code falling under that license. + + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION +---------------------------------------------------------------------- + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/research/h25-full-caller-readable-inputs/NOTICE.md b/research/h25-full-caller-readable-inputs/NOTICE.md new file mode 100644 index 0000000000..2b2f477f93 --- /dev/null +++ b/research/h25-full-caller-readable-inputs/NOTICE.md @@ -0,0 +1,7 @@ +New packaging and analysis: Chris R / Clear1nsight, with substantial OpenAI Codex assistance, Apache-2.0. + +Preserved H25 source/review lineage includes PR6029 (e05aad954689d0ee21baff19b4674f1fcb2e838f), PR6321 (ca9d90e93dc495e1e5e5ef6d271ff1e4f089cd0c), separate PR6316/6317 contributions, unpaidmoon with substantial Cursor Grok assistance for PR6339 (608ad23adc6c01264c8195daf7f18e29c17464a7), PR6346 (abff67b31fa781e950c82d95eccb6f168950943c), PR6347 (59140439e7f791876159e2f3838f1dead2e54953), and PR6351 (1e9db2d08be4551ffe0bcfc573574851530eb4ca). Exact refreshed metadata is in UPSTREAM-AND-OVERLAP.json. + +Retain Douglas R. Colkitt and the original CrocSwap circuit/network/native/verification contributors, and every notice in the byte-exact source objects and inherited upstream license. Retain Sjoerd Mullender and Jeffrey Yasskin's attribution in the CPython Fraction reference. CPython material retains its PSF and predecessor license terms; LICENSE-CPYTHON.txt is the complete license at CPython v3.12.15. + +Substantial ChatGPT Pro consultation and OpenAI Codex/GPT-6.1-sol Max implementation and distinct-agent review assistance is disclosed. Agent agreement is independent AI source review, without independent human, proof-kernel, native or runtime acceptance. Predecessor performance results and archival merges are not transferred to this source-only result. diff --git a/research/h25-full-caller-readable-inputs/PROVENANCE.json b/research/h25-full-caller-readable-inputs/PROVENANCE.json new file mode 100644 index 0000000000..b8b38b5258 --- /dev/null +++ b/research/h25-full-caller-readable-inputs/PROVENANCE.json @@ -0,0 +1,202 @@ +{ + "credit": "Chris R/Clear1nsight and original H25/PR6029/PR6321/PR6715 source and review contributors; Douglas R. Colkitt; unpaidmoon/Cursor-Grok predecessor lineage; OpenAI Codex and ChatGPT Pro assistance. Preserve source notices/licenses.", + "external_dependencies": "Bodies contain immutable original absolute source locators. Dependencies, current runtime inputs and caller admission are not provided or repinned. Read source as text only; no executable portable replay is offered.", + "inherited_driver_is_not_selected_full_body": true, + "inspection_limit": "Public origin manifest mapping and exact retained originals are checked. This does not independently decode or verify the historical compressed archive at this publication boundary.", + "objects": [ + { + "archival_git_mode": "100644", + "bytes": 102614, + "content_changed": false, + "origin_mapping_rows": [ + { + "archive_member": "objects/9bbafe3f53febec7a984751b9e06741e06df34e2e6fa7c328c805b9eea700bd7.txt", + "archive_mode": 292, + "bytes": 102614, + "json_pointer": "/origins/1073", + "observed_original_mode": 292, + "opaque_historical_compressed_input": false, + "origin_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/s03-final-source-adoption-20261104T1137Z/implementation/selected-images/9bbafe3f53febec7a984751b9e06741e06df34e2e6fa7c328c805b9eea700bd7.py", + "package_file": null, + "sha256": "9bbafe3f53febec7a984751b9e06741e06df34e2e6fa7c328c805b9eea700bd7", + "workspace_relative_path": "outputs/s03-final-source-adoption-20261104T1137Z/implementation/selected-images/9bbafe3f53febec7a984751b9e06741e06df34e2e6fa7c328c805b9eea700bd7.py" + } + ], + "original_observed_mode": "0444", + "path": "full-baseline.py.txt", + "public_archive": "research/h25-s03-08-source-adoption/SOURCE-ARCHIVE.tar.xz", + "public_origin_PR": 6715, + "public_origin_head": "dc34598c22e2ef43ae7e11fc1d8c14de3915cf89", + "public_source_map_sha256": "220823fa96c3a1d088e2ab1e502a8d525429479afc8c74f13e5865fde0fdc272", + "public_source_map_url": "https://github.com/CrocSwap/integer-mult-bounds/blob/dc34598c22e2ef43ae7e11fc1d8c14de3915cf89/research/h25-s03-08-source-adoption/SOURCE-MAP.json", + "role": "selected full baseline scientific driver", + "sha256": "9bbafe3f53febec7a984751b9e06741e06df34e2e6fa7c328c805b9eea700bd7" + }, + { + "archival_git_mode": "100644", + "bytes": 104276, + "content_changed": false, + "origin_mapping_rows": [ + { + "archive_member": "objects/fa9f473320e9df3a2328bd8388f12eca4e7fc3eeed9289f7fdbf2eeb32a7452f.txt", + "archive_mode": 292, + "bytes": 104276, + "json_pointer": "/origins/1123", + "observed_original_mode": 292, + "opaque_historical_compressed_input": false, + "origin_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/s03-final-source-adoption-20261104T1137Z/implementation/selected-images/fa9f473320e9df3a2328bd8388f12eca4e7fc3eeed9289f7fdbf2eeb32a7452f.py", + "package_file": null, + "sha256": "fa9f473320e9df3a2328bd8388f12eca4e7fc3eeed9289f7fdbf2eeb32a7452f", + "workspace_relative_path": "outputs/s03-final-source-adoption-20261104T1137Z/implementation/selected-images/fa9f473320e9df3a2328bd8388f12eca4e7fc3eeed9289f7fdbf2eeb32a7452f.py" + } + ], + "original_observed_mode": "0444", + "path": "full-candidate.py.txt", + "public_archive": "research/h25-s03-08-source-adoption/SOURCE-ARCHIVE.tar.xz", + "public_origin_PR": 6715, + "public_origin_head": "dc34598c22e2ef43ae7e11fc1d8c14de3915cf89", + "public_source_map_sha256": "220823fa96c3a1d088e2ab1e502a8d525429479afc8c74f13e5865fde0fdc272", + "public_source_map_url": "https://github.com/CrocSwap/integer-mult-bounds/blob/dc34598c22e2ef43ae7e11fc1d8c14de3915cf89/research/h25-s03-08-source-adoption/SOURCE-MAP.json", + "role": "selected full candidate scientific driver", + "sha256": "fa9f473320e9df3a2328bd8388f12eca4e7fc3eeed9289f7fdbf2eeb32a7452f" + }, + { + "archival_git_mode": "100644", + "bytes": 89606, + "content_changed": false, + "origin_mapping_rows": [ + { + "archive_member": "objects/1e8202b7a4c17fc8dfb0a001085c26bf2ec26a69eb6c8501763773324c2bd9a1.txt", + "archive_mode": 292, + "bytes": 89606, + "json_pointer": "/origins/83", + "observed_original_mode": 292, + "opaque_historical_compressed_input": false, + "origin_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/areas/cache-epoch-products-v5/epoch_scientific_driver_v1.py", + "package_file": null, + "sha256": "1e8202b7a4c17fc8dfb0a001085c26bf2ec26a69eb6c8501763773324c2bd9a1", + "workspace_relative_path": "outputs/h25-data-handling-20261028/areas/cache-epoch-products-v5/epoch_scientific_driver_v1.py" + } + ], + "original_observed_mode": "0444", + "path": "inherited-epoch-driver.py.txt", + "public_archive": "research/h25-s03-08-source-adoption/SOURCE-ARCHIVE.tar.xz", + "public_origin_PR": 6715, + "public_origin_head": "dc34598c22e2ef43ae7e11fc1d8c14de3915cf89", + "public_source_map_sha256": "220823fa96c3a1d088e2ab1e502a8d525429479afc8c74f13e5865fde0fdc272", + "public_source_map_url": "https://github.com/CrocSwap/integer-mult-bounds/blob/dc34598c22e2ef43ae7e11fc1d8c14de3915cf89/research/h25-s03-08-source-adoption/SOURCE-MAP.json", + "role": "inherited epoch scientific driver; ancestry input, distinct from adopted full baseline/candidate selections", + "sha256": "1e8202b7a4c17fc8dfb0a001085c26bf2ec26a69eb6c8501763773324c2bd9a1" + }, + { + "archival_git_mode": "100644", + "bytes": 6105, + "content_changed": false, + "origin_mapping_rows": [ + { + "archive_member": "objects/0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b.txt", + "archive_mode": 292, + "bytes": 6105, + "json_pointer": "/origins/593", + "observed_original_mode": 292, + "opaque_historical_compressed_input": false, + "origin_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/stages/combined-finite-v8/baseline/engine/source/complex_network.py", + "package_file": null, + "sha256": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b", + "workspace_relative_path": "outputs/h25-data-handling-20261028/stages/combined-finite-v8/baseline/engine/source/complex_network.py" + }, + { + "archive_member": "objects/0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b.txt", + "archive_mode": 292, + "bytes": 6105, + "json_pointer": "/origins/665", + "observed_original_mode": 292, + "opaque_historical_compressed_input": false, + "origin_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/stages/combined-finite-v8/baseline/frozen/scripts/complex_network.py", + "package_file": null, + "sha256": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b", + "workspace_relative_path": "outputs/h25-data-handling-20261028/stages/combined-finite-v8/baseline/frozen/scripts/complex_network.py" + } + ], + "original_observed_mode": "0444", + "path": "complete-original-cli.py.txt", + "public_archive": "research/h25-s03-08-source-adoption/SOURCE-ARCHIVE.tar.xz", + "public_origin_PR": 6715, + "public_origin_head": "dc34598c22e2ef43ae7e11fc1d8c14de3915cf89", + "public_source_map_sha256": "220823fa96c3a1d088e2ab1e502a8d525429479afc8c74f13e5865fde0fdc272", + "public_source_map_url": "https://github.com/CrocSwap/integer-mult-bounds/blob/dc34598c22e2ef43ae7e11fc1d8c14de3915cf89/research/h25-s03-08-source-adoption/SOURCE-MAP.json", + "role": "original actual complete_original_cli body", + "sha256": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + { + "archival_git_mode": "100644", + "bytes": 84536, + "content_changed": false, + "origin_mapping_rows": [ + { + "archive_member": "objects/8dd481a5a83ad6b74b70328a93633c590a10727058dcc806d70e5c34da896b9e.txt", + "archive_mode": 292, + "bytes": 84536, + "json_pointer": "/origins/464", + "observed_original_mode": 292, + "opaque_historical_compressed_input": false, + "origin_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/control/hourly-progress/ACTIVITY-BREAKDOWN-v16.json", + "package_file": null, + "sha256": "8dd481a5a83ad6b74b70328a93633c590a10727058dcc806d70e5c34da896b9e", + "workspace_relative_path": "outputs/h25-data-handling-20261028/control/hourly-progress/ACTIVITY-BREAKDOWN-v16.json" + } + ], + "original_observed_mode": "0444", + "path": "ACTIVITY-BREAKDOWN-v16.json", + "public_archive": "research/h25-s03-08-source-adoption/SOURCE-ARCHIVE.tar.xz", + "public_origin_PR": 6715, + "public_origin_head": "dc34598c22e2ef43ae7e11fc1d8c14de3915cf89", + "public_source_map_sha256": "220823fa96c3a1d088e2ab1e502a8d525429479afc8c74f13e5865fde0fdc272", + "public_source_map_url": "https://github.com/CrocSwap/integer-mult-bounds/blob/dc34598c22e2ef43ae7e11fc1d8c14de3915cf89/research/h25-s03-08-source-adoption/SOURCE-MAP.json", + "role": "already-public archive original activity criteria source", + "sha256": "8dd481a5a83ad6b74b70328a93633c590a10727058dcc806d70e5c34da896b9e" + }, + { + "bytes": 11357, + "content_changed": false, + "path": "LICENSE-APACHE-2.0.txt", + "public_origin_head": "dc34598c22e2ef43ae7e11fc1d8c14de3915cf89", + "public_origin_path": "research/h25-s03-08-source-adoption/LICENSE-APACHE-2.0.txt", + "role": "Exact predecessor notice/license", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "bytes": 13936, + "content_changed": false, + "path": "LICENSE-CPYTHON.txt", + "public_origin_head": "dc34598c22e2ef43ae7e11fc1d8c14de3915cf89", + "public_origin_path": "research/h25-s03-08-source-adoption/LICENSE-CPYTHON.txt", + "role": "Exact predecessor notice/license", + "sha256": "3b2f81fe21d181c499c59a256c8e1968455d6689d269aa85373bfb6af41da3bf" + }, + { + "bytes": 1375, + "content_changed": false, + "path": "NOTICE.md", + "public_origin_head": "dc34598c22e2ef43ae7e11fc1d8c14de3915cf89", + "public_origin_path": "research/h25-s03-08-source-adoption/NOTICE.md", + "role": "Exact predecessor notice/license", + "sha256": "327fcdce33b509f5773c77f1a8d54ea8c650e9f42cb780810d0608fe5e715c1b" + } + ], + "origin_selection": "Local retained original bytes, authenticated against the public frozen SOURCE-MAP exact SHA256/size/member mapping. No compressed archive was opened.", + "original_activity_completion_tests": { + "S04.02": "Assemble the complete required payload without replacing it with the finite prefix.", + "S05.04": "Reconcile every original/new control identity and its concrete execution mapping.", + "status_fields_in_v16": "Historical; no present completion/status claim", + "total": 49, + "v16_and_v19_all_completion_tests_equal": true + }, + "schema": "h25-full-caller-readable-input-provenance-v1", + "scope": "Byte-exact plaintext access to five already-published PR6715 archive subjects, with unchanged original licenses. No caller modification, source acceptance, runtime or original activity credit.", + "selected_full_roles": { + "full:baseline": "full-baseline.py.txt", + "full:candidate": "full-candidate.py.txt" + }, + "source_archive_opened_or_decoded": false +} diff --git a/research/h25-full-caller-readable-inputs/README.md b/research/h25-full-caller-readable-inputs/README.md new file mode 100644 index 0000000000..02ce01111c --- /dev/null +++ b/research/h25-full-caller-readable-inputs/README.md @@ -0,0 +1,31 @@ +# Readable adopted H25 full-caller inputs + +This contribution exposes exact text copies of five bodies/documents already published as objects inside [PR6715](https://github.com/CrocSwap/integer-mult-bounds/pull/6715), head `dc34598c22e2ef43ae7e11fc1d8c14de3915cf89`. A public source review could read the archive map but its UTF-8 GitHub interface could not retrieve compressed member bytes. These ordinary files close that finite transport gap. They do not implement or qualify the full workload. + +## Exact selections + +- `full-baseline.py.txt`: selected full baseline, 102614 bytes, SHA256 `9bbafe3f53febec7a984751b9e06741e06df34e2e6fa7c328c805b9eea700bd7`. +- `full-candidate.py.txt`: selected full candidate, 104276 bytes, SHA256 `fa9f473320e9df3a2328bd8388f12eca4e7fc3eeed9289f7fdbf2eeb32a7452f`. +- `inherited-epoch-driver.py.txt`: inherited 89606-byte driver `1e8202b7a4c17fc8dfb0a001085c26bf2ec26a69eb6c8501763773324c2bd9a1`. It is a distinct ancestry input and must not replace either selected full image. +- `complete-original-cli.py.txt`: original 6105-byte complete CLI, SHA256 `0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b`. +- `ACTIVITY-BREAKDOWN-v16.json`: exact already-public historical activity document, 84536 bytes, SHA256 `8dd481a5a83ad6b74b70328a93633c590a10727058dcc806d70e5c34da896b9e`. Its progress/status notes are historical. All49 completion-test strings match the later v19 definitions; current credit is not derived from the older status bits. + +`PROVENANCE.json` records each original public SOURCE-MAP JSON pointer, archive member, byte count and hash. These are existing retained source bytes, not reconstructed outputs. The archive was not opened, decoded or decompressed. No source import, compiler/native/scientific execution, target inspection or previous control rerun was performed. + +## Relation to the current work + +[PR6736](https://github.com/CrocSwap/integer-mult-bounds/pull/6736) completes S03.07 implemented SOURCE scope. Its selected `full_driver.py` is a finite DATA adapter; the external adopted full scientific selections supplied here must be kept distinct. [PR6588](https://github.com/CrocSwap/integer-mult-bounds/pull/6588) contains earlier caller/preparation machinery. This export makes the adopted successor inspectable before modifications or integration. It changes no earlier source or proof and supplies no original activity, stage-gate, overall, performance or kappa credit. + +Code has an inert `.txt` suffix. Original source mode0444 is recorded separately from Git100644. Absolute source locators remain original DATA; this export does not create portable runtime authority or satisfy external dependencies. There is no VERIFY hook or candidate replay command. + +## Integrity + +From this directory, `sha256sum -c SHA256SUMS` verifies ordinary file bytes only. The checksum file excludes itself and is externally bound by the exact publication Git tree/allowlist. It does not verify program semantics, original control completeness or the compressed predecessor container. No historical compressed file is copied or decoded. + +## Open next questions + +Read the selected baseline/candidate and original activity criteria, reconcile complete family execution and independent family reception with the actual parent, and freeze one complete workload tuple before actual qualification. Preserve the original unit-only and prefix-only refusals; changing a completion flag supplies no missing execution. Current owner/native/profile/resource/funding inputs, complete normal/O controls, assertion-on full comparison and complete costs remain separate open gates. Do not reopen accepted S03 source work or inherit a historical speed factor. + +## Credit and licence + +All source and predecessor notices remain unchanged. Exact PR6715 NOTICE, Apache2 and CPython licence files are retained. New wrapper metadata/documentation is Apache2; source-specific rights remain in force. Credit Chris R/Clear1nsight, Douglas R. Colkitt and original H25/source/review contributors, unpaidmoon/Cursor-Grok predecessor work, and substantial OpenAI Codex and ChatGPT Pro assistance. This is an AI-assisted source-transport contribution, not human or proof-kernel acceptance. diff --git a/research/h25-full-caller-readable-inputs/SHA256SUMS b/research/h25-full-caller-readable-inputs/SHA256SUMS new file mode 100644 index 0000000000..1dfc739610 --- /dev/null +++ b/research/h25-full-caller-readable-inputs/SHA256SUMS @@ -0,0 +1,11 @@ +705fd4d6451a31d36b3df7de96f83f30ac976c9b4a6d1e51671d8e2f33e2d0da .gitattributes +8dd481a5a83ad6b74b70328a93633c590a10727058dcc806d70e5c34da896b9e ACTIVITY-BREAKDOWN-v16.json +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE-APACHE-2.0.txt +3b2f81fe21d181c499c59a256c8e1968455d6689d269aa85373bfb6af41da3bf LICENSE-CPYTHON.txt +327fcdce33b509f5773c77f1a8d54ea8c650e9f42cb780810d0608fe5e715c1b NOTICE.md +c870392a531f8105602ca99844e213d3283e9a2829f8eafaffc7191f1eefa7c6 PROVENANCE.json +98ce85a7758b97a7fa41cd7144571ed8d99ae85bd7135de8d042d5bee9f29dc6 README.md +0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b complete-original-cli.py.txt +9bbafe3f53febec7a984751b9e06741e06df34e2e6fa7c328c805b9eea700bd7 full-baseline.py.txt +fa9f473320e9df3a2328bd8388f12eca4e7fc3eeed9289f7fdbf2eeb32a7452f full-candidate.py.txt +1e8202b7a4c17fc8dfb0a001085c26bf2ec26a69eb6c8501763773324c2bd9a1 inherited-epoch-driver.py.txt diff --git a/research/h25-full-caller-readable-inputs/complete-original-cli.py.txt b/research/h25-full-caller-readable-inputs/complete-original-cli.py.txt new file mode 100644 index 0000000000..af9bb6d7b3 --- /dev/null +++ b/research/h25-full-caller-readable-inputs/complete-original-cli.py.txt @@ -0,0 +1,120 @@ +#!/usr/bin/env python3 +"""Conditional 59/10^11 witness: a compressed complex side circuit. + +The compact-control witness was limited by the original complex motif, whose +v*z_c side wires per invocation dilute its rank deficit. The new side circuit +computes the same correction with shared sums, binary coordinate and pair-star +labels, and the bit network's transparent twelve-operation schedule. The bit +network, compact-control movement and assembly recipe are unchanged. +""" +from fractions import Fraction as Q +from math import comb +from pathlib import Path +import json + +from certify import Parameters, constraints, margins, require, verify_sources +from compact_control_layer import layer_exponents +from complex_circuit import ComplexSideCircuit, Checks, compile_roles, verify_role_frames +from paired_network import BIT_SAVING +from prepare_layers import serializable +from search_network import log_integer_bounds + +ROOT = Path(__file__).resolve().parents[1] +H = 25 +COMPLEX_SAVING = Q(14, 10**9) +LOG_BOUND = Q(966, 100) +KAPPA = Q(59, 10**11) + + +def counts(c): + h = c.h; v = comb(h, 3); m = h**3; N = v**3; I = 3*v*v + R = c.roles; W = 2*N+I*(R+h+1); L = I*(h+1)*h + s = W*m-2*N+2*L + require(L < N, 'Complex deficit is not positive') + return dict(h=h, v=v, m=m, N=N, I=I, side_roles_per_invocation=R, + central_roles=h+1, W=W, L=L, s=s, deficit=W*m-s, eta=Q(W*m-s, W*m), + original_side_wires_per_invocation=v*(comb(h-3, 3)+3*(h-3))) + + +def gate_count(c, n): + """Per invocation: four mixer passes, two copies, two injections, four central gates.""" + per = 4*len(c.active)+4*n['v']+4 + require(n['I']*per <= 12*n['W'], 'The 12W gate bound behind E=64(W+m+1)^3 failed') + return dict(gates_per_invocation=per, total_gates=n['I']*per, twelve_W=12*n['W']) + + +def guard(n, beta, zeta): + """Generalized stopped-depth guard with the new complex constants.""" + m, s, W = n['m'], n['s'], n['W'] + E = 64*(W+m+1)**3; B = s+E + require(m >= 3 and 2 <= s < m**5, 'Unverified coefficient-depth hypothesis') + require(s*(8+E) <= 9*B*B, 'One-piece constant failed') + C1 = 5-4*beta+zeta + raw = max(Q(128*m*B*B), 18*m*B*B*(1+1/zeta)) + C0 = -(-raw.numerator//raw.denominator) + require(9*m*B*B*(1+1/zeta)+18 <= C0, 'Whole-layer constant failed') + return dict(m=m, s=s, E=E, B=B, beta=beta, zeta=zeta, C0=C0, C1=C1) + + +def parameters(): + return Parameters(tau=1-BIT_SAVING, sigma=1-COMPLEX_SAVING, + epsilon=Q(19999, 100000), c=Q(999, 1000), + lam=1-Q(2958, 10**12), lamp=1-Q(2956, 10**12), + kappa=KAPPA, beta=Q(1, 1000), delta=Q(1, 10**6), + C1=Q(49961, 10000)) + + +def witness(p, n): + g = guard(n, p.beta, Q(1, 10000)) + require(p.C1 == g['C1'], 'Guard mismatch') + e = layer_exponents(p.tau, p.sigma, p.beta, p.c) + slacks = constraints(p, layout_model='nonadjacent', assembly_model='tight-gaussian') + slacks['packed_overhead'] = p.lam-e['internal'] # compact control: internal = max exponent + slacks['reserved_axes'] = p.lamp-e['preprocessing'] + for name, slack in slacks.items(): require(slack > 0, 'Constraint failed: '+name) + gs = margins(p, layout_model='nonadjacent', assembly_model='tight-gaussian') + require(min(gs.values()) > p.kappa, 'No final absorption gap') + return dict(parameters=vars(p), guard=g, recurrence=e, constraint_slacks=slacks, + margins=gs, minimum_margin=min(gs.values()), + limiting_margins=[k for k, v in gs.items() if v == min(gs.values())], + absorption_gap=min(gs.values())-p.kappa) + + +def witness_only(): + """Counts and parameter witness without the full finite checks (for the patch).""" + n = counts(ComplexSideCircuit(H)) + require(n['eta'] > COMPLEX_SAVING*LOG_BOUND, 'Complex saving failed') + return witness(parameters(), n) + + +def certificate(): + c = ComplexSideCircuit(H); checks = Checks(c); code = compile_roles(c) + side = checks.verify_map(); labels = checks.verify_labels() + roles = verify_role_frames(c, checks, code) + n = counts(c) + lo, hi = log_integer_bounds(n['m']) + require(hi < LOG_BOUND, 'Logarithm enclosure failed') + require(n['eta'] > COMPLEX_SAVING*LOG_BOUND, 'Complex saving failed') + p = parameters(); w = witness(p, n) + require(Q(1, 2**31) < KAPPA < Q(1, 2**30), 'Unexpected dyadic scale') + # With the bit exponent fixed, g3 <= epsilon*(1-lambda) < epsilon*a_b < a_b/5. + ceiling = BIT_SAVING/5 + require(ceiling < Q(1, 2**30), 'This bit network could cross 2^-30') + return dict(status='CONDITIONAL 59/10^11 WITNESS; COMPRESSED COMPLEX SIDE CIRCUIT; NOT FORMAL VERIFICATION', + upstream_commit=verify_sources(), circuit=c.stats(), side_map=side, + labels=labels, role_frames=roles, gates=gate_count(c, n), + complex_counts=n, complex_saving=COMPLEX_SAVING, log_m_upper=LOG_BOUND, + log_enclosure=(lo, hi), complex_deficit_slack=n['eta']-COMPLEX_SAVING*LOG_BOUND, + bit_saving=BIT_SAVING, witness=w, + improvement_over_compact_control=KAPPA/Q(83, 10**12), + scoped_ceiling=dict(upper=ceiling, below_2_to_minus_30=True, + scope='Published h=50 paired bit network and retained Gaussian margin; not a bound on other networks or algorithms.'), + scope='Conditional on the pinned upstream interfaces, the compact-control movement and guard proofs, the paired bit network, and the written binary-frame transfer for this complex side circuit. Exact arithmetic and finite checks are not formal verification.') + + +if __name__ == '__main__': + result = serializable(certificate()) + (ROOT/'certificates/complex-network.json').write_text(json.dumps(result, indent=2, sort_keys=True)+'\n') + print('PASS conditional', KAPPA, '> 2^-31; minimum margin', result['witness']['minimum_margin']) + print('Side roles per invocation', result['complex_counts']['side_roles_per_invocation'], + 'vs original', result['complex_counts']['original_side_wires_per_invocation']) diff --git a/research/h25-full-caller-readable-inputs/full-baseline.py.txt b/research/h25-full-caller-readable-inputs/full-baseline.py.txt new file mode 100644 index 0000000000..cb808ed14e --- /dev/null +++ b/research/h25-full-caller-readable-inputs/full-baseline.py.txt @@ -0,0 +1,1464 @@ +#!/usr/bin/env python3 +"""One complete frozen complex-network CLI with retained exact observations. + +Parent-owned serial wall/RSS/aggregate guard is mandatory. Profile mode is one +literal baseline diagnostic/anchor, not a performance sample. Both benchmark +modes require its immutable anchor. No search, retry, orchestration or network. +""" +from __future__ import annotations + +# Actual source-authenticated root injects these three values before driver exec. +# Capture them before importing any candidate, scientific, or orchestration code. +_CAPTURED_BOOTSTRAP_ROOT = bootstrap_root +_CAPTURED_BOOTSTRAP_CAPABILITY = bootstrap_capability +_CAPTURED_BOOTSTRAP_API = bootstrap_api +if type(_CAPTURED_BOOTSTRAP_API) is not tuple or len(_CAPTURED_BOOTSTRAP_API) != 4: + raise RuntimeError('Driver requires the parent-sealed exact four-entry bootstrap API') +_INITIAL_ROOT_IDENTITY = _CAPTURED_BOOTSTRAP_API[0]() +if (type(_CAPTURED_BOOTSTRAP_ROOT) is not _CAPTURED_BOOTSTRAP_ROOT.ModuleType or + any(type(entry) is not _CAPTURED_BOOTSTRAP_ROOT.FunctionType or + entry.__globals__ is not _CAPTURED_BOOTSTRAP_ROOT.__dict__ + for entry in _CAPTURED_BOOTSTRAP_API)): + raise RuntimeError('Driver bootstrap API is not bound to the actual root namespace') + +# Accepted helper/control sources and parent-inspected native dependency tuple. +# These are static expected pins; finite and full execution gates remain closed. +EXPECTED_BOOTSTRAP_ROOT_SHA256 = 'f5a2d33f2b4d3651f214156a0e7094c2bb516ce2d5ab7698d18c11f98f35dee0' +NATIVE_TCB_HELPER_SHA256 = '865943df5cfdbf9383362d7fb2b76c6d0fd895cf0a0e20d550a26b579606b5d7' +NATIVE_TCB_CONTROLS_SHA256 = '63b1804caa7f89915662a1424f788c3becad13520e1f63212a338fb45aaa2c5a' +NATIVE_TCB_EXPECTED_FILES = (('/usr/bin/python3.12', 'e50d468e8b0adfb05733f5b87b3cff34829c4a8c1aea50c865aa8bdfe4bb150f', 8020928), + ('/usr/lib/python3.12/lib-dynload/_hashlib.cpython-312-x86_64-linux-gnu.so', + '8dc6cda6dd9495b95a2bfb5b26e8cf06b72f36dc0213d958b9277a958287f0fe', + 64368), + ('/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2', + 'c20a2dc8917c755f02b94049356320fe1f62ac7d9f8994731f807d9df39302da', + 236616), + ('/usr/lib/x86_64-linux-gnu/libc.so.6', + '3a15d66867d83762c7f2f1e37359cb8f6c5743edb369c65285cb0b1c4f7498bf', + 2129424), + ('/usr/lib/x86_64-linux-gnu/libcrypto.so.3', + '6866ed711dab8927e1bf82bf1cd30e828bdfc34f3cc1e83b1c9eb01ce6c37d9a', + 5309400), + ('/usr/lib/x86_64-linux-gnu/libexpat.so.1.9.1', + '286682ecbc5e59a638963b1a4e6351e65eb32fcf4bdcb9cb7569b6a61fe06a8d', + 186624), + ('/usr/lib/x86_64-linux-gnu/libm.so.6', + 'fce00b6f25f459cf4ae0b7fae4257909a1a8a86f9149e7c029a5d617baf1ccd0', + 952616), + ('/usr/lib/x86_64-linux-gnu/libz.so.1.3', + 'f61677c7bdb7c2aa2a243ea781bfd16afcb361cede7b4ef76127a9d8eb9a5242', + 113000)) +NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN = '/usr/lib/python3.12/lib-dynload/_hashlib.cpython-312-x86_64-linux-gnu.so' + + +def _initial_native_tcb(): + root, api = _CAPTURED_BOOTSTRAP_ROOT, _CAPTURED_BOOTSTRAP_API + if (type(EXPECTED_BOOTSTRAP_ROOT_SHA256) is not str or + _INITIAL_ROOT_IDENTITY != EXPECTED_BOOTSTRAP_ROOT_SHA256 or + type(NATIVE_TCB_HELPER_SHA256) is not str or len(NATIVE_TCB_HELPER_SHA256) != 64 or + type(NATIVE_TCB_EXPECTED_FILES) is not tuple or + type(NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN) is not str): + raise RuntimeError('Initial native TCB source and expected dependency tuple are not configured') + helper_path = __file__.rsplit('/', 2)[0] + '/areas/cache-validity/probe-native/native_tcb_v1.py' + api[0]() + digest, _, source = root._hash_regular(helper_path, 262144, True) + if digest != NATIVE_TCB_HELPER_SHA256: + raise RuntimeError('Initial native TCB helper source differs') + helper = root.ModuleType('_h25_initial_native_tcb') + namespace = helper.__dict__ + namespace.update({'__file__': helper_path, '__builtins__': root.builtins.__dict__}) + api[0]() + code = root._COMPILE(source, helper_path, 'exec', dont_inherit=True, optimize=root._OPTIMIZE) + api[0]() + root._EXEC(code, namespace) + api[0]() + receipt = namespace['verify_native_tcb'](root, api, NATIVE_TCB_EXPECTED_FILES, + NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN) + if type(NATIVE_TCB_CONTROLS_SHA256) is not str or len(NATIVE_TCB_CONTROLS_SHA256) != 64: + raise RuntimeError('Initial native TCB control source pin is not configured') + control_path = __file__.rsplit('/', 2)[0] + '/areas/cache-validity/probe-native/native_tcb_controls_v1.py' + api[0]() + digest, _, control_source = root._hash_regular(control_path, 262144, True) + if digest != NATIVE_TCB_CONTROLS_SHA256: + raise RuntimeError('Initial native TCB controls source differs') + control_namespace = {'__name__': '_h25_initial_native_tcb_controls', '__file__': control_path, + '__builtins__': root.builtins.__dict__} + api[0]() + control_code = root._COMPILE(control_source, control_path, 'exec', dont_inherit=True, optimize=root._OPTIMIZE) + api[0]() + root._EXEC(control_code, control_namespace) + argv = root.sys.argv + if (type(argv) is not list or any(type(arg) is not str for arg in argv) or + argv.count('--output') != 1 or argv.index('--output') + 1 >= len(argv)): + raise RuntimeError('Early TCB controls require the unique parent --output argument') + output = argv[argv.index('--output') + 1] + stage_root = __file__.rsplit('/', 2)[0] + if (not output.startswith('/') or output.endswith('/') or + any(part in ('', '.', '..') for part in output.split('/')[1:]) or + output == stage_root or output.startswith(stage_root + '/')): + raise RuntimeError('Early TCB controls require a canonical absolute output outside the stage') + # Parent owns an existing nonsymlink output parent. mkdir is exclusive: + # a preexisting output, file, or symlink is rejected before any fixture write. + api[0]() + root.posix.mkdir(output, 0o700) + control_directory = output + '/initial-tcb-controls' + root.posix.mkdir(control_directory, 0o700) + api[0]() + controls = control_namespace['run_controls']( + helper, root, api, NATIVE_TCB_EXPECTED_FILES, NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN, control_directory) + if (controls.get('schema') != 'h25-native-tcb-controls-v1' or + controls.get('expected_records') != 5 or len(controls.get('records', [])) != 5 or + controls.get('scientific_calls') != 0 or controls.get('probe_native_imports') != 0): + raise RuntimeError('Initial native TCB control census differs') + controls['status'] = 'NATIVE_INITIAL_TCB_CONTROLS_PASS' + return receipt, controls, output + + +# Child outer wall/CPU/RSS includes this entire initial trust check. +# It assumes the declared trusted OS/native startup; it does not prove itself. +INITIAL_NATIVE_TCB_RECEIPT, INITIAL_NATIVE_TCB_CONTROLS, _INITIAL_OUTPUT = _initial_native_tcb() + +# This independent bootstrap support captures the initial system-stdlib +# continuity boundary before any adapter or scientific module is exposed. +# No late candidate-created snapshot is accepted as initial authentication. +COLD_AUTHORITY_SHA256 = 'f279ab86fc17c6a517b035f19d56863919cbd8304de4e7d5332457c6159aec10' + + +def _initial_cold_authority(): + root, cap, api = (_CAPTURED_BOOTSTRAP_ROOT, _CAPTURED_BOOTSTRAP_CAPABILITY, + _CAPTURED_BOOTSTRAP_API) + if type(COLD_AUTHORITY_SHA256) is not str or len(COLD_AUTHORITY_SHA256) != 64: + raise RuntimeError('Initial cold authority source pin is not configured') + source_path = __file__.rsplit('/', 2)[0] + '/areas/cache-validity/cold_authority_v7.py' + api[0]() + digest, _, source = root._hash_regular(source_path, 1048576, True) + if digest != COLD_AUTHORITY_SHA256: + raise RuntimeError('Initial cold authority source differs') + module = root.ModuleType('_h25_initial_cold_authority') + namespace = module.__dict__ + namespace.update({'__file__': source_path, '__builtins__': root.builtins.__dict__}) + api[0]() + code = root._COMPILE(source, source_path, 'exec', dont_inherit=True, optimize=root._OPTIMIZE) + api[0]() + root._EXEC(code, namespace) + # The actual source bytes have just executed under the admitted initial + # interpreter/system-stdlib premise. Capture precedes every candidate import. + api[0]() + bundle = namespace['capture_epoch_authority'](root, cap, api); authority = bundle[1] + if (type(authority) is not tuple or len(authority) != 7 or + any(type(entry) is not root.FunctionType for entry in authority)): + raise RuntimeError('Initial cold authority must expose the sealed seven-entry tuple') + # Read fresh transport exactly once, before any candidate exposure. + transport = root.FunctionType.__dict__['__dict__'].__get__(authority[0], root.FunctionType) + descriptor = transport['_h25_caller_descriptor'] + if type(descriptor) is not tuple or len(descriptor) != 6 or descriptor[1] is not authority: + raise RuntimeError('Initial cold authority caller descriptor differs') + return authority, descriptor, bundle + + +import importlib +import typing +_INITIAL_COLD_AUTHORITY, _INITIAL_COLD_CALLER_DESCRIPTOR, _INITIAL_EPOCH_BUNDLE = _initial_cold_authority() + +import time +START_WALL = time.perf_counter() +import argparse +from contextlib import redirect_stdout +from fractions import Fraction +import hashlib +import io +import json +import os +from pathlib import Path +import resource +import runpy +import shutil +import stat +import sys + +sys.dont_write_bytecode = True +# Independent source pins are literal final-stage configuration. These modules +# are admitted by the pre-exposure authority, including their live helper code. +# Driver/source identity does not depend on a hash of itself. +EARLY_INTEGRATION_SOURCE_PINS = ({'adapters': ('integration/adapters.py', 'f7ca7f4f03ac63c1a95ba42f06149543211566de5e29f487a3dc4d08c5ee9b94'), 'cold_build_evidence': ('integration/cold_build_evidence.py', 'aa0a315110e031e19291970c9611fe5e0f91465fa20eaec51e81186099563f78'), 'native_packet': ('integration/native_packet.py', '8e9298cfbf44cedd07868dc1624631d7ce73d78c48c4eec1fca15d3640076dab'), 'data_adapters': ('integration/data_adapters.py', '18679fd1eb6ae99c4b375756511427c26718f77674c2d8fcc490e25ceb47cba5'), 'guarded_adapters_v4': ('integration/guarded_adapters_v4.py', '5579fe0838d8c6acf63834990269479c6c32024a1662846ed0a075c25d13954c'), '_h25_data_cache': ('areas/cache-validity/cache_contract_v8.py', 'd317c9866566cd6147c96566879f26f364e7e6801ac3eed0800b6ed8eedd01a2')} + + + + + + +) +_INITIAL_INTEGRATION_MODULES = {} +_INITIAL_INTEGRATION_HANDLES = {} +for _entry_name, (_entry_relative, _entry_digest) in EARLY_INTEGRATION_SOURCE_PINS.items(): + if type(_entry_digest) is not str or len(_entry_digest) != 64: + raise RuntimeError('Early integration source pin is not configured: ' + _entry_name) + # BEGIN evaluated dispatch arguments scientific_driver:195 + _ca_args = (__file__.rsplit('/', 2)[0] + '/' + _entry_relative, _entry_digest, _entry_name) + _ca_kwargs = {} + # END evaluated dispatch arguments scientific_driver:195 + # BEGIN caller admission scientific_driver:195 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:195 + _entry_module, _entry_handle = _ca_dispatch(0, *_ca_args, **_ca_kwargs) + if type(_entry_module) is not _CAPTURED_BOOTSTRAP_ROOT.ModuleType or sys.modules.get(_entry_name) is not _entry_module: + raise RuntimeError('Early integration module registry identity differs: ' + _entry_name) + _INITIAL_INTEGRATION_MODULES[_entry_name] = _entry_module + _INITIAL_INTEGRATION_HANDLES[_entry_name] = _entry_handle +adapters = _INITIAL_INTEGRATION_MODULES['adapters'] +native_packet = _INITIAL_INTEGRATION_MODULES['native_packet'] +data_adapters = _INITIAL_INTEGRATION_MODULES['data_adapters'] +guarded_adapters_v4 = _INITIAL_INTEGRATION_MODULES['guarded_adapters_v4'] +_EXECUTION = {'output': Path(_INITIAL_OUTPUT), 'state': None, 'packet': None} +ROUND = Path(__file__).resolve().parent.parent +HERE = ROUND / "baseline" +REFERENCE_DRIVER_SHA = "0d976d2eb6b845f20d4a3396591a806f966688b88693cd6a5f8a0c9e48925e36" +BASE = "19fdb086ea96af9a9f87936a2b888e10af4ed810" +UPSTREAM = "adc7f1241b42e322a6451854ab7e4b4c146bf78a" +PIN_SHA = "88bba3caf5975f30fa7abceaea9454110cf3b069233e8241a2ca13d1dff171a7" +REFERENCE_SHA = "1f763d95c7ff163aa71d13cd82784f16665be8afb21f75e76941e2119562098f" +ENGINE_PINS = { + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a", + "source/complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "source/complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b", +} +COMPLEMENT_EXPECTED = { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838", + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", +} +EXPECTED_STDOUT = ( + "PASS conditional 59/100000000000 > 2^-31; minimum margin 14779261/25000000000000000\n" + "Side roles per invocation 108195 vs original 3693800\n" +) + + +def need(condition, message): + if not condition: + raise RuntimeError(message) + + +def sha(data): + return hashlib.sha256(data).hexdigest() + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode("ascii") + + +def cpu(): + own = resource.getrusage(resource.RUSAGE_SELF) + children = resource.getrusage(resource.RUSAGE_CHILDREN) + return own.ru_utime + own.ru_stime + children.ru_utime + children.ru_stime + + +def inventory(root, pins, *, exact=True): + need(root.is_dir() and not root.is_symlink(), "Missing or symlinked input root") + files = {} + for path in sorted(root.rglob("*")): + need(not path.is_symlink(), "Symlink in frozen inputs: " + str(path)) + if path.is_file(): + relative = str(path.relative_to(root)) + if relative not in pins: + need(not exact, "Undeclared frozen input: " + relative) + continue + raw = path.read_bytes() + expected = pins[relative][0] if type(pins[relative]) is list else pins[relative] + need(sha(raw) == expected, "Frozen input digest changed: " + relative) + files[relative] = {"sha256": sha(raw), "mode": stat.S_IMODE(path.stat().st_mode), "bytes": len(raw)} + need(set(files) == set(pins), "Frozen input inventory incomplete") + return files + +# Preserve the literal baseline function; main selects a local arm function. +original_inventory = inventory + +def candidate_inventory(root, pins, *, exact=True): + need(root.is_dir() and not root.is_symlink(), "Missing or symlinked input root") + files = {} + for path in sorted(root.rglob("*")): + need(not path.is_symlink(), "Symlink in frozen inputs: " + str(path)) + if path.is_file(): + relative = str(path.relative_to(root)) + if relative not in pins: + need(not exact, "Undeclared frozen input: " + relative) + continue + raw = path.read_bytes() + expected = pins[relative][0] if type(pins[relative]) is list else pins[relative] + raw_digest = sha(raw) + need(raw_digest == expected, "Frozen input digest changed: " + relative) + files[relative] = {"sha256": raw_digest, "mode": stat.S_IMODE(path.stat().st_mode), "bytes": len(raw)} + need(set(files) == set(pins), "Frozen input inventory incomplete") + return files + + +def typed(value): + """Lossless full return representation, including order and exact types.""" + kind = type(value) + if kind is Fraction: + return ["Fraction", value.numerator, value.denominator] + if value is None: + return ["None"] + if kind is bool: + return ["bool", value] + if kind is int: + return ["int", str(value)] + if kind is float: + return ["float", value.hex()] + if kind is str: + return ["str", value] + if kind is list or kind is tuple: + return [kind.__name__, [typed(item) for item in value]] + if kind is dict: + return ["dict", [[typed(key), typed(item)] for key, item in value.items()]] + raise TypeError("Unsupported exact full-certificate return type: " + kind.__name__) + + +class Phases: + """Broad phase observations; no per-arithmetic resource sampling. + + Every call retains the old timing fields. Memory samples are paid by both + arms, including nested side_construction so snapshots/retirement are visible. + """ + def __init__(self): + self.rows = {} + + @staticmethod + def memory(): + with open("/proc/self/status", "rb") as stream: + raw = stream.read(65537) + need(len(raw) <= 65536, "Process status diagnostic exceeded its bound") + current = None + for line in raw.splitlines(): + if line.startswith(b"VmRSS:"): + fields = line.split() + need(len(fields) == 3 and fields[2] == b"kB", "Unexpected process RSS diagnostic units") + current = int(fields[1]) * 1024 + break + need(current is not None, "Current process RSS diagnostic unavailable") + highwater = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss * 1024 + return {"current_vmrss_bytes": current, "process_ru_maxrss_bytes": highwater} + + def call(self, name, function, *args, **kwargs): + wall, used = time.perf_counter(), cpu() + memory_before = self.memory() + primary_failure = False + try: + return function(*args, **kwargs) + except BaseException: + primary_failure = True + raise + finally: + memory_after, memory_error = None, None + try: + memory_after = self.memory() + except BaseException as error: + # Do not replace an original failure with diagnostic failure. + memory_error = {"type": type(error).__name__} + if not primary_failure: + raise + row = self.rows.setdefault(name, {"calls": 0, "wall_seconds": 0.0, + "cpu_seconds_with_children": 0.0, + "memory_samples": [], + "memory_semantics": "VmRSS is current resident bytes; ru_maxrss is process high-water bytes; neither is an additive phase peak"}) + row["calls"] += 1 + row["memory_samples"].append({"before": memory_before, "after": memory_after, + "diagnostic_error": memory_error}) + row["wall_seconds"] += time.perf_counter() - wall + row["cpu_seconds_with_children"] += cpu() - used + + def wrap(self, owner, attribute, name): + original = getattr(owner, attribute) + def observed(*args, **kwargs): + return self.call(name, original, *args, **kwargs) + setattr(owner, attribute, observed) + return original, observed + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--frozen-root", type=Path, default=HERE / "frozen") + parser.add_argument("--reference", type=Path, default=HERE / "reference/certificates/complex-network.json") + parser.add_argument("--lanes", choices=("baseline", "candidate"), required=True) + parser.add_argument("--finite-only", action="store_true") + parser.add_argument("--output", type=Path, required=True, help="New external directory; every write stays below it") + parser.add_argument("--anchor", type=Path, default=HERE / "anchor.json") + args = parser.parse_args() + args.data_lanes = args.lanes + args.lanes = "all" # Both comparison arms retain the complete original native/bookkeeping baseline. + if args.data_lanes == "transport": + need(args.frozen_root == HERE / "frozen" and + args.reference == HERE / "reference/certificates/complex-network.json" and + args.anchor == HERE / "anchor.json", "Transport uses only the original fixed historical inputs") + data_adapters.transport(ROUND, HERE, args.output) + return + inventory = candidate_inventory if args.data_lanes == "candidate" else original_inventory + args.mode = "candidate" # Every new arm starts from the original native C configuration. + need(args.finite_only or sys.flags.optimize == 0, "Every full-caller mode requires original assertions") + need(sys.implementation.name == "cpython" and sys.version_info[:2] == (3, 12), "Frozen CPython 3.12 required") + data_adapters.require_execution_contract(args.data_lanes, args.finite_only) + need((args.mode == "profile") == (args.anchor is None), "Profile creates the anchor; both benchmark arms require --anchor") + frozen, reference = args.frozen_root.resolve(), args.reference.resolve() + output = args.output.resolve() + need(str(output) == _INITIAL_OUTPUT and output.is_dir() and not output.is_symlink() and + {path.name for path in output.iterdir()} == {'initial-tcb-controls'} and + (output / 'initial-tcb-controls').is_dir() and + not (output / 'initial-tcb-controls').is_symlink() and + not list((output / 'initial-tcb-controls').iterdir()), + "Early TCB output ownership or fresh control directory changed") + need(not output.is_relative_to(HERE) and not output.is_relative_to(frozen), "Output must be outside immutable sources") + need(reference.is_file() and not reference.is_symlink(), "Reference certificate missing or symlinked") + source_pin_bytes = (HERE / "SOURCE-PINS.json").read_bytes() + need(sha(source_pin_bytes) == PIN_SHA, "Source inventory pin changed") + pins = json.loads(source_pin_bytes) + need(len(pins) == 32, "Frozen closure must contain twelve scripts, manifest and nineteen payloads") + reference_bytes = reference.read_bytes() + need(sha(reference_bytes) == REFERENCE_SHA, "Original full certificate reference changed") + driver_before = Path(__file__).read_bytes() + new_custody_before = adapters.custody(ROUND, args.lanes) + data_custody_before = data_adapters.custody(ROUND) + reference_driver_before = (HERE / "full_driver.py").read_bytes() + need(sha(reference_driver_before) == REFERENCE_DRIVER_SHA, "Reference driver pin changed") + anchor_bytes = None if args.anchor is None else args.anchor.read_bytes() + expected_anchor = None if anchor_bytes is None else json.loads(anchor_bytes) + if expected_anchor is not None: + need(expected_anchor.get("schema") == "gf2-full-network-anchor-v1" and + expected_anchor.get("base_commit") == BASE and expected_anchor.get("source_pin_sha256") == PIN_SHA and + expected_anchor.get("driver_sha256") == REFERENCE_DRIVER_SHA and + expected_anchor.get("engine_pins") == ENGINE_PINS, + "Anchor source/driver/engine identity differs; no benchmark permitted") + _EXECUTION['output'] = output + compiler_tmp = output / "compiler-tmp" + compiler_tmp.mkdir() + os.environ["TMPDIR"] = str(compiler_tmp) + phases = Phases() + (output / 'initial-native-tcb.json').write_bytes(canonical(INITIAL_NATIVE_TCB_RECEIPT) + b'\n') + (output / 'initial-tcb-controls' / 'receipt.json').write_bytes(canonical(INITIAL_NATIVE_TCB_CONTROLS) + b'\n') + frozen_before = phases.call("input_custody", inventory, frozen, pins) + engine_before = phases.call("engine_custody", inventory, HERE / "engine", ENGINE_PINS) + manifest = json.loads((frozen / "upstream/manifest.json").read_bytes()) + need(manifest["commit"] == UPSTREAM and len(manifest["files"]) == 19, "Wrong pinned upstream manifest") + need({"upstream/" + name for name in manifest["files"]} == + {name for name in pins if name.startswith("upstream/") and name != "upstream/manifest.json"}, + "Source verifier payload closure changed") + for name, info in manifest["files"].items(): + need(info["sha256"] == pins["upstream/" + name][0], "Manifest payload hash differs from independent frozen pin") + + runtime, engine = output / "runtime-root", output / "engine" + phases.call("fresh_root_copy", shutil.copytree, frozen, runtime) + phases.call("fresh_engine_copy", shutil.copytree, HERE / "engine", engine) + # copytree retains readonly source directory permissions. Only this new + # private root is made writable for the original CLI certificate output. + runtime.chmod(0o755) + (runtime / "certificates").mkdir() + runtime_before = inventory(runtime, pins) + copied_engine_before = inventory(engine, ENGINE_PINS) + need(runtime_before == frozen_before and copied_engine_before == engine_before, "Copy changed input bytes or modes") + for name in ("complex_network.py", "complex_circuit.py"): + need((engine / "source" / name).read_bytes() == (runtime / "scripts" / name).read_bytes(), + "PR5929 engine/source differs from the full caller closure") + script_names = {Path(name).stem for name in pins if name.startswith("scripts/")} + engine_names = {"native_backend", "finite_controls", "compare_side_verifier", "profile_side_verifier"} + need(not (script_names | engine_names) & set(sys.modules), "Scientific module already loaded; fresh process required") + sys.path[:0] = [str(engine), str(runtime / "scripts")] + # BEGIN evaluated dispatch arguments scientific_driver:462 + _ca_args = (str(engine / 'native_backend.py'), ENGINE_PINS['native_backend.py'], 'native_backend') + _ca_kwargs = {'kind': 'backend'} + # END evaluated dispatch arguments scientific_driver:462 + # BEGIN caller admission scientific_driver:462 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:462 + backend, backend_handle = phases.call('cold_engine_import', _ca_dispatch, 0, *_ca_args, **_ca_kwargs) + # BEGIN evaluated dispatch arguments scientific_driver:465 + _ca_args = (_INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'capture_backend_factory_environment', backend) + _ca_kwargs = {'cold_authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'backend_handle': backend_handle, 'cache_handle': _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'bootstrap_root': _CAPTURED_BOOTSTRAP_ROOT, 'bootstrap_capability': _CAPTURED_BOOTSTRAP_CAPABILITY, 'bootstrap_api': _CAPTURED_BOOTSTRAP_API} + # END evaluated dispatch arguments scientific_driver:465 + # BEGIN caller admission scientific_driver:465 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:465 + factory_environment = phases.call('cold_backend_factory_environment', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + comparison = importlib.import_module("compare_side_verifier") + native = None + finite = None + build = None + if args.mode == "candidate": + packet = phases.call("cold_native_metadata_build", native_packet.prepare, + ROUND, output, data_custody_before, _CAPTURED_BOOTSTRAP_ROOT, + _CAPTURED_BOOTSTRAP_CAPABILITY, _CAPTURED_BOOTSTRAP_API) + _EXECUTION['packet'] = packet + packet['controls']['native_initial_tcb'] = INITIAL_NATIVE_TCB_CONTROLS + native, build = phases.call("cold_compile_link_load", backend.build_native, output / "cold-build") + # BEGIN evaluated dispatch arguments scientific_driver:484 + _ca_args = (_INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'prepare', ROUND, backend, backend_handle, native, output, args.lanes, phases, _INITIAL_COLD_AUTHORITY, _INITIAL_INTEGRATION_HANDLES['adapters'], new_custody_before) + _ca_kwargs = {'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR} + # END evaluated dispatch arguments scientific_driver:484 + # BEGIN caller admission scientific_driver:484 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:484 + extensions = phases.call('new_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + phases.call("all_native_metadata_and_preload_controls", native_packet.run_controls, packet, phases) + finite = phases.call("all_native_finite_independent_controls", importlib.import_module("finite_controls").run_controls, native) + phases.call("all_new_controls", adapters.run_controls, extensions, backend, native, phases) + # BEGIN evaluated dispatch arguments scientific_driver:492 + _ca_args = (_INITIAL_INTEGRATION_HANDLES['data_adapters'], 'prepare', ROUND, backend, comparison, extensions, args.data_lanes, data_custody_before, packet) + _ca_kwargs = {'authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'integration_handles': _INITIAL_INTEGRATION_HANDLES, 'backend_handle': backend_handle, 'adapters_handle': _INITIAL_INTEGRATION_HANDLES['adapters'], 'setup_handle': _INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'factory_environment': factory_environment, 'preloaded_cache': (_INITIAL_INTEGRATION_MODULES['_h25_data_cache'], _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'])} + # END evaluated dispatch arguments scientific_driver:492 + # BEGIN caller admission scientific_driver:492 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:492 + data_state = phases.call('data_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + _EXECUTION['state'] = data_state + phases.call("all_data_controls", data_adapters.run_controls, + data_state, native, output, phases, HERE / "full_driver.py", candidate_inventory, extensions) + (output / "finite-controls.json").write_bytes(canonical(finite) + b"\n") + + if args.finite_only: + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + # LAST native/scientific call. Everything below is source or receipt work. + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + need(inventory(frozen, pins) == frozen_before and inventory(HERE / "engine", ENGINE_PINS) == engine_before, "Finite immutable source custody changed") + need(inventory(runtime, pins) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, "Finite copied source custody changed") + need(adapters.custody(ROUND, args.lanes) == new_custody_before, "Finite new source custody changed") + need(data_adapters.custody(ROUND) == data_custody_before, "Finite data source custody changed") + result = {"status": "H25_DATA_HANDLING_FINITE_PASS", "lanes": args.data_lanes, + "data_handling": data_adapters.finite_receipt(data_state), + "data_source_custody": data_custody_before, + "optimized": sys.flags.optimize, "original_controls": finite, + "new_controls": extensions["controls"], "new_source_custody": new_custody_before, + "driver_sha256": sha(driver_before), + "initial_native_tcb": INITIAL_NATIVE_TCB_RECEIPT, + "native_packet": native_packet.receipt(packet), + "reference_driver_sha256": REFERENCE_DRIVER_SHA, "phases": phases.rows} + (output / "receipt.json").write_text(json.dumps(result, indent=2, sort_keys=True) + "\n") + print(json.dumps(result, sort_keys=True)) + return + + circuit_module = phases.call("cold_complex_module_load", backend.load_source, "complex_circuit") + sys.modules["complex_circuit"] = circuit_module + rank_calls = [] + complement = extensions["trace_type"](circuit_module.Label) + phases.call("private_set_and_data_adapter_installation", data_adapters.install_circuit, + data_state, extensions, circuit_module, comparison) + side_writer = data_adapters.scientific_writer(data_state) + binding = None + captures = {} + phases.wrap(circuit_module.ComplexSideCircuit, "__init__", "side_construction") + phases.wrap(circuit_module.Checks, "__init__", "checks_initialization") + phases.wrap(circuit_module, "compile_roles", "compile_roles") + phases.wrap(circuit_module.Checks, "verify_map", "verify_map") + phases.wrap(circuit_module.Checks, "verify_labels", "verify_labels") + original_roles = circuit_module.verify_role_frames + def observe_roles(c, checks, code=None): + need("side" not in captures and code is not None, "Unexpected role-frame invocation") + result = phases.call("verify_role_frames", original_roles, c, checks, code) + captures["side"] = (c, checks, code, result) + return result + circuit_module.verify_role_frames = observe_roles + + certify = phases.call("cold_certify_import", importlib.import_module, "certify") + phases.wrap(certify, "verify_sources", "original_upstream_verify_sources") + prepare = phases.call("cold_prepare_import", importlib.import_module, "prepare_layers") + search = importlib.import_module("search_network") + phases.wrap(search, "log_integer_bounds", "full_log_integer_bounds") + original_serializable = prepare.serializable + depth = 0 + def observe_serializable(value): + nonlocal depth + outer = depth == 0 + if outer: + need("full_return" not in captures and type(value) is dict, "Unexpected outer serialization") + captures["full_return"] = value + depth += 1 + try: + # Recursion still delegates the original serializable exactly once + # per value; only the outer call is captured/timed. + if outer: + return phases.call("original_serializable", original_serializable, value) + return original_serializable(value) + finally: + depth -= 1 + prepare.serializable = observe_serializable + + # CS/Checks/phase/trace observers are final before either new guard captures them. + binding = phases.call("final_native_binding", data_adapters.bind_native, + data_state, backend, circuit_module, native, rank_calls, complement) + phases.call("construction_lease_sealing", data_adapters.seal, data_state) + phases.call("private_set_lease_sealing", adapters.seal, extensions) + caller = runtime / "scripts/complex_network.py" + old_argv = sys.argv + stdout = io.StringIO() + try: + phases.call("final_private_environment_and_arming", data_adapters.arm, data_state, extensions) + sys.argv = [str(caller)] + with redirect_stdout(stdout): + namespace = phases.call("complete_original_cli", runpy.run_path, str(caller), run_name="__main__") + finally: + sys.argv = old_argv + adapters.disarm(extensions) + cli_stdout = stdout.getvalue() + need(cli_stdout == EXPECTED_STDOUT, "Original CLI stdout changed") + certificate_bytes = (runtime / "certificates/complex-network.json").read_bytes() + need(certificate_bytes == reference_bytes, "Original CLI certificate bytes differ from the pinned reference") + need(sys.modules["complex_circuit"] is circuit_module and + namespace["ComplexSideCircuit"] is circuit_module.ComplexSideCircuit and + namespace["Checks"] is circuit_module.Checks and namespace["compile_roles"] is circuit_module.compile_roles and + namespace["verify_role_frames"] is observe_roles and namespace["serializable"] is observe_serializable, + "Caller used a different scientific module or observation binding") + need(captures.keys() == {"side", "full_return"}, "Missing exact caller observations") + c, checks, code, role_result = captures["side"] + full_return = captures["full_return"] + need(full_return["role_frames"] is role_result and full_return["upstream_commit"] == UPSTREAM, + "Role return or actual source verification boundary changed") + for name in ("side_construction", "checks_initialization", "compile_roles", "verify_map", "verify_labels", + "verify_role_frames", "original_upstream_verify_sources", "full_log_integer_bounds", + "original_serializable", "complete_original_cli"): + need(phases.rows.get(name, {}).get("calls") == 1, "Original phase was omitted or repeated: " + name) + imports = {} + for name in script_names - {"complex_network"}: + module = sys.modules.get(name) + expected_path = engine / "source/complex_circuit.py" if name == "complex_circuit" else runtime / "scripts" / (name + ".py") + need(module is not None and Path(module.__file__).resolve() == expected_path.resolve(), "Unpinned scientific import: " + name) + imports[name] = str(module.__file__) + if binding is not None: + binding["runtime_guard"].check() + need(binding["counters"] == {"complement_native": 238685, "complement_fallback": 0, + "gram_native": 59959, "gram_fallback": 0}, "Native full-call coverage changed") + + side_result = {key: full_return[key] for key in ("circuit", "side_map", "labels", "role_frames")} + witness = { + "support": c.support, "args": c.args, "kind": c.kind, "active": sorted(c.active), + "pieces": [(target, node, (coefficient.numerator, coefficient.denominator)) for target, node, coefficient in c.pieces], + "labels": [(key, list(label.basis.items()), label.dim, label.key) for key, label in checks.cache.items()], + "code": {"roles": code["roles"], "gates": code["gates"], "sources": list(code["sources"].items()), + "outputs": list(code["outputs"].items())}, + } + side_output = output / "side-observations" + side_output.mkdir() + side_receipt = phases.call("identical_lossless_side_serialization", side_writer, + side_output, side_result, witness, rank_calls) + complement_receipt = complement.receipt() + need(complement_receipt == COMPLEMENT_EXPECTED, "Every ordered complement observation must match PR5929") + full_typed_bytes = canonical(typed(full_return)) + (output / "full-return.lossless.json").write_bytes(full_typed_bytes) + (output / "original-stdout.txt").write_text(cli_stdout, encoding="utf-8") + (output / "complement-transcript.json").write_bytes(canonical(complement_receipt) + b"\n") + science = { + "full_cli_certificate_sha256": sha(certificate_bytes), "full_cli_stdout_sha256": sha(cli_stdout.encode("utf-8")), + "full_return_lossless_sha256": sha(full_typed_bytes), "side": side_receipt, + "ordered_complements": complement_receipt, "upstream_commit": UPSTREAM, + } + anchor = {"schema": "gf2-full-network-anchor-v1", "base_commit": BASE, "source_pin_sha256": PIN_SHA, + "driver_sha256": REFERENCE_DRIVER_SHA, "engine_pins": ENGINE_PINS, "science": science} + if expected_anchor is not None: + need(anchor == expected_anchor, "Complete certificate/types/ordered observations differ from frozen anchor") + else: + (output / "anchor.json").write_bytes(canonical(anchor) + b"\n") + need(inventory(frozen, pins) == frozen_before and inventory(HERE / "engine", ENGINE_PINS) == engine_before, + "Immutable source bytes/modes changed") + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, + "Runtime scientific source bytes/modes changed") + runtime_files = {str(path.relative_to(runtime)) for path in runtime.rglob("*") if path.is_file()} + need(runtime_files == set(pins) | {"certificates/complex-network.json"}, "Unexpected full-caller file side effect") + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and + (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), "Driver/reference/anchor changed during run") + need(adapters.custody(ROUND, args.lanes) == new_custody_before, "New source custody changed") + # Snapshot final scientific bookkeeping before the deliberately terminal late hook. + bookkeeping_receipt = adapters.receipt(extensions) + data_receipt = phases.call("data_finalization", data_adapters.finish, data_state, binding) + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + # LAST native/scientific call. No owner, root API, provider, or native guard follows. + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + # Honest source custody and receipt work continue after the terminal boundary. + need(data_adapters.custody(ROUND) == data_custody_before, "Data source custody changed") + need(adapters.custody(ROUND, args.lanes) == new_custody_before, "Post-late original source custody changed") + need(inventory(frozen, pins) == frozen_before and inventory(HERE / "engine", ENGINE_PINS) == engine_before, + "Post-late immutable source custody changed") + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, + "Post-late copied source custody changed") + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and + (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), "Post-late driver/reference/anchor changed") + receipt = { + "new_source_custody": new_custody_before, + "status": "FULL_NETWORK_PROFILE_ANCHOR_PASS" if args.mode == "profile" else "FULL_NETWORK_COMPLETE_PASS", + "mode": args.mode, "lanes": args.data_lanes, "bookkeeping": bookkeeping_receipt, + "data_handling": data_receipt, "data_source_custody": data_custody_before, + "reference_driver_sha256": REFERENCE_DRIVER_SHA, + "science": science, "base_commit": BASE, "native_predecessor_pr": 5995, + "driver_sha256": sha(driver_before), "source_pin_sha256": PIN_SHA, + "frozen_custody": frozen_before, "engine_custody": engine_before, "scientific_imports": imports, + "build": build, "finite_controls": finite, + "initial_native_tcb": INITIAL_NATIVE_TCB_RECEIPT, + "native_packet": native_packet.receipt(packet), + "private_root_permission": "runtime-root is0755; copied input file modes are retained and checked; immutable stages are never chmodded", + "compiler_tmpdir": str(compiler_tmp), + "native_calls": None if binding is None else dict(binding["counters"]), + "phases": phases.rows, "driver_wall_seconds_after_initial_tcb_before_receipt": time.perf_counter() - START_WALL, + "process_and_compiler_cpu_seconds_before_receipt": cpu(), + "environment": {"python": sys.version, "executable": sys.executable, "platform": sys.platform}, + "measurement": "Parent outer guard is authoritative and includes pristine root startup, initial native TCB authentication, early cold source authority capture and every factory dependency/product check, three cold metadata compilations plus original cold native/trace builds, every old and new control in BOTH arms, all candidate production admission/guards, IO and terminal cleanup. Baseline receives the complete same control union. Driver wall diagnostic starts after initial TCB and cold authority capture and is not total process wall. Broad phase samples are nested, not additive; VmRSS is current RSS and ru_maxrss is process high-water. Eager witnesses and original observations remain; full funding and equality gates are separate and currently closed.", + "scope": "Complete frozen historical complex-network CLI with retained observations; conditional certificate only. No bare-CLI factor, selected-frontier, new kappa or PR5864 speed claim.", + } + (output / "receipt.json").write_text(json.dumps(receipt, indent=2, sort_keys=True) + "\n") + sys.stdout.write(cli_stdout) + print(json.dumps({"status": receipt["status"], "mode": args.mode, "science": science, + "wall_seconds": receipt["driver_wall_seconds_after_initial_tcb_before_receipt"], + "cpu_seconds_with_compiler": receipt["process_and_compiler_cpu_seconds_before_receipt"], + "phases": phases.rows}, sort_keys=True)) + + +def _run_with_stop_evidence(): + try: + main() + except BaseException as primary_error: + # Nothing in cleanup or evidence assembly may replace this primary object. + try: + state = _EXECUTION['state'] + cleanup_errors = [] + try: + cleanup_errors = data_adapters.cleanup_owned(state) + except BaseException as cleanup_error: + cleanup_errors.append({'type': type(cleanup_error).__name__, 'message': str(cleanup_error)}) + stop = {'schema': 'h25-combined-v2-stop-v1', 'status': 'STOP', + 'primary_error': {'type': type(primary_error).__name__, 'message': str(primary_error)}, + 'primary_cause': None if primary_error.__cause__ is None else { + 'type': type(primary_error.__cause__).__name__, 'message': str(primary_error.__cause__)}, + 'cleanup_errors': cleanup_errors, + 'data': data_adapters.stop_diagnostics(state), + 'native_packet': None if _EXECUTION['packet'] is None else native_packet.receipt(_EXECUTION['packet']), + 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT} + output = _EXECUTION['output'] + if output is not None: + with (output / 'STOP.json').open('x', encoding='utf-8') as stream: + stream.write(json.dumps(stop, sort_keys=True, indent=2) + '\n') + except BaseException as evidence_error: + # Parent retains an independent process transcript even if this fails. + try: + sys.stderr.write('STOP evidence write failed: ' + type(evidence_error).__name__ + '\n') + except BaseException: + pass + raise + + + + +def _epoch_cli_boundary(phases, data_state, extensions, caller, stdout, invocation_token, old_argv): + _epoch_cli_primary = None + _epoch_cli_argv_error = None + _epoch_cli_disarm_error = None + _epoch_cli_retirement_error = None + _epoch_cli_record = None + try: + try: + _epoch_cli_record = {'primary': None, 'argv_error': None, 'disarm_error': None, 'retirement_error': None, 'outer_retirement_error': None, 'uncertain': False, 'argv_owner': old_argv, 'retirement_channel': {'started': False, 'error': None, 'journal_error': None, 'acknowledged': False}, 'outer_retirement_channel': {'started': False, 'error': None, 'journal_error': None, 'acknowledged': False}} + data_state['epoch_cli_cleanup'] = _epoch_cli_record + phases.call('final_private_environment_and_arming', data_adapters.arm, data_state, extensions) + if data_state['enabled']: + data_adapters.epoch_arm(data_state, invocation_token) + sys.argv = [str(caller)] + with redirect_stdout(stdout): + namespace = phases.call('complete_original_cli', runpy.run_path, str(caller), run_name='__main__') + return namespace + except BaseException as _epoch_cli_error: + _epoch_cli_primary = _epoch_cli_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_cli_error + raise + finally: + try: + sys.argv = old_argv + except BaseException as _epoch_argv_error: + _epoch_cli_argv_error = _epoch_argv_error + if _epoch_cli_record is not None: + _epoch_cli_record['argv_error'] = _epoch_argv_error + _epoch_cli_record['uncertain'] = True + if _epoch_cli_primary is None: + _epoch_cli_primary = _epoch_argv_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_argv_error + try: + adapters.disarm(extensions) + except BaseException as _epoch_disarm_error: + _epoch_cli_disarm_error = _epoch_disarm_error + if _epoch_cli_record is not None: + _epoch_cli_record['disarm_error'] = _epoch_disarm_error + _epoch_cli_record['uncertain'] = True + if _epoch_cli_primary is None: + _epoch_cli_primary = _epoch_disarm_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_disarm_error + raise + if _epoch_cli_argv_error is not None: + raise _epoch_cli_primary + finally: + try: + data_adapters.epoch_retire(data_state, 'whole-cli-terminal', _epoch_cli_primary, _epoch_cli_disarm_error, _epoch_cli_argv_error, None if _epoch_cli_record is None else _epoch_cli_record['retirement_channel'], 'inner') + except BaseException as _epoch_retirement_error: + _epoch_cli_retirement_error = _epoch_retirement_error + if _epoch_cli_record is not None: + _epoch_cli_record['retirement_error'] = _epoch_retirement_error + _epoch_cli_record['uncertain'] = True + if _epoch_cli_primary is None: + _epoch_cli_primary = _epoch_retirement_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_retirement_error + raise + +def main_epoch(): + _epoch_invocation = object() + _epoch_driver_origin = data_adapters.epoch_driver_entry(_INITIAL_COLD_AUTHORITY, _INITIAL_COLD_CALLER_DESCRIPTOR, _INITIAL_EPOCH_BUNDLE[3], main_epoch, Phases, _epoch_invocation) + data_state = None + _epoch_primary = None + _epoch_outer_retirement_error = None + _epoch_outer_cleanup = None + try: + _epoch_outer_cleanup = {'primary': None, 'retirement_error': None, 'uncertain': False, 'attempted': False} + _EXECUTION['epoch_outer_cleanup'] = _epoch_outer_cleanup + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--frozen-root', type=Path, default=HERE / 'frozen') + parser.add_argument('--reference', type=Path, default=HERE / 'reference/certificates/complex-network.json') + parser.add_argument('--lanes', choices=('baseline', 'candidate'), required=True) + parser.add_argument('--finite-only', action='store_true') + parser.add_argument('--output', type=Path, required=True, help='New external directory; every write stays below it') + parser.add_argument('--anchor', type=Path, default=HERE / 'anchor.json') + args = parser.parse_args() + args.data_lanes = args.lanes + args.lanes = 'all' + if args.data_lanes == 'transport': + need(args.frozen_root == HERE / 'frozen' and args.reference == HERE / 'reference/certificates/complex-network.json' and (args.anchor == HERE / 'anchor.json'), 'Transport uses only the original fixed historical inputs') + data_adapters.transport(ROUND, HERE, args.output) + return + inventory = candidate_inventory if args.data_lanes == 'candidate' else original_inventory + args.mode = 'candidate' + need(args.finite_only or sys.flags.optimize == 0, 'Every full-caller mode requires original assertions') + need(sys.implementation.name == 'cpython' and sys.version_info[:2] == (3, 12), 'Frozen CPython 3.12 required') + data_adapters.require_execution_contract(args.data_lanes, args.finite_only) + need((args.mode == 'profile') == (args.anchor is None), 'Profile creates the anchor; both benchmark arms require --anchor') + frozen, reference = (args.frozen_root.resolve(), args.reference.resolve()) + output = args.output.resolve() + need(str(output) == _INITIAL_OUTPUT and output.is_dir() and (not output.is_symlink()) and ({path.name for path in output.iterdir()} == {'initial-tcb-controls'}) and (output / 'initial-tcb-controls').is_dir() and (not (output / 'initial-tcb-controls').is_symlink()) and (not list((output / 'initial-tcb-controls').iterdir())), 'Early TCB output ownership or fresh control directory changed') + need(not output.is_relative_to(HERE) and (not output.is_relative_to(frozen)), 'Output must be outside immutable sources') + need(reference.is_file() and (not reference.is_symlink()), 'Reference certificate missing or symlinked') + source_pin_bytes = (HERE / 'SOURCE-PINS.json').read_bytes() + need(sha(source_pin_bytes) == PIN_SHA, 'Source inventory pin changed') + pins = json.loads(source_pin_bytes) + need(len(pins) == 32, 'Frozen closure must contain twelve scripts, manifest and nineteen payloads') + reference_bytes = reference.read_bytes() + need(sha(reference_bytes) == REFERENCE_SHA, 'Original full certificate reference changed') + driver_before = Path(__file__).read_bytes() + new_custody_before = adapters.custody(ROUND, args.lanes) + data_custody_before = data_adapters.custody(ROUND) + reference_driver_before = (HERE / 'full_driver.py').read_bytes() + need(sha(reference_driver_before) == REFERENCE_DRIVER_SHA, 'Reference driver pin changed') + anchor_bytes = None if args.anchor is None else args.anchor.read_bytes() + expected_anchor = None if anchor_bytes is None else json.loads(anchor_bytes) + if expected_anchor is not None: + need(expected_anchor.get('schema') == 'gf2-full-network-anchor-v1' and expected_anchor.get('base_commit') == BASE and (expected_anchor.get('source_pin_sha256') == PIN_SHA) and (expected_anchor.get('driver_sha256') == REFERENCE_DRIVER_SHA) and (expected_anchor.get('engine_pins') == ENGINE_PINS), 'Anchor source/driver/engine identity differs; no benchmark permitted') + _EXECUTION['output'] = output + compiler_tmp = output / 'compiler-tmp' + compiler_tmp.mkdir() + os.environ['TMPDIR'] = str(compiler_tmp) + phases = Phases() + (output / 'initial-native-tcb.json').write_bytes(canonical(INITIAL_NATIVE_TCB_RECEIPT) + b'\n') + (output / 'initial-tcb-controls' / 'receipt.json').write_bytes(canonical(INITIAL_NATIVE_TCB_CONTROLS) + b'\n') + frozen_before = phases.call('input_custody', inventory, frozen, pins) + engine_before = phases.call('engine_custody', inventory, HERE / 'engine', ENGINE_PINS) + manifest = json.loads((frozen / 'upstream/manifest.json').read_bytes()) + need(manifest['commit'] == UPSTREAM and len(manifest['files']) == 19, 'Wrong pinned upstream manifest') + need({'upstream/' + name for name in manifest['files']} == {name for name in pins if name.startswith('upstream/') and name != 'upstream/manifest.json'}, 'Source verifier payload closure changed') + for name, info in manifest['files'].items(): + need(info['sha256'] == pins['upstream/' + name][0], 'Manifest payload hash differs from independent frozen pin') + runtime, engine = (output / 'runtime-root', output / 'engine') + phases.call('fresh_root_copy', shutil.copytree, frozen, runtime) + phases.call('fresh_engine_copy', shutil.copytree, HERE / 'engine', engine) + runtime.chmod(493) + (runtime / 'certificates').mkdir() + runtime_before = inventory(runtime, pins) + copied_engine_before = inventory(engine, ENGINE_PINS) + need(runtime_before == frozen_before and copied_engine_before == engine_before, 'Copy changed input bytes or modes') + for name in ('complex_network.py', 'complex_circuit.py'): + need((engine / 'source' / name).read_bytes() == (runtime / 'scripts' / name).read_bytes(), 'PR5929 engine/source differs from the full caller closure') + script_names = {Path(name).stem for name in pins if name.startswith('scripts/')} + engine_names = {'native_backend', 'finite_controls', 'compare_side_verifier', 'profile_side_verifier'} + need(not (script_names | engine_names) & set(sys.modules), 'Scientific module already loaded; fresh process required') + sys.path[:0] = [str(engine), str(runtime / 'scripts')] + _ca_args = (str(engine / 'native_backend.py'), ENGINE_PINS['native_backend.py'], 'native_backend') + _ca_kwargs = {'kind': 'backend'} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + backend, backend_handle = phases.call('cold_engine_import', _ca_dispatch, 0, *_ca_args, **_ca_kwargs) + _ca_args = (_INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'capture_backend_factory_environment', backend) + _ca_kwargs = {'cold_authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'backend_handle': backend_handle, 'cache_handle': _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'bootstrap_root': _CAPTURED_BOOTSTRAP_ROOT, 'bootstrap_capability': _CAPTURED_BOOTSTRAP_CAPABILITY, 'bootstrap_api': _CAPTURED_BOOTSTRAP_API} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + factory_environment = phases.call('cold_backend_factory_environment', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + comparison = importlib.import_module('compare_side_verifier') + native = None + finite = None + build = None + if args.mode == 'candidate': + packet = phases.call('cold_native_metadata_build', native_packet.prepare, ROUND, output, data_custody_before, _CAPTURED_BOOTSTRAP_ROOT, _CAPTURED_BOOTSTRAP_CAPABILITY, _CAPTURED_BOOTSTRAP_API) + _EXECUTION['packet'] = packet + packet['controls']['native_initial_tcb'] = INITIAL_NATIVE_TCB_CONTROLS + native, build = phases.call('cold_compile_link_load', backend.build_native, output / 'cold-build') + _ca_args = (_INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'prepare', ROUND, backend, backend_handle, native, output, args.lanes, phases, _INITIAL_COLD_AUTHORITY, _INITIAL_INTEGRATION_HANDLES['adapters'], new_custody_before) + _ca_kwargs = {'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + extensions = phases.call('new_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + phases.call('all_native_metadata_and_preload_controls', native_packet.run_controls, packet, phases) + finite = phases.call('all_native_finite_independent_controls', importlib.import_module('finite_controls').run_controls, native) + phases.call('all_new_controls', adapters.run_controls, extensions, backend, native, phases) + _ca_args = (_INITIAL_INTEGRATION_HANDLES['data_adapters'], 'prepare', ROUND, backend, comparison, extensions, args.data_lanes, data_custody_before, packet) + _ca_kwargs = {'authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'integration_handles': _INITIAL_INTEGRATION_HANDLES, 'backend_handle': backend_handle, 'adapters_handle': _INITIAL_INTEGRATION_HANDLES['adapters'], 'setup_handle': _INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'factory_environment': factory_environment, 'preloaded_cache': (_INITIAL_INTEGRATION_MODULES['_h25_data_cache'], _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'])} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + data_state = phases.call('data_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + _EXECUTION['state'] = data_state + phases.call('all_data_controls', data_adapters.run_controls, data_state, native, output, phases, HERE / 'full_driver.py', candidate_inventory, extensions) + (output / 'finite-controls.json').write_bytes(canonical(finite) + b'\n') + if args.finite_only: + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + need(inventory(frozen, pins) == frozen_before and inventory(HERE / 'engine', ENGINE_PINS) == engine_before, 'Finite immutable source custody changed') + need(inventory(runtime, pins) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, 'Finite copied source custody changed') + need(adapters.custody(ROUND, args.lanes) == new_custody_before, 'Finite new source custody changed') + need(data_adapters.custody(ROUND) == data_custody_before, 'Finite data source custody changed') + result = {'status': 'H25_DATA_HANDLING_FINITE_PASS', 'lanes': args.data_lanes, 'data_handling': data_adapters.finite_receipt(data_state), 'data_source_custody': data_custody_before, 'optimized': sys.flags.optimize, 'original_controls': finite, 'new_controls': extensions['controls'], 'new_source_custody': new_custody_before, 'driver_sha256': sha(driver_before), 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT, 'native_packet': native_packet.receipt(packet), 'reference_driver_sha256': REFERENCE_DRIVER_SHA, 'phases': phases.rows} + (output / 'receipt.json').write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + print(json.dumps(result, sort_keys=True)) + return + if data_state['enabled']: + circuit_module, _epoch_load_ticket = phases.call('cold_complex_module_load', data_adapters.epoch_load, data_state, _INITIAL_EPOCH_BUNDLE[3]) + else: + circuit_module = phases.call('cold_complex_module_load', backend.load_source, 'complex_circuit') + sys.modules['complex_circuit'] = circuit_module + rank_calls = [] + complement = extensions['trace_type'](circuit_module.Label) + if data_state['enabled']: + _epoch_context = {'data_handle': _INITIAL_INTEGRATION_HANDLES['data_adapters'], 'data_module': data_adapters, 'phase_function': Phases.wrap, 'phase_class': Phases, 'phase_owner': phases, 'driver_function': main_epoch, 'driver_record': _epoch_driver_origin, 'invocation_token': _epoch_invocation, 'disposition_state': data_state} + phases.call('private_set_and_data_adapter_installation', data_adapters.install_epoch_circuit, data_state, extensions, circuit_module, comparison, _INITIAL_EPOCH_BUNDLE[3], _epoch_load_ticket, _epoch_context) + else: + phases.call('private_set_and_data_adapter_installation', data_adapters.install_circuit, data_state, extensions, circuit_module, comparison) + side_writer = data_adapters.scientific_writer(data_state) + binding = None + captures = {} + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'circuit', circuit_module.ComplexSideCircuit, '__init__', 'side_construction') + else: + phases.wrap(circuit_module.ComplexSideCircuit, '__init__', 'side_construction') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'checks', circuit_module.Checks, '__init__', 'checks_initialization') + else: + phases.wrap(circuit_module.Checks, '__init__', 'checks_initialization') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'module', circuit_module, 'compile_roles', 'compile_roles') + else: + phases.wrap(circuit_module, 'compile_roles', 'compile_roles') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'checks', circuit_module.Checks, 'verify_map', 'verify_map') + else: + phases.wrap(circuit_module.Checks, 'verify_map', 'verify_map') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'checks', circuit_module.Checks, 'verify_labels', 'verify_labels') + else: + phases.wrap(circuit_module.Checks, 'verify_labels', 'verify_labels') + original_roles = circuit_module.verify_role_frames + + def observe_roles(c, checks, code=None): + need('side' not in captures and code is not None, 'Unexpected role-frame invocation') + result = phases.call('verify_role_frames', original_roles, c, checks, code) + captures['side'] = (c, checks, code, result) + return result + if data_state['enabled']: + data_adapters.epoch_role_observer(data_state, observe_roles) + else: + circuit_module.verify_role_frames = observe_roles + certify = phases.call('cold_certify_import', importlib.import_module, 'certify') + phases.wrap(certify, 'verify_sources', 'original_upstream_verify_sources') + prepare = phases.call('cold_prepare_import', importlib.import_module, 'prepare_layers') + search = importlib.import_module('search_network') + phases.wrap(search, 'log_integer_bounds', 'full_log_integer_bounds') + original_serializable = prepare.serializable + depth = 0 + + def observe_serializable(value): + nonlocal depth + outer = depth == 0 + if outer: + need('full_return' not in captures and type(value) is dict, 'Unexpected outer serialization') + captures['full_return'] = value + depth += 1 + try: + if outer: + return phases.call('original_serializable', original_serializable, value) + return original_serializable(value) + finally: + depth -= 1 + prepare.serializable = observe_serializable + binding = phases.call('final_native_binding', data_adapters.bind_epoch_native if data_state['enabled'] else data_adapters.bind_native, data_state, backend, circuit_module, native, rank_calls, complement) + phases.call('construction_lease_sealing', data_adapters.seal, data_state) + phases.call('private_set_lease_sealing', adapters.seal, extensions) + if data_state['enabled']: + data_adapters.epoch_seal(data_state) + caller = runtime / 'scripts/complex_network.py' + old_argv = sys.argv + stdout = io.StringIO() + namespace = _epoch_cli_boundary(phases, data_state, extensions, caller, stdout, _epoch_invocation, old_argv) + cli_stdout = stdout.getvalue() + need(cli_stdout == EXPECTED_STDOUT, 'Original CLI stdout changed') + certificate_bytes = (runtime / 'certificates/complex-network.json').read_bytes() + need(certificate_bytes == reference_bytes, 'Original CLI certificate bytes differ from the pinned reference') + need(sys.modules['complex_circuit'] is circuit_module and namespace['ComplexSideCircuit'] is circuit_module.ComplexSideCircuit and (namespace['Checks'] is circuit_module.Checks) and (namespace['compile_roles'] is circuit_module.compile_roles) and (namespace['verify_role_frames'] is observe_roles) and (namespace['serializable'] is observe_serializable), 'Caller used a different scientific module or observation binding') + need(captures.keys() == {'side', 'full_return'}, 'Missing exact caller observations') + c, checks, code, role_result = captures['side'] + full_return = captures['full_return'] + need(full_return['role_frames'] is role_result and full_return['upstream_commit'] == UPSTREAM, 'Role return or actual source verification boundary changed') + for name in ('side_construction', 'checks_initialization', 'compile_roles', 'verify_map', 'verify_labels', 'verify_role_frames', 'original_upstream_verify_sources', 'full_log_integer_bounds', 'original_serializable', 'complete_original_cli'): + need(phases.rows.get(name, {}).get('calls') == 1, 'Original phase was omitted or repeated: ' + name) + imports = {} + for name in script_names - {'complex_network'}: + module = sys.modules.get(name) + expected_path = engine / 'source/complex_circuit.py' if name == 'complex_circuit' else runtime / 'scripts' / (name + '.py') + need(module is not None and Path(module.__file__).resolve() == expected_path.resolve(), 'Unpinned scientific import: ' + name) + imports[name] = str(module.__file__) + if binding is not None: + binding['runtime_guard'].check() + need(binding['counters'] == {'complement_native': 238685, 'complement_fallback': 0, 'gram_native': 59959, 'gram_fallback': 0}, 'Native full-call coverage changed') + side_result = {key: full_return[key] for key in ('circuit', 'side_map', 'labels', 'role_frames')} + witness = {'support': c.support, 'args': c.args, 'kind': c.kind, 'active': sorted(c.active), 'pieces': [(target, node, (coefficient.numerator, coefficient.denominator)) for target, node, coefficient in c.pieces], 'labels': [(key, list(label.basis.items()), label.dim, label.key) for key, label in checks.cache.items()], 'code': {'roles': code['roles'], 'gates': code['gates'], 'sources': list(code['sources'].items()), 'outputs': list(code['outputs'].items())}} + side_output = output / 'side-observations' + side_output.mkdir() + side_receipt = phases.call('identical_lossless_side_serialization', side_writer, side_output, side_result, witness, rank_calls) + complement_receipt = complement.receipt() + need(complement_receipt == COMPLEMENT_EXPECTED, 'Every ordered complement observation must match PR5929') + full_typed_bytes = canonical(typed(full_return)) + (output / 'full-return.lossless.json').write_bytes(full_typed_bytes) + (output / 'original-stdout.txt').write_text(cli_stdout, encoding='utf-8') + (output / 'complement-transcript.json').write_bytes(canonical(complement_receipt) + b'\n') + science = {'full_cli_certificate_sha256': sha(certificate_bytes), 'full_cli_stdout_sha256': sha(cli_stdout.encode('utf-8')), 'full_return_lossless_sha256': sha(full_typed_bytes), 'side': side_receipt, 'ordered_complements': complement_receipt, 'upstream_commit': UPSTREAM} + anchor = {'schema': 'gf2-full-network-anchor-v1', 'base_commit': BASE, 'source_pin_sha256': PIN_SHA, 'driver_sha256': REFERENCE_DRIVER_SHA, 'engine_pins': ENGINE_PINS, 'science': science} + if expected_anchor is not None: + need(anchor == expected_anchor, 'Complete certificate/types/ordered observations differ from frozen anchor') + else: + (output / 'anchor.json').write_bytes(canonical(anchor) + b'\n') + need(inventory(frozen, pins) == frozen_before and inventory(HERE / 'engine', ENGINE_PINS) == engine_before, 'Immutable source bytes/modes changed') + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, 'Runtime scientific source bytes/modes changed') + runtime_files = {str(path.relative_to(runtime)) for path in runtime.rglob('*') if path.is_file()} + need(runtime_files == set(pins) | {'certificates/complex-network.json'}, 'Unexpected full-caller file side effect') + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), 'Driver/reference/anchor changed during run') + need(adapters.custody(ROUND, args.lanes) == new_custody_before, 'New source custody changed') + bookkeeping_receipt = adapters.receipt(extensions) + data_receipt = phases.call('data_finalization', data_adapters.finish, data_state, binding) + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + need(data_adapters.custody(ROUND) == data_custody_before, 'Data source custody changed') + need(adapters.custody(ROUND, args.lanes) == new_custody_before, 'Post-late original source custody changed') + need(inventory(frozen, pins) == frozen_before and inventory(HERE / 'engine', ENGINE_PINS) == engine_before, 'Post-late immutable source custody changed') + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, 'Post-late copied source custody changed') + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), 'Post-late driver/reference/anchor changed') + receipt = {'new_source_custody': new_custody_before, 'status': 'FULL_NETWORK_PROFILE_ANCHOR_PASS' if args.mode == 'profile' else 'FULL_NETWORK_COMPLETE_PASS', 'mode': args.mode, 'lanes': args.data_lanes, 'bookkeeping': bookkeeping_receipt, 'data_handling': data_receipt, 'data_source_custody': data_custody_before, 'reference_driver_sha256': REFERENCE_DRIVER_SHA, 'science': science, 'base_commit': BASE, 'native_predecessor_pr': 5995, 'driver_sha256': sha(driver_before), 'source_pin_sha256': PIN_SHA, 'frozen_custody': frozen_before, 'engine_custody': engine_before, 'scientific_imports': imports, 'build': build, 'finite_controls': finite, 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT, 'native_packet': native_packet.receipt(packet), 'private_root_permission': 'runtime-root is0755; copied input file modes are retained and checked; immutable stages are never chmodded', 'compiler_tmpdir': str(compiler_tmp), 'native_calls': None if binding is None else dict(binding['counters']), 'phases': phases.rows, 'driver_wall_seconds_after_initial_tcb_before_receipt': time.perf_counter() - START_WALL, 'process_and_compiler_cpu_seconds_before_receipt': cpu(), 'environment': {'python': sys.version, 'executable': sys.executable, 'platform': sys.platform}, 'measurement': 'Parent outer guard is authoritative and includes pristine root startup, initial native TCB authentication, early cold source authority capture and every factory dependency/product check, three cold metadata compilations plus original cold native/trace builds, every old and new control in BOTH arms, all candidate production admission/guards, IO and terminal cleanup. Baseline receives the complete same control union. Driver wall diagnostic starts after initial TCB and cold authority capture and is not total process wall. Broad phase samples are nested, not additive; VmRSS is current RSS and ru_maxrss is process high-water. Eager witnesses and original observations remain; full funding and equality gates are separate and currently closed.', 'scope': 'Complete frozen historical complex-network CLI with retained observations; conditional certificate only. No bare-CLI factor, selected-frontier, new kappa or PR5864 speed claim.'} + (output / 'receipt.json').write_text(json.dumps(receipt, indent=2, sort_keys=True) + '\n') + sys.stdout.write(cli_stdout) + print(json.dumps({'status': receipt['status'], 'mode': args.mode, 'science': science, 'wall_seconds': receipt['driver_wall_seconds_after_initial_tcb_before_receipt'], 'cpu_seconds_with_compiler': receipt['process_and_compiler_cpu_seconds_before_receipt'], 'phases': phases.rows}, sort_keys=True)) + try: + _EPOCH_SC4_FULL_STATE['full_observation'] = { + 'receipt': receipt, 'phases': phases, 'extensions': extensions, + 'state': data_state, 'packet': packet, 'argv_owner': old_argv, + } + except BaseException as _sc4_completion_error: + try: + _EPOCH_SC4_FULL_STATE['completion_error'] = _sc4_completion_error + except BaseException: + pass + except BaseException as _epoch_error: + _epoch_primary = _epoch_error + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['primary'] = _epoch_error + raise + finally: + try: + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['attempted'] = True + data_adapters.epoch_retire(data_state, 'whole-cli-terminal', _epoch_primary, None, None, None, 'outer') + except BaseException as _epoch_outer_error: + _epoch_outer_retirement_error = _epoch_outer_error + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['retirement_error'] = _epoch_outer_error + _epoch_outer_cleanup['uncertain'] = True + if _epoch_primary is None: + _epoch_primary = _epoch_outer_error + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['primary'] = _epoch_outer_error + raise + +def _run_epoch_with_stop_evidence(): + try: + main_epoch() + except BaseException as primary_error: + try: + state = _EXECUTION['state'] + cleanup_errors = [] + try: + cleanup_errors = data_adapters.epoch_cleanup_owned(state) + except BaseException as cleanup_error: + cleanup_errors.append({'type': type(cleanup_error).__name__, 'message': str(cleanup_error)}) + stop = {'schema': 'h25-combined-v2-stop-v1', 'status': 'STOP', 'primary_error': {'type': type(primary_error).__name__, 'message': str(primary_error)}, 'primary_cause': None if primary_error.__cause__ is None else {'type': type(primary_error.__cause__).__name__, 'message': str(primary_error.__cause__)}, 'cleanup_errors': cleanup_errors, 'data': data_adapters.epoch_stop_diagnostics(state), 'native_packet': None if _EXECUTION['packet'] is None else native_packet.receipt(_EXECUTION['packet']), 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT} + output = _EXECUTION['output'] + if output is not None: + with (output / 'STOP.json').open('x', encoding='utf-8') as stream: + stream.write(json.dumps(stop, sort_keys=True, indent=2) + '\n') + except BaseException as evidence_error: + try: + sys.stderr.write('STOP evidence write failed: ' + type(evidence_error).__name__ + '\n') + except BaseException: + pass + raise + +# SC4 fixed positive full entry. Dormant until original full gates are admitted. +import types +_EPOCH_SC4_FULL_STATE = { + 'started': False, 'argv_owner': None, 'full_observation': None, + 'completion_error': None, 'primary': None, 'disposition': None, + 'qualification_error': None, 'qualified': False, +} + + +def _epoch_sc4_full_require_disposition(record): + # Pure reads of actual original completion and owner records, after main finally. + need(record is _EPOCH_SC4_FULL_STATE and record['started'] is True and + record['primary'] is None and record['completion_error'] is None and + record['disposition'] is None and record['qualification_error'] is None and + record['qualified'] is False, 'SC4 positive one-use completion record differs') + observed = record['full_observation']; state = _EXECUTION['state'] + need(type(observed) is dict and set(observed) == { + 'receipt', 'phases', 'extensions', 'state', 'packet', 'argv_owner'} and + type(state) is dict and observed['state'] is state and + observed['packet'] is _EXECUTION['packet'] and state['native_packet'] is observed['packet'] and + observed['argv_owner'] is record['argv_owner'] and sys.argv is record['argv_owner'], + 'SC4 positive original completed main/state/packet/argv ownership differs') + outer = _EXECUTION['epoch_outer_cleanup'] + need(type(outer) is dict and outer['attempted'] is True and + outer['primary'] is None and outer['retirement_error'] is None and outer['uncertain'] is False, + 'SC4 positive original outer completion retained a failure') + receipt = observed['receipt']; phases = observed['phases']; extensions = observed['extensions'] + need(type(receipt) is dict and receipt['status'] == 'FULL_NETWORK_COMPLETE_PASS' and + receipt['lanes'] == 'baseline' and receipt['mode'] == 'candidate' and + receipt['data_handling'] is state['final_receipt'] and + type(state['final_receipt']) is dict and state['final_receipt']['full_caller_run'] is True and + state['final_receipt']['arm'] == 'baseline' and state['enabled'] is False and + type(phases) is Phases and receipt['phases'] is phases.rows and type(phases.rows) is dict and + state['native_packet']['late_started'] is True, + 'SC4 positive actual full result/phase owner/late completion differs') + for phase_name, row in phases.rows.items(): + need(type(phase_name) is str and type(row) is dict and + all(type(key) is str for key in row) and type(row['memory_samples']) is list, + 'SC4 positive original phase record shape differs') + for sample in row['memory_samples']: + need(type(sample) is dict and all(type(key) is str for key in sample) and + sample['diagnostic_error'] is None, + 'SC4 positive original phase retained a diagnostic failure') + cli = state['epoch_cli_cleanup'] + need(type(cli) is dict and cli['primary'] is None and cli['argv_error'] is None and + cli['disarm_error'] is None and cli['retirement_error'] is None and + cli['outer_retirement_error'] is None and cli['uncertain'] is False and + cli['argv_owner'] is record['argv_owner'], + 'SC4 positive protected CLI retained a failure or changed argv owner') + inner = cli['retirement_channel']; outer_channel = cli['outer_retirement_channel'] + need(type(inner) is dict and type(outer_channel) is dict and inner is not outer_channel, + 'SC4 positive protected CLI channels are not independent') + for channel in (inner, outer_channel): + need(channel['started'] is False and channel['acknowledged'] is False and + channel['error'] is None and channel['journal_error'] is None, + 'SC4 positive original CLI retirement channel differs') + original_owner = extensions['set_binding']['owner'] + need(original_owner.cli_active is False and original_owner.current is None and + original_owner.circuit is None and original_owner.checks is None and original_owner.triples is None, + 'SC4 positive original set owner retains active operands') + need(state.get('epoch_suite') is None and state.get('epoch_acquisition') is None, + 'SC4 baseline must remain the original non-epoch full caller') + owned_states = state['owned_states']; owners = [] + need(type(owned_states) is list and sum(owned is state for owned in owned_states) == 1, + 'SC4 positive original known-owner census differs') + for index, owned in enumerate(owned_states): + need(type(owned) is dict and owned['owned_states'] is owned_states and + type(owned['cleanup_errors']) is list and len(owned['cleanup_errors']) == 0, + 'SC4 positive an actual known owner retains cleanup failure') + binding = owned['cache_binding'] + if binding is None: + need(owned['cache_teardown_attempted'] is False and owned['cache_teardown_receipt'] is None and + owned['cache_teardown_stop'] is None and owned.get('epoch_acquisition') is None, + 'SC4 positive unacquired owner has a fabricated teardown outcome') + owners.append({'index': index, 'acquired': False}) + continue + need(type(binding) is dict, 'SC4 positive acquired cache binding shape differs') + owner = binding['owner']; closed = owned['cache_teardown_receipt'] + need(owned['cache_teardown_attempted'] is True and owned['cache_teardown_stop'] is None and + type(closed) is dict and type(closed['teardowns']) is int and closed['teardowns'] == 1 and + type(closed['current_authority_entries']) is int and closed['current_authority_entries'] == 0 and + closed['probe_closed'] is True and owner.probe_closed is True and + type(owner.states) is dict and len(owner.states) == 0 and owner.teardown_stop is None and + owner.teardown_primary_error is None and owner.teardown_close_error is None and + type(owner.receipt) is dict and owner.receipt['teardowns'] == 1 and + owner.receipt['current_authority_entries'] == 0, + 'SC4 positive actual owner lacks a clean original one-shot close') + counters = closed['native_probe'] + need(type(counters) is dict and type(counters['calls']) is int and + type(counters['counter_overflow']) is int and counters['counter_overflow'] == 0 and + counters['calls'] == owner.receipt['probe_entry_calls'] + owner.receipt['probe_exit_calls'], + 'SC4 positive actual closed-owner counters differ') + acquisition = owned.get('epoch_acquisition') + if acquisition is not None: + # Successful original finish/cleanup_owned does NOT write STOP close flags. + need(owned is state and state['enabled'] is True and type(acquisition) is dict and + acquisition['prepared'] is binding and acquisition['owner'] is owner and + acquisition['published'] is True and acquisition['origin_handle'] is not None and + acquisition['phase'] == 'ORIGIN_ACCEPTED_PARENT_OWNED' and + acquisition['close_attempted'] is False and acquisition['close_result'] is None and + acquisition['primary'] is None and acquisition['secondary'] is None and + acquisition['uncertain'] is False and owner is state['epoch_suite'].owner, + 'SC4 positive original acquisition writer path differs') + owners.append({'index': index, 'acquired': True, 'teardowns': closed['teardowns'], + 'probe_closed': closed['probe_closed'], 'native_probe': counters}) + return {'schema': 'cache-SC4-baseline-positive-disposition-observation-v1', + 'original_receipt': receipt, 'known_owners': owners, + 'whole_source_caller_cost_or_activity_admitted': False} + + +def _epoch_sc4_full_entry(): + record = _EPOCH_SC4_FULL_STATE; binding = _EPOCH_SC4_FULL_BINDING + need(type(record) is dict and set(record) == { + 'started', 'argv_owner', 'full_observation', 'completion_error', 'primary', + 'disposition', 'qualification_error', 'qualified'} and + record['started'] is False and record['qualified'] is False, + 'SC4 baseline full entry is a fresh exact one-use record') + for name in ('argv_owner', 'full_observation', 'completion_error', 'primary', + 'disposition', 'qualification_error'): + need(record[name] is None, 'SC4 positive entry record already consumed') + record['started'] = True + need(type(binding) is tuple and len(binding) == 11, + 'SC4 positive fixed source binding tuple differs') + entry, entry_code, predicate, predicate_code, main, main_code, stop, stop_code, owner, builtins, namespace = binding + need(entry is _epoch_sc4_full_entry and predicate is _epoch_sc4_full_require_disposition and + main is main_epoch and stop is _run_epoch_with_stop_evidence and owner is record and + namespace is globals() and type(builtins) is dict, + 'SC4 positive source function/record identities differ') + for function, code in ((entry, entry_code), (predicate, predicate_code), (main, main_code), (stop, stop_code)): + need(type(function) is types.FunctionType and type(code) is types.CodeType and + function.__code__ is code and function.__globals__ is namespace and + function.__builtins__ is builtins and function.__defaults__ is None and + function.__kwdefaults__ is None and function.__closure__ is None, + 'SC4 positive actual source function environment differs') + argv = sys.argv + need(type(argv) is list and all(type(value) is str for value in argv) and + argv.count('--lanes') == 1 and argv.index('--lanes') + 1 < len(argv) and + argv[argv.index('--lanes') + 1] == 'baseline' and '--finite-only' not in argv and + '--cache-control-case' not in argv and '--cache-control-sha256' not in argv and + sys.flags.optimize == 0 and _EXECUTION['state'] is None and _EXECUTION['packet'] is None, + 'SC4 fixed assertion-on fresh baseline full invocation required') + driver = sys.modules['__main__'] + need(type(driver) is types.ModuleType and driver.__dict__ is namespace, + 'SC4 positive entry is not the original Root-installed driver') + record['argv_owner'] = argv + try: + result = stop() # Original fresh _run_epoch_with_stop_evidence -> main_epoch. + except BaseException as primary: + try: + record['primary'] = primary + except BaseException: + pass + raise # No qualification failure replaces an original main primary. + try: + need(_EPOCH_SC4_FULL_BINDING is binding and _EPOCH_SC4_FULL_STATE is record and + entry is _epoch_sc4_full_entry and predicate is _epoch_sc4_full_require_disposition and + main is main_epoch and stop is _run_epoch_with_stop_evidence and + sys.modules['__main__'] is driver and driver.__dict__ is namespace and sys.argv is argv, + 'SC4 positive live source/argv ownership changed') + for function, code in ((entry, entry_code), (predicate, predicate_code), (main, main_code), (stop, stop_code)): + need(function.__code__ is code and function.__globals__ is namespace and + function.__builtins__ is builtins and function.__defaults__ is None and + function.__kwdefaults__ is None and function.__closure__ is None, + 'SC4 positive live source environment changed') + record['disposition'] = predicate(record) + need(type(record['disposition']) is dict and record['qualification_error'] is None, + 'SC4 positive actual disposition did not complete') + record['qualified'] = True + except BaseException as qualification_error: + try: + record['qualification_error'] = qualification_error + except BaseException: + pass + raise # Original main returned; this is a new nonqualifying observer failure. + return result # Only the original normal return, never a synthetic full receipt. + + +_EPOCH_SC4_FULL_BINDING = ( + _epoch_sc4_full_entry, _epoch_sc4_full_entry.__code__, + _epoch_sc4_full_require_disposition, _epoch_sc4_full_require_disposition.__code__, + main_epoch, main_epoch.__code__, _run_epoch_with_stop_evidence, _run_epoch_with_stop_evidence.__code__, + _EPOCH_SC4_FULL_STATE, _epoch_sc4_full_entry.__builtins__, globals(), +) + +if __name__ == '__main__': + _epoch_sc4_full_entry() diff --git a/research/h25-full-caller-readable-inputs/full-candidate.py.txt b/research/h25-full-caller-readable-inputs/full-candidate.py.txt new file mode 100644 index 0000000000..c50283e710 --- /dev/null +++ b/research/h25-full-caller-readable-inputs/full-candidate.py.txt @@ -0,0 +1,1485 @@ +#!/usr/bin/env python3 +"""One complete frozen complex-network CLI with retained exact observations. + +Parent-owned serial wall/RSS/aggregate guard is mandatory. Profile mode is one +literal baseline diagnostic/anchor, not a performance sample. Both benchmark +modes require its immutable anchor. No search, retry, orchestration or network. +""" +from __future__ import annotations + +# Actual source-authenticated root injects these three values before driver exec. +# Capture them before importing any candidate, scientific, or orchestration code. +_CAPTURED_BOOTSTRAP_ROOT = bootstrap_root +_CAPTURED_BOOTSTRAP_CAPABILITY = bootstrap_capability +_CAPTURED_BOOTSTRAP_API = bootstrap_api +if type(_CAPTURED_BOOTSTRAP_API) is not tuple or len(_CAPTURED_BOOTSTRAP_API) != 4: + raise RuntimeError('Driver requires the parent-sealed exact four-entry bootstrap API') +_INITIAL_ROOT_IDENTITY = _CAPTURED_BOOTSTRAP_API[0]() +if (type(_CAPTURED_BOOTSTRAP_ROOT) is not _CAPTURED_BOOTSTRAP_ROOT.ModuleType or + any(type(entry) is not _CAPTURED_BOOTSTRAP_ROOT.FunctionType or + entry.__globals__ is not _CAPTURED_BOOTSTRAP_ROOT.__dict__ + for entry in _CAPTURED_BOOTSTRAP_API)): + raise RuntimeError('Driver bootstrap API is not bound to the actual root namespace') + +# Accepted helper/control sources and parent-inspected native dependency tuple. +# These are static expected pins; finite and full execution gates remain closed. +EXPECTED_BOOTSTRAP_ROOT_SHA256 = 'f5a2d33f2b4d3651f214156a0e7094c2bb516ce2d5ab7698d18c11f98f35dee0' +NATIVE_TCB_HELPER_SHA256 = '865943df5cfdbf9383362d7fb2b76c6d0fd895cf0a0e20d550a26b579606b5d7' +NATIVE_TCB_CONTROLS_SHA256 = '63b1804caa7f89915662a1424f788c3becad13520e1f63212a338fb45aaa2c5a' +NATIVE_TCB_EXPECTED_FILES = (('/usr/bin/python3.12', 'e50d468e8b0adfb05733f5b87b3cff34829c4a8c1aea50c865aa8bdfe4bb150f', 8020928), + ('/usr/lib/python3.12/lib-dynload/_hashlib.cpython-312-x86_64-linux-gnu.so', + '8dc6cda6dd9495b95a2bfb5b26e8cf06b72f36dc0213d958b9277a958287f0fe', + 64368), + ('/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2', + 'c20a2dc8917c755f02b94049356320fe1f62ac7d9f8994731f807d9df39302da', + 236616), + ('/usr/lib/x86_64-linux-gnu/libc.so.6', + '3a15d66867d83762c7f2f1e37359cb8f6c5743edb369c65285cb0b1c4f7498bf', + 2129424), + ('/usr/lib/x86_64-linux-gnu/libcrypto.so.3', + '6866ed711dab8927e1bf82bf1cd30e828bdfc34f3cc1e83b1c9eb01ce6c37d9a', + 5309400), + ('/usr/lib/x86_64-linux-gnu/libexpat.so.1.9.1', + '286682ecbc5e59a638963b1a4e6351e65eb32fcf4bdcb9cb7569b6a61fe06a8d', + 186624), + ('/usr/lib/x86_64-linux-gnu/libm.so.6', + 'fce00b6f25f459cf4ae0b7fae4257909a1a8a86f9149e7c029a5d617baf1ccd0', + 952616), + ('/usr/lib/x86_64-linux-gnu/libz.so.1.3', + 'f61677c7bdb7c2aa2a243ea781bfd16afcb361cede7b4ef76127a9d8eb9a5242', + 113000)) +NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN = '/usr/lib/python3.12/lib-dynload/_hashlib.cpython-312-x86_64-linux-gnu.so' + + +def _initial_native_tcb(): + root, api = _CAPTURED_BOOTSTRAP_ROOT, _CAPTURED_BOOTSTRAP_API + if (type(EXPECTED_BOOTSTRAP_ROOT_SHA256) is not str or + _INITIAL_ROOT_IDENTITY != EXPECTED_BOOTSTRAP_ROOT_SHA256 or + type(NATIVE_TCB_HELPER_SHA256) is not str or len(NATIVE_TCB_HELPER_SHA256) != 64 or + type(NATIVE_TCB_EXPECTED_FILES) is not tuple or + type(NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN) is not str): + raise RuntimeError('Initial native TCB source and expected dependency tuple are not configured') + helper_path = __file__.rsplit('/', 2)[0] + '/areas/cache-validity/probe-native/native_tcb_v1.py' + api[0]() + digest, _, source = root._hash_regular(helper_path, 262144, True) + if digest != NATIVE_TCB_HELPER_SHA256: + raise RuntimeError('Initial native TCB helper source differs') + helper = root.ModuleType('_h25_initial_native_tcb') + namespace = helper.__dict__ + namespace.update({'__file__': helper_path, '__builtins__': root.builtins.__dict__}) + api[0]() + code = root._COMPILE(source, helper_path, 'exec', dont_inherit=True, optimize=root._OPTIMIZE) + api[0]() + root._EXEC(code, namespace) + api[0]() + receipt = namespace['verify_native_tcb'](root, api, NATIVE_TCB_EXPECTED_FILES, + NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN) + if type(NATIVE_TCB_CONTROLS_SHA256) is not str or len(NATIVE_TCB_CONTROLS_SHA256) != 64: + raise RuntimeError('Initial native TCB control source pin is not configured') + control_path = __file__.rsplit('/', 2)[0] + '/areas/cache-validity/probe-native/native_tcb_controls_v1.py' + api[0]() + digest, _, control_source = root._hash_regular(control_path, 262144, True) + if digest != NATIVE_TCB_CONTROLS_SHA256: + raise RuntimeError('Initial native TCB controls source differs') + control_namespace = {'__name__': '_h25_initial_native_tcb_controls', '__file__': control_path, + '__builtins__': root.builtins.__dict__} + api[0]() + control_code = root._COMPILE(control_source, control_path, 'exec', dont_inherit=True, optimize=root._OPTIMIZE) + api[0]() + root._EXEC(control_code, control_namespace) + argv = root.sys.argv + if (type(argv) is not list or any(type(arg) is not str for arg in argv) or + argv.count('--output') != 1 or argv.index('--output') + 1 >= len(argv)): + raise RuntimeError('Early TCB controls require the unique parent --output argument') + output = argv[argv.index('--output') + 1] + stage_root = __file__.rsplit('/', 2)[0] + if (not output.startswith('/') or output.endswith('/') or + any(part in ('', '.', '..') for part in output.split('/')[1:]) or + output == stage_root or output.startswith(stage_root + '/')): + raise RuntimeError('Early TCB controls require a canonical absolute output outside the stage') + # Parent owns an existing nonsymlink output parent. mkdir is exclusive: + # a preexisting output, file, or symlink is rejected before any fixture write. + api[0]() + root.posix.mkdir(output, 0o700) + control_directory = output + '/initial-tcb-controls' + root.posix.mkdir(control_directory, 0o700) + api[0]() + controls = control_namespace['run_controls']( + helper, root, api, NATIVE_TCB_EXPECTED_FILES, NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN, control_directory) + if (controls.get('schema') != 'h25-native-tcb-controls-v1' or + controls.get('expected_records') != 5 or len(controls.get('records', [])) != 5 or + controls.get('scientific_calls') != 0 or controls.get('probe_native_imports') != 0): + raise RuntimeError('Initial native TCB control census differs') + controls['status'] = 'NATIVE_INITIAL_TCB_CONTROLS_PASS' + return receipt, controls, output + + +# Child outer wall/CPU/RSS includes this entire initial trust check. +# It assumes the declared trusted OS/native startup; it does not prove itself. +INITIAL_NATIVE_TCB_RECEIPT, INITIAL_NATIVE_TCB_CONTROLS, _INITIAL_OUTPUT = _initial_native_tcb() + +# This independent bootstrap support captures the initial system-stdlib +# continuity boundary before any adapter or scientific module is exposed. +# No late candidate-created snapshot is accepted as initial authentication. +COLD_AUTHORITY_SHA256 = 'b32155cd9d31510b1ca1c155121b3ca49b41be2c8be96e23dbdfe58a921abee5' + + +def _initial_cold_authority(): + root, cap, api = (_CAPTURED_BOOTSTRAP_ROOT, _CAPTURED_BOOTSTRAP_CAPABILITY, + _CAPTURED_BOOTSTRAP_API) + if type(COLD_AUTHORITY_SHA256) is not str or len(COLD_AUTHORITY_SHA256) != 64: + raise RuntimeError('Initial cold authority source pin is not configured') + source_path = __file__.rsplit('/', 2)[0] + '/areas/cache-validity/cold_authority_v7.py' + api[0]() + digest, _, source = root._hash_regular(source_path, 1048576, True) + if digest != COLD_AUTHORITY_SHA256: + raise RuntimeError('Initial cold authority source differs') + module = root.ModuleType('_h25_initial_cold_authority') + namespace = module.__dict__ + namespace.update({'__file__': source_path, '__builtins__': root.builtins.__dict__}) + api[0]() + code = root._COMPILE(source, source_path, 'exec', dont_inherit=True, optimize=root._OPTIMIZE) + api[0]() + root._EXEC(code, namespace) + # The actual source bytes have just executed under the admitted initial + # interpreter/system-stdlib premise. Capture precedes every candidate import. + api[0]() + bundle = namespace['capture_epoch_authority'](root, cap, api); authority = bundle[1] + if (type(authority) is not tuple or len(authority) != 7 or + any(type(entry) is not root.FunctionType for entry in authority)): + raise RuntimeError('Initial cold authority must expose the sealed seven-entry tuple') + # Read fresh transport exactly once, before any candidate exposure. + transport = root.FunctionType.__dict__['__dict__'].__get__(authority[0], root.FunctionType) + descriptor = transport['_h25_caller_descriptor'] + if type(descriptor) is not tuple or len(descriptor) != 6 or descriptor[1] is not authority: + raise RuntimeError('Initial cold authority caller descriptor differs') + return authority, descriptor, bundle + + +import importlib +import typing +_INITIAL_COLD_AUTHORITY, _INITIAL_COLD_CALLER_DESCRIPTOR, _INITIAL_EPOCH_BUNDLE = _initial_cold_authority() + +import time +START_WALL = time.perf_counter() +import argparse +from contextlib import redirect_stdout +from fractions import Fraction +import hashlib +import io +import json +import os +from pathlib import Path +import resource +import runpy +import shutil +import stat +import sys + +sys.dont_write_bytecode = True +# Independent source pins are literal final-stage configuration. These modules +# are admitted by the pre-exposure authority, including their live helper code. +# Driver/source identity does not depend on a hash of itself. +EARLY_INTEGRATION_SOURCE_PINS = ({'adapters': ('integration/adapters.py', 'f7ca7f4f03ac63c1a95ba42f06149543211566de5e29f487a3dc4d08c5ee9b94'), 'cold_build_evidence': ('integration/cold_build_evidence.py', 'aa0a315110e031e19291970c9611fe5e0f91465fa20eaec51e81186099563f78'), 'native_packet': ('integration/native_packet.py', '8e9298cfbf44cedd07868dc1624631d7ce73d78c48c4eec1fca15d3640076dab'), 'data_adapters': ('integration/data_adapters.py', '18679fd1eb6ae99c4b375756511427c26718f77674c2d8fcc490e25ceb47cba5'), 'guarded_adapters_v4': ('integration/guarded_adapters_v4.py', '5579fe0838d8c6acf63834990269479c6c32024a1662846ed0a075c25d13954c'), '_h25_data_cache': ('areas/cache-validity/cache_contract_v8.py', '06911ec0b671240398f62dc47ae72b8cf6ee8916784b3a10b49a1f8e69fa64ac')} + + + + + + +) +_INITIAL_INTEGRATION_MODULES = {} +_INITIAL_INTEGRATION_HANDLES = {} +for _entry_name, (_entry_relative, _entry_digest) in EARLY_INTEGRATION_SOURCE_PINS.items(): + if type(_entry_digest) is not str or len(_entry_digest) != 64: + raise RuntimeError('Early integration source pin is not configured: ' + _entry_name) + # BEGIN evaluated dispatch arguments scientific_driver:195 + _ca_args = (__file__.rsplit('/', 2)[0] + '/' + _entry_relative, _entry_digest, _entry_name) + _ca_kwargs = {} + # END evaluated dispatch arguments scientific_driver:195 + # BEGIN caller admission scientific_driver:195 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:195 + _entry_module, _entry_handle = _ca_dispatch(0, *_ca_args, **_ca_kwargs) + if type(_entry_module) is not _CAPTURED_BOOTSTRAP_ROOT.ModuleType or sys.modules.get(_entry_name) is not _entry_module: + raise RuntimeError('Early integration module registry identity differs: ' + _entry_name) + _INITIAL_INTEGRATION_MODULES[_entry_name] = _entry_module + _INITIAL_INTEGRATION_HANDLES[_entry_name] = _entry_handle +adapters = _INITIAL_INTEGRATION_MODULES['adapters'] +native_packet = _INITIAL_INTEGRATION_MODULES['native_packet'] +data_adapters = _INITIAL_INTEGRATION_MODULES['data_adapters'] +guarded_adapters_v4 = _INITIAL_INTEGRATION_MODULES['guarded_adapters_v4'] +_EXECUTION = {'output': Path(_INITIAL_OUTPUT), 'state': None, 'packet': None} +ROUND = Path(__file__).resolve().parent.parent +HERE = ROUND / "baseline" +REFERENCE_DRIVER_SHA = "0d976d2eb6b845f20d4a3396591a806f966688b88693cd6a5f8a0c9e48925e36" +BASE = "19fdb086ea96af9a9f87936a2b888e10af4ed810" +UPSTREAM = "adc7f1241b42e322a6451854ab7e4b4c146bf78a" +PIN_SHA = "88bba3caf5975f30fa7abceaea9454110cf3b069233e8241a2ca13d1dff171a7" +REFERENCE_SHA = "1f763d95c7ff163aa71d13cd82784f16665be8afb21f75e76941e2119562098f" +ENGINE_PINS = { + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a", + "source/complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "source/complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b", +} +COMPLEMENT_EXPECTED = { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838", + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", +} +EXPECTED_STDOUT = ( + "PASS conditional 59/100000000000 > 2^-31; minimum margin 14779261/25000000000000000\n" + "Side roles per invocation 108195 vs original 3693800\n" +) + + +def need(condition, message): + if not condition: + raise RuntimeError(message) + + +def sha(data): + return hashlib.sha256(data).hexdigest() + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode("ascii") + + +def cpu(): + own = resource.getrusage(resource.RUSAGE_SELF) + children = resource.getrusage(resource.RUSAGE_CHILDREN) + return own.ru_utime + own.ru_stime + children.ru_utime + children.ru_stime + + +def inventory(root, pins, *, exact=True): + need(root.is_dir() and not root.is_symlink(), "Missing or symlinked input root") + files = {} + for path in sorted(root.rglob("*")): + need(not path.is_symlink(), "Symlink in frozen inputs: " + str(path)) + if path.is_file(): + relative = str(path.relative_to(root)) + if relative not in pins: + need(not exact, "Undeclared frozen input: " + relative) + continue + raw = path.read_bytes() + expected = pins[relative][0] if type(pins[relative]) is list else pins[relative] + need(sha(raw) == expected, "Frozen input digest changed: " + relative) + files[relative] = {"sha256": sha(raw), "mode": stat.S_IMODE(path.stat().st_mode), "bytes": len(raw)} + need(set(files) == set(pins), "Frozen input inventory incomplete") + return files + +# Preserve the literal baseline function; main selects a local arm function. +original_inventory = inventory + +def candidate_inventory(root, pins, *, exact=True): + need(root.is_dir() and not root.is_symlink(), "Missing or symlinked input root") + files = {} + for path in sorted(root.rglob("*")): + need(not path.is_symlink(), "Symlink in frozen inputs: " + str(path)) + if path.is_file(): + relative = str(path.relative_to(root)) + if relative not in pins: + need(not exact, "Undeclared frozen input: " + relative) + continue + raw = path.read_bytes() + expected = pins[relative][0] if type(pins[relative]) is list else pins[relative] + raw_digest = sha(raw) + need(raw_digest == expected, "Frozen input digest changed: " + relative) + files[relative] = {"sha256": raw_digest, "mode": stat.S_IMODE(path.stat().st_mode), "bytes": len(raw)} + need(set(files) == set(pins), "Frozen input inventory incomplete") + return files + + +def typed(value): + """Lossless full return representation, including order and exact types.""" + kind = type(value) + if kind is Fraction: + return ["Fraction", value.numerator, value.denominator] + if value is None: + return ["None"] + if kind is bool: + return ["bool", value] + if kind is int: + return ["int", str(value)] + if kind is float: + return ["float", value.hex()] + if kind is str: + return ["str", value] + if kind is list or kind is tuple: + return [kind.__name__, [typed(item) for item in value]] + if kind is dict: + return ["dict", [[typed(key), typed(item)] for key, item in value.items()]] + raise TypeError("Unsupported exact full-certificate return type: " + kind.__name__) + + +class Phases: + """Broad phase observations; no per-arithmetic resource sampling. + + Every call retains the old timing fields. Memory samples are paid by both + arms, including nested side_construction so snapshots/retirement are visible. + """ + def __init__(self): + self.rows = {} + + @staticmethod + def memory(): + with open("/proc/self/status", "rb") as stream: + raw = stream.read(65537) + need(len(raw) <= 65536, "Process status diagnostic exceeded its bound") + current = None + for line in raw.splitlines(): + if line.startswith(b"VmRSS:"): + fields = line.split() + need(len(fields) == 3 and fields[2] == b"kB", "Unexpected process RSS diagnostic units") + current = int(fields[1]) * 1024 + break + need(current is not None, "Current process RSS diagnostic unavailable") + highwater = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss * 1024 + return {"current_vmrss_bytes": current, "process_ru_maxrss_bytes": highwater} + + def call(self, name, function, *args, **kwargs): + wall, used = time.perf_counter(), cpu() + memory_before = self.memory() + primary_failure = False + try: + return function(*args, **kwargs) + except BaseException: + primary_failure = True + raise + finally: + memory_after, memory_error = None, None + try: + memory_after = self.memory() + except BaseException as error: + # Do not replace an original failure with diagnostic failure. + memory_error = {"type": type(error).__name__} + if not primary_failure: + raise + row = self.rows.setdefault(name, {"calls": 0, "wall_seconds": 0.0, + "cpu_seconds_with_children": 0.0, + "memory_samples": [], + "memory_semantics": "VmRSS is current resident bytes; ru_maxrss is process high-water bytes; neither is an additive phase peak"}) + row["calls"] += 1 + row["memory_samples"].append({"before": memory_before, "after": memory_after, + "diagnostic_error": memory_error}) + row["wall_seconds"] += time.perf_counter() - wall + row["cpu_seconds_with_children"] += cpu() - used + + def wrap(self, owner, attribute, name): + original = getattr(owner, attribute) + def observed(*args, **kwargs): + return self.call(name, original, *args, **kwargs) + setattr(owner, attribute, observed) + return original, observed + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--frozen-root", type=Path, default=HERE / "frozen") + parser.add_argument("--reference", type=Path, default=HERE / "reference/certificates/complex-network.json") + parser.add_argument("--lanes", choices=("baseline", "candidate"), required=True) + parser.add_argument("--finite-only", action="store_true") + parser.add_argument("--output", type=Path, required=True, help="New external directory; every write stays below it") + parser.add_argument("--anchor", type=Path, default=HERE / "anchor.json") + args = parser.parse_args() + args.data_lanes = args.lanes + args.lanes = "all" # Both comparison arms retain the complete original native/bookkeeping baseline. + if args.data_lanes == "transport": + need(args.frozen_root == HERE / "frozen" and + args.reference == HERE / "reference/certificates/complex-network.json" and + args.anchor == HERE / "anchor.json", "Transport uses only the original fixed historical inputs") + data_adapters.transport(ROUND, HERE, args.output) + return + inventory = candidate_inventory if args.data_lanes == "candidate" else original_inventory + args.mode = "candidate" # Every new arm starts from the original native C configuration. + need(args.finite_only or sys.flags.optimize == 0, "Every full-caller mode requires original assertions") + need(sys.implementation.name == "cpython" and sys.version_info[:2] == (3, 12), "Frozen CPython 3.12 required") + data_adapters.require_execution_contract(args.data_lanes, args.finite_only) + need((args.mode == "profile") == (args.anchor is None), "Profile creates the anchor; both benchmark arms require --anchor") + frozen, reference = args.frozen_root.resolve(), args.reference.resolve() + output = args.output.resolve() + need(str(output) == _INITIAL_OUTPUT and output.is_dir() and not output.is_symlink() and + {path.name for path in output.iterdir()} == {'initial-tcb-controls'} and + (output / 'initial-tcb-controls').is_dir() and + not (output / 'initial-tcb-controls').is_symlink() and + not list((output / 'initial-tcb-controls').iterdir()), + "Early TCB output ownership or fresh control directory changed") + need(not output.is_relative_to(HERE) and not output.is_relative_to(frozen), "Output must be outside immutable sources") + need(reference.is_file() and not reference.is_symlink(), "Reference certificate missing or symlinked") + source_pin_bytes = (HERE / "SOURCE-PINS.json").read_bytes() + need(sha(source_pin_bytes) == PIN_SHA, "Source inventory pin changed") + pins = json.loads(source_pin_bytes) + need(len(pins) == 32, "Frozen closure must contain twelve scripts, manifest and nineteen payloads") + reference_bytes = reference.read_bytes() + need(sha(reference_bytes) == REFERENCE_SHA, "Original full certificate reference changed") + driver_before = Path(__file__).read_bytes() + new_custody_before = adapters.custody(ROUND, args.lanes) + data_custody_before = data_adapters.custody(ROUND) + reference_driver_before = (HERE / "full_driver.py").read_bytes() + need(sha(reference_driver_before) == REFERENCE_DRIVER_SHA, "Reference driver pin changed") + anchor_bytes = None if args.anchor is None else args.anchor.read_bytes() + expected_anchor = None if anchor_bytes is None else json.loads(anchor_bytes) + if expected_anchor is not None: + need(expected_anchor.get("schema") == "gf2-full-network-anchor-v1" and + expected_anchor.get("base_commit") == BASE and expected_anchor.get("source_pin_sha256") == PIN_SHA and + expected_anchor.get("driver_sha256") == REFERENCE_DRIVER_SHA and + expected_anchor.get("engine_pins") == ENGINE_PINS, + "Anchor source/driver/engine identity differs; no benchmark permitted") + _EXECUTION['output'] = output + compiler_tmp = output / "compiler-tmp" + compiler_tmp.mkdir() + os.environ["TMPDIR"] = str(compiler_tmp) + phases = Phases() + (output / 'initial-native-tcb.json').write_bytes(canonical(INITIAL_NATIVE_TCB_RECEIPT) + b'\n') + (output / 'initial-tcb-controls' / 'receipt.json').write_bytes(canonical(INITIAL_NATIVE_TCB_CONTROLS) + b'\n') + frozen_before = phases.call("input_custody", inventory, frozen, pins) + engine_before = phases.call("engine_custody", inventory, HERE / "engine", ENGINE_PINS) + manifest = json.loads((frozen / "upstream/manifest.json").read_bytes()) + need(manifest["commit"] == UPSTREAM and len(manifest["files"]) == 19, "Wrong pinned upstream manifest") + need({"upstream/" + name for name in manifest["files"]} == + {name for name in pins if name.startswith("upstream/") and name != "upstream/manifest.json"}, + "Source verifier payload closure changed") + for name, info in manifest["files"].items(): + need(info["sha256"] == pins["upstream/" + name][0], "Manifest payload hash differs from independent frozen pin") + + runtime, engine = output / "runtime-root", output / "engine" + phases.call("fresh_root_copy", shutil.copytree, frozen, runtime) + phases.call("fresh_engine_copy", shutil.copytree, HERE / "engine", engine) + # copytree retains readonly source directory permissions. Only this new + # private root is made writable for the original CLI certificate output. + runtime.chmod(0o755) + (runtime / "certificates").mkdir() + runtime_before = inventory(runtime, pins) + copied_engine_before = inventory(engine, ENGINE_PINS) + need(runtime_before == frozen_before and copied_engine_before == engine_before, "Copy changed input bytes or modes") + for name in ("complex_network.py", "complex_circuit.py"): + need((engine / "source" / name).read_bytes() == (runtime / "scripts" / name).read_bytes(), + "PR5929 engine/source differs from the full caller closure") + script_names = {Path(name).stem for name in pins if name.startswith("scripts/")} + engine_names = {"native_backend", "finite_controls", "compare_side_verifier", "profile_side_verifier"} + need(not (script_names | engine_names) & set(sys.modules), "Scientific module already loaded; fresh process required") + sys.path[:0] = [str(engine), str(runtime / "scripts")] + # BEGIN evaluated dispatch arguments scientific_driver:462 + _ca_args = (str(engine / 'native_backend.py'), ENGINE_PINS['native_backend.py'], 'native_backend') + _ca_kwargs = {'kind': 'backend'} + # END evaluated dispatch arguments scientific_driver:462 + # BEGIN caller admission scientific_driver:462 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:462 + backend, backend_handle = phases.call('cold_engine_import', _ca_dispatch, 0, *_ca_args, **_ca_kwargs) + # BEGIN evaluated dispatch arguments scientific_driver:465 + _ca_args = (_INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'capture_backend_factory_environment', backend) + _ca_kwargs = {'cold_authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'backend_handle': backend_handle, 'cache_handle': _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'bootstrap_root': _CAPTURED_BOOTSTRAP_ROOT, 'bootstrap_capability': _CAPTURED_BOOTSTRAP_CAPABILITY, 'bootstrap_api': _CAPTURED_BOOTSTRAP_API} + # END evaluated dispatch arguments scientific_driver:465 + # BEGIN caller admission scientific_driver:465 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:465 + factory_environment = phases.call('cold_backend_factory_environment', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + comparison = importlib.import_module("compare_side_verifier") + native = None + finite = None + build = None + if args.mode == "candidate": + packet = phases.call("cold_native_metadata_build", native_packet.prepare, + ROUND, output, data_custody_before, _CAPTURED_BOOTSTRAP_ROOT, + _CAPTURED_BOOTSTRAP_CAPABILITY, _CAPTURED_BOOTSTRAP_API) + _EXECUTION['packet'] = packet + packet['controls']['native_initial_tcb'] = INITIAL_NATIVE_TCB_CONTROLS + native, build = phases.call("cold_compile_link_load", backend.build_native, output / "cold-build") + # BEGIN evaluated dispatch arguments scientific_driver:484 + _ca_args = (_INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'prepare', ROUND, backend, backend_handle, native, output, args.lanes, phases, _INITIAL_COLD_AUTHORITY, _INITIAL_INTEGRATION_HANDLES['adapters'], new_custody_before) + _ca_kwargs = {'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR} + # END evaluated dispatch arguments scientific_driver:484 + # BEGIN caller admission scientific_driver:484 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:484 + extensions = phases.call('new_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + phases.call("all_native_metadata_and_preload_controls", native_packet.run_controls, packet, phases) + finite = phases.call("all_native_finite_independent_controls", importlib.import_module("finite_controls").run_controls, native) + phases.call("all_new_controls", adapters.run_controls, extensions, backend, native, phases) + # BEGIN evaluated dispatch arguments scientific_driver:492 + _ca_args = (_INITIAL_INTEGRATION_HANDLES['data_adapters'], 'prepare', ROUND, backend, comparison, extensions, args.data_lanes, data_custody_before, packet) + _ca_kwargs = {'authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'integration_handles': _INITIAL_INTEGRATION_HANDLES, 'backend_handle': backend_handle, 'adapters_handle': _INITIAL_INTEGRATION_HANDLES['adapters'], 'setup_handle': _INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'factory_environment': factory_environment, 'preloaded_cache': (_INITIAL_INTEGRATION_MODULES['_h25_data_cache'], _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'])} + # END evaluated dispatch arguments scientific_driver:492 + # BEGIN caller admission scientific_driver:492 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:492 + data_state = phases.call('data_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + _EXECUTION['state'] = data_state + phases.call("all_data_controls", data_adapters.run_controls, + data_state, native, output, phases, HERE / "full_driver.py", candidate_inventory, extensions) + (output / "finite-controls.json").write_bytes(canonical(finite) + b"\n") + + if args.finite_only: + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + # LAST native/scientific call. Everything below is source or receipt work. + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + need(inventory(frozen, pins) == frozen_before and inventory(HERE / "engine", ENGINE_PINS) == engine_before, "Finite immutable source custody changed") + need(inventory(runtime, pins) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, "Finite copied source custody changed") + need(adapters.custody(ROUND, args.lanes) == new_custody_before, "Finite new source custody changed") + need(data_adapters.custody(ROUND) == data_custody_before, "Finite data source custody changed") + result = {"status": "H25_DATA_HANDLING_FINITE_PASS", "lanes": args.data_lanes, + "data_handling": data_adapters.finite_receipt(data_state), + "data_source_custody": data_custody_before, + "optimized": sys.flags.optimize, "original_controls": finite, + "new_controls": extensions["controls"], "new_source_custody": new_custody_before, + "driver_sha256": sha(driver_before), + "initial_native_tcb": INITIAL_NATIVE_TCB_RECEIPT, + "native_packet": native_packet.receipt(packet), + "reference_driver_sha256": REFERENCE_DRIVER_SHA, "phases": phases.rows} + (output / "receipt.json").write_text(json.dumps(result, indent=2, sort_keys=True) + "\n") + print(json.dumps(result, sort_keys=True)) + return + + circuit_module = phases.call("cold_complex_module_load", backend.load_source, "complex_circuit") + sys.modules["complex_circuit"] = circuit_module + rank_calls = [] + complement = extensions["trace_type"](circuit_module.Label) + phases.call("private_set_and_data_adapter_installation", data_adapters.install_circuit, + data_state, extensions, circuit_module, comparison) + side_writer = data_adapters.scientific_writer(data_state) + binding = None + captures = {} + phases.wrap(circuit_module.ComplexSideCircuit, "__init__", "side_construction") + phases.wrap(circuit_module.Checks, "__init__", "checks_initialization") + phases.wrap(circuit_module, "compile_roles", "compile_roles") + phases.wrap(circuit_module.Checks, "verify_map", "verify_map") + phases.wrap(circuit_module.Checks, "verify_labels", "verify_labels") + original_roles = circuit_module.verify_role_frames + def observe_roles(c, checks, code=None): + need("side" not in captures and code is not None, "Unexpected role-frame invocation") + result = phases.call("verify_role_frames", original_roles, c, checks, code) + captures["side"] = (c, checks, code, result) + return result + circuit_module.verify_role_frames = observe_roles + + certify = phases.call("cold_certify_import", importlib.import_module, "certify") + phases.wrap(certify, "verify_sources", "original_upstream_verify_sources") + prepare = phases.call("cold_prepare_import", importlib.import_module, "prepare_layers") + search = importlib.import_module("search_network") + phases.wrap(search, "log_integer_bounds", "full_log_integer_bounds") + original_serializable = prepare.serializable + depth = 0 + def observe_serializable(value): + nonlocal depth + outer = depth == 0 + if outer: + need("full_return" not in captures and type(value) is dict, "Unexpected outer serialization") + captures["full_return"] = value + depth += 1 + try: + # Recursion still delegates the original serializable exactly once + # per value; only the outer call is captured/timed. + if outer: + return phases.call("original_serializable", original_serializable, value) + return original_serializable(value) + finally: + depth -= 1 + prepare.serializable = observe_serializable + + # CS/Checks/phase/trace observers are final before either new guard captures them. + binding = phases.call("final_native_binding", data_adapters.bind_native, + data_state, backend, circuit_module, native, rank_calls, complement) + phases.call("construction_lease_sealing", data_adapters.seal, data_state) + phases.call("private_set_lease_sealing", adapters.seal, extensions) + caller = runtime / "scripts/complex_network.py" + old_argv = sys.argv + stdout = io.StringIO() + try: + phases.call("final_private_environment_and_arming", data_adapters.arm, data_state, extensions) + sys.argv = [str(caller)] + with redirect_stdout(stdout): + namespace = phases.call("complete_original_cli", runpy.run_path, str(caller), run_name="__main__") + finally: + sys.argv = old_argv + adapters.disarm(extensions) + cli_stdout = stdout.getvalue() + need(cli_stdout == EXPECTED_STDOUT, "Original CLI stdout changed") + certificate_bytes = (runtime / "certificates/complex-network.json").read_bytes() + need(certificate_bytes == reference_bytes, "Original CLI certificate bytes differ from the pinned reference") + need(sys.modules["complex_circuit"] is circuit_module and + namespace["ComplexSideCircuit"] is circuit_module.ComplexSideCircuit and + namespace["Checks"] is circuit_module.Checks and namespace["compile_roles"] is circuit_module.compile_roles and + namespace["verify_role_frames"] is observe_roles and namespace["serializable"] is observe_serializable, + "Caller used a different scientific module or observation binding") + need(captures.keys() == {"side", "full_return"}, "Missing exact caller observations") + c, checks, code, role_result = captures["side"] + full_return = captures["full_return"] + need(full_return["role_frames"] is role_result and full_return["upstream_commit"] == UPSTREAM, + "Role return or actual source verification boundary changed") + for name in ("side_construction", "checks_initialization", "compile_roles", "verify_map", "verify_labels", + "verify_role_frames", "original_upstream_verify_sources", "full_log_integer_bounds", + "original_serializable", "complete_original_cli"): + need(phases.rows.get(name, {}).get("calls") == 1, "Original phase was omitted or repeated: " + name) + imports = {} + for name in script_names - {"complex_network"}: + module = sys.modules.get(name) + expected_path = engine / "source/complex_circuit.py" if name == "complex_circuit" else runtime / "scripts" / (name + ".py") + need(module is not None and Path(module.__file__).resolve() == expected_path.resolve(), "Unpinned scientific import: " + name) + imports[name] = str(module.__file__) + if binding is not None: + binding["runtime_guard"].check() + need(binding["counters"] == {"complement_native": 238685, "complement_fallback": 0, + "gram_native": 59959, "gram_fallback": 0}, "Native full-call coverage changed") + + side_result = {key: full_return[key] for key in ("circuit", "side_map", "labels", "role_frames")} + witness = { + "support": c.support, "args": c.args, "kind": c.kind, "active": sorted(c.active), + "pieces": [(target, node, (coefficient.numerator, coefficient.denominator)) for target, node, coefficient in c.pieces], + "labels": [(key, list(label.basis.items()), label.dim, label.key) for key, label in checks.cache.items()], + "code": {"roles": code["roles"], "gates": code["gates"], "sources": list(code["sources"].items()), + "outputs": list(code["outputs"].items())}, + } + side_output = output / "side-observations" + side_output.mkdir() + side_receipt = phases.call("identical_lossless_side_serialization", side_writer, + side_output, side_result, witness, rank_calls) + complement_receipt = complement.receipt() + need(complement_receipt == COMPLEMENT_EXPECTED, "Every ordered complement observation must match PR5929") + full_typed_bytes = canonical(typed(full_return)) + (output / "full-return.lossless.json").write_bytes(full_typed_bytes) + (output / "original-stdout.txt").write_text(cli_stdout, encoding="utf-8") + (output / "complement-transcript.json").write_bytes(canonical(complement_receipt) + b"\n") + science = { + "full_cli_certificate_sha256": sha(certificate_bytes), "full_cli_stdout_sha256": sha(cli_stdout.encode("utf-8")), + "full_return_lossless_sha256": sha(full_typed_bytes), "side": side_receipt, + "ordered_complements": complement_receipt, "upstream_commit": UPSTREAM, + } + anchor = {"schema": "gf2-full-network-anchor-v1", "base_commit": BASE, "source_pin_sha256": PIN_SHA, + "driver_sha256": REFERENCE_DRIVER_SHA, "engine_pins": ENGINE_PINS, "science": science} + if expected_anchor is not None: + need(anchor == expected_anchor, "Complete certificate/types/ordered observations differ from frozen anchor") + else: + (output / "anchor.json").write_bytes(canonical(anchor) + b"\n") + need(inventory(frozen, pins) == frozen_before and inventory(HERE / "engine", ENGINE_PINS) == engine_before, + "Immutable source bytes/modes changed") + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, + "Runtime scientific source bytes/modes changed") + runtime_files = {str(path.relative_to(runtime)) for path in runtime.rglob("*") if path.is_file()} + need(runtime_files == set(pins) | {"certificates/complex-network.json"}, "Unexpected full-caller file side effect") + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and + (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), "Driver/reference/anchor changed during run") + need(adapters.custody(ROUND, args.lanes) == new_custody_before, "New source custody changed") + # Snapshot final scientific bookkeeping before the deliberately terminal late hook. + bookkeeping_receipt = adapters.receipt(extensions) + data_receipt = phases.call("data_finalization", data_adapters.finish, data_state, binding) + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + # LAST native/scientific call. No owner, root API, provider, or native guard follows. + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + # Honest source custody and receipt work continue after the terminal boundary. + need(data_adapters.custody(ROUND) == data_custody_before, "Data source custody changed") + need(adapters.custody(ROUND, args.lanes) == new_custody_before, "Post-late original source custody changed") + need(inventory(frozen, pins) == frozen_before and inventory(HERE / "engine", ENGINE_PINS) == engine_before, + "Post-late immutable source custody changed") + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, + "Post-late copied source custody changed") + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and + (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), "Post-late driver/reference/anchor changed") + receipt = { + "new_source_custody": new_custody_before, + "status": "FULL_NETWORK_PROFILE_ANCHOR_PASS" if args.mode == "profile" else "FULL_NETWORK_COMPLETE_PASS", + "mode": args.mode, "lanes": args.data_lanes, "bookkeeping": bookkeeping_receipt, + "data_handling": data_receipt, "data_source_custody": data_custody_before, + "reference_driver_sha256": REFERENCE_DRIVER_SHA, + "science": science, "base_commit": BASE, "native_predecessor_pr": 5995, + "driver_sha256": sha(driver_before), "source_pin_sha256": PIN_SHA, + "frozen_custody": frozen_before, "engine_custody": engine_before, "scientific_imports": imports, + "build": build, "finite_controls": finite, + "initial_native_tcb": INITIAL_NATIVE_TCB_RECEIPT, + "native_packet": native_packet.receipt(packet), + "private_root_permission": "runtime-root is0755; copied input file modes are retained and checked; immutable stages are never chmodded", + "compiler_tmpdir": str(compiler_tmp), + "native_calls": None if binding is None else dict(binding["counters"]), + "phases": phases.rows, "driver_wall_seconds_after_initial_tcb_before_receipt": time.perf_counter() - START_WALL, + "process_and_compiler_cpu_seconds_before_receipt": cpu(), + "environment": {"python": sys.version, "executable": sys.executable, "platform": sys.platform}, + "measurement": "Parent outer guard is authoritative and includes pristine root startup, initial native TCB authentication, early cold source authority capture and every factory dependency/product check, three cold metadata compilations plus original cold native/trace builds, every old and new control in BOTH arms, all candidate production admission/guards, IO and terminal cleanup. Baseline receives the complete same control union. Driver wall diagnostic starts after initial TCB and cold authority capture and is not total process wall. Broad phase samples are nested, not additive; VmRSS is current RSS and ru_maxrss is process high-water. Eager witnesses and original observations remain; full funding and equality gates are separate and currently closed.", + "scope": "Complete frozen historical complex-network CLI with retained observations; conditional certificate only. No bare-CLI factor, selected-frontier, new kappa or PR5864 speed claim.", + } + (output / "receipt.json").write_text(json.dumps(receipt, indent=2, sort_keys=True) + "\n") + sys.stdout.write(cli_stdout) + print(json.dumps({"status": receipt["status"], "mode": args.mode, "science": science, + "wall_seconds": receipt["driver_wall_seconds_after_initial_tcb_before_receipt"], + "cpu_seconds_with_compiler": receipt["process_and_compiler_cpu_seconds_before_receipt"], + "phases": phases.rows}, sort_keys=True)) + + +def _run_with_stop_evidence(): + try: + main() + except BaseException as primary_error: + # Nothing in cleanup or evidence assembly may replace this primary object. + try: + state = _EXECUTION['state'] + cleanup_errors = [] + try: + cleanup_errors = data_adapters.cleanup_owned(state) + except BaseException as cleanup_error: + cleanup_errors.append({'type': type(cleanup_error).__name__, 'message': str(cleanup_error)}) + stop = {'schema': 'h25-combined-v2-stop-v1', 'status': 'STOP', + 'primary_error': {'type': type(primary_error).__name__, 'message': str(primary_error)}, + 'primary_cause': None if primary_error.__cause__ is None else { + 'type': type(primary_error.__cause__).__name__, 'message': str(primary_error.__cause__)}, + 'cleanup_errors': cleanup_errors, + 'data': data_adapters.stop_diagnostics(state), + 'native_packet': None if _EXECUTION['packet'] is None else native_packet.receipt(_EXECUTION['packet']), + 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT} + output = _EXECUTION['output'] + if output is not None: + with (output / 'STOP.json').open('x', encoding='utf-8') as stream: + stream.write(json.dumps(stop, sort_keys=True, indent=2) + '\n') + except BaseException as evidence_error: + # Parent retains an independent process transcript even if this fails. + try: + sys.stderr.write('STOP evidence write failed: ' + type(evidence_error).__name__ + '\n') + except BaseException: + pass + raise + + + + +def _epoch_cli_boundary(phases, data_state, extensions, caller, stdout, invocation_token, old_argv): + _epoch_cli_primary = None + _epoch_cli_argv_error = None + _epoch_cli_disarm_error = None + _epoch_cli_retirement_error = None + _epoch_cli_record = None + try: + try: + _epoch_cli_record = {'primary': None, 'argv_error': None, 'disarm_error': None, 'retirement_error': None, 'outer_retirement_error': None, 'uncertain': False, 'argv_owner': old_argv, 'retirement_channel': {'started': False, 'error': None, 'journal_error': None, 'acknowledged': False}, 'outer_retirement_channel': {'started': False, 'error': None, 'journal_error': None, 'acknowledged': False}} + data_state['epoch_cli_cleanup'] = _epoch_cli_record + phases.call('final_private_environment_and_arming', data_adapters.arm, data_state, extensions) + if data_state['enabled']: + data_adapters.epoch_arm(data_state, invocation_token) + sys.argv = [str(caller)] + with redirect_stdout(stdout): + namespace = phases.call('complete_original_cli', runpy.run_path, str(caller), run_name='__main__') + return namespace + except BaseException as _epoch_cli_error: + _epoch_cli_primary = _epoch_cli_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_cli_error + raise + finally: + try: + sys.argv = old_argv + except BaseException as _epoch_argv_error: + _epoch_cli_argv_error = _epoch_argv_error + if _epoch_cli_record is not None: + _epoch_cli_record['argv_error'] = _epoch_argv_error + _epoch_cli_record['uncertain'] = True + if _epoch_cli_primary is None: + _epoch_cli_primary = _epoch_argv_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_argv_error + try: + adapters.disarm(extensions) + except BaseException as _epoch_disarm_error: + _epoch_cli_disarm_error = _epoch_disarm_error + if _epoch_cli_record is not None: + _epoch_cli_record['disarm_error'] = _epoch_disarm_error + _epoch_cli_record['uncertain'] = True + if _epoch_cli_primary is None: + _epoch_cli_primary = _epoch_disarm_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_disarm_error + raise + if _epoch_cli_argv_error is not None: + raise _epoch_cli_primary + finally: + try: + data_adapters.epoch_retire(data_state, 'whole-cli-terminal', _epoch_cli_primary, _epoch_cli_disarm_error, _epoch_cli_argv_error, None if _epoch_cli_record is None else _epoch_cli_record['retirement_channel'], 'inner') + except BaseException as _epoch_retirement_error: + _epoch_cli_retirement_error = _epoch_retirement_error + if _epoch_cli_record is not None: + _epoch_cli_record['retirement_error'] = _epoch_retirement_error + _epoch_cli_record['uncertain'] = True + if _epoch_cli_primary is None: + _epoch_cli_primary = _epoch_retirement_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_retirement_error + raise + +def main_epoch(): + _epoch_invocation = object() + _epoch_driver_origin = data_adapters.epoch_driver_entry(_INITIAL_COLD_AUTHORITY, _INITIAL_COLD_CALLER_DESCRIPTOR, _INITIAL_EPOCH_BUNDLE[3], main_epoch, Phases, _epoch_invocation) + data_state = None + _epoch_primary = None + _epoch_outer_retirement_error = None + _epoch_outer_cleanup = None + try: + _epoch_outer_cleanup = {'primary': None, 'retirement_error': None, 'uncertain': False, 'attempted': False} + _EXECUTION['epoch_outer_cleanup'] = _epoch_outer_cleanup + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--frozen-root', type=Path, default=HERE / 'frozen') + parser.add_argument('--reference', type=Path, default=HERE / 'reference/certificates/complex-network.json') + parser.add_argument('--lanes', choices=('baseline', 'candidate'), required=True) + parser.add_argument('--finite-only', action='store_true') + parser.add_argument('--output', type=Path, required=True, help='New external directory; every write stays below it') + parser.add_argument('--anchor', type=Path, default=HERE / 'anchor.json') + args = parser.parse_args() + args.data_lanes = args.lanes + args.lanes = 'all' + if args.data_lanes == 'transport': + need(args.frozen_root == HERE / 'frozen' and args.reference == HERE / 'reference/certificates/complex-network.json' and (args.anchor == HERE / 'anchor.json'), 'Transport uses only the original fixed historical inputs') + data_adapters.transport(ROUND, HERE, args.output) + return + inventory = candidate_inventory if args.data_lanes == 'candidate' else original_inventory + args.mode = 'candidate' + need(args.finite_only or sys.flags.optimize == 0, 'Every full-caller mode requires original assertions') + need(sys.implementation.name == 'cpython' and sys.version_info[:2] == (3, 12), 'Frozen CPython 3.12 required') + data_adapters.require_execution_contract(args.data_lanes, args.finite_only) + need((args.mode == 'profile') == (args.anchor is None), 'Profile creates the anchor; both benchmark arms require --anchor') + frozen, reference = (args.frozen_root.resolve(), args.reference.resolve()) + output = args.output.resolve() + need(str(output) == _INITIAL_OUTPUT and output.is_dir() and (not output.is_symlink()) and ({path.name for path in output.iterdir()} == {'initial-tcb-controls'}) and (output / 'initial-tcb-controls').is_dir() and (not (output / 'initial-tcb-controls').is_symlink()) and (not list((output / 'initial-tcb-controls').iterdir())), 'Early TCB output ownership or fresh control directory changed') + need(not output.is_relative_to(HERE) and (not output.is_relative_to(frozen)), 'Output must be outside immutable sources') + need(reference.is_file() and (not reference.is_symlink()), 'Reference certificate missing or symlinked') + source_pin_bytes = (HERE / 'SOURCE-PINS.json').read_bytes() + need(sha(source_pin_bytes) == PIN_SHA, 'Source inventory pin changed') + pins = json.loads(source_pin_bytes) + need(len(pins) == 32, 'Frozen closure must contain twelve scripts, manifest and nineteen payloads') + reference_bytes = reference.read_bytes() + need(sha(reference_bytes) == REFERENCE_SHA, 'Original full certificate reference changed') + driver_before = Path(__file__).read_bytes() + new_custody_before = adapters.custody(ROUND, args.lanes) + data_custody_before = data_adapters.custody(ROUND) + reference_driver_before = (HERE / 'full_driver.py').read_bytes() + need(sha(reference_driver_before) == REFERENCE_DRIVER_SHA, 'Reference driver pin changed') + anchor_bytes = None if args.anchor is None else args.anchor.read_bytes() + expected_anchor = None if anchor_bytes is None else json.loads(anchor_bytes) + if expected_anchor is not None: + need(expected_anchor.get('schema') == 'gf2-full-network-anchor-v1' and expected_anchor.get('base_commit') == BASE and (expected_anchor.get('source_pin_sha256') == PIN_SHA) and (expected_anchor.get('driver_sha256') == REFERENCE_DRIVER_SHA) and (expected_anchor.get('engine_pins') == ENGINE_PINS), 'Anchor source/driver/engine identity differs; no benchmark permitted') + _EXECUTION['output'] = output + compiler_tmp = output / 'compiler-tmp' + compiler_tmp.mkdir() + os.environ['TMPDIR'] = str(compiler_tmp) + phases = Phases() + (output / 'initial-native-tcb.json').write_bytes(canonical(INITIAL_NATIVE_TCB_RECEIPT) + b'\n') + (output / 'initial-tcb-controls' / 'receipt.json').write_bytes(canonical(INITIAL_NATIVE_TCB_CONTROLS) + b'\n') + frozen_before = phases.call('input_custody', inventory, frozen, pins) + engine_before = phases.call('engine_custody', inventory, HERE / 'engine', ENGINE_PINS) + manifest = json.loads((frozen / 'upstream/manifest.json').read_bytes()) + need(manifest['commit'] == UPSTREAM and len(manifest['files']) == 19, 'Wrong pinned upstream manifest') + need({'upstream/' + name for name in manifest['files']} == {name for name in pins if name.startswith('upstream/') and name != 'upstream/manifest.json'}, 'Source verifier payload closure changed') + for name, info in manifest['files'].items(): + need(info['sha256'] == pins['upstream/' + name][0], 'Manifest payload hash differs from independent frozen pin') + runtime, engine = (output / 'runtime-root', output / 'engine') + phases.call('fresh_root_copy', shutil.copytree, frozen, runtime) + phases.call('fresh_engine_copy', shutil.copytree, HERE / 'engine', engine) + runtime.chmod(493) + (runtime / 'certificates').mkdir() + runtime_before = inventory(runtime, pins) + copied_engine_before = inventory(engine, ENGINE_PINS) + need(runtime_before == frozen_before and copied_engine_before == engine_before, 'Copy changed input bytes or modes') + for name in ('complex_network.py', 'complex_circuit.py'): + need((engine / 'source' / name).read_bytes() == (runtime / 'scripts' / name).read_bytes(), 'PR5929 engine/source differs from the full caller closure') + script_names = {Path(name).stem for name in pins if name.startswith('scripts/')} + engine_names = {'native_backend', 'finite_controls', 'compare_side_verifier', 'profile_side_verifier'} + need(not (script_names | engine_names) & set(sys.modules), 'Scientific module already loaded; fresh process required') + sys.path[:0] = [str(engine), str(runtime / 'scripts')] + _ca_args = (str(engine / 'native_backend.py'), ENGINE_PINS['native_backend.py'], 'native_backend') + _ca_kwargs = {'kind': 'backend'} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + backend, backend_handle = phases.call('cold_engine_import', _ca_dispatch, 0, *_ca_args, **_ca_kwargs) + _ca_args = (_INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'capture_backend_factory_environment', backend) + _ca_kwargs = {'cold_authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'backend_handle': backend_handle, 'cache_handle': _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'bootstrap_root': _CAPTURED_BOOTSTRAP_ROOT, 'bootstrap_capability': _CAPTURED_BOOTSTRAP_CAPABILITY, 'bootstrap_api': _CAPTURED_BOOTSTRAP_API} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + factory_environment = phases.call('cold_backend_factory_environment', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + comparison = importlib.import_module('compare_side_verifier') + native = None + finite = None + build = None + if args.mode == 'candidate': + packet = phases.call('cold_native_metadata_build', native_packet.prepare, ROUND, output, data_custody_before, _CAPTURED_BOOTSTRAP_ROOT, _CAPTURED_BOOTSTRAP_CAPABILITY, _CAPTURED_BOOTSTRAP_API) + _EXECUTION['packet'] = packet + packet['controls']['native_initial_tcb'] = INITIAL_NATIVE_TCB_CONTROLS + native, build = phases.call('cold_compile_link_load', backend.build_native, output / 'cold-build') + _ca_args = (_INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'prepare', ROUND, backend, backend_handle, native, output, args.lanes, phases, _INITIAL_COLD_AUTHORITY, _INITIAL_INTEGRATION_HANDLES['adapters'], new_custody_before) + _ca_kwargs = {'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + extensions = phases.call('new_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + phases.call('all_native_metadata_and_preload_controls', native_packet.run_controls, packet, phases) + finite = phases.call('all_native_finite_independent_controls', importlib.import_module('finite_controls').run_controls, native) + phases.call('all_new_controls', adapters.run_controls, extensions, backend, native, phases) + _ca_args = (_INITIAL_INTEGRATION_HANDLES['data_adapters'], 'prepare', ROUND, backend, comparison, extensions, args.data_lanes, data_custody_before, packet) + _ca_kwargs = {'authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'integration_handles': _INITIAL_INTEGRATION_HANDLES, 'backend_handle': backend_handle, 'adapters_handle': _INITIAL_INTEGRATION_HANDLES['adapters'], 'setup_handle': _INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'factory_environment': factory_environment, 'preloaded_cache': (_INITIAL_INTEGRATION_MODULES['_h25_data_cache'], _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'])} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + data_state = phases.call('data_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + _EXECUTION['state'] = data_state + phases.call('all_data_controls', data_adapters.run_controls, data_state, native, output, phases, HERE / 'full_driver.py', candidate_inventory, extensions) + (output / 'finite-controls.json').write_bytes(canonical(finite) + b'\n') + if args.finite_only: + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + need(inventory(frozen, pins) == frozen_before and inventory(HERE / 'engine', ENGINE_PINS) == engine_before, 'Finite immutable source custody changed') + need(inventory(runtime, pins) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, 'Finite copied source custody changed') + need(adapters.custody(ROUND, args.lanes) == new_custody_before, 'Finite new source custody changed') + need(data_adapters.custody(ROUND) == data_custody_before, 'Finite data source custody changed') + result = {'status': 'H25_DATA_HANDLING_FINITE_PASS', 'lanes': args.data_lanes, 'data_handling': data_adapters.finite_receipt(data_state), 'data_source_custody': data_custody_before, 'optimized': sys.flags.optimize, 'original_controls': finite, 'new_controls': extensions['controls'], 'new_source_custody': new_custody_before, 'driver_sha256': sha(driver_before), 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT, 'native_packet': native_packet.receipt(packet), 'reference_driver_sha256': REFERENCE_DRIVER_SHA, 'phases': phases.rows} + (output / 'receipt.json').write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + print(json.dumps(result, sort_keys=True)) + return + if data_state['enabled']: + circuit_module, _epoch_load_ticket = phases.call('cold_complex_module_load', data_adapters.epoch_load, data_state, _INITIAL_EPOCH_BUNDLE[3]) + else: + circuit_module = phases.call('cold_complex_module_load', backend.load_source, 'complex_circuit') + sys.modules['complex_circuit'] = circuit_module + rank_calls = [] + complement = extensions['trace_type'](circuit_module.Label) + if data_state['enabled']: + _epoch_context = {'data_handle': _INITIAL_INTEGRATION_HANDLES['data_adapters'], 'data_module': data_adapters, 'phase_function': Phases.wrap, 'phase_class': Phases, 'phase_owner': phases, 'driver_function': main_epoch, 'driver_record': _epoch_driver_origin, 'invocation_token': _epoch_invocation, 'disposition_state': data_state} + phases.call('private_set_and_data_adapter_installation', data_adapters.install_epoch_circuit, data_state, extensions, circuit_module, comparison, _INITIAL_EPOCH_BUNDLE[3], _epoch_load_ticket, _epoch_context) + else: + phases.call('private_set_and_data_adapter_installation', data_adapters.install_circuit, data_state, extensions, circuit_module, comparison) + side_writer = data_adapters.scientific_writer(data_state) + binding = None + captures = {} + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'circuit', circuit_module.ComplexSideCircuit, '__init__', 'side_construction') + else: + phases.wrap(circuit_module.ComplexSideCircuit, '__init__', 'side_construction') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'checks', circuit_module.Checks, '__init__', 'checks_initialization') + else: + phases.wrap(circuit_module.Checks, '__init__', 'checks_initialization') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'module', circuit_module, 'compile_roles', 'compile_roles') + else: + phases.wrap(circuit_module, 'compile_roles', 'compile_roles') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'checks', circuit_module.Checks, 'verify_map', 'verify_map') + else: + phases.wrap(circuit_module.Checks, 'verify_map', 'verify_map') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'checks', circuit_module.Checks, 'verify_labels', 'verify_labels') + else: + phases.wrap(circuit_module.Checks, 'verify_labels', 'verify_labels') + original_roles = circuit_module.verify_role_frames + + def observe_roles(c, checks, code=None): + need('side' not in captures and code is not None, 'Unexpected role-frame invocation') + result = phases.call('verify_role_frames', original_roles, c, checks, code) + captures['side'] = (c, checks, code, result) + return result + if data_state['enabled']: + data_adapters.epoch_role_observer(data_state, observe_roles) + else: + circuit_module.verify_role_frames = observe_roles + certify = phases.call('cold_certify_import', importlib.import_module, 'certify') + phases.wrap(certify, 'verify_sources', 'original_upstream_verify_sources') + prepare = phases.call('cold_prepare_import', importlib.import_module, 'prepare_layers') + search = importlib.import_module('search_network') + phases.wrap(search, 'log_integer_bounds', 'full_log_integer_bounds') + original_serializable = prepare.serializable + depth = 0 + + def observe_serializable(value): + nonlocal depth + outer = depth == 0 + if outer: + need('full_return' not in captures and type(value) is dict, 'Unexpected outer serialization') + captures['full_return'] = value + depth += 1 + try: + if outer: + return phases.call('original_serializable', original_serializable, value) + return original_serializable(value) + finally: + depth -= 1 + prepare.serializable = observe_serializable + binding = phases.call('final_native_binding', data_adapters.bind_epoch_native if data_state['enabled'] else data_adapters.bind_native, data_state, backend, circuit_module, native, rank_calls, complement) + phases.call('construction_lease_sealing', data_adapters.seal, data_state) + phases.call('private_set_lease_sealing', adapters.seal, extensions) + if data_state['enabled']: + data_adapters.epoch_seal(data_state) + caller = runtime / 'scripts/complex_network.py' + old_argv = sys.argv + stdout = io.StringIO() + namespace = _epoch_cli_boundary(phases, data_state, extensions, caller, stdout, _epoch_invocation, old_argv) + cli_stdout = stdout.getvalue() + need(cli_stdout == EXPECTED_STDOUT, 'Original CLI stdout changed') + certificate_bytes = (runtime / 'certificates/complex-network.json').read_bytes() + need(certificate_bytes == reference_bytes, 'Original CLI certificate bytes differ from the pinned reference') + need(sys.modules['complex_circuit'] is circuit_module and namespace['ComplexSideCircuit'] is circuit_module.ComplexSideCircuit and (namespace['Checks'] is circuit_module.Checks) and (namespace['compile_roles'] is circuit_module.compile_roles) and (namespace['verify_role_frames'] is observe_roles) and (namespace['serializable'] is observe_serializable), 'Caller used a different scientific module or observation binding') + need(captures.keys() == {'side', 'full_return'}, 'Missing exact caller observations') + c, checks, code, role_result = captures['side'] + full_return = captures['full_return'] + need(full_return['role_frames'] is role_result and full_return['upstream_commit'] == UPSTREAM, 'Role return or actual source verification boundary changed') + for name in ('side_construction', 'checks_initialization', 'compile_roles', 'verify_map', 'verify_labels', 'verify_role_frames', 'original_upstream_verify_sources', 'full_log_integer_bounds', 'original_serializable', 'complete_original_cli'): + need(phases.rows.get(name, {}).get('calls') == 1, 'Original phase was omitted or repeated: ' + name) + imports = {} + for name in script_names - {'complex_network'}: + module = sys.modules.get(name) + expected_path = engine / 'source/complex_circuit.py' if name == 'complex_circuit' else runtime / 'scripts' / (name + '.py') + need(module is not None and Path(module.__file__).resolve() == expected_path.resolve(), 'Unpinned scientific import: ' + name) + imports[name] = str(module.__file__) + if binding is not None: + binding['runtime_guard'].check() + need(binding['counters'] == {'complement_native': 238685, 'complement_fallback': 0, 'gram_native': 59959, 'gram_fallback': 0}, 'Native full-call coverage changed') + side_result = {key: full_return[key] for key in ('circuit', 'side_map', 'labels', 'role_frames')} + witness = {'support': c.support, 'args': c.args, 'kind': c.kind, 'active': sorted(c.active), 'pieces': [(target, node, (coefficient.numerator, coefficient.denominator)) for target, node, coefficient in c.pieces], 'labels': [(key, list(label.basis.items()), label.dim, label.key) for key, label in checks.cache.items()], 'code': {'roles': code['roles'], 'gates': code['gates'], 'sources': list(code['sources'].items()), 'outputs': list(code['outputs'].items())}} + side_output = output / 'side-observations' + side_output.mkdir() + side_receipt = phases.call('identical_lossless_side_serialization', side_writer, side_output, side_result, witness, rank_calls) + complement_receipt = complement.receipt() + need(complement_receipt == COMPLEMENT_EXPECTED, 'Every ordered complement observation must match PR5929') + full_typed_bytes = canonical(typed(full_return)) + (output / 'full-return.lossless.json').write_bytes(full_typed_bytes) + (output / 'original-stdout.txt').write_text(cli_stdout, encoding='utf-8') + (output / 'complement-transcript.json').write_bytes(canonical(complement_receipt) + b'\n') + science = {'full_cli_certificate_sha256': sha(certificate_bytes), 'full_cli_stdout_sha256': sha(cli_stdout.encode('utf-8')), 'full_return_lossless_sha256': sha(full_typed_bytes), 'side': side_receipt, 'ordered_complements': complement_receipt, 'upstream_commit': UPSTREAM} + anchor = {'schema': 'gf2-full-network-anchor-v1', 'base_commit': BASE, 'source_pin_sha256': PIN_SHA, 'driver_sha256': REFERENCE_DRIVER_SHA, 'engine_pins': ENGINE_PINS, 'science': science} + if expected_anchor is not None: + need(anchor == expected_anchor, 'Complete certificate/types/ordered observations differ from frozen anchor') + else: + (output / 'anchor.json').write_bytes(canonical(anchor) + b'\n') + need(inventory(frozen, pins) == frozen_before and inventory(HERE / 'engine', ENGINE_PINS) == engine_before, 'Immutable source bytes/modes changed') + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, 'Runtime scientific source bytes/modes changed') + runtime_files = {str(path.relative_to(runtime)) for path in runtime.rglob('*') if path.is_file()} + need(runtime_files == set(pins) | {'certificates/complex-network.json'}, 'Unexpected full-caller file side effect') + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), 'Driver/reference/anchor changed during run') + need(adapters.custody(ROUND, args.lanes) == new_custody_before, 'New source custody changed') + bookkeeping_receipt = adapters.receipt(extensions) + data_receipt = phases.call('data_finalization', data_adapters.finish, data_state, binding) + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + need(data_adapters.custody(ROUND) == data_custody_before, 'Data source custody changed') + need(adapters.custody(ROUND, args.lanes) == new_custody_before, 'Post-late original source custody changed') + need(inventory(frozen, pins) == frozen_before and inventory(HERE / 'engine', ENGINE_PINS) == engine_before, 'Post-late immutable source custody changed') + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, 'Post-late copied source custody changed') + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), 'Post-late driver/reference/anchor changed') + receipt = {'new_source_custody': new_custody_before, 'status': 'FULL_NETWORK_PROFILE_ANCHOR_PASS' if args.mode == 'profile' else 'FULL_NETWORK_COMPLETE_PASS', 'mode': args.mode, 'lanes': args.data_lanes, 'bookkeeping': bookkeeping_receipt, 'data_handling': data_receipt, 'data_source_custody': data_custody_before, 'reference_driver_sha256': REFERENCE_DRIVER_SHA, 'science': science, 'base_commit': BASE, 'native_predecessor_pr': 5995, 'driver_sha256': sha(driver_before), 'source_pin_sha256': PIN_SHA, 'frozen_custody': frozen_before, 'engine_custody': engine_before, 'scientific_imports': imports, 'build': build, 'finite_controls': finite, 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT, 'native_packet': native_packet.receipt(packet), 'private_root_permission': 'runtime-root is0755; copied input file modes are retained and checked; immutable stages are never chmodded', 'compiler_tmpdir': str(compiler_tmp), 'native_calls': None if binding is None else dict(binding['counters']), 'phases': phases.rows, 'driver_wall_seconds_after_initial_tcb_before_receipt': time.perf_counter() - START_WALL, 'process_and_compiler_cpu_seconds_before_receipt': cpu(), 'environment': {'python': sys.version, 'executable': sys.executable, 'platform': sys.platform}, 'measurement': 'Parent outer guard is authoritative and includes pristine root startup, initial native TCB authentication, early cold source authority capture and every factory dependency/product check, three cold metadata compilations plus original cold native/trace builds, every old and new control in BOTH arms, all candidate production admission/guards, IO and terminal cleanup. Baseline receives the complete same control union. Driver wall diagnostic starts after initial TCB and cold authority capture and is not total process wall. Broad phase samples are nested, not additive; VmRSS is current RSS and ru_maxrss is process high-water. Eager witnesses and original observations remain; full funding and equality gates are separate and currently closed.', 'scope': 'Complete frozen historical complex-network CLI with retained observations; conditional certificate only. No bare-CLI factor, selected-frontier, new kappa or PR5864 speed claim.'} + (output / 'receipt.json').write_text(json.dumps(receipt, indent=2, sort_keys=True) + '\n') + sys.stdout.write(cli_stdout) + print(json.dumps({'status': receipt['status'], 'mode': args.mode, 'science': science, 'wall_seconds': receipt['driver_wall_seconds_after_initial_tcb_before_receipt'], 'cpu_seconds_with_compiler': receipt['process_and_compiler_cpu_seconds_before_receipt'], 'phases': phases.rows}, sort_keys=True)) + try: + _EPOCH_SC4_FULL_STATE['full_observation'] = { + 'receipt': receipt, 'phases': phases, 'extensions': extensions, + 'state': data_state, 'packet': packet, 'argv_owner': old_argv, + } + except BaseException as _sc4_completion_error: + try: + _EPOCH_SC4_FULL_STATE['completion_error'] = _sc4_completion_error + except BaseException: + pass + except BaseException as _epoch_error: + _epoch_primary = _epoch_error + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['primary'] = _epoch_error + raise + finally: + try: + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['attempted'] = True + data_adapters.epoch_retire(data_state, 'whole-cli-terminal', _epoch_primary, None, None, None, 'outer') + except BaseException as _epoch_outer_error: + _epoch_outer_retirement_error = _epoch_outer_error + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['retirement_error'] = _epoch_outer_error + _epoch_outer_cleanup['uncertain'] = True + if _epoch_primary is None: + _epoch_primary = _epoch_outer_error + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['primary'] = _epoch_outer_error + raise + +def _run_epoch_with_stop_evidence(): + try: + main_epoch() + except BaseException as primary_error: + try: + state = _EXECUTION['state'] + cleanup_errors = [] + try: + cleanup_errors = data_adapters.epoch_cleanup_owned(state) + except BaseException as cleanup_error: + cleanup_errors.append({'type': type(cleanup_error).__name__, 'message': str(cleanup_error)}) + stop = {'schema': 'h25-combined-v2-stop-v1', 'status': 'STOP', 'primary_error': {'type': type(primary_error).__name__, 'message': str(primary_error)}, 'primary_cause': None if primary_error.__cause__ is None else {'type': type(primary_error.__cause__).__name__, 'message': str(primary_error.__cause__)}, 'cleanup_errors': cleanup_errors, 'data': data_adapters.epoch_stop_diagnostics(state), 'native_packet': None if _EXECUTION['packet'] is None else native_packet.receipt(_EXECUTION['packet']), 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT} + output = _EXECUTION['output'] + if output is not None: + with (output / 'STOP.json').open('x', encoding='utf-8') as stream: + stream.write(json.dumps(stop, sort_keys=True, indent=2) + '\n') + except BaseException as evidence_error: + try: + sys.stderr.write('STOP evidence write failed: ' + type(evidence_error).__name__ + '\n') + except BaseException: + pass + raise + +# SC4 fixed positive full entry. Dormant until original full gates are admitted. +import types +_EPOCH_SC4_FULL_STATE = { + 'started': False, 'argv_owner': None, 'full_observation': None, + 'completion_error': None, 'primary': None, 'disposition': None, + 'qualification_error': None, 'qualified': False, +} + + +def _epoch_sc4_full_require_disposition(record): + # Pure reads of actual original completion and owner records, after main finally. + need(record is _EPOCH_SC4_FULL_STATE and record['started'] is True and + record['primary'] is None and record['completion_error'] is None and + record['disposition'] is None and record['qualification_error'] is None and + record['qualified'] is False, 'SC4 positive one-use completion record differs') + observed = record['full_observation']; state = _EXECUTION['state'] + need(type(observed) is dict and set(observed) == { + 'receipt', 'phases', 'extensions', 'state', 'packet', 'argv_owner'} and + type(state) is dict and observed['state'] is state and + observed['packet'] is _EXECUTION['packet'] and state['native_packet'] is observed['packet'] and + observed['argv_owner'] is record['argv_owner'] and sys.argv is record['argv_owner'], + 'SC4 positive original completed main/state/packet/argv ownership differs') + outer = _EXECUTION['epoch_outer_cleanup'] + need(type(outer) is dict and outer['attempted'] is True and + outer['primary'] is None and outer['retirement_error'] is None and outer['uncertain'] is False, + 'SC4 positive original outer completion retained a failure') + receipt = observed['receipt']; phases = observed['phases']; extensions = observed['extensions'] + need(type(receipt) is dict and receipt['status'] == 'FULL_NETWORK_COMPLETE_PASS' and + receipt['lanes'] == 'candidate' and receipt['mode'] == 'candidate' and + receipt['data_handling'] is state['final_receipt'] and + type(state['final_receipt']) is dict and state['final_receipt']['full_caller_run'] is True and + state['final_receipt']['arm'] == 'candidate' and state['enabled'] is True and + type(phases) is Phases and receipt['phases'] is phases.rows and type(phases.rows) is dict and + state['native_packet']['late_started'] is True, + 'SC4 positive actual full result/phase owner/late completion differs') + for phase_name, row in phases.rows.items(): + need(type(phase_name) is str and type(row) is dict and + all(type(key) is str for key in row) and type(row['memory_samples']) is list, + 'SC4 positive original phase record shape differs') + for sample in row['memory_samples']: + need(type(sample) is dict and all(type(key) is str for key in sample) and + sample['diagnostic_error'] is None, + 'SC4 positive original phase retained a diagnostic failure') + cli = state['epoch_cli_cleanup'] + need(type(cli) is dict and cli['primary'] is None and cli['argv_error'] is None and + cli['disarm_error'] is None and cli['retirement_error'] is None and + cli['outer_retirement_error'] is None and cli['uncertain'] is False and + cli['argv_owner'] is record['argv_owner'], + 'SC4 positive protected CLI retained a failure or changed argv owner') + inner = cli['retirement_channel']; outer_channel = cli['outer_retirement_channel'] + need(type(inner) is dict and type(outer_channel) is dict and inner is not outer_channel, + 'SC4 positive protected CLI channels are not independent') + for channel in (inner, outer_channel): + need(channel['started'] is True and channel['acknowledged'] is True and + channel['error'] is None and channel['journal_error'] is None, + 'SC4 positive original CLI retirement channel differs') + original_owner = extensions['set_binding']['owner'] + need(original_owner.cli_active is False and original_owner.current is None and + original_owner.circuit is None and original_owner.checks is None and original_owner.triples is None, + 'SC4 positive original set owner retains active operands') + suite = state['epoch_suite'] + need(suite.context['phase_owner'] is phases and suite.context['disposition_state'] is state and + suite.primary_error is None and suite.secondary_error is None and suite.uncertain is False and + type(suite.secondary) is list and len(suite.secondary) == 0 and suite.active is False and + suite.terminal is True and suite.invocation_consumed is True and suite.pending is None and + suite.request_live is None and suite.checks is None and suite.checks_c is None and + suite.checks_h is None and type(suite.registry) is dict and len(suite.registry) == 0, + 'SC4 positive candidate suite is not cleanly terminal') + role_channel = suite.role_retirement_channel + need(type(role_channel) is dict and role_channel['started'] is True and + role_channel['acknowledged'] is True and role_channel['error'] is None and + role_channel['journal_error'] is None, + 'SC4 positive candidate original role retirement differs') + for channel in (suite.inner_retirement_channel, suite.outer_retirement_channel, + suite.emergency_retirement_channel): + need(type(channel) is dict and channel['started'] is False and channel['acknowledged'] is False and + channel['error'] is None and channel['journal_error'] is None, + 'SC4 positive candidate unexpectedly used a fallback retirement channel') + need(suite.role_retirement_error is None and suite.inner_retirement_error is None and + suite.inner_journal_error is None and suite.outer_retirement_error is None and + suite.outer_journal_error is None and suite.emergency_retirement_error is None and + suite.emergency_journal_error is None, + 'SC4 positive candidate retained an extra raw retirement error') + owned_states = state['owned_states']; owners = [] + need(type(owned_states) is list and sum(owned is state for owned in owned_states) == 1, + 'SC4 positive original known-owner census differs') + for index, owned in enumerate(owned_states): + need(type(owned) is dict and owned['owned_states'] is owned_states and + type(owned['cleanup_errors']) is list and len(owned['cleanup_errors']) == 0, + 'SC4 positive an actual known owner retains cleanup failure') + binding = owned['cache_binding'] + if binding is None: + need(owned['cache_teardown_attempted'] is False and owned['cache_teardown_receipt'] is None and + owned['cache_teardown_stop'] is None and owned.get('epoch_acquisition') is None, + 'SC4 positive unacquired owner has a fabricated teardown outcome') + owners.append({'index': index, 'acquired': False}) + continue + need(type(binding) is dict, 'SC4 positive acquired cache binding shape differs') + owner = binding['owner']; closed = owned['cache_teardown_receipt'] + need(owned['cache_teardown_attempted'] is True and owned['cache_teardown_stop'] is None and + type(closed) is dict and type(closed['teardowns']) is int and closed['teardowns'] == 1 and + type(closed['current_authority_entries']) is int and closed['current_authority_entries'] == 0 and + closed['probe_closed'] is True and owner.probe_closed is True and + type(owner.states) is dict and len(owner.states) == 0 and owner.teardown_stop is None and + owner.teardown_primary_error is None and owner.teardown_close_error is None and + type(owner.receipt) is dict and owner.receipt['teardowns'] == 1 and + owner.receipt['current_authority_entries'] == 0, + 'SC4 positive actual owner lacks a clean original one-shot close') + counters = closed['native_probe'] + need(type(counters) is dict and type(counters['calls']) is int and + type(counters['counter_overflow']) is int and counters['counter_overflow'] == 0 and + counters['calls'] == owner.receipt['probe_entry_calls'] + owner.receipt['probe_exit_calls'], + 'SC4 positive actual closed-owner counters differ') + acquisition = owned.get('epoch_acquisition') + if acquisition is not None: + # Successful original finish/cleanup_owned does NOT write STOP close flags. + need(owned is state and state['enabled'] is True and type(acquisition) is dict and + acquisition['prepared'] is binding and acquisition['owner'] is owner and + acquisition['published'] is True and acquisition['origin_handle'] is not None and + acquisition['phase'] == 'ORIGIN_ACCEPTED_PARENT_OWNED' and + acquisition['close_attempted'] is False and acquisition['close_result'] is None and + acquisition['primary'] is None and acquisition['secondary'] is None and + acquisition['uncertain'] is False and owner is state['epoch_suite'].owner, + 'SC4 positive original acquisition writer path differs') + owners.append({'index': index, 'acquired': True, 'teardowns': closed['teardowns'], + 'probe_closed': closed['probe_closed'], 'native_probe': counters}) + return {'schema': 'cache-SC4-candidate-positive-disposition-observation-v1', + 'original_receipt': receipt, 'known_owners': owners, + 'whole_source_caller_cost_or_activity_admitted': False} + + +def _epoch_sc4_full_entry(): + record = _EPOCH_SC4_FULL_STATE; binding = _EPOCH_SC4_FULL_BINDING + need(type(record) is dict and set(record) == { + 'started', 'argv_owner', 'full_observation', 'completion_error', 'primary', + 'disposition', 'qualification_error', 'qualified'} and + record['started'] is False and record['qualified'] is False, + 'SC4 candidate full entry is a fresh exact one-use record') + for name in ('argv_owner', 'full_observation', 'completion_error', 'primary', + 'disposition', 'qualification_error'): + need(record[name] is None, 'SC4 positive entry record already consumed') + record['started'] = True + need(type(binding) is tuple and len(binding) == 11, + 'SC4 positive fixed source binding tuple differs') + entry, entry_code, predicate, predicate_code, main, main_code, stop, stop_code, owner, builtins, namespace = binding + need(entry is _epoch_sc4_full_entry and predicate is _epoch_sc4_full_require_disposition and + main is main_epoch and stop is _run_epoch_with_stop_evidence and owner is record and + namespace is globals() and type(builtins) is dict, + 'SC4 positive source function/record identities differ') + for function, code in ((entry, entry_code), (predicate, predicate_code), (main, main_code), (stop, stop_code)): + need(type(function) is types.FunctionType and type(code) is types.CodeType and + function.__code__ is code and function.__globals__ is namespace and + function.__builtins__ is builtins and function.__defaults__ is None and + function.__kwdefaults__ is None and function.__closure__ is None, + 'SC4 positive actual source function environment differs') + argv = sys.argv + need(type(argv) is list and all(type(value) is str for value in argv) and + argv.count('--lanes') == 1 and argv.index('--lanes') + 1 < len(argv) and + argv[argv.index('--lanes') + 1] == 'candidate' and '--finite-only' not in argv and + '--cache-control-case' not in argv and '--cache-control-sha256' not in argv and + sys.flags.optimize == 0 and _EXECUTION['state'] is None and _EXECUTION['packet'] is None, + 'SC4 fixed assertion-on fresh candidate full invocation required') + driver = sys.modules['__main__'] + need(type(driver) is types.ModuleType and driver.__dict__ is namespace, + 'SC4 positive entry is not the original Root-installed driver') + record['argv_owner'] = argv + try: + result = stop() # Original fresh _run_epoch_with_stop_evidence -> main_epoch. + except BaseException as primary: + try: + record['primary'] = primary + except BaseException: + pass + raise # No qualification failure replaces an original main primary. + try: + need(_EPOCH_SC4_FULL_BINDING is binding and _EPOCH_SC4_FULL_STATE is record and + entry is _epoch_sc4_full_entry and predicate is _epoch_sc4_full_require_disposition and + main is main_epoch and stop is _run_epoch_with_stop_evidence and + sys.modules['__main__'] is driver and driver.__dict__ is namespace and sys.argv is argv, + 'SC4 positive live source/argv ownership changed') + for function, code in ((entry, entry_code), (predicate, predicate_code), (main, main_code), (stop, stop_code)): + need(function.__code__ is code and function.__globals__ is namespace and + function.__builtins__ is builtins and function.__defaults__ is None and + function.__kwdefaults__ is None and function.__closure__ is None, + 'SC4 positive live source environment changed') + record['disposition'] = predicate(record) + need(type(record['disposition']) is dict and record['qualification_error'] is None, + 'SC4 positive actual disposition did not complete') + record['qualified'] = True + except BaseException as qualification_error: + try: + record['qualification_error'] = qualification_error + except BaseException: + pass + raise # Original main returned; this is a new nonqualifying observer failure. + return result # Only the original normal return, never a synthetic full receipt. + + +_EPOCH_SC4_FULL_BINDING = ( + _epoch_sc4_full_entry, _epoch_sc4_full_entry.__code__, + _epoch_sc4_full_require_disposition, _epoch_sc4_full_require_disposition.__code__, + main_epoch, main_epoch.__code__, _run_epoch_with_stop_evidence, _run_epoch_with_stop_evidence.__code__, + _EPOCH_SC4_FULL_STATE, _epoch_sc4_full_entry.__builtins__, globals(), +) + +if __name__ == '__main__': + _epoch_sc4_full_entry() diff --git a/research/h25-full-caller-readable-inputs/inherited-epoch-driver.py.txt b/research/h25-full-caller-readable-inputs/inherited-epoch-driver.py.txt new file mode 100644 index 0000000000..3ae194abcc --- /dev/null +++ b/research/h25-full-caller-readable-inputs/inherited-epoch-driver.py.txt @@ -0,0 +1,1270 @@ +#!/usr/bin/env python3 +"""One complete frozen complex-network CLI with retained exact observations. + +Parent-owned serial wall/RSS/aggregate guard is mandatory. Profile mode is one +literal baseline diagnostic/anchor, not a performance sample. Both benchmark +modes require its immutable anchor. No search, retry, orchestration or network. +""" +from __future__ import annotations + +# Actual source-authenticated root injects these three values before driver exec. +# Capture them before importing any candidate, scientific, or orchestration code. +_CAPTURED_BOOTSTRAP_ROOT = bootstrap_root +_CAPTURED_BOOTSTRAP_CAPABILITY = bootstrap_capability +_CAPTURED_BOOTSTRAP_API = bootstrap_api +if type(_CAPTURED_BOOTSTRAP_API) is not tuple or len(_CAPTURED_BOOTSTRAP_API) != 4: + raise RuntimeError('Driver requires the parent-sealed exact four-entry bootstrap API') +_INITIAL_ROOT_IDENTITY = _CAPTURED_BOOTSTRAP_API[0]() +if (type(_CAPTURED_BOOTSTRAP_ROOT) is not _CAPTURED_BOOTSTRAP_ROOT.ModuleType or + any(type(entry) is not _CAPTURED_BOOTSTRAP_ROOT.FunctionType or + entry.__globals__ is not _CAPTURED_BOOTSTRAP_ROOT.__dict__ + for entry in _CAPTURED_BOOTSTRAP_API)): + raise RuntimeError('Driver bootstrap API is not bound to the actual root namespace') + +# Accepted helper/control sources and parent-inspected native dependency tuple. +# These are static expected pins; finite and full execution gates remain closed. +EXPECTED_BOOTSTRAP_ROOT_SHA256 = 'f5a2d33f2b4d3651f214156a0e7094c2bb516ce2d5ab7698d18c11f98f35dee0' +NATIVE_TCB_HELPER_SHA256 = '865943df5cfdbf9383362d7fb2b76c6d0fd895cf0a0e20d550a26b579606b5d7' +NATIVE_TCB_CONTROLS_SHA256 = '63b1804caa7f89915662a1424f788c3becad13520e1f63212a338fb45aaa2c5a' +NATIVE_TCB_EXPECTED_FILES = (('/usr/bin/python3.12', 'e50d468e8b0adfb05733f5b87b3cff34829c4a8c1aea50c865aa8bdfe4bb150f', 8020928), + ('/usr/lib/python3.12/lib-dynload/_hashlib.cpython-312-x86_64-linux-gnu.so', + '8dc6cda6dd9495b95a2bfb5b26e8cf06b72f36dc0213d958b9277a958287f0fe', + 64368), + ('/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2', + 'c20a2dc8917c755f02b94049356320fe1f62ac7d9f8994731f807d9df39302da', + 236616), + ('/usr/lib/x86_64-linux-gnu/libc.so.6', + '3a15d66867d83762c7f2f1e37359cb8f6c5743edb369c65285cb0b1c4f7498bf', + 2129424), + ('/usr/lib/x86_64-linux-gnu/libcrypto.so.3', + '6866ed711dab8927e1bf82bf1cd30e828bdfc34f3cc1e83b1c9eb01ce6c37d9a', + 5309400), + ('/usr/lib/x86_64-linux-gnu/libexpat.so.1.9.1', + '286682ecbc5e59a638963b1a4e6351e65eb32fcf4bdcb9cb7569b6a61fe06a8d', + 186624), + ('/usr/lib/x86_64-linux-gnu/libm.so.6', + 'fce00b6f25f459cf4ae0b7fae4257909a1a8a86f9149e7c029a5d617baf1ccd0', + 952616), + ('/usr/lib/x86_64-linux-gnu/libz.so.1.3', + 'f61677c7bdb7c2aa2a243ea781bfd16afcb361cede7b4ef76127a9d8eb9a5242', + 113000)) +NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN = '/usr/lib/python3.12/lib-dynload/_hashlib.cpython-312-x86_64-linux-gnu.so' + + +def _initial_native_tcb(): + root, api = _CAPTURED_BOOTSTRAP_ROOT, _CAPTURED_BOOTSTRAP_API + if (type(EXPECTED_BOOTSTRAP_ROOT_SHA256) is not str or + _INITIAL_ROOT_IDENTITY != EXPECTED_BOOTSTRAP_ROOT_SHA256 or + type(NATIVE_TCB_HELPER_SHA256) is not str or len(NATIVE_TCB_HELPER_SHA256) != 64 or + type(NATIVE_TCB_EXPECTED_FILES) is not tuple or + type(NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN) is not str): + raise RuntimeError('Initial native TCB source and expected dependency tuple are not configured') + helper_path = __file__.rsplit('/', 2)[0] + '/areas/cache-validity/probe-native/native_tcb_v1.py' + api[0]() + digest, _, source = root._hash_regular(helper_path, 262144, True) + if digest != NATIVE_TCB_HELPER_SHA256: + raise RuntimeError('Initial native TCB helper source differs') + helper = root.ModuleType('_h25_initial_native_tcb') + namespace = helper.__dict__ + namespace.update({'__file__': helper_path, '__builtins__': root.builtins.__dict__}) + api[0]() + code = root._COMPILE(source, helper_path, 'exec', dont_inherit=True, optimize=root._OPTIMIZE) + api[0]() + root._EXEC(code, namespace) + api[0]() + receipt = namespace['verify_native_tcb'](root, api, NATIVE_TCB_EXPECTED_FILES, + NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN) + if type(NATIVE_TCB_CONTROLS_SHA256) is not str or len(NATIVE_TCB_CONTROLS_SHA256) != 64: + raise RuntimeError('Initial native TCB control source pin is not configured') + control_path = __file__.rsplit('/', 2)[0] + '/areas/cache-validity/probe-native/native_tcb_controls_v1.py' + api[0]() + digest, _, control_source = root._hash_regular(control_path, 262144, True) + if digest != NATIVE_TCB_CONTROLS_SHA256: + raise RuntimeError('Initial native TCB controls source differs') + control_namespace = {'__name__': '_h25_initial_native_tcb_controls', '__file__': control_path, + '__builtins__': root.builtins.__dict__} + api[0]() + control_code = root._COMPILE(control_source, control_path, 'exec', dont_inherit=True, optimize=root._OPTIMIZE) + api[0]() + root._EXEC(control_code, control_namespace) + argv = root.sys.argv + if (type(argv) is not list or any(type(arg) is not str for arg in argv) or + argv.count('--output') != 1 or argv.index('--output') + 1 >= len(argv)): + raise RuntimeError('Early TCB controls require the unique parent --output argument') + output = argv[argv.index('--output') + 1] + stage_root = __file__.rsplit('/', 2)[0] + if (not output.startswith('/') or output.endswith('/') or + any(part in ('', '.', '..') for part in output.split('/')[1:]) or + output == stage_root or output.startswith(stage_root + '/')): + raise RuntimeError('Early TCB controls require a canonical absolute output outside the stage') + # Parent owns an existing nonsymlink output parent. mkdir is exclusive: + # a preexisting output, file, or symlink is rejected before any fixture write. + api[0]() + root.posix.mkdir(output, 0o700) + control_directory = output + '/initial-tcb-controls' + root.posix.mkdir(control_directory, 0o700) + api[0]() + controls = control_namespace['run_controls']( + helper, root, api, NATIVE_TCB_EXPECTED_FILES, NATIVE_TCB_EXPECTED_HASHLIB_ORIGIN, control_directory) + if (controls.get('schema') != 'h25-native-tcb-controls-v1' or + controls.get('expected_records') != 5 or len(controls.get('records', [])) != 5 or + controls.get('scientific_calls') != 0 or controls.get('probe_native_imports') != 0): + raise RuntimeError('Initial native TCB control census differs') + controls['status'] = 'NATIVE_INITIAL_TCB_CONTROLS_PASS' + return receipt, controls, output + + +# Child outer wall/CPU/RSS includes this entire initial trust check. +# It assumes the declared trusted OS/native startup; it does not prove itself. +INITIAL_NATIVE_TCB_RECEIPT, INITIAL_NATIVE_TCB_CONTROLS, _INITIAL_OUTPUT = _initial_native_tcb() + +# This independent bootstrap support captures the initial system-stdlib +# continuity boundary before any adapter or scientific module is exposed. +# No late candidate-created snapshot is accepted as initial authentication. +COLD_AUTHORITY_SHA256 = 'f279ab86fc17c6a517b035f19d56863919cbd8304de4e7d5332457c6159aec10' + + +def _initial_cold_authority(): + root, cap, api = (_CAPTURED_BOOTSTRAP_ROOT, _CAPTURED_BOOTSTRAP_CAPABILITY, + _CAPTURED_BOOTSTRAP_API) + if type(COLD_AUTHORITY_SHA256) is not str or len(COLD_AUTHORITY_SHA256) != 64: + raise RuntimeError('Initial cold authority source pin is not configured') + source_path = __file__.rsplit('/', 2)[0] + '/areas/cache-validity/cold_authority_v7.py' + api[0]() + digest, _, source = root._hash_regular(source_path, 1048576, True) + if digest != COLD_AUTHORITY_SHA256: + raise RuntimeError('Initial cold authority source differs') + module = root.ModuleType('_h25_initial_cold_authority') + namespace = module.__dict__ + namespace.update({'__file__': source_path, '__builtins__': root.builtins.__dict__}) + api[0]() + code = root._COMPILE(source, source_path, 'exec', dont_inherit=True, optimize=root._OPTIMIZE) + api[0]() + root._EXEC(code, namespace) + # The actual source bytes have just executed under the admitted initial + # interpreter/system-stdlib premise. Capture precedes every candidate import. + api[0]() + bundle = namespace['capture_epoch_authority'](root, cap, api); authority = bundle[1] + if (type(authority) is not tuple or len(authority) != 7 or + any(type(entry) is not root.FunctionType for entry in authority)): + raise RuntimeError('Initial cold authority must expose the sealed seven-entry tuple') + # Read fresh transport exactly once, before any candidate exposure. + transport = root.FunctionType.__dict__['__dict__'].__get__(authority[0], root.FunctionType) + descriptor = transport['_h25_caller_descriptor'] + if type(descriptor) is not tuple or len(descriptor) != 6 or descriptor[1] is not authority: + raise RuntimeError('Initial cold authority caller descriptor differs') + return authority, descriptor, bundle + + +import importlib +import typing +_INITIAL_COLD_AUTHORITY, _INITIAL_COLD_CALLER_DESCRIPTOR, _INITIAL_EPOCH_BUNDLE = _initial_cold_authority() + +import time +START_WALL = time.perf_counter() +import argparse +from contextlib import redirect_stdout +from fractions import Fraction +import hashlib +import io +import json +import os +from pathlib import Path +import resource +import runpy +import shutil +import stat +import sys + +sys.dont_write_bytecode = True +# Independent source pins are literal final-stage configuration. These modules +# are admitted by the pre-exposure authority, including their live helper code. +# Driver/source identity does not depend on a hash of itself. +EARLY_INTEGRATION_SOURCE_PINS = ({'adapters': ('integration/adapters.py', 'f7ca7f4f03ac63c1a95ba42f06149543211566de5e29f487a3dc4d08c5ee9b94'), 'cold_build_evidence': ('integration/cold_build_evidence.py', 'aa0a315110e031e19291970c9611fe5e0f91465fa20eaec51e81186099563f78'), 'native_packet': ('integration/native_packet.py', '6adbcd1dfeb77fb6da7ee8f725796b1bfdbf0a4f397ef23f3a266a6b89d55892'), 'data_adapters': ('integration/data_adapters.py', '18679fd1eb6ae99c4b375756511427c26718f77674c2d8fcc490e25ceb47cba5'), 'guarded_adapters_v4': ('integration/guarded_adapters_v4.py', '5579fe0838d8c6acf63834990269479c6c32024a1662846ed0a075c25d13954c'), '_h25_data_cache': ('areas/cache-validity/cache_contract_v8.py', 'd317c9866566cd6147c96566879f26f364e7e6801ac3eed0800b6ed8eedd01a2')} + + + + + + +) +_INITIAL_INTEGRATION_MODULES = {} +_INITIAL_INTEGRATION_HANDLES = {} +for _entry_name, (_entry_relative, _entry_digest) in EARLY_INTEGRATION_SOURCE_PINS.items(): + if type(_entry_digest) is not str or len(_entry_digest) != 64: + raise RuntimeError('Early integration source pin is not configured: ' + _entry_name) + # BEGIN evaluated dispatch arguments scientific_driver:195 + _ca_args = (__file__.rsplit('/', 2)[0] + '/' + _entry_relative, _entry_digest, _entry_name) + _ca_kwargs = {} + # END evaluated dispatch arguments scientific_driver:195 + # BEGIN caller admission scientific_driver:195 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:195 + _entry_module, _entry_handle = _ca_dispatch(0, *_ca_args, **_ca_kwargs) + if type(_entry_module) is not _CAPTURED_BOOTSTRAP_ROOT.ModuleType or sys.modules.get(_entry_name) is not _entry_module: + raise RuntimeError('Early integration module registry identity differs: ' + _entry_name) + _INITIAL_INTEGRATION_MODULES[_entry_name] = _entry_module + _INITIAL_INTEGRATION_HANDLES[_entry_name] = _entry_handle +adapters = _INITIAL_INTEGRATION_MODULES['adapters'] +native_packet = _INITIAL_INTEGRATION_MODULES['native_packet'] +data_adapters = _INITIAL_INTEGRATION_MODULES['data_adapters'] +guarded_adapters_v4 = _INITIAL_INTEGRATION_MODULES['guarded_adapters_v4'] +_EXECUTION = {'output': Path(_INITIAL_OUTPUT), 'state': None, 'packet': None} +ROUND = Path(__file__).resolve().parent.parent +HERE = ROUND / "baseline" +REFERENCE_DRIVER_SHA = "0d976d2eb6b845f20d4a3396591a806f966688b88693cd6a5f8a0c9e48925e36" +BASE = "19fdb086ea96af9a9f87936a2b888e10af4ed810" +UPSTREAM = "adc7f1241b42e322a6451854ab7e4b4c146bf78a" +PIN_SHA = "88bba3caf5975f30fa7abceaea9454110cf3b069233e8241a2ca13d1dff171a7" +REFERENCE_SHA = "1f763d95c7ff163aa71d13cd82784f16665be8afb21f75e76941e2119562098f" +ENGINE_PINS = { + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a", + "source/complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "source/complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b", +} +COMPLEMENT_EXPECTED = { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838", + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", +} +EXPECTED_STDOUT = ( + "PASS conditional 59/100000000000 > 2^-31; minimum margin 14779261/25000000000000000\n" + "Side roles per invocation 108195 vs original 3693800\n" +) + + +def need(condition, message): + if not condition: + raise RuntimeError(message) + + +def sha(data): + return hashlib.sha256(data).hexdigest() + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode("ascii") + + +def cpu(): + own = resource.getrusage(resource.RUSAGE_SELF) + children = resource.getrusage(resource.RUSAGE_CHILDREN) + return own.ru_utime + own.ru_stime + children.ru_utime + children.ru_stime + + +def inventory(root, pins, *, exact=True): + need(root.is_dir() and not root.is_symlink(), "Missing or symlinked input root") + files = {} + for path in sorted(root.rglob("*")): + need(not path.is_symlink(), "Symlink in frozen inputs: " + str(path)) + if path.is_file(): + relative = str(path.relative_to(root)) + if relative not in pins: + need(not exact, "Undeclared frozen input: " + relative) + continue + raw = path.read_bytes() + expected = pins[relative][0] if type(pins[relative]) is list else pins[relative] + need(sha(raw) == expected, "Frozen input digest changed: " + relative) + files[relative] = {"sha256": sha(raw), "mode": stat.S_IMODE(path.stat().st_mode), "bytes": len(raw)} + need(set(files) == set(pins), "Frozen input inventory incomplete") + return files + +# Preserve the literal baseline function; main selects a local arm function. +original_inventory = inventory + +def candidate_inventory(root, pins, *, exact=True): + need(root.is_dir() and not root.is_symlink(), "Missing or symlinked input root") + files = {} + for path in sorted(root.rglob("*")): + need(not path.is_symlink(), "Symlink in frozen inputs: " + str(path)) + if path.is_file(): + relative = str(path.relative_to(root)) + if relative not in pins: + need(not exact, "Undeclared frozen input: " + relative) + continue + raw = path.read_bytes() + expected = pins[relative][0] if type(pins[relative]) is list else pins[relative] + raw_digest = sha(raw) + need(raw_digest == expected, "Frozen input digest changed: " + relative) + files[relative] = {"sha256": raw_digest, "mode": stat.S_IMODE(path.stat().st_mode), "bytes": len(raw)} + need(set(files) == set(pins), "Frozen input inventory incomplete") + return files + + +def typed(value): + """Lossless full return representation, including order and exact types.""" + kind = type(value) + if kind is Fraction: + return ["Fraction", value.numerator, value.denominator] + if value is None: + return ["None"] + if kind is bool: + return ["bool", value] + if kind is int: + return ["int", str(value)] + if kind is float: + return ["float", value.hex()] + if kind is str: + return ["str", value] + if kind is list or kind is tuple: + return [kind.__name__, [typed(item) for item in value]] + if kind is dict: + return ["dict", [[typed(key), typed(item)] for key, item in value.items()]] + raise TypeError("Unsupported exact full-certificate return type: " + kind.__name__) + + +class Phases: + """Broad phase observations; no per-arithmetic resource sampling. + + Every call retains the old timing fields. Memory samples are paid by both + arms, including nested side_construction so snapshots/retirement are visible. + """ + def __init__(self): + self.rows = {} + + @staticmethod + def memory(): + with open("/proc/self/status", "rb") as stream: + raw = stream.read(65537) + need(len(raw) <= 65536, "Process status diagnostic exceeded its bound") + current = None + for line in raw.splitlines(): + if line.startswith(b"VmRSS:"): + fields = line.split() + need(len(fields) == 3 and fields[2] == b"kB", "Unexpected process RSS diagnostic units") + current = int(fields[1]) * 1024 + break + need(current is not None, "Current process RSS diagnostic unavailable") + highwater = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss * 1024 + return {"current_vmrss_bytes": current, "process_ru_maxrss_bytes": highwater} + + def call(self, name, function, *args, **kwargs): + wall, used = time.perf_counter(), cpu() + memory_before = self.memory() + primary_failure = False + try: + return function(*args, **kwargs) + except BaseException: + primary_failure = True + raise + finally: + memory_after, memory_error = None, None + try: + memory_after = self.memory() + except BaseException as error: + # Do not replace an original failure with diagnostic failure. + memory_error = {"type": type(error).__name__} + if not primary_failure: + raise + row = self.rows.setdefault(name, {"calls": 0, "wall_seconds": 0.0, + "cpu_seconds_with_children": 0.0, + "memory_samples": [], + "memory_semantics": "VmRSS is current resident bytes; ru_maxrss is process high-water bytes; neither is an additive phase peak"}) + row["calls"] += 1 + row["memory_samples"].append({"before": memory_before, "after": memory_after, + "diagnostic_error": memory_error}) + row["wall_seconds"] += time.perf_counter() - wall + row["cpu_seconds_with_children"] += cpu() - used + + def wrap(self, owner, attribute, name): + original = getattr(owner, attribute) + def observed(*args, **kwargs): + return self.call(name, original, *args, **kwargs) + setattr(owner, attribute, observed) + return original, observed + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--frozen-root", type=Path, default=HERE / "frozen") + parser.add_argument("--reference", type=Path, default=HERE / "reference/certificates/complex-network.json") + parser.add_argument("--lanes", choices=("baseline", "candidate"), required=True) + parser.add_argument("--finite-only", action="store_true") + parser.add_argument("--output", type=Path, required=True, help="New external directory; every write stays below it") + parser.add_argument("--anchor", type=Path, default=HERE / "anchor.json") + args = parser.parse_args() + args.data_lanes = args.lanes + args.lanes = "all" # Both comparison arms retain the complete original native/bookkeeping baseline. + if args.data_lanes == "transport": + need(args.frozen_root == HERE / "frozen" and + args.reference == HERE / "reference/certificates/complex-network.json" and + args.anchor == HERE / "anchor.json", "Transport uses only the original fixed historical inputs") + data_adapters.transport(ROUND, HERE, args.output) + return + inventory = candidate_inventory if args.data_lanes == "candidate" else original_inventory + args.mode = "candidate" # Every new arm starts from the original native C configuration. + need(args.finite_only or sys.flags.optimize == 0, "Every full-caller mode requires original assertions") + need(sys.implementation.name == "cpython" and sys.version_info[:2] == (3, 12), "Frozen CPython 3.12 required") + data_adapters.require_execution_contract(args.data_lanes, args.finite_only) + need((args.mode == "profile") == (args.anchor is None), "Profile creates the anchor; both benchmark arms require --anchor") + frozen, reference = args.frozen_root.resolve(), args.reference.resolve() + output = args.output.resolve() + need(str(output) == _INITIAL_OUTPUT and output.is_dir() and not output.is_symlink() and + {path.name for path in output.iterdir()} == {'initial-tcb-controls'} and + (output / 'initial-tcb-controls').is_dir() and + not (output / 'initial-tcb-controls').is_symlink() and + not list((output / 'initial-tcb-controls').iterdir()), + "Early TCB output ownership or fresh control directory changed") + need(not output.is_relative_to(HERE) and not output.is_relative_to(frozen), "Output must be outside immutable sources") + need(reference.is_file() and not reference.is_symlink(), "Reference certificate missing or symlinked") + source_pin_bytes = (HERE / "SOURCE-PINS.json").read_bytes() + need(sha(source_pin_bytes) == PIN_SHA, "Source inventory pin changed") + pins = json.loads(source_pin_bytes) + need(len(pins) == 32, "Frozen closure must contain twelve scripts, manifest and nineteen payloads") + reference_bytes = reference.read_bytes() + need(sha(reference_bytes) == REFERENCE_SHA, "Original full certificate reference changed") + driver_before = Path(__file__).read_bytes() + new_custody_before = adapters.custody(ROUND, args.lanes) + data_custody_before = data_adapters.custody(ROUND) + reference_driver_before = (HERE / "full_driver.py").read_bytes() + need(sha(reference_driver_before) == REFERENCE_DRIVER_SHA, "Reference driver pin changed") + anchor_bytes = None if args.anchor is None else args.anchor.read_bytes() + expected_anchor = None if anchor_bytes is None else json.loads(anchor_bytes) + if expected_anchor is not None: + need(expected_anchor.get("schema") == "gf2-full-network-anchor-v1" and + expected_anchor.get("base_commit") == BASE and expected_anchor.get("source_pin_sha256") == PIN_SHA and + expected_anchor.get("driver_sha256") == REFERENCE_DRIVER_SHA and + expected_anchor.get("engine_pins") == ENGINE_PINS, + "Anchor source/driver/engine identity differs; no benchmark permitted") + _EXECUTION['output'] = output + compiler_tmp = output / "compiler-tmp" + compiler_tmp.mkdir() + os.environ["TMPDIR"] = str(compiler_tmp) + phases = Phases() + (output / 'initial-native-tcb.json').write_bytes(canonical(INITIAL_NATIVE_TCB_RECEIPT) + b'\n') + (output / 'initial-tcb-controls' / 'receipt.json').write_bytes(canonical(INITIAL_NATIVE_TCB_CONTROLS) + b'\n') + frozen_before = phases.call("input_custody", inventory, frozen, pins) + engine_before = phases.call("engine_custody", inventory, HERE / "engine", ENGINE_PINS) + manifest = json.loads((frozen / "upstream/manifest.json").read_bytes()) + need(manifest["commit"] == UPSTREAM and len(manifest["files"]) == 19, "Wrong pinned upstream manifest") + need({"upstream/" + name for name in manifest["files"]} == + {name for name in pins if name.startswith("upstream/") and name != "upstream/manifest.json"}, + "Source verifier payload closure changed") + for name, info in manifest["files"].items(): + need(info["sha256"] == pins["upstream/" + name][0], "Manifest payload hash differs from independent frozen pin") + + runtime, engine = output / "runtime-root", output / "engine" + phases.call("fresh_root_copy", shutil.copytree, frozen, runtime) + phases.call("fresh_engine_copy", shutil.copytree, HERE / "engine", engine) + # copytree retains readonly source directory permissions. Only this new + # private root is made writable for the original CLI certificate output. + runtime.chmod(0o755) + (runtime / "certificates").mkdir() + runtime_before = inventory(runtime, pins) + copied_engine_before = inventory(engine, ENGINE_PINS) + need(runtime_before == frozen_before and copied_engine_before == engine_before, "Copy changed input bytes or modes") + for name in ("complex_network.py", "complex_circuit.py"): + need((engine / "source" / name).read_bytes() == (runtime / "scripts" / name).read_bytes(), + "PR5929 engine/source differs from the full caller closure") + script_names = {Path(name).stem for name in pins if name.startswith("scripts/")} + engine_names = {"native_backend", "finite_controls", "compare_side_verifier", "profile_side_verifier"} + need(not (script_names | engine_names) & set(sys.modules), "Scientific module already loaded; fresh process required") + sys.path[:0] = [str(engine), str(runtime / "scripts")] + # BEGIN evaluated dispatch arguments scientific_driver:462 + _ca_args = (str(engine / 'native_backend.py'), ENGINE_PINS['native_backend.py'], 'native_backend') + _ca_kwargs = {'kind': 'backend'} + # END evaluated dispatch arguments scientific_driver:462 + # BEGIN caller admission scientific_driver:462 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:462 + backend, backend_handle = phases.call('cold_engine_import', _ca_dispatch, 0, *_ca_args, **_ca_kwargs) + # BEGIN evaluated dispatch arguments scientific_driver:465 + _ca_args = (_INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'capture_backend_factory_environment', backend) + _ca_kwargs = {'cold_authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'backend_handle': backend_handle, 'cache_handle': _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'bootstrap_root': _CAPTURED_BOOTSTRAP_ROOT, 'bootstrap_capability': _CAPTURED_BOOTSTRAP_CAPABILITY, 'bootstrap_api': _CAPTURED_BOOTSTRAP_API} + # END evaluated dispatch arguments scientific_driver:465 + # BEGIN caller admission scientific_driver:465 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:465 + factory_environment = phases.call('cold_backend_factory_environment', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + comparison = importlib.import_module("compare_side_verifier") + native = None + finite = None + build = None + if args.mode == "candidate": + packet = phases.call("cold_native_metadata_build", native_packet.prepare, + ROUND, output, data_custody_before, _CAPTURED_BOOTSTRAP_ROOT, + _CAPTURED_BOOTSTRAP_CAPABILITY, _CAPTURED_BOOTSTRAP_API) + _EXECUTION['packet'] = packet + packet['controls']['native_initial_tcb'] = INITIAL_NATIVE_TCB_CONTROLS + native, build = phases.call("cold_compile_link_load", backend.build_native, output / "cold-build") + # BEGIN evaluated dispatch arguments scientific_driver:484 + _ca_args = (_INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'prepare', ROUND, backend, backend_handle, native, output, args.lanes, phases, _INITIAL_COLD_AUTHORITY, _INITIAL_INTEGRATION_HANDLES['adapters'], new_custody_before) + _ca_kwargs = {'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR} + # END evaluated dispatch arguments scientific_driver:484 + # BEGIN caller admission scientific_driver:484 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:484 + extensions = phases.call('new_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + phases.call("all_native_metadata_and_preload_controls", native_packet.run_controls, packet, phases) + finite = phases.call("all_native_finite_independent_controls", importlib.import_module("finite_controls").run_controls, native) + phases.call("all_new_controls", adapters.run_controls, extensions, backend, native, phases) + # BEGIN evaluated dispatch arguments scientific_driver:492 + _ca_args = (_INITIAL_INTEGRATION_HANDLES['data_adapters'], 'prepare', ROUND, backend, comparison, extensions, args.data_lanes, data_custody_before, packet) + _ca_kwargs = {'authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'integration_handles': _INITIAL_INTEGRATION_HANDLES, 'backend_handle': backend_handle, 'adapters_handle': _INITIAL_INTEGRATION_HANDLES['adapters'], 'setup_handle': _INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'factory_environment': factory_environment, 'preloaded_cache': (_INITIAL_INTEGRATION_MODULES['_h25_data_cache'], _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'])} + # END evaluated dispatch arguments scientific_driver:492 + # BEGIN caller admission scientific_driver:492 + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission scientific_driver:492 + data_state = phases.call('data_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + _EXECUTION['state'] = data_state + phases.call("all_data_controls", data_adapters.run_controls, + data_state, native, output, phases, HERE / "full_driver.py", candidate_inventory, extensions) + (output / "finite-controls.json").write_bytes(canonical(finite) + b"\n") + + if args.finite_only: + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + # LAST native/scientific call. Everything below is source or receipt work. + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + need(inventory(frozen, pins) == frozen_before and inventory(HERE / "engine", ENGINE_PINS) == engine_before, "Finite immutable source custody changed") + need(inventory(runtime, pins) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, "Finite copied source custody changed") + need(adapters.custody(ROUND, args.lanes) == new_custody_before, "Finite new source custody changed") + need(data_adapters.custody(ROUND) == data_custody_before, "Finite data source custody changed") + result = {"status": "H25_DATA_HANDLING_FINITE_PASS", "lanes": args.data_lanes, + "data_handling": data_adapters.finite_receipt(data_state), + "data_source_custody": data_custody_before, + "optimized": sys.flags.optimize, "original_controls": finite, + "new_controls": extensions["controls"], "new_source_custody": new_custody_before, + "driver_sha256": sha(driver_before), + "initial_native_tcb": INITIAL_NATIVE_TCB_RECEIPT, + "native_packet": native_packet.receipt(packet), + "reference_driver_sha256": REFERENCE_DRIVER_SHA, "phases": phases.rows} + (output / "receipt.json").write_text(json.dumps(result, indent=2, sort_keys=True) + "\n") + print(json.dumps(result, sort_keys=True)) + return + + circuit_module = phases.call("cold_complex_module_load", backend.load_source, "complex_circuit") + sys.modules["complex_circuit"] = circuit_module + rank_calls = [] + complement = extensions["trace_type"](circuit_module.Label) + phases.call("private_set_and_data_adapter_installation", data_adapters.install_circuit, + data_state, extensions, circuit_module, comparison) + side_writer = data_adapters.scientific_writer(data_state) + binding = None + captures = {} + phases.wrap(circuit_module.ComplexSideCircuit, "__init__", "side_construction") + phases.wrap(circuit_module.Checks, "__init__", "checks_initialization") + phases.wrap(circuit_module, "compile_roles", "compile_roles") + phases.wrap(circuit_module.Checks, "verify_map", "verify_map") + phases.wrap(circuit_module.Checks, "verify_labels", "verify_labels") + original_roles = circuit_module.verify_role_frames + def observe_roles(c, checks, code=None): + need("side" not in captures and code is not None, "Unexpected role-frame invocation") + result = phases.call("verify_role_frames", original_roles, c, checks, code) + captures["side"] = (c, checks, code, result) + return result + circuit_module.verify_role_frames = observe_roles + + certify = phases.call("cold_certify_import", importlib.import_module, "certify") + phases.wrap(certify, "verify_sources", "original_upstream_verify_sources") + prepare = phases.call("cold_prepare_import", importlib.import_module, "prepare_layers") + search = importlib.import_module("search_network") + phases.wrap(search, "log_integer_bounds", "full_log_integer_bounds") + original_serializable = prepare.serializable + depth = 0 + def observe_serializable(value): + nonlocal depth + outer = depth == 0 + if outer: + need("full_return" not in captures and type(value) is dict, "Unexpected outer serialization") + captures["full_return"] = value + depth += 1 + try: + # Recursion still delegates the original serializable exactly once + # per value; only the outer call is captured/timed. + if outer: + return phases.call("original_serializable", original_serializable, value) + return original_serializable(value) + finally: + depth -= 1 + prepare.serializable = observe_serializable + + # CS/Checks/phase/trace observers are final before either new guard captures them. + binding = phases.call("final_native_binding", data_adapters.bind_native, + data_state, backend, circuit_module, native, rank_calls, complement) + phases.call("construction_lease_sealing", data_adapters.seal, data_state) + phases.call("private_set_lease_sealing", adapters.seal, extensions) + caller = runtime / "scripts/complex_network.py" + old_argv = sys.argv + stdout = io.StringIO() + try: + phases.call("final_private_environment_and_arming", data_adapters.arm, data_state, extensions) + sys.argv = [str(caller)] + with redirect_stdout(stdout): + namespace = phases.call("complete_original_cli", runpy.run_path, str(caller), run_name="__main__") + finally: + sys.argv = old_argv + adapters.disarm(extensions) + cli_stdout = stdout.getvalue() + need(cli_stdout == EXPECTED_STDOUT, "Original CLI stdout changed") + certificate_bytes = (runtime / "certificates/complex-network.json").read_bytes() + need(certificate_bytes == reference_bytes, "Original CLI certificate bytes differ from the pinned reference") + need(sys.modules["complex_circuit"] is circuit_module and + namespace["ComplexSideCircuit"] is circuit_module.ComplexSideCircuit and + namespace["Checks"] is circuit_module.Checks and namespace["compile_roles"] is circuit_module.compile_roles and + namespace["verify_role_frames"] is observe_roles and namespace["serializable"] is observe_serializable, + "Caller used a different scientific module or observation binding") + need(captures.keys() == {"side", "full_return"}, "Missing exact caller observations") + c, checks, code, role_result = captures["side"] + full_return = captures["full_return"] + need(full_return["role_frames"] is role_result and full_return["upstream_commit"] == UPSTREAM, + "Role return or actual source verification boundary changed") + for name in ("side_construction", "checks_initialization", "compile_roles", "verify_map", "verify_labels", + "verify_role_frames", "original_upstream_verify_sources", "full_log_integer_bounds", + "original_serializable", "complete_original_cli"): + need(phases.rows.get(name, {}).get("calls") == 1, "Original phase was omitted or repeated: " + name) + imports = {} + for name in script_names - {"complex_network"}: + module = sys.modules.get(name) + expected_path = engine / "source/complex_circuit.py" if name == "complex_circuit" else runtime / "scripts" / (name + ".py") + need(module is not None and Path(module.__file__).resolve() == expected_path.resolve(), "Unpinned scientific import: " + name) + imports[name] = str(module.__file__) + if binding is not None: + binding["runtime_guard"].check() + need(binding["counters"] == {"complement_native": 238685, "complement_fallback": 0, + "gram_native": 59959, "gram_fallback": 0}, "Native full-call coverage changed") + + side_result = {key: full_return[key] for key in ("circuit", "side_map", "labels", "role_frames")} + witness = { + "support": c.support, "args": c.args, "kind": c.kind, "active": sorted(c.active), + "pieces": [(target, node, (coefficient.numerator, coefficient.denominator)) for target, node, coefficient in c.pieces], + "labels": [(key, list(label.basis.items()), label.dim, label.key) for key, label in checks.cache.items()], + "code": {"roles": code["roles"], "gates": code["gates"], "sources": list(code["sources"].items()), + "outputs": list(code["outputs"].items())}, + } + side_output = output / "side-observations" + side_output.mkdir() + side_receipt = phases.call("identical_lossless_side_serialization", side_writer, + side_output, side_result, witness, rank_calls) + complement_receipt = complement.receipt() + need(complement_receipt == COMPLEMENT_EXPECTED, "Every ordered complement observation must match PR5929") + full_typed_bytes = canonical(typed(full_return)) + (output / "full-return.lossless.json").write_bytes(full_typed_bytes) + (output / "original-stdout.txt").write_text(cli_stdout, encoding="utf-8") + (output / "complement-transcript.json").write_bytes(canonical(complement_receipt) + b"\n") + science = { + "full_cli_certificate_sha256": sha(certificate_bytes), "full_cli_stdout_sha256": sha(cli_stdout.encode("utf-8")), + "full_return_lossless_sha256": sha(full_typed_bytes), "side": side_receipt, + "ordered_complements": complement_receipt, "upstream_commit": UPSTREAM, + } + anchor = {"schema": "gf2-full-network-anchor-v1", "base_commit": BASE, "source_pin_sha256": PIN_SHA, + "driver_sha256": REFERENCE_DRIVER_SHA, "engine_pins": ENGINE_PINS, "science": science} + if expected_anchor is not None: + need(anchor == expected_anchor, "Complete certificate/types/ordered observations differ from frozen anchor") + else: + (output / "anchor.json").write_bytes(canonical(anchor) + b"\n") + need(inventory(frozen, pins) == frozen_before and inventory(HERE / "engine", ENGINE_PINS) == engine_before, + "Immutable source bytes/modes changed") + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, + "Runtime scientific source bytes/modes changed") + runtime_files = {str(path.relative_to(runtime)) for path in runtime.rglob("*") if path.is_file()} + need(runtime_files == set(pins) | {"certificates/complex-network.json"}, "Unexpected full-caller file side effect") + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and + (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), "Driver/reference/anchor changed during run") + need(adapters.custody(ROUND, args.lanes) == new_custody_before, "New source custody changed") + # Snapshot final scientific bookkeeping before the deliberately terminal late hook. + bookkeeping_receipt = adapters.receipt(extensions) + data_receipt = phases.call("data_finalization", data_adapters.finish, data_state, binding) + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + # LAST native/scientific call. No owner, root API, provider, or native guard follows. + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + # Honest source custody and receipt work continue after the terminal boundary. + need(data_adapters.custody(ROUND) == data_custody_before, "Data source custody changed") + need(adapters.custody(ROUND, args.lanes) == new_custody_before, "Post-late original source custody changed") + need(inventory(frozen, pins) == frozen_before and inventory(HERE / "engine", ENGINE_PINS) == engine_before, + "Post-late immutable source custody changed") + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, + "Post-late copied source custody changed") + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and + (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), "Post-late driver/reference/anchor changed") + receipt = { + "new_source_custody": new_custody_before, + "status": "FULL_NETWORK_PROFILE_ANCHOR_PASS" if args.mode == "profile" else "FULL_NETWORK_COMPLETE_PASS", + "mode": args.mode, "lanes": args.data_lanes, "bookkeeping": bookkeeping_receipt, + "data_handling": data_receipt, "data_source_custody": data_custody_before, + "reference_driver_sha256": REFERENCE_DRIVER_SHA, + "science": science, "base_commit": BASE, "native_predecessor_pr": 5995, + "driver_sha256": sha(driver_before), "source_pin_sha256": PIN_SHA, + "frozen_custody": frozen_before, "engine_custody": engine_before, "scientific_imports": imports, + "build": build, "finite_controls": finite, + "initial_native_tcb": INITIAL_NATIVE_TCB_RECEIPT, + "native_packet": native_packet.receipt(packet), + "private_root_permission": "runtime-root is0755; copied input file modes are retained and checked; immutable stages are never chmodded", + "compiler_tmpdir": str(compiler_tmp), + "native_calls": None if binding is None else dict(binding["counters"]), + "phases": phases.rows, "driver_wall_seconds_after_initial_tcb_before_receipt": time.perf_counter() - START_WALL, + "process_and_compiler_cpu_seconds_before_receipt": cpu(), + "environment": {"python": sys.version, "executable": sys.executable, "platform": sys.platform}, + "measurement": "Parent outer guard is authoritative and includes pristine root startup, initial native TCB authentication, early cold source authority capture and every factory dependency/product check, three cold metadata compilations plus original cold native/trace builds, every old and new control in BOTH arms, all candidate production admission/guards, IO and terminal cleanup. Baseline receives the complete same control union. Driver wall diagnostic starts after initial TCB and cold authority capture and is not total process wall. Broad phase samples are nested, not additive; VmRSS is current RSS and ru_maxrss is process high-water. Eager witnesses and original observations remain; full funding and equality gates are separate and currently closed.", + "scope": "Complete frozen historical complex-network CLI with retained observations; conditional certificate only. No bare-CLI factor, selected-frontier, new kappa or PR5864 speed claim.", + } + (output / "receipt.json").write_text(json.dumps(receipt, indent=2, sort_keys=True) + "\n") + sys.stdout.write(cli_stdout) + print(json.dumps({"status": receipt["status"], "mode": args.mode, "science": science, + "wall_seconds": receipt["driver_wall_seconds_after_initial_tcb_before_receipt"], + "cpu_seconds_with_compiler": receipt["process_and_compiler_cpu_seconds_before_receipt"], + "phases": phases.rows}, sort_keys=True)) + + +def _run_with_stop_evidence(): + try: + main() + except BaseException as primary_error: + # Nothing in cleanup or evidence assembly may replace this primary object. + try: + state = _EXECUTION['state'] + cleanup_errors = [] + try: + cleanup_errors = data_adapters.cleanup_owned(state) + except BaseException as cleanup_error: + cleanup_errors.append({'type': type(cleanup_error).__name__, 'message': str(cleanup_error)}) + stop = {'schema': 'h25-combined-v2-stop-v1', 'status': 'STOP', + 'primary_error': {'type': type(primary_error).__name__, 'message': str(primary_error)}, + 'primary_cause': None if primary_error.__cause__ is None else { + 'type': type(primary_error.__cause__).__name__, 'message': str(primary_error.__cause__)}, + 'cleanup_errors': cleanup_errors, + 'data': data_adapters.stop_diagnostics(state), + 'native_packet': None if _EXECUTION['packet'] is None else native_packet.receipt(_EXECUTION['packet']), + 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT} + output = _EXECUTION['output'] + if output is not None: + with (output / 'STOP.json').open('x', encoding='utf-8') as stream: + stream.write(json.dumps(stop, sort_keys=True, indent=2) + '\n') + except BaseException as evidence_error: + # Parent retains an independent process transcript even if this fails. + try: + sys.stderr.write('STOP evidence write failed: ' + type(evidence_error).__name__ + '\n') + except BaseException: + pass + raise + + + + +def _epoch_cli_boundary(phases, data_state, extensions, caller, stdout, invocation_token, old_argv): + _epoch_cli_primary = None + _epoch_cli_argv_error = None + _epoch_cli_disarm_error = None + _epoch_cli_retirement_error = None + _epoch_cli_record = None + try: + try: + _epoch_cli_record = {'primary': None, 'argv_error': None, 'disarm_error': None, 'retirement_error': None, 'outer_retirement_error': None, 'uncertain': False, 'argv_owner': old_argv, 'retirement_channel': {'started': False, 'error': None, 'journal_error': None, 'acknowledged': False}, 'outer_retirement_channel': {'started': False, 'error': None, 'journal_error': None, 'acknowledged': False}} + data_state['epoch_cli_cleanup'] = _epoch_cli_record + phases.call('final_private_environment_and_arming', data_adapters.arm, data_state, extensions) + if data_state['enabled']: + data_adapters.epoch_arm(data_state, invocation_token) + sys.argv = [str(caller)] + with redirect_stdout(stdout): + namespace = phases.call('complete_original_cli', runpy.run_path, str(caller), run_name='__main__') + return namespace + except BaseException as _epoch_cli_error: + _epoch_cli_primary = _epoch_cli_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_cli_error + raise + finally: + try: + sys.argv = old_argv + except BaseException as _epoch_argv_error: + _epoch_cli_argv_error = _epoch_argv_error + if _epoch_cli_record is not None: + _epoch_cli_record['argv_error'] = _epoch_argv_error + _epoch_cli_record['uncertain'] = True + if _epoch_cli_primary is None: + _epoch_cli_primary = _epoch_argv_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_argv_error + try: + adapters.disarm(extensions) + except BaseException as _epoch_disarm_error: + _epoch_cli_disarm_error = _epoch_disarm_error + if _epoch_cli_record is not None: + _epoch_cli_record['disarm_error'] = _epoch_disarm_error + _epoch_cli_record['uncertain'] = True + if _epoch_cli_primary is None: + _epoch_cli_primary = _epoch_disarm_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_disarm_error + raise + if _epoch_cli_argv_error is not None: + raise _epoch_cli_primary + finally: + try: + data_adapters.epoch_retire(data_state, 'whole-cli-terminal', _epoch_cli_primary, _epoch_cli_disarm_error, _epoch_cli_argv_error, None if _epoch_cli_record is None else _epoch_cli_record['retirement_channel'], 'inner') + except BaseException as _epoch_retirement_error: + _epoch_cli_retirement_error = _epoch_retirement_error + if _epoch_cli_record is not None: + _epoch_cli_record['retirement_error'] = _epoch_retirement_error + _epoch_cli_record['uncertain'] = True + if _epoch_cli_primary is None: + _epoch_cli_primary = _epoch_retirement_error + if _epoch_cli_record is not None: + _epoch_cli_record['primary'] = _epoch_retirement_error + raise + +def main_epoch(): + _epoch_invocation = object() + _epoch_driver_origin = data_adapters.epoch_driver_entry(_INITIAL_COLD_AUTHORITY, _INITIAL_COLD_CALLER_DESCRIPTOR, _INITIAL_EPOCH_BUNDLE[3], main_epoch, Phases, _epoch_invocation) + data_state = None + _epoch_primary = None + _epoch_outer_retirement_error = None + _epoch_outer_cleanup = None + try: + _epoch_outer_cleanup = {'primary': None, 'retirement_error': None, 'uncertain': False, 'attempted': False} + _EXECUTION['epoch_outer_cleanup'] = _epoch_outer_cleanup + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--frozen-root', type=Path, default=HERE / 'frozen') + parser.add_argument('--reference', type=Path, default=HERE / 'reference/certificates/complex-network.json') + parser.add_argument('--lanes', choices=('baseline', 'candidate'), required=True) + parser.add_argument('--finite-only', action='store_true') + parser.add_argument('--output', type=Path, required=True, help='New external directory; every write stays below it') + parser.add_argument('--anchor', type=Path, default=HERE / 'anchor.json') + args = parser.parse_args() + args.data_lanes = args.lanes + args.lanes = 'all' + if args.data_lanes == 'transport': + need(args.frozen_root == HERE / 'frozen' and args.reference == HERE / 'reference/certificates/complex-network.json' and (args.anchor == HERE / 'anchor.json'), 'Transport uses only the original fixed historical inputs') + data_adapters.transport(ROUND, HERE, args.output) + return + inventory = candidate_inventory if args.data_lanes == 'candidate' else original_inventory + args.mode = 'candidate' + need(args.finite_only or sys.flags.optimize == 0, 'Every full-caller mode requires original assertions') + need(sys.implementation.name == 'cpython' and sys.version_info[:2] == (3, 12), 'Frozen CPython 3.12 required') + data_adapters.require_execution_contract(args.data_lanes, args.finite_only) + need((args.mode == 'profile') == (args.anchor is None), 'Profile creates the anchor; both benchmark arms require --anchor') + frozen, reference = (args.frozen_root.resolve(), args.reference.resolve()) + output = args.output.resolve() + need(str(output) == _INITIAL_OUTPUT and output.is_dir() and (not output.is_symlink()) and ({path.name for path in output.iterdir()} == {'initial-tcb-controls'}) and (output / 'initial-tcb-controls').is_dir() and (not (output / 'initial-tcb-controls').is_symlink()) and (not list((output / 'initial-tcb-controls').iterdir())), 'Early TCB output ownership or fresh control directory changed') + need(not output.is_relative_to(HERE) and (not output.is_relative_to(frozen)), 'Output must be outside immutable sources') + need(reference.is_file() and (not reference.is_symlink()), 'Reference certificate missing or symlinked') + source_pin_bytes = (HERE / 'SOURCE-PINS.json').read_bytes() + need(sha(source_pin_bytes) == PIN_SHA, 'Source inventory pin changed') + pins = json.loads(source_pin_bytes) + need(len(pins) == 32, 'Frozen closure must contain twelve scripts, manifest and nineteen payloads') + reference_bytes = reference.read_bytes() + need(sha(reference_bytes) == REFERENCE_SHA, 'Original full certificate reference changed') + driver_before = Path(__file__).read_bytes() + new_custody_before = adapters.custody(ROUND, args.lanes) + data_custody_before = data_adapters.custody(ROUND) + reference_driver_before = (HERE / 'full_driver.py').read_bytes() + need(sha(reference_driver_before) == REFERENCE_DRIVER_SHA, 'Reference driver pin changed') + anchor_bytes = None if args.anchor is None else args.anchor.read_bytes() + expected_anchor = None if anchor_bytes is None else json.loads(anchor_bytes) + if expected_anchor is not None: + need(expected_anchor.get('schema') == 'gf2-full-network-anchor-v1' and expected_anchor.get('base_commit') == BASE and (expected_anchor.get('source_pin_sha256') == PIN_SHA) and (expected_anchor.get('driver_sha256') == REFERENCE_DRIVER_SHA) and (expected_anchor.get('engine_pins') == ENGINE_PINS), 'Anchor source/driver/engine identity differs; no benchmark permitted') + _EXECUTION['output'] = output + compiler_tmp = output / 'compiler-tmp' + compiler_tmp.mkdir() + os.environ['TMPDIR'] = str(compiler_tmp) + phases = Phases() + (output / 'initial-native-tcb.json').write_bytes(canonical(INITIAL_NATIVE_TCB_RECEIPT) + b'\n') + (output / 'initial-tcb-controls' / 'receipt.json').write_bytes(canonical(INITIAL_NATIVE_TCB_CONTROLS) + b'\n') + frozen_before = phases.call('input_custody', inventory, frozen, pins) + engine_before = phases.call('engine_custody', inventory, HERE / 'engine', ENGINE_PINS) + manifest = json.loads((frozen / 'upstream/manifest.json').read_bytes()) + need(manifest['commit'] == UPSTREAM and len(manifest['files']) == 19, 'Wrong pinned upstream manifest') + need({'upstream/' + name for name in manifest['files']} == {name for name in pins if name.startswith('upstream/') and name != 'upstream/manifest.json'}, 'Source verifier payload closure changed') + for name, info in manifest['files'].items(): + need(info['sha256'] == pins['upstream/' + name][0], 'Manifest payload hash differs from independent frozen pin') + runtime, engine = (output / 'runtime-root', output / 'engine') + phases.call('fresh_root_copy', shutil.copytree, frozen, runtime) + phases.call('fresh_engine_copy', shutil.copytree, HERE / 'engine', engine) + runtime.chmod(493) + (runtime / 'certificates').mkdir() + runtime_before = inventory(runtime, pins) + copied_engine_before = inventory(engine, ENGINE_PINS) + need(runtime_before == frozen_before and copied_engine_before == engine_before, 'Copy changed input bytes or modes') + for name in ('complex_network.py', 'complex_circuit.py'): + need((engine / 'source' / name).read_bytes() == (runtime / 'scripts' / name).read_bytes(), 'PR5929 engine/source differs from the full caller closure') + script_names = {Path(name).stem for name in pins if name.startswith('scripts/')} + engine_names = {'native_backend', 'finite_controls', 'compare_side_verifier', 'profile_side_verifier'} + need(not (script_names | engine_names) & set(sys.modules), 'Scientific module already loaded; fresh process required') + sys.path[:0] = [str(engine), str(runtime / 'scripts')] + _ca_args = (str(engine / 'native_backend.py'), ENGINE_PINS['native_backend.py'], 'native_backend') + _ca_kwargs = {'kind': 'backend'} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + backend, backend_handle = phases.call('cold_engine_import', _ca_dispatch, 0, *_ca_args, **_ca_kwargs) + _ca_args = (_INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'capture_backend_factory_environment', backend) + _ca_kwargs = {'cold_authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'backend_handle': backend_handle, 'cache_handle': _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'], 'bootstrap_root': _CAPTURED_BOOTSTRAP_ROOT, 'bootstrap_capability': _CAPTURED_BOOTSTRAP_CAPABILITY, 'bootstrap_api': _CAPTURED_BOOTSTRAP_API} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + factory_environment = phases.call('cold_backend_factory_environment', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + comparison = importlib.import_module('compare_side_verifier') + native = None + finite = None + build = None + if args.mode == 'candidate': + packet = phases.call('cold_native_metadata_build', native_packet.prepare, ROUND, output, data_custody_before, _CAPTURED_BOOTSTRAP_ROOT, _CAPTURED_BOOTSTRAP_CAPABILITY, _CAPTURED_BOOTSTRAP_API) + _EXECUTION['packet'] = packet + packet['controls']['native_initial_tcb'] = INITIAL_NATIVE_TCB_CONTROLS + native, build = phases.call('cold_compile_link_load', backend.build_native, output / 'cold-build') + _ca_args = (_INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'prepare', ROUND, backend, backend_handle, native, output, args.lanes, phases, _INITIAL_COLD_AUTHORITY, _INITIAL_INTEGRATION_HANDLES['adapters'], new_custody_before) + _ca_kwargs = {'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + extensions = phases.call('new_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + phases.call('all_native_metadata_and_preload_controls', native_packet.run_controls, packet, phases) + finite = phases.call('all_native_finite_independent_controls', importlib.import_module('finite_controls').run_controls, native) + phases.call('all_new_controls', adapters.run_controls, extensions, backend, native, phases) + _ca_args = (_INITIAL_INTEGRATION_HANDLES['data_adapters'], 'prepare', ROUND, backend, comparison, extensions, args.data_lanes, data_custody_before, packet) + _ca_kwargs = {'authority': _INITIAL_COLD_AUTHORITY, 'cold_caller_descriptor': _INITIAL_COLD_CALLER_DESCRIPTOR, 'integration_handles': _INITIAL_INTEGRATION_HANDLES, 'backend_handle': backend_handle, 'adapters_handle': _INITIAL_INTEGRATION_HANDLES['adapters'], 'setup_handle': _INITIAL_INTEGRATION_HANDLES['guarded_adapters_v4'], 'factory_environment': factory_environment, 'preloaded_cache': (_INITIAL_INTEGRATION_MODULES['_h25_data_cache'], _INITIAL_INTEGRATION_HANDLES['_h25_data_cache'])} + _ca_desc = _INITIAL_COLD_CALLER_DESCRIPTOR + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if _INITIAL_COLD_AUTHORITY is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + data_state = phases.call('data_adapter_preparation', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + _EXECUTION['state'] = data_state + phases.call('all_data_controls', data_adapters.run_controls, data_state, native, output, phases, HERE / 'full_driver.py', candidate_inventory, extensions) + (output / 'finite-controls.json').write_bytes(canonical(finite) + b'\n') + if args.finite_only: + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + need(inventory(frozen, pins) == frozen_before and inventory(HERE / 'engine', ENGINE_PINS) == engine_before, 'Finite immutable source custody changed') + need(inventory(runtime, pins) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, 'Finite copied source custody changed') + need(adapters.custody(ROUND, args.lanes) == new_custody_before, 'Finite new source custody changed') + need(data_adapters.custody(ROUND) == data_custody_before, 'Finite data source custody changed') + result = {'status': 'H25_DATA_HANDLING_FINITE_PASS', 'lanes': args.data_lanes, 'data_handling': data_adapters.finite_receipt(data_state), 'data_source_custody': data_custody_before, 'optimized': sys.flags.optimize, 'original_controls': finite, 'new_controls': extensions['controls'], 'new_source_custody': new_custody_before, 'driver_sha256': sha(driver_before), 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT, 'native_packet': native_packet.receipt(packet), 'reference_driver_sha256': REFERENCE_DRIVER_SHA, 'phases': phases.rows} + (output / 'receipt.json').write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + print(json.dumps(result, sort_keys=True)) + return + if data_state['enabled']: + circuit_module, _epoch_load_ticket = phases.call('cold_complex_module_load', data_adapters.epoch_load, data_state, _INITIAL_EPOCH_BUNDLE[3]) + else: + circuit_module = phases.call('cold_complex_module_load', backend.load_source, 'complex_circuit') + sys.modules['complex_circuit'] = circuit_module + rank_calls = [] + complement = extensions['trace_type'](circuit_module.Label) + if data_state['enabled']: + _epoch_context = {'data_handle': _INITIAL_INTEGRATION_HANDLES['data_adapters'], 'data_module': data_adapters, 'phase_function': Phases.wrap, 'phase_class': Phases, 'phase_owner': phases, 'driver_function': main_epoch, 'driver_record': _epoch_driver_origin, 'invocation_token': _epoch_invocation, 'disposition_state': data_state} + phases.call('private_set_and_data_adapter_installation', data_adapters.install_epoch_circuit, data_state, extensions, circuit_module, comparison, _INITIAL_EPOCH_BUNDLE[3], _epoch_load_ticket, _epoch_context) + else: + phases.call('private_set_and_data_adapter_installation', data_adapters.install_circuit, data_state, extensions, circuit_module, comparison) + side_writer = data_adapters.scientific_writer(data_state) + binding = None + captures = {} + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'circuit', circuit_module.ComplexSideCircuit, '__init__', 'side_construction') + else: + phases.wrap(circuit_module.ComplexSideCircuit, '__init__', 'side_construction') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'checks', circuit_module.Checks, '__init__', 'checks_initialization') + else: + phases.wrap(circuit_module.Checks, '__init__', 'checks_initialization') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'module', circuit_module, 'compile_roles', 'compile_roles') + else: + phases.wrap(circuit_module, 'compile_roles', 'compile_roles') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'checks', circuit_module.Checks, 'verify_map', 'verify_map') + else: + phases.wrap(circuit_module.Checks, 'verify_map', 'verify_map') + if data_state['enabled']: + data_adapters.epoch_phase_wrap(data_state, phases, 'checks', circuit_module.Checks, 'verify_labels', 'verify_labels') + else: + phases.wrap(circuit_module.Checks, 'verify_labels', 'verify_labels') + original_roles = circuit_module.verify_role_frames + + def observe_roles(c, checks, code=None): + need('side' not in captures and code is not None, 'Unexpected role-frame invocation') + result = phases.call('verify_role_frames', original_roles, c, checks, code) + captures['side'] = (c, checks, code, result) + return result + if data_state['enabled']: + data_adapters.epoch_role_observer(data_state, observe_roles) + else: + circuit_module.verify_role_frames = observe_roles + certify = phases.call('cold_certify_import', importlib.import_module, 'certify') + phases.wrap(certify, 'verify_sources', 'original_upstream_verify_sources') + prepare = phases.call('cold_prepare_import', importlib.import_module, 'prepare_layers') + search = importlib.import_module('search_network') + phases.wrap(search, 'log_integer_bounds', 'full_log_integer_bounds') + original_serializable = prepare.serializable + depth = 0 + + def observe_serializable(value): + nonlocal depth + outer = depth == 0 + if outer: + need('full_return' not in captures and type(value) is dict, 'Unexpected outer serialization') + captures['full_return'] = value + depth += 1 + try: + if outer: + return phases.call('original_serializable', original_serializable, value) + return original_serializable(value) + finally: + depth -= 1 + prepare.serializable = observe_serializable + binding = phases.call('final_native_binding', data_adapters.bind_epoch_native if data_state['enabled'] else data_adapters.bind_native, data_state, backend, circuit_module, native, rank_calls, complement) + phases.call('construction_lease_sealing', data_adapters.seal, data_state) + phases.call('private_set_lease_sealing', adapters.seal, extensions) + if data_state['enabled']: + data_adapters.epoch_seal(data_state) + caller = runtime / 'scripts/complex_network.py' + old_argv = sys.argv + stdout = io.StringIO() + namespace = _epoch_cli_boundary(phases, data_state, extensions, caller, stdout, _epoch_invocation, old_argv) + cli_stdout = stdout.getvalue() + need(cli_stdout == EXPECTED_STDOUT, 'Original CLI stdout changed') + certificate_bytes = (runtime / 'certificates/complex-network.json').read_bytes() + need(certificate_bytes == reference_bytes, 'Original CLI certificate bytes differ from the pinned reference') + need(sys.modules['complex_circuit'] is circuit_module and namespace['ComplexSideCircuit'] is circuit_module.ComplexSideCircuit and (namespace['Checks'] is circuit_module.Checks) and (namespace['compile_roles'] is circuit_module.compile_roles) and (namespace['verify_role_frames'] is observe_roles) and (namespace['serializable'] is observe_serializable), 'Caller used a different scientific module or observation binding') + need(captures.keys() == {'side', 'full_return'}, 'Missing exact caller observations') + c, checks, code, role_result = captures['side'] + full_return = captures['full_return'] + need(full_return['role_frames'] is role_result and full_return['upstream_commit'] == UPSTREAM, 'Role return or actual source verification boundary changed') + for name in ('side_construction', 'checks_initialization', 'compile_roles', 'verify_map', 'verify_labels', 'verify_role_frames', 'original_upstream_verify_sources', 'full_log_integer_bounds', 'original_serializable', 'complete_original_cli'): + need(phases.rows.get(name, {}).get('calls') == 1, 'Original phase was omitted or repeated: ' + name) + imports = {} + for name in script_names - {'complex_network'}: + module = sys.modules.get(name) + expected_path = engine / 'source/complex_circuit.py' if name == 'complex_circuit' else runtime / 'scripts' / (name + '.py') + need(module is not None and Path(module.__file__).resolve() == expected_path.resolve(), 'Unpinned scientific import: ' + name) + imports[name] = str(module.__file__) + if binding is not None: + binding['runtime_guard'].check() + need(binding['counters'] == {'complement_native': 238685, 'complement_fallback': 0, 'gram_native': 59959, 'gram_fallback': 0}, 'Native full-call coverage changed') + side_result = {key: full_return[key] for key in ('circuit', 'side_map', 'labels', 'role_frames')} + witness = {'support': c.support, 'args': c.args, 'kind': c.kind, 'active': sorted(c.active), 'pieces': [(target, node, (coefficient.numerator, coefficient.denominator)) for target, node, coefficient in c.pieces], 'labels': [(key, list(label.basis.items()), label.dim, label.key) for key, label in checks.cache.items()], 'code': {'roles': code['roles'], 'gates': code['gates'], 'sources': list(code['sources'].items()), 'outputs': list(code['outputs'].items())}} + side_output = output / 'side-observations' + side_output.mkdir() + side_receipt = phases.call('identical_lossless_side_serialization', side_writer, side_output, side_result, witness, rank_calls) + complement_receipt = complement.receipt() + need(complement_receipt == COMPLEMENT_EXPECTED, 'Every ordered complement observation must match PR5929') + full_typed_bytes = canonical(typed(full_return)) + (output / 'full-return.lossless.json').write_bytes(full_typed_bytes) + (output / 'original-stdout.txt').write_text(cli_stdout, encoding='utf-8') + (output / 'complement-transcript.json').write_bytes(canonical(complement_receipt) + b'\n') + science = {'full_cli_certificate_sha256': sha(certificate_bytes), 'full_cli_stdout_sha256': sha(cli_stdout.encode('utf-8')), 'full_return_lossless_sha256': sha(full_typed_bytes), 'side': side_receipt, 'ordered_complements': complement_receipt, 'upstream_commit': UPSTREAM} + anchor = {'schema': 'gf2-full-network-anchor-v1', 'base_commit': BASE, 'source_pin_sha256': PIN_SHA, 'driver_sha256': REFERENCE_DRIVER_SHA, 'engine_pins': ENGINE_PINS, 'science': science} + if expected_anchor is not None: + need(anchor == expected_anchor, 'Complete certificate/types/ordered observations differ from frozen anchor') + else: + (output / 'anchor.json').write_bytes(canonical(anchor) + b'\n') + need(inventory(frozen, pins) == frozen_before and inventory(HERE / 'engine', ENGINE_PINS) == engine_before, 'Immutable source bytes/modes changed') + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, 'Runtime scientific source bytes/modes changed') + runtime_files = {str(path.relative_to(runtime)) for path in runtime.rglob('*') if path.is_file()} + need(runtime_files == set(pins) | {'certificates/complex-network.json'}, 'Unexpected full-caller file side effect') + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), 'Driver/reference/anchor changed during run') + need(adapters.custody(ROUND, args.lanes) == new_custody_before, 'New source custody changed') + bookkeeping_receipt = adapters.receipt(extensions) + data_receipt = phases.call('data_finalization', data_adapters.finish, data_state, binding) + phases.call('terminal_native_cleanup_and_checks', data_adapters.finish_before_late, data_state) + phases.call('bootstrap_late_last', data_adapters.finish_late_last, data_state) + need(data_adapters.custody(ROUND) == data_custody_before, 'Data source custody changed') + need(adapters.custody(ROUND, args.lanes) == new_custody_before, 'Post-late original source custody changed') + need(inventory(frozen, pins) == frozen_before and inventory(HERE / 'engine', ENGINE_PINS) == engine_before, 'Post-late immutable source custody changed') + need(inventory(runtime, pins, exact=False) == runtime_before and inventory(engine, ENGINE_PINS) == copied_engine_before, 'Post-late copied source custody changed') + need(Path(__file__).read_bytes() == driver_before and reference.read_bytes() == reference_bytes and (anchor_bytes is None or args.anchor.read_bytes() == anchor_bytes), 'Post-late driver/reference/anchor changed') + receipt = {'new_source_custody': new_custody_before, 'status': 'FULL_NETWORK_PROFILE_ANCHOR_PASS' if args.mode == 'profile' else 'FULL_NETWORK_COMPLETE_PASS', 'mode': args.mode, 'lanes': args.data_lanes, 'bookkeeping': bookkeeping_receipt, 'data_handling': data_receipt, 'data_source_custody': data_custody_before, 'reference_driver_sha256': REFERENCE_DRIVER_SHA, 'science': science, 'base_commit': BASE, 'native_predecessor_pr': 5995, 'driver_sha256': sha(driver_before), 'source_pin_sha256': PIN_SHA, 'frozen_custody': frozen_before, 'engine_custody': engine_before, 'scientific_imports': imports, 'build': build, 'finite_controls': finite, 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT, 'native_packet': native_packet.receipt(packet), 'private_root_permission': 'runtime-root is0755; copied input file modes are retained and checked; immutable stages are never chmodded', 'compiler_tmpdir': str(compiler_tmp), 'native_calls': None if binding is None else dict(binding['counters']), 'phases': phases.rows, 'driver_wall_seconds_after_initial_tcb_before_receipt': time.perf_counter() - START_WALL, 'process_and_compiler_cpu_seconds_before_receipt': cpu(), 'environment': {'python': sys.version, 'executable': sys.executable, 'platform': sys.platform}, 'measurement': 'Parent outer guard is authoritative and includes pristine root startup, initial native TCB authentication, early cold source authority capture and every factory dependency/product check, three cold metadata compilations plus original cold native/trace builds, every old and new control in BOTH arms, all candidate production admission/guards, IO and terminal cleanup. Baseline receives the complete same control union. Driver wall diagnostic starts after initial TCB and cold authority capture and is not total process wall. Broad phase samples are nested, not additive; VmRSS is current RSS and ru_maxrss is process high-water. Eager witnesses and original observations remain; full funding and equality gates are separate and currently closed.', 'scope': 'Complete frozen historical complex-network CLI with retained observations; conditional certificate only. No bare-CLI factor, selected-frontier, new kappa or PR5864 speed claim.'} + (output / 'receipt.json').write_text(json.dumps(receipt, indent=2, sort_keys=True) + '\n') + sys.stdout.write(cli_stdout) + print(json.dumps({'status': receipt['status'], 'mode': args.mode, 'science': science, 'wall_seconds': receipt['driver_wall_seconds_after_initial_tcb_before_receipt'], 'cpu_seconds_with_compiler': receipt['process_and_compiler_cpu_seconds_before_receipt'], 'phases': phases.rows}, sort_keys=True)) + except BaseException as _epoch_error: + _epoch_primary = _epoch_error + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['primary'] = _epoch_error + raise + finally: + try: + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['attempted'] = True + data_adapters.epoch_retire(data_state, 'whole-cli-terminal', _epoch_primary, None, None, None, 'outer') + except BaseException as _epoch_outer_error: + _epoch_outer_retirement_error = _epoch_outer_error + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['retirement_error'] = _epoch_outer_error + _epoch_outer_cleanup['uncertain'] = True + if _epoch_primary is None: + _epoch_primary = _epoch_outer_error + if _epoch_outer_cleanup is not None: + _epoch_outer_cleanup['primary'] = _epoch_outer_error + raise + +def _run_epoch_with_stop_evidence(): + try: + main_epoch() + except BaseException as primary_error: + try: + state = _EXECUTION['state'] + cleanup_errors = [] + try: + cleanup_errors = data_adapters.epoch_cleanup_owned(state) + except BaseException as cleanup_error: + cleanup_errors.append({'type': type(cleanup_error).__name__, 'message': str(cleanup_error)}) + stop = {'schema': 'h25-combined-v2-stop-v1', 'status': 'STOP', 'primary_error': {'type': type(primary_error).__name__, 'message': str(primary_error)}, 'primary_cause': None if primary_error.__cause__ is None else {'type': type(primary_error.__cause__).__name__, 'message': str(primary_error.__cause__)}, 'cleanup_errors': cleanup_errors, 'data': data_adapters.epoch_stop_diagnostics(state), 'native_packet': None if _EXECUTION['packet'] is None else native_packet.receipt(_EXECUTION['packet']), 'initial_native_tcb': INITIAL_NATIVE_TCB_RECEIPT} + output = _EXECUTION['output'] + if output is not None: + with (output / 'STOP.json').open('x', encoding='utf-8') as stream: + stream.write(json.dumps(stop, sort_keys=True, indent=2) + '\n') + except BaseException as evidence_error: + try: + sys.stderr.write('STOP evidence write failed: ' + type(evidence_error).__name__ + '\n') + except BaseException: + pass + raise + +if __name__ == '__main__': + _run_epoch_with_stop_evidence()