Compare commits

..
75 changed files with 20365 additions and 490 deletions
@@ -0,0 +1,2 @@
__pycache__/
*.pyc
@@ -1,4 +1,12 @@
# Current checker protocol — repair29
# Checker protocol — historical repair29 description
Repair30 is a partial, blocked implementation. CURRENT_STATUS.md and
REPAIR30_STATUS.md supersede the current-role, authority and execution claims
below. M is c0ea009; product manifests exclude checker, selected native/full
SourceRefs include it. Q is the actual recomputed merge-tree; C requires separate
normal-integration qualification. All four remaining D05 policies are approved.
Do not run the old collection/index recipe as fresh-Q evidence. No 500000-byte
limit applies. The historical protocol text below is retained for provenance.
Worker **SOURCE-READY / NOTRUN**. [CURRENT_STATUS.md](CURRENT_STATUS.md) is canonical for execution facts; creation-time NOT RUN in REPAIR22–28 and runbooks is historical. [ORDER_AUDIT.md](ORDER_AUDIT.md) and order-audit.json give the eleven-phase/seven-domain audit. [D05_REMAINING_ORDER_CANDIDATE.md](D05_REMAINING_ORDER_CANDIDATE.md) is approval material only.
@@ -1,31 +1,29 @@
# P04-01 current status — repair29
# P04-01 current status — repair31
Worker checks: SOURCE-READY / NOTRUN. No probes or tests were run by this worker.
**BLOCKED: partial implementation; do not start the once-only native/full run.**
Formal completed status is **16/88**, with **zero P04 credit**.
This canonical table overrides creation-time NOT RUN / pending-execution entries in REPAIR22–28, their status/validation records, and the runbooks (including S4_ROOT_RUN.md). Those files are historical and remain untouched. It does not relabel an old run as execution of repair29.
D05 is six of six actually approved; adoption and exact-Q verification are pending.
All four later D05 policies were approved by the actual human on 2026-10-18.
D05_REMAINING_APPROVAL.json preserves exact answers and binds both supplied
records by path/SHA256. Dependency hold, 18:00 and A01 upkeep remain approved.
The old candidates are superseded, not deleted.
`B` = `/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build`.
Frozen M is c0ea009b28a7649aca6a433a1a24dc0be5e7ab81. Actual tree enumeration
found 1368 product files excluding the checker and 3644 metadata paths.
Native/full selected SourceRefs must additionally include the checker.
Final S, genuine non-production Q and later normal C are not supplied by this
worker. No Git writes, engine execution, Runner operations or delegation.
| Item | Canonical status | Exact-version evidence |
| --- | --- | --- |
| Current native product / main | Root-measured `5f6bc11d` / `9b1a18c1` | Product1338 at B/audit-support/p04-r17-full-inputs-r01/product; current SHA256 inventory in REPAIR29_STATIC_SOURCE.json. Old deb11300 is not current. |
| S4 r28 | Root-measured 4/4 PASS; import/parse/Writer/Reader PIDs49940,50044,50078,50105 all ended; guards0; cleanup0 | B/p04-s4-native-r28; B/audit-support/p04-root-fb8b-s4-r01/native.result.json. Full controls in that same support directory. |
| Local8 | Root-measured PASS | B/audit-support/p04-root-fb8b-local-r01: bulk, negative, applicability, native, series, encoder, join, roles result/stdio records. |
| Collection | Root-measured r22 collected, no native re-run claimed | B/audit-support/p04-raw-collect-r22/MANIFEST.json and s1/s2a/s2b/s3/s4.json. |
| Index | Root-measured schema2, missing_conditions=[], all15 conditions + EV mechanically verified | B/p04-evidence/index.json and generation-invocation.json; local-r01 index/checker output. This is not D05 approval. |
| Registered validation on fb8b7919 | Root-measured PASS,28.095s | B/audit-support/p04-root-fb8b-local-r01/registered-validation.result.json and stdout log. Does not establish final repair29 validation or acceptance. |
| Full178 | Root-measured178 suites /21615 checks PASS used checker f5, **not a61** | B/audit-support/p18-regression-support-final-r01/native-full178/runner-ended.json and source-start.json; exact receipt remains preserved. Checker f5 SHA256 `f5b44827958f2ae352fe5c4bc3a1ffd4211ec7a41fc4c0759c8b954891662324`. |
| Full1339 against a61 | **No such full run exists** | a61 SHA256 `a61c5b496e656f60c66898e42500bc9a2d45f947690ce8f5f19a03984ebbc850`. Local8 and registered validation are separate evidence. |
| Worker repair29 | SOURCE-READY / NOTRUN | Static source/line/registration/SHA256 inspection only. No tests, probes, Git, engine, Runner or agents. |
| Owner D05 | Pending a–d, candidate only | D05_REMAINING_ORDER_CANDIDATE.md/json; A01, dependency hold and18:00 remain approved. |
| Original unit | **Incomplete;13/88 unchanged** | Mechanical PASS does not approve unknown mandatory priorities, replace independent review, or integrate the unit. |
The checker has partial authority/role corrections; the seven-domain audit uses
M source. S5 executable probes, fresh-Q collector/wrapper/index plumbing,
full-proof joins and independent normal-C qualification remain incomplete.
Normal C now fails closed without the authoritative Root/Runner receipt contract.
The isolated Git fixtures remain Root-run because `/tmp` creation was denied.
See [REPAIR31_STATUS.md](REPAIR31_STATUS.md) for precise remaining work and the
corrected Root execution order; [s5/PENDING.md](s5/PENDING.md) records S5 gaps.
Proof hashes for the exact collection/index/full receipt/validation and current source are in [REPAIR29_STATIC_SOURCE.json](REPAIR29_STATIC_SOURCE.json). Applicable source/config/input/environment joins stay in the immutable schema2 index and raw collection; no raw is normalized, spliced, regenerated or relabelled here.
Product reuse requires exact applicability: the178 suites do not execute the Python checker and the316-file GDScript parse roster excludes it. Static comparison with the preserved full178 selected_source_map found one test-source difference, tests/business/test_required_kitchen.gd (full178 3a9c92f8…, current product5dcc86d6…), and no game-source difference. Preserve the Runner applicability binding for this test; do not claim all1338 selected product hashes match that full178 receipt or byte-identical full1339 validation against a61. Preserve the f5 full178 receipt and all historical partial/full outputs separately.
Remaining Runner steps: independent review of these documents, then Root obtains owner decisions (or explicit non-mandatory rulings) for D05 a–d. Unknown mandatory rules stay pending. Any destruction authority pin/registry or other approved implementation change follows a normal repair. The support53cb normal registered rebind, final full run on the final source/checker, final source/config/input/environment binding, formal independent review and integration remain Runner work. Integration order is **P04 first, then support on main9b (`9b1a18c1`)**. NativeWindows obligations remain individually pending if required. No criterion is waived and no extra original unit is counted.
Known authority/scope gaps: destruction_stop binds BASELINE:183 (mana depletion, not destruction); explicit D05 destruction rule required before normal pin repair. S4 NO_POWER was induced by direct disconnect_nodes; global depletion appears only in B1 combined diagnostic. Preserve these distinctions even though the mechanical index passes.
Changed files in repair29 (all under this directory): ORDER_AUDIT.md; order-audit.json; D05_REMAINING_ORDER_CANDIDATE.md; D05_REMAINING_ORDER_CANDIDATE.json; CHECKER_PROTOCOL.md; EVIDENCE_COLLECTION.md; P04_ORDER_EVIDENCE_PROTOCOL.json; CURRENT_STATUS.md; REPAIR29_STATIC_SOURCE.json. Product/checker/registry, native footprint, staged inputs, raw and historical runbooks are unchanged.
Historical S1–S4/r22, old registered validation and f5 full178 retain their
original identities. They are not fresh Q evidence. All 15 conditions plus EV
still require exact-version evidence; nativeWindows remains individually
pending. Static fixture results confer no original acceptance credit.
@@ -0,0 +1,53 @@
{
"task_id": "P04-01",
"origin": "direct_user_reply",
"formal_acceptance": false,
"source_bindings": [
{
"path": "build/owner-handoff/p04-after-p26-closure-r01/D05_ACTUAL_HUMAN_APPROVAL.json",
"sha256": "cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96"
},
{
"commit": "c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01-owner-approval-20261018/D05_ACTUAL_HUMAN_APPROVAL.json",
"sha256": "cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96"
}
],
"approved_choices": [
{
"id": "D05-P04-DESTRUCTION",
"source_id": "destruction_completion_order",
"answer_exact": "現行順序を承認する(Opus推奨)",
"approved_question_policy": "コマンド破壊をサービス完了前に処理。事故・襲撃による破壊は完了・課金後に処理してその分の売上を有効とし、次の分で失敗処理と予約解放。"
},
{
"id": "D05-P04-MIDNIGHT-DAY",
"source_id": "midnight_revenue_day",
"answer_exact": "新しい日に計上し、前日決算・維持費を完了より先に確定する(Opus推奨・現状維持)",
"approved_question_policy": "00:00完了のサービス売上は新しい日に計上。前日決算・維持費は完了より先に確定。既承認の維持費規則と18:00交代順序を維持。"
},
{
"id": "D05-P04-PAUSE-REASON",
"source_id": "pause_reason_priority",
"answer_exact": "2点とも現行動作を確定する(Opus推奨)",
"approved_question_policy": "停電と依存先休業が同時なら休業を理由表示の優先とする。どちらも進捗・課金停止、予約保持。"
},
{
"id": "D05-P04-EXIT",
"source_id": "exit_command_ai_order",
"answer_exact": "2点とも現行動作を確定する(Opus推奨)",
"approved_question_policy": "退出コマンドは完了前、AIの予定退出は判断中の客だけを対象として完了後に処理。"
}
],
"prior_approved_rules_preserved": [
"依存先休業中は進捗・課金停止、予約保持、復帰後1回だけ完了",
"17:59→18:00昼番作業を先に確定し完了・課金後に交代",
"既承認維持費規則"
],
"supersedes": [
"D05_REMAINING_ORDER_CANDIDATE.md",
"D05_REMAINING_ORDER_CANDIDATE.json"
],
"original_unit_complete": false
}
@@ -1,8 +1,8 @@
{
"task_id": "P04-01",
"revision": "repair29",
"status": "approval candidate only; SOURCE-READY / NOTRUN",
"approval": null,
"status": "superseded by D05_REMAINING_APPROVAL.json; candidate text below is historical",
"approval": "D05_REMAINING_APPROVAL.json",
"apply_to_product_or_checker": false,
"review_flow": "Root asks owner after review. This document neither requests approval from worker nor records it.",
"proof_legend": {
@@ -126,5 +126,6 @@
},
"authority_gap": "destruction_stop currently binds BASELINE:183, which is mana depletion, not destruction authority. Explicit D05 destruction rule required. Pin/registry repair only after approval through normal repair.",
"power_scope": "S4 NO_POWER uses direct disconnect_nodes; not proof of global depletion, which exists only in B1 combined diagnostic.",
"original_unit_complete": false
"original_unit_complete": false,
"superseded_by": "D05_REMAINING_APPROVAL.json"
}
@@ -1,3 +1,5 @@
> Superseded: D05_REMAINING_APPROVAL.json records the actual human approval of all four policies. The candidate text below is retained as history.
# D05 remaining order candidate — repair29
**Approval candidate only. SOURCE-READY / NOTRUN.** Root asks the owner after review. Nothing is applied to product, checker or registry; observation is not approval. A01 midnight ownership upkeep, dependency hold and18:00 are already approved and are not re-asked.
@@ -1,4 +1,9 @@
# Evidence collection status — repair29
# Evidence collection — historical repair29 description
Repair30 supersedes current-use claims below: existing S1–S4/r22/full178 records
remain historical. New Q evidence is required, with checker explicitly selected.
The fresh-Q collection path and S5 drivers are not ready in this partial repair.
See REPAIR30_STATUS.md; do not start native/full or formal acceptance yet.
Worker **SOURCE-READY / NOTRUN** (static Read/SHA256 only). No probes, tests, engine or Runner execution in this repair. [CURRENT_STATUS.md](CURRENT_STATUS.md) overrides historical creation-time NOT RUN entries in REPAIR22–28 and runbooks, which remain untouched. Do not repeat their completed execution steps merely because their original prose says pending.
@@ -0,0 +1,33 @@
# Concrete32 external Runner-record boundary
The supplied normal-gate reference was read directly: verify, has_evidence,
prepare_integration, approve and integrate (893–1092), and the SQL schema
(474–483). P26 normal-candidate-example files are format samples only.
`normal_c_join.py` uses read-only SQLite transactions over actual Root-selected
Runner records. It joins submitted S, candidate C, frozen main_base M, approval,
validation/review on S and integration/final on C. It checks the exact validation
roster, raw review result and referenced validation logs, and hashes evidence
inputs and the logical record snapshot. Root must establish that both databases
are actual Runner records: arbitrary SQLite files cannot authenticate themselves.
Runner integrate deletes approvals after final verification. Root retains an
actual consistent Runner snapshot after approve, supplied as
`--approved-runner-db`; `--runner-db` supplies later final evidence. These are
read-only inputs, not a new Runner API. The worker creates neither snapshot.
Missing records fail. No Git, Runner or engine is invoked. Outputs confer no
acceptance or Git/Q/source/settings/markers/policy/engine/input qualification.
All partial31 files, including the existing checker, remain unchanged as directed.
Its NORMAL_C_RECEIPT_CONTRACT fail-closed path therefore still blocks formal C
qualification. This new join is not wired into that gate and cannot bypass it.
Integration of the boundary remains an implementation gap. No actual Q/C or
ordinary-gate proof was produced. This is not a new human D05 policy question.
Root runs `normal_c_join_fixtures.py --scratch DIR`: synthetic positive, wrong
C/M, missing kind, failed check, extra/missing validation ID, task mismatch,
medium review, missing artifact, wrong approval and missing final. Unexecuted.
`scratch_fixture_adapter.py --scratch DIR --fixture NAME -- ...` routes preserved
fixture TemporaryDirectory calls to explicit external scratch and clears inherited
GIT_* routing. Existing assertions are unchanged; candidate/role fixtures still
exercise partial31 semantics. No fixture output belongs in source.
@@ -1,61 +1,28 @@
# P04-01 order audit — repair29
# P04-01 order audit — repair31
Worker **SOURCE-READY / NOTRUN**: static Read and SHA256 only. No original completion. [CURRENT_STATUS.md](CURRENT_STATUS.md) is canonical for execution status. [order-audit.json](order-audit.json) is the matching structured audit.
Formal status is **16/88, P04 credit 0**. Policy approvals are recorded; implementation and exact-Q evidence remain incomplete. No original-unit completion is claimed.
B = `/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build`.
P = `B/audit-support/p04-r17-full-inputs-r01/product`. Source references below are relative to P, not old deb11300. All1338 product file SHA256 values, function lines and16 handler registrations are recomputed in [REPAIR29_STATIC_SOURCE.json](REPAIR29_STATIC_SOURCE.json).
Kernel `scripts/core/simulation_kernel.gd` SHA256: `341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb`.
Runtime `autoload/simulation_runtime.gd` SHA256: `7f01b2dcdf28bc965c7588173c2dc70054633faf7204b1ac38ba0f4369331b47`.
Root-measured native product `5f6bc11d`; main `9b1a18c1`.
D05 is **six of six actually approved**; adoption into raw enforcement and
verification are pending. Normal-C qualification now rejects matching-parent/tree
commits without the authoritative Root/Runner receipt contract. That contract's
path, SHA256 and provenance verification remain a concrete context gap.
## Actual eleven phases — observed-current
M is `c0ea009b28a7649aca6a433a1a24dc0be5e7ab81`. Source hashes, full product inventory, metadata membership and function line numbers were read from its actual Git tree in [REPAIR30_SOURCE_FACTS.json](REPAIR30_SOURCE_FACTS.json). Product manifest excludes the checker; native/full selected SourceRefs must include it. Q and C do not yet exist for this worker revision.
Kernel advance_one_minute:122 defines the order; _run_phase:236 string-sorts handler IDs. Registrations below are Runtime lines366–435 plus operations:1766. Every literal ID begins `simulation_runtime.`. Observations do not approve D05.
The four actual human answers are preserved verbatim in [D05_REMAINING_APPROVAL.json](D05_REMAINING_APPROVAL.json), bound to both supplied copies by path and SHA256. Existing dependency, 18:00 and A01 approvals remain unchanged. The candidate documents are superseded history.
1. **APPLY_COMMANDS** — simulation_runtime.commands → _process_tick_commands (registration:369). Previous minute: commands → _process_tick_commands:5743. Operations gate requests current tick abort and returns before Clock changes; otherwise commands apply for minute+1.
| Domain | Approved rule | Current M source | Evidence |
| --- | --- | --- | --- |
| 閉店 | D-034 preserves started services on direct closure and releases waiting requests. Dependency closure stops progress and charging, retains reservations/service identity, and completes once after recovery. RELATED_FACILITY_INACTIVE wins over NO_POWER when both apply. | autoload/simulation_runtime.gd:5765 _process_tick_commands; scripts/facility/facility_service.gd:853 _prepare_service_for_tick; autoload/simulation_runtime.gd:12672 _release_closed_business_queues | Fresh Q pending; nativeWindows pending |
| 停電 | BASELINE:183 covers real mana depletion. Legitimately stopped service has no progress or charge and preserves reservations. D05-P04-PAUSE-REASON makes dependency closure the displayed reason when dependency closure and power loss coincide. | autoload/simulation_runtime.gd:10716 _advance_mana; scripts/facility/facility_service.gd:853 _prepare_service_for_tick | Fresh Q pending; nativeWindows pending |
| 破壊 | Command destruction precedes completion. Accident/raid destruction follows completion and charging in minute N; that sale remains valid. Failure and reservation release for affected unfinished service occurs in N+1. D05-P04-DESTRUCTION is the authority, not BASELINE:183. | autoload/simulation_runtime.gd:5765 _process_tick_commands; autoload/simulation_runtime.gd:8599 _advance_defense; autoload/simulation_runtime.gd:9826 _apply_defense_outcome_boundary; scripts/facility/facility_service.gd:853 _prepare_service_for_tick | Fresh Q pending; nativeWindows pending |
| 退出 | D-034 release safety remains. Command exit precedes completion; AI planned exit follows completion and only applies to a deciding guest. Later despawn is distinct. | autoload/simulation_runtime.gd:7575 _execute_leave_facility_queue; autoload/simulation_runtime.gd:8760 _advance_guest_ai_decisions | Fresh Q pending; nativeWindows pending |
| 課金 | Charge only completed service, once per idempotency key; retain original price snapshot and reservation/ledger joins. At 00:00 prior-day settlement and upkeep precede completion; the sale belongs to the new day. | autoload/simulation_runtime.gd:1876 _advance_facility_upkeep; autoload/simulation_runtime.gd:11817 _complete_service_transaction; autoload/simulation_runtime.gd:11833 _apply_service_transaction; scripts/operations/operations_coordinator.gd:1125 _process_daily_close | Fresh Q pending; nativeWindows pending |
| シフト交代 | Approved 18:00 order remains: completion and payment before handover. No renewal of prior approval. | autoload/simulation_runtime.gd:8504 _advance_facilities; autoload/simulation_runtime.gd:8680 _advance_staff_ai | Fresh Q pending; nativeWindows pending |
| 00:00決算 | A01 ownership-based upkeep is unchanged. Prior-day settlement/upkeep precede 00:00 service completion; its sale belongs to the new day. Replay/restore must not duplicate settlement. | scripts/core/simulation_kernel.gd:254 _handle_time_boundaries; autoload/simulation_runtime.gd:1919 _advance_operations_time; scripts/operations/operations_coordinator.gd:882 _process_minute_boundaries; scripts/operations/operations_coordinator.gd:1125 _process_daily_close | Fresh Q pending; nativeWindows pending |
2. **TIME_BOUNDARIES** — simulation_runtime.0_weather → _advance_weather (registration:366); simulation_runtime.a_upkeep → _advance_facility_upkeep (registration:368); simulation_runtime.operations → _advance_operations_time (registration:1766). After APPLY: absolute_minute += 1, _sync_calendar_fields, _handle_time_boundaries:254 emits settlement_requested(completed_day) then day_started at00:00, before TIME_BOUNDARIES handlers. Handler order: weather, upkeep, operations. Runtime upkeep:1855; operations:1898 → coordinator _process_minute_boundaries:882: 00:00 upkeep, daily close, 06:00 morning, demand, arrivals (conditional boundaries and early returns).
The preserved S1–S4, r22 index, old registered validation and f5 full178 run retain their historical identities. Current runtime deltas conservatively require fresh proof for all 15 conditions plus EV. A test count, approval record or byte-equal ordering function alone does not establish original acceptance. No thresholds or original unknown values are changed.
3. **MANA** — simulation_runtime.mana → _advance_mana (registration:379). Runtime _advance_mana:10694: proxy preflight → mana_network advance → mana_power_projection.apply → MANA_STATE_CHANGED events.
The eleven phases remain APPLY_COMMANDS, TIME_BOUNDARIES, MANA, CONSTRUCTION, LOGISTICS, FACILITY_COMPLETION, VITALS_AND_ENVIRONMENT, INCIDENTS_AND_EVENTS, FACILITY_QUEUES, AI_DECISIONS, PUBLISH_SNAPSHOT. See the structured audit for preserved phase analysis and the new source manifest for exact M references.
4. **CONSTRUCTION** — simulation_runtime.construction → _advance_construction (registration:384). Construction:8064 follows power and precedes logistics.
5. **LOGISTICS** — simulation_runtime.logistics → _advance_inventory_and_logistics (registration:389). Logistics:8472 precedes completion.
6. **FACILITY_COMPLETION** — simulation_runtime.facilities → _advance_facilities (registration:394). Runtime _advance_facilities:8482: facility_service.advance_one_minute then kitchen. FacilityService _prepare_service_for_tick:853 checks BROKEN, related_facility_operating (RELATED_FACILITY_INACTIVE), power_available (NO_POWER), staff grace. Only ACTIVE services advance (:569). _complete_service:895 → Runtime _complete_service_transaction:11769 → _apply_service_transaction:11785 posts SERVICE_SALE / SERVICE_CASH_SWEEP at the post-increment minute (:11826–11838).
7. **VITALS_AND_ENVIRONMENT** — simulation_runtime.guest_vitals → _advance_guest_vitals (registration:399). Guest vitals:8488 follows completion.
8. **INCIDENTS_AND_EVENTS** — simulation_runtime.authority_incidents → _advance_authority_incidents (registration:409); simulation_runtime.defense → _advance_defense (registration:414); simulation_runtime.relationship_events → _advance_relationship_events (registration:419). String-sorted authority_incidents:8551 → defense:8577 → relationship_events:8615; after completion/charging.
9. **FACILITY_QUEUES** — simulation_runtime.guest_queues → _advance_guest_queues (registration:404). _advance_guest_queues:8502 releases closed queues first (_release_closed_business_queues:12624); closed queues spend no patience (:8516–8517).
10. **AI_DECISIONS** — simulation_runtime.staff_ai → _advance_staff_ai (registration:424). _advance_staff_ai:8658: prune elevator waits, elevators, rescue, staff_service, prune waits, staff_commute (shift handover), staffing sync, cleaning, fatigue, rescue and staffing sync again, then _advance_guest_ai_decisions:8738. DECIDING PLANNED_EXIT → LEAVING; despawn occurs only on later minute (:8760–8762).
11. **PUBLISH_SNAPSHOT** — simulation_runtime.snapshot → _publish_snapshot (registration:374); simulation_runtime.zz_save_checkpoints → _process_save_checkpoints (registration:431). snapshot:12476 then zz_save_checkpoints:4514; persistence follows publication.
## Seven domains
Proofs below are **Root-measured**. R = B/audit-support/p04-raw-collect-r22; I = B/p04-evidence/index.json (schema2). I native_bundle/raw_references/versions/source_map/environment preserve exact C and series bindings. R/MANIFEST.json pins series bytes/SHA256 and relocation; each series retains raw provenance. REPAIR29_STATIC_SOURCE.json also pins R files and I. Source function paths/lines/hashes are in that static manifest.
| Domain | Status / authority | Phase and source function+line | Relative priority | Exact-version proof | Pending |
| --- | --- | --- | --- | --- | --- |
| 閉店 | approved; D-034, D05-P04-DEPENDENCY | APPLY_COMMANDS / FACILITY_COMPLETION / FACILITY_QUEUES: Runtime _process_tick_commands:5743; FacilityService _prepare_service_for_tick:853; Runtime _release_closed_business_queues:12624 | Command closure before completion; dependency hold during preparation; closed queue release after completion. | I native_bundle C; R/s2a.json; R/s3.json B1 | D05(a) simultaneous reason selection |
| 停電 | observed-current; BASELINE:183, P04-01 safety acceptance | MANA → FACILITY_COMPLETION: Runtime _advance_mana:10694; FacilityService _prepare_service_for_tick:853 | Projection before completion; RELATED chosen before NO_POWER. | R/s4.json; B/p04-s4-native-r28; R/s3.json B1 combined diagnostic | D05(a) |
| 破壊 | pending D05; P04-01 safety acceptance (original); explicit destruction rule pending D05 | APPLY_COMMANDS vs INCIDENTS_AND_EVENTS: Runtime _process_tick_commands:5743; _advance_defense:8577; _apply_defense_outcome_boundary:9804; FacilityService _prepare_service_for_tick:853 | Command destruction before completion; incident destruction after completion: B4a charges25G then destroys in same tick; B4b next-tick failure/release. | R/s3.json B4a/B4b | D05(b); BASELINE:183 is mana depletion, not destruction authority; destruction_stop registry correction only after approval |
| 退出 | pending D05; D-034, P04-01 safety acceptance | APPLY_COMMANDS vs AI_DECISIONS: Runtime _execute_leave_facility_queue:7553; _advance_guest_ai_decisions:8738 | Command exit before completion/charging; AI PLANNED_EXIT after them; despawn later. | R/s3.json B2a/B2b/B3 and B1 departure history | D05(c) |
| 課金 | pending D05; P04-01 safety acceptance, D05-P04-DEPENDENCY, D05-P04-SHIFT-1800 | TIME_BOUNDARIES → FACILITY_COMPLETION: Runtime _advance_facility_upkeep:1855; _complete_service_transaction:11769; _apply_service_transaction:11785; coordinator _process_daily_close:1125 | Upkeep/daily close before sale; post-increment sale timestamp, exclusive close period_end;00:00 sale belongs to new day. | I native_bundle C; R/s2a.json; R/s4.json | D05(d), beyond approved A01 and18:00; timing/attribution mandatory P04, numeric math D04/P05 separate |
| シフト交代 | approved; BASELINE:64, BASELINE:67, D05-P04-SHIFT-1800 | FACILITY_COMPLETION → AI_DECISIONS: Runtime _advance_facilities:8482; _advance_staff_ai:8658; StaffService advance_one_minute:700 | 18:00 completion/payment before shift handover; day staff [17:59,18:00), night [18:00,18:01). | I C first1080 sale joins; R/s2b.json no-night1081/overtime | Already approved; do not re-ask |
| 00:00決算 | approved; BASELINE:71, BASELINE:72, A01, D05-P04-DEPENDENCY | pre-TIME_BOUNDARIES signals → TIME_BOUNDARIES → FACILITY_COMPLETION: Kernel _handle_time_boundaries:254; Runtime _advance_operations_time:1898; coordinator _process_minute_boundaries:882; _process_daily_close:1125 | Midnight signals, then upkeep/close, then completion. | I C paused/formal; R/s2a.json nonzero payroll/upkeep, replay and typed restore | A01 approved ownership-based midnight upkeep not reopened; extra attribution D05(d) |
S4 proves isolated NO_POWER caused by the probe calling disconnect_nodes directly, not global mana depletion. Global depletion appears only in B1 combined diagnostic; B1 does not prove isolated power or approve priority. BASELINE:183 is mana depletion, not destruction authority. Current destruction_stop binding is therefore a known authority gap. Checker a61 and registry stay unchanged until approval and normal repair.
## Cross-cutting safety
- **No charge while paused NO_POWER or RELATED** — original; FACILITY_COMPLETION; FacilityService _prepare_service_for_tick:853, ACTIVE-only gate:569, _complete_service:895. Preparation before advance/completion/payment. Root-measured proof: R/s4.json isolated power; I C and R/s2a.json dependency hold.
- **Double-settlement idempotency** — original; TIME_BOUNDARIES; coordinator _process_daily_close:1125; _day_summaries replay:1127–1130; daily-close:N:1137. Before facility completion. Root-measured proof: I C; R/s2a.json same-boundary replay and separate-PID restore, unchanged accounting.
- **Orphan reservation release** — original; APPLY_COMMANDS / FACILITY_QUEUES; Runtime _execute_leave_facility_queue:7553 (release keys:7565–7569); _leave_guest_queue_boundary:9178; _release_closed_business_queues:12624; _release_closed_business_request:12642. Command release before completion; closed-queue release afterward; closed patience not spent. Root-measured proof: R/s3.json B2a/B2b/B3/B4b; I C; R/s2a.json reservation/service identity and restore.
A01 midnight ownership upkeep, dependency hold and18:00 are already approved; do not re-ask. Authority pins are in I/authority; D05_OWNER_APPROVAL.json approves only the two named D05 choices. Remaining candidate choices and their side effects are in [D05_REMAINING_ORDER_CANDIDATE.md](D05_REMAINING_ORDER_CANDIDATE.md). P04 timing/attribution remains mandatory and separate from D04/P05 numeric cost math. Unknown mandatory rules remain pending.
Original credit **13/88 unchanged**,15 conditions + EV, seven domains, three safety outcomes and30/88 denominator unchanged. P04 remains incomplete. Root execution history and remaining Runner steps are in CURRENT_STATUS.md.
See [CURRENT_STATUS.md](CURRENT_STATUS.md) and [REPAIR31_STATUS.md](REPAIR31_STATUS.md) before any Root execution.
@@ -0,0 +1,71 @@
{
"task_id": "P04-01",
"scope": "Worker static controls only; no engine/registered validation/acceptance",
"formal_acceptance": false,
"original_credit": 0,
"results": [
{
"check": "checker_approval_fixtures",
"status": "pass",
"positive": 6,
"negative": 24,
"scope": "path/hash/status + literal human answers"
},
{
"check": "checker_negative_fixtures",
"status": "pass"
},
{
"check": "checker_applicability_fixtures",
"status": "pass",
"M": "c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"changed_function_units": 58
},
{
"check": "checker_native_fixtures",
"status": "pass",
"scope": "mutations of historical supplied raw; not a native engine run"
},
{
"check": "checker_series_fixtures",
"status": "pass",
"scope": "historical/synthetic controls"
},
{
"check": "checker_encoder_fixtures",
"status": "pass"
},
{
"check": "checker_join_fixtures",
"status": "pass",
"scope": "historical/synthetic controls"
},
{
"check": "bulk_reader_equivalence",
"status": "not_run",
"reason": "Contains git init/hash-object -w and isolated-object writes; worker Git writes prohibited"
},
{
"check": "checker_role_fixtures",
"status": "not_run",
"reason": "Contains clone/checkout/add/commit/merge/reset; worker Git writes prohibited; fresh Q index is also not available"
},
{
"check": "Python AST / top-level execution JSON",
"status": "pass"
},
{
"check": "git diff --check",
"status": "pass"
}
],
"exclusions": [
"No fresh-Q positive fixture claimed",
"No fake-normal-C qualification claimed",
"No S5 native execution",
"No full184/329",
"No p04-acceptance on current S"
],
"note": "Recorded fixture outcomes are not exact-version native proofs. Final comment/document edits do not alter executed fixture semantics. Final source is unqualified for native admission; see REPAIR30_STATUS.md."
}
@@ -0,0 +1,67 @@
# Repair 30 — BLOCKED / partial implementation
This revision is **not ready for Root native admission**. Formal status remains
**16/88, P04=0**. Outstanding items include unfinished implementation, not merely
the fresh evidence Root is expected to produce after submission.
Implemented within allowed_paths:
- Four actual human approvals, exact answer/policy text, both source paths and
SHA256 bindings; candidate documents marked superseded.
- Per-ID path/hash authority binding for six D05 IDs; required authority refs
corrected without changing the 15-condition + EV roster or thresholds.
- Frozen M is c0ea009b28a7649aca6a433a1a24dc0be5e7ab81. Counts/membership derive
from Git objects: 1368 product files excluding checker, 3644 metadata paths.
Ordering functions retain registered byte equality; applicability has 58
changed function units. Full details are in REPAIR30_SOURCE_FACTS.json.
- Q must equal the recomputed merge-tree object. A commit cannot impersonate Q.
C must have frozen M as first parent, legal S as second parent and the same
entire tree as Q. Selected native sources explicitly include the checker;
product equality continues to exclude it.
- Seven-domain audit refreshed with actual M hashes/function lines. All
condition-specific nativeWindows obligations remain pending.
Implementation/context gaps blocking readiness:
1. S5's four executable drivers and raw semantic adapters are **not written**.
s5/PENDING.md records concrete source constraints. Additional approved
destruction/day/pause-reason/exit measurements are not enforced from S5 raw
bytes yet. REQUIRED retains the existing safety metrics.
2. p04_native_series.py, collect_p04_native.py, S1–S4 wrappers and parts of the
schema2 builder still bind historical run names/manifests/raw pins. Connect
fresh Q material without replacing historical records or inventing future
hashes. The builder now reads tested revision from native provenance and
includes the checker, so the old bundle cannot satisfy the new role check.
3. Full184/329 runner-input has no source_before or QA_overrides, unlike native
QA inputs. It needs its own exact source/settings/markers/policy/engine/input
and ended-receipt join. The native input loop is not a full-proof verifier.
4. Parent/tree equality alone cannot establish normal prepare-integration
provenance: a synthetic commit can have identical parents/tree. The supplied
plan does not define the concrete normal-candidate qualification receipt,
path and hash contract. Independent qualification remains pending; no
invented Runner API or authority has been added.
5. Bulk and role fixtures perform Git writes, including temporary objects,
commits and merges. They were not run under the worker Git-write prohibition.
Updated role negatives are unexecuted; genuine fresh-Q positive and
fake-normal-C rejection remain unqualified.
Static results are in REPAIR30_STATIC_CHECKS.json. Historical/synthetic fixture
success is not new game evidence. No engine, formal registered gate, Runner
operation, Git write or other agent was invoked. Product/test-tree/Clock/values
remain unchanged.
Required Root order after remaining implementation is repaired:
1. All eight static controls plus role/applicability/approval negatives.
2. Genuine Q from final S and frozen M; fresh real native S1–S5 once.
3. Inspect free disk and verified CoW, then full184/329 once on the same final Q
including final checker; bind test_required_kitchen separately.
4. Truthful index from exact raw material.
5. Registered p04-acceptance on S with --verify-only.
6. Independent whole-unit review.
7. Normal prepare-integration/final on independently qualified C, equal to Q for
source/settings/markers/policy/engine/inputs.
Keep live Root records under .runtime while M is frozen. Old S1–S4/r22 and f5
full178 remain historical. No known-fail formal gate is a progress check.
No sources/evidence are removed for the obsolete 500000-byte cap.
@@ -0,0 +1,94 @@
{
"task_id": "P04-01",
"scope": "Worker static controls only; no native run or formal gate",
"formal_acceptance": false,
"original_credit": 0,
"results": [
{
"check": "checker_approval_fixtures",
"status": "pass",
"exit_code": 0,
"scope": "six positive and 24 negative authority controls"
},
{
"check": "checker_negative_fixtures",
"status": "pass",
"exit_code": 0,
"scope": "historical/synthetic control only; no fresh Q proof"
},
{
"check": "checker_applicability_fixtures",
"status": "pass",
"exit_code": 0,
"scope": "historical/synthetic control only; no fresh Q proof"
},
{
"check": "checker_native_fixtures",
"status": "pass",
"exit_code": 0,
"scope": "historical/synthetic control only; no fresh Q proof"
},
{
"check": "checker_series_fixtures",
"status": "pass",
"exit_code": 0,
"scope": "historical/synthetic control only; no fresh Q proof"
},
{
"check": "checker_encoder_fixtures",
"status": "pass",
"exit_code": 0,
"scope": "historical/synthetic control only; no fresh Q proof"
},
{
"check": "checker_join_fixtures",
"status": "pass",
"exit_code": 0,
"scope": "historical/synthetic control only; no fresh Q proof"
},
{
"check": "Python AST / execution JSON",
"status": "pass",
"python_files": 22,
"json_files": 17
},
{
"check": "git diff --check",
"status": "pass"
},
{
"check": "normal C fail-closed in-memory controls",
"status": "pass",
"cases": [
"missing authority contract rejected",
"caller-forged authority contract rejected"
],
"scope": "not a Git role fixture"
},
{
"check": "bulk_reader_equivalence",
"status": "blocked",
"exit_code": 1,
"reason": "/tmp directory creation raised PermissionError (Operation not permitted), before any Git invocation",
"execution": "fixture body unexecuted; Root-run"
},
{
"check": "checker_role_fixtures",
"status": "unexecuted",
"reason": "isolated temporary directory unavailable; fresh-Q evidence also unavailable; Root-run"
},
{
"check": "checker_candidate_fixtures",
"status": "unexecuted",
"reason": "isolated temporary directory unavailable; Root-run"
}
],
"exclusions": [
"S5 drivers and adapters not implemented",
"fresh-Q pipeline not implemented",
"full184/329 verifier not implemented",
"normal-C authoritative receipt path/hash/provenance contract not supplied",
"no genuine-Q or qualified-C positive claimed"
],
"note": "Existing REPAIR30_SOURCE_FACTS and REPAIR30_STATIC_CHECKS were reused without modification. Counts here describe static file parsing, not acceptance or runtime source membership."
}
@@ -0,0 +1,59 @@
# Repair 31 — BLOCKED / incomplete implementation
Formal status remains **16/88, P04 credit 0**. **Do not admit the once-only
native/full batch.** This revision does not finish BF35.
D05 is **six of six actually approved**. There is no policy question for the
human. Adoption into enforced raw evidence and exact-Q verification are pending.
A01 remains approved. The per-ID path/SHA256 bindings in the checker and the
superseded candidate documents are preserved. The authority fixtures exercise
positive, missing, wrong-hash, pending-status and wrong-path cases for every ID.
Repair30's SOURCE_FACTS and STATIC_CHECKS remain historical, unchanged inputs.
This repair adds a fail-closed normal-C qualification boundary and records the
receipt content requirements in `NORMAL_C_RECEIPT_FIELDS`. Even a commit with
the correct two parents and Q tree is insufficient. The authoritative Root/Runner
receipt path, digest and provenance verification contract have not been supplied;
`NORMAL_C_RECEIPT_CONTRACT` remains unset. No Runner API or authority is inferred.
An index-provided receipt cannot resolve this gap. This blocks every C, including
a legitimate C, until that concrete contract and its verifier are supplied.
The schema2 builder's undefined `tested` reference is fixed by checking the CLI
reference against the constructed payload's tested version. This does not make
its historical pipeline usable for fresh Q.
Bulk and role fixtures now allocate under `/tmp`, outside the source repository,
with inherited Git routing removed. Role fixtures reject unqualified no-ff merges
and synthetic commits with identical parents/tree. The additional candidate
fixture constructs such a commit only in a temporary bare clone. These Git
fixtures are **Root-run / unexecuted**: the worker's bulk attempt failed on
temporary directory creation with `PermissionError: Operation not permitted`,
before any Git invocation. They were not redirected into the worktree.
Remaining implementation, separate from the genuine authority context gap:
1. Four executable S5 drivers and their raw semantic adapters are still missing.
`s5/PENDING.md` remains accurate. All approved destruction/day/reason/exit
policies must be enforced alongside the existing safety conditions.
2. Fresh-Q run identity/provenance plumbing in native series, collector, S1–S4
wrappers and schema2 builder is unfinished. Historical names, pins and source
manifests have not been relabeled.
3. The separate full184/329 verifier and its exact source/settings/markers/policy/
engine/input/ended-receipt joins, including separate test_required_kitchen
binding, are unfinished. The native input loop is not a substitute.
4. Normal-C positive qualification needs the actual authoritative receipt contract
described above; matching Git structure alone is deliberately rejected.
5. Genuine-Q positive and fake-Q/full-role fixtures remain unexecuted. The new
synthetic-C Git fixture also remains unexecuted; static parsing is not proof
that it ran.
See REPAIR31_STATIC_CHECKS.json for actual worker results. No engine, formal gate,
Runner operation, repository Git write, integration or other agent was invoked.
Product code, Clock, values, tests, spec, denominator, thresholds and permissions
are unchanged. No material was removed for the obsolete byte cap.
After the missing implementation and context are resolved, Root retains the
recorded order: static controls; genuine Q and fresh S1–S5 once; disk/verified CoW
then full184/329 once on final Q with final checker; truthful index; verify-only
on S; independent whole-unit review; prepare-integration/final on qualified C.
Live records stay under `.runtime`. No known-failing gate is a progress check.
@@ -0,0 +1,63 @@
{
"task_id": "P04-01",
"scope": "new concrete32 static preparation only",
"results": [
{
"path": "normal_c_join.py",
"check": "AST and in-memory compile",
"exit_code": 0,
"status": "pass",
"sha256": "3156e1df928ae15ab311b61eb27e21ef27cf123cb7097646a81a3f836c30ba33"
},
{
"path": "normal_c_join_fixtures.py",
"check": "AST and in-memory compile",
"exit_code": 0,
"status": "pass",
"sha256": "fba1634aafbb5c6030bec073b75b609a20d10d5ca6a6f0eddc270a12023830a3"
},
{
"path": "scratch_fixture_adapter.py",
"check": "AST and in-memory compile",
"exit_code": 0,
"status": "pass",
"sha256": "4994101754c38568007f2d7e1e0c8a2221d26216f464c496a7258ff89c601994"
},
{
"path": "s5/run_s5_native.py",
"check": "AST and in-memory compile",
"exit_code": 0,
"status": "pass",
"sha256": "928409e17984330498b2637e33957740bcdd91d427df5ee60d21a86671646fa2"
},
{
"path": "s5/s5_power_adapter.py",
"check": "AST and in-memory compile",
"exit_code": 0,
"status": "pass",
"sha256": "6b77e1ac7f1bdfd031321f106d8a6fcf465a3c1dd30e697d2b1e7c7285139f15"
},
{
"path": "s5/p04_s5_power_probe.gd",
"check": "text-only forbidden operation and declaration controls",
"exit_code": 0,
"status": "pass",
"godot_parse": "unexecuted",
"sha256": "248da3f1dbca644e2fd62fcf283a4e499e0631ff23f8dc44dc77b872ef1be5ba"
},
{
"check": "normal-gate reference supplied index SHA256",
"status": "pass",
"exit_code": 0,
"sha256": "4c6067bbd57034764873a468ff161a6882d232503043d5640fc83dea0b455856"
}
],
"fixtures": "unexecuted",
"formal_validation": "unexecuted",
"engines_launched": 0,
"git_commands": 0,
"runner_operations": 0,
"whole_goal_accepted": false,
"original_credit": 0,
"existing_partial31_files_edited": 0
}
@@ -0,0 +1,44 @@
# Repair 32 — partial implementation submitted; no acceptance claim
Only new concrete32 files were added. Existing partial31 files, including the
checker and s5/PENDING.md, were not edited. No condition credit is claimed:
formal 16/88, original 30/88, P04 credit 0, all 15 conditions plus EV, frozen
Mc0 and all six approved D05 items remain unchanged.
Implemented, unexecuted:
- S5 power driver pair and S4-derived wrapper: public bath pure depletion and
cafeteria/kitchen reason-priority depletion; public spend/recovery commands;
observed completion; same-key replay; full typed/JSON phase points; formal
save/independent Reader load/replay. No disconnect or direct resource mutation.
- Hashed raw semantic adapter for existing power_stop, dependency_stop and
recovery_completion measurement keys. It does not qualify native provenance.
- Read-only normal_c_join over actual Runner task/candidate/main_base, approval,
validation/review and integration/final records. No future C hash is frozen.
Root must retain an actual approved Runner snapshot before integrate deletes
approval; later final records come from the current Runner database.
- Root-run synthetic normal join controls and explicit-scratch adapter for
preserved Git fixtures. No fixtures were executed.
- S5_ROOT_RUN.md and NORMAL_C_BOUNDARY32.md explain boundaries and limitations.
Actual verification: Python AST/compile for five new Python files and textual
probe controls passed. No pycache, engine, Godot parse, Git command, Runner
operation, fixture, formal validation, independent review or integration ran.
The shell rejected a here-document temporary-file allocation; subsequent commands
used python -c. An attempted documentation addition at the repository root was
rejected and no file was created there; the document was added within allowed_paths.
Remaining implementation limitations:
1. The old checker still deliberately rejects normal C: preserving partial31
means this standalone Runner-record join is not connected to its role output.
It does not assert Git structure/Q equivalence and cannot bypass that gate.
2. The S5 wrapper retains historical S4 template identity/count bindings. Fresh-Q
plumbing is outside this step and remains pending; this is not batch admission.
3. S5 destruction/midnight/exit, fresh-Q/full184/329, truthful collection/index,
exact-version applicability, independent review and ordinary gates remain
pending. None was attempted together or counted as a new unit.
4. Scratch adapters preserve the old fixtures' assertions; positive normal-C
structure fixtures under the eventual integrated boundary are still pending.
Runner/Root must run the permitted static fixtures in external scratch, review
the added source, and resolve boundary integration before the established
once-only genuine-Q/native/full sequence. No evidence or completion is invented.
@@ -0,0 +1,112 @@
{
"task_id": "P04-01",
"status": "blocked",
"checks": [
{
"kind": "py_compile",
"path": "tools/check_p04_order_evidence.py",
"output": "compiled without syntax errors",
"exit_code": 0
},
{
"kind": "py_compile",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_candidate_fixtures.py",
"output": "compiled without syntax errors",
"exit_code": 0
},
{
"kind": "py_compile",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_role_fixtures.py",
"output": "compiled without syntax errors",
"exit_code": 0
},
{
"kind": "py_compile",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/normal_c_join.py",
"output": "compiled without syntax errors",
"exit_code": 0
},
{
"kind": "py_compile",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/normal_c_join_fixtures.py",
"output": "compiled without syntax errors",
"exit_code": 0
},
{
"kind": "py_compile",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py",
"output": "compiled without syntax errors",
"exit_code": 0
},
{
"kind": "pure_static_ast",
"observation": "normal_c_join.verify parameters",
"output": [
"database",
"approved_database",
"candidate",
"submission",
"hashes"
]
},
{
"kind": "pure_static_source",
"observation": "checker contains runner_inputs",
"output": true
}
],
"fixtures": [
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_applicability_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_approval_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_candidate_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_encoder_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_join_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_native_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_negative_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_role_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_series_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/normal_c_join_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s4/engine_identity_negative_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s4/receipt_lifecycle_fixtures.py",
"execution": "unexecuted; Root only"
}
],
"engine_runs": 0,
"fixture_runs": 0,
"condition_credit": 0,
"original_completion": false
}
@@ -0,0 +1,51 @@
# REPAIR33 — blocked, no implementation or acceptance claim
P04-01 remains incomplete. Only this status and REPAIR33_STATIC_CHECKS.json
were added. Checker, fixtures, wrapper and S5 run documents remain unchanged.
No Git writes, Runner operations, fixture execution or engine runs occurred.
The instruction to return blocked for missing specifications applies to these
unresolved input contracts:
- The Root-supplied Q descriptor has no supplied schema or existing definition
in the inspected checker, S5 wrapper or local execution documentation.
`verify_roles` requires `product_binding` to contain exactly `tested_product`
and `runner_inputs`. Each runner input references an existing native receipt,
wrapper and materials; it does not define M/S fields or the wrapper's fresh-Q
configuration input. Specify the descriptor fields/types and how M, S, Q,
staged product, settings, markers, policy and material bindings are obtained
without inventing another input contract. Future hashes are not requested.
- The requested combined control includes matching Runner/Root records, but
`normal_c_join.verify(database, approved_database, candidate, submission,
hashes)` accepts only Runner databases and caller-supplied commit strings.
Its CLI has no Root exact-candidate record input or verification. Specify
that record's schema and binding, or explicitly confirm that Root performs
this join outside this verifier and define the combined control boundary.
The verifier was neither weakened nor called from the checker.
These are contract questions, not requests for permission expansion. Runner
core, Owner CLI and the reference core were not read. No dependency on them
was introduced. No speculative partial implementation was made.
Actual verification: six existing Python files compiled with py_compile;
generated bytecode was placed under the allowed execution directory and
removed. Pure AST inspection confirmed the normal_c_join parameter list;
a source assertion confirmed runner_inputs is present. Actual outputs are
recorded in REPAIR33_STATIC_CHECKS.json. All twelve discovered fixture files
are individually listed there as unexecuted; Root runs them later with its
own scratch directory. No test or acceptance result is inferred from syntax.
An initial shell here-document command failed before Python started with
`can't create temp file for here document: operation not permitted`.
It produced no verification result. The checks were then run using python3
`-c`, without shell temporary-file redirection.
Explicitly pending: this REPAIR33 implementation; S5 destruction, midnight
and exit drivers; fresh-Q plumbing for S1–S4 and the collector; all 184
executable suites and the 329 parse verifier; the truthful index; Root's
fixed run order, independent review and normal integration/final joins.
Formal 16/88, original 30/88, seven domains plus EV, all six D05 approvals
and P04 credit 0 remain fixed. M remains
`c0ea009b28a7649aca6a433a1a24dc0be5e7ab81`. No condition credit, original
completion, self-reported acceptance or cap change is claimed.
@@ -0,0 +1,95 @@
{
"task_id": "P04-01",
"status": "submitted",
"checks": [
{
"kind": "py_compile",
"path": "tools/check_p04_order_evidence.py",
"output": "tools/check_p04_order_evidence.py: py_compile completed without syntax errors",
"exit_code": 0
},
{
"kind": "py_compile",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_candidate_fixtures.py",
"output": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_candidate_fixtures.py: py_compile completed without syntax errors",
"exit_code": 0
},
{
"kind": "py_compile",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_role_fixtures.py",
"output": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_role_fixtures.py: py_compile completed without syntax errors",
"exit_code": 0
},
{
"kind": "ast",
"output": "AST: documentation roster is definition-only; qualifier retains identity require and structural return with provenance false; role candidate initialized, assigned and returned; pure control function has no subprocess/Git calls.",
"exit_code": 0
},
{
"kind": "py_compile",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_candidate_fixtures.py",
"output": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_candidate_fixtures.py: py_compile completed without syntax errors (final literal inputs)",
"exit_code": 0
},
{
"kind": "ast",
"output": "AST: pure candidate controls contain four literal 40-hex inputs.",
"exit_code": 0
}
],
"fixtures": [
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_applicability_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_approval_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_candidate_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_encoder_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_join_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_native_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_negative_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_role_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_series_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/normal_c_join_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s4/engine_identity_negative_fixtures.py",
"execution": "unexecuted; Root only"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s4/receipt_lifecycle_fixtures.py",
"execution": "unexecuted; Root only"
}
],
"pure_candidate_controls": "unexecuted; Root may use checker_candidate_fixtures.py --pure-only",
"engine_runs": 0,
"fixture_runs": 0,
"condition_credit": 0,
"original_completion": false
}
@@ -0,0 +1,49 @@
# REPAIR34 — structural step submitted
P04-01 remains incomplete. This step changes only the checker structural C
qualification and the two local fixture boundaries, plus this status and the
static-check record. The checker returns structure_qualified true and
provenance_verified_by_checker false with C/S/M/C_tree/Q joins. Prospective
roles return candidate_structure null. The provenance roster is documentation
only, never consumed. Other parent, tree, checker-blob and binding guards
were left unchanged.
Candidate fixtures now expect honest structural qualification for a manufactured
same-tree C. A separate --pure-only path contains three identity negatives and
one exact positive with literal 40-hex inputs; it requires no Git or engine.
The two role cases expect structural verification and separately record actual
downstream --verify-only returncode/stdout/stderr without asserting acceptance.
Both boundaries assert stderr has no 'qualification context gap'. Other
negative expectations remain unchanged. These fixtures have not been executed;
their downstream outcomes are pending Root execution, not inferred here.
Actual verification is limited to py_compile for the three changed Python
files and AST checks recorded with their real output in
REPAIR34_STATIC_CHECKS.json. Temporary compilation bytecode was created only
inside the allowed execution directory and removed. Every discovered fixture,
including the pure candidate controls, is unexecuted. An initial editing
command failed with a Python SyntaxError before any file writes; edits were
then applied in place. That command was not a validation check.
Explicitly pending in this same unit:
- normal_c_join and its fixtures: unchanged and unexecuted here; post-final
Root SQL candidate/M/S/approval/validation/review/integration/final joins
remain mandatory before original credit.
- Wrapper/descriptor: separate pre-run configuration with Root-derived M/S/Q
and pinned source/material references, not after-run binding.runner_inputs
receipts. Root JSON and exact-candidate qualification remain pending.
- S5 destruction, midnight and exit drivers; S1–S4 and collector fresh Q.
- All 184 executable suites / 329 parse verification; truthful index.
- Root run order, independent review, integration/final and provenance joins.
scratch_fixture_adapter.py routing is unchanged. No Git commands or writes,
engine runs, fixture runs, Runner operations, permissions or cap changes were
performed. Runner core and Owner CLI were not read; this step does not depend
on them. External provenance remains a required pending context, not a reason
to block the authorized structural step.
All seven domains plus EV, all six D05 approvals, formal 16/88, original 30/88
and P04 credit 0 remain fixed. Frozen M is
c0ea009b28a7649aca6a433a1a24dc0be5e7ab81. No condition credit, self-reported
acceptance, original completion or new counted unit is claimed.
@@ -0,0 +1,72 @@
{
"validation": "py_compile and ast only",
"results": [
{
"file": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py",
"py_compile": "passed",
"ast.parse": "passed",
"ast.required_functions": "passed",
"ast.no_fixed_counts": "passed"
},
{
"file": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_wrapper_fixtures.py",
"py_compile": "passed",
"ast.parse": "passed"
}
],
"fixtures": [
{
"name": "partial-triple",
"status": "unexecuted"
},
{
"name": "non-hex",
"status": "unexecuted"
},
{
"name": "short",
"status": "unexecuted"
},
{
"name": "mixed-modes",
"status": "unexecuted"
},
{
"name": "historical-native",
"status": "unexecuted"
},
{
"name": "no-flags",
"status": "unexecuted"
},
{
"name": "fresh-q",
"status": "unexecuted"
},
{
"name": "historical-check-only",
"status": "unexecuted"
},
{
"name": "git-dirty-file",
"status": "unexecuted"
},
{
"name": "git-untracked-file",
"status": "unexecuted"
},
{
"name": "git-wrong-head-tree",
"status": "unexecuted"
},
{
"name": "git-wrong-submission",
"status": "unexecuted"
},
{
"name": "git-wrong-main",
"status": "unexecuted"
}
],
"accepted": false
}
@@ -0,0 +1,37 @@
# REPAIR35 — submitted preparation, no acceptance credit
Scope is the S5 wrapper fresh-Q mode, pure mode-selection fixtures and status
documents only. The wrapper now binds M/S/Q_tree, the clean checkout carrier,
selection authority, selected source bytes and Q marker contracts. Fixed-input
rechecks require identical provenance. Cache comparisons remove only checker
and TEST from both maps and otherwise compare keys and hashes. R17 is explicitly
check-only/read-only. Fresh-Q counts are derived; historical material is listed
as historical_not_inputs rather than pinned as fresh-Q input.
R34 structural C, Root normal_c_join, probe, adapter, ownership/PID/cleanup,
Writer/Reader, formal mirror and inventory remain unchanged. Product, Clock,
values, tests/, Runner, core and Owner CLI were read-only. No Git commands,
engines, Runner operations or fixture execution were performed. No /tmp or
permission additions were used. A shell heredoc could not be created by the
environment; that edit attempt exited before running Python or changing files.
Edits were then applied directly in place.
Only py_compile and AST static validation are recorded in
REPAIR35_STATIC_CHECKS.json. Pure fixtures (partial triple, non-hex, short,
mixed modes, historical native, no flags, full triple, historical check-only)
and all five Root Git negatives are **unexecuted**. No functional pass is claimed.
Pending: S5 destruction/midnight/exit drivers; fresh Q for S1–S4 and collector;
184 suites / 329 parse; truthful index; Root run order; Root exact-candidate
qualification. Root next builds Qt and parentless X, stages under its own B,
then runs check-only, pure fixtures and Git negatives as described in
s5/S5_ROOT_RUN.md. No native/batch admission until the pending prerequisites
are ready.
All 7 domains + EV, formal 16/88, original 30/88, P04 credit 0, all six D05
approvals, frozen M c0ea009b28a7649aca6a433a1a24dc0be5e7ab81 and allowed_paths
remain fixed. This is an internal step of P04-01, no new counted unit and no
completion claim. Unchanged support gates including owned_outer.py were not
read or executed; their qualification remains with Root, as recorded in the
direction. Source commit identity was not independently checked because Git
commands are prohibited for this worker.
@@ -0,0 +1,41 @@
{
"py_compile_ast": [
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py",
"sha256": "e96b2793d7352ac52e16505c9c4cde3d151497763be3cb47926338df070b05e5",
"py_compile": "passed",
"ast": "passed",
"top_level_functions": [
"r17_relocation_guard",
"probe_guard",
"module",
"pin",
"load_uid_helper",
"make_uid_policy",
"engine_pin",
"select_mode",
"fresh_q_guard",
"main"
]
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_uid_controls.py",
"sha256": "17069b87b98c385e1298152c9c5c2f23c8710b79eb19aef073c64ce215f6c902",
"py_compile": "passed",
"ast": "passed",
"top_level_functions": [
"module",
"main"
]
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_wrapper_fixtures.py",
"sha256": "1a4daebf46051e975a9cc740660c4672371ea6a9e6cb04cbc1d458ece5f0151d",
"py_compile": "passed",
"ast": "passed",
"top_level_functions": [
"main"
]
}
]
}
@@ -0,0 +1,28 @@
# REPAIR36 — bounded preparation submitted, no acceptance credit
Changes are limited to the S5 wrapper, new pure UID controls and these documents.
Actual-Q AST helper loading, finite derived UID planning, import sealing,
private-globals phase instrumentation, phase receipts and cleanup rechecks
supplement the existing expected inventory. Historical selection, existing
require gates, ownership/PID, engine, cache and formal mirror rules remain.
The helper is loaded from real Q before controls construct synthetic refs.
Only py_compile and AST checks are executed and recorded in
REPAIR36_STATIC_CHECKS.json. Wrapper fixtures, UID controls, check-only plans,
Git negatives and every native diagnostic are unexecuted. No functional pass,
full regression, 15+EV batch, original credit or completion is claimed.
No Git, engine, Runner or other agent operations were performed. A shell
heredoc edit failed before Python execution; edits then used apply_patch.
Context gap: Q runner API was read from
build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_all_tests.py.reference;
Root must confirm the actual Q runner matches that mirror (320ca668…)
at runtime. Helper implementation was read from the adjacent P13 reference;
runtime loading uses only the actual pinned Q, never either mirror.
Pending: S5 destruction/midnight/exit drivers; S1–S4/collector fresh Q;
derived 184 suites / 329 parse; truthful index; Root exact-candidate qualification.
Root order is py_compile → wrapper fixtures → UID controls with explicit scratch
→ fresh check-only plan → exactly one new-name diagnostic. The failed r35
diagnostic is preserved. All 7 domains + EV, formal 16/88, original 30/88,
P04 credit 0, all six D05 approved in the actual human record; adoption verification pending, M c0ea009 and allowed_paths stay fixed.
@@ -0,0 +1,23 @@
{
"checks": [
{
"path": "s5/s5_power_adapter.py",
"sha256": "448f7a99cd08ead1d4e2b91907a66e8805261c9d24c9f55eed9a047fac48b57c",
"py_compile": "pass",
"ast_parse": "pass"
},
{
"path": "s5/s5_power_adapter_controls.py",
"sha256": "32d71db80994052b905829e6a2da38448ae789825c44570a901e67fe2d07fd33",
"py_compile": "pass",
"ast_parse": "pass"
}
],
"executed": [
"py_compile",
"ast.parse"
],
"functional_controls_executed": false,
"native_executed": false,
"accepted": false
}
@@ -0,0 +1,15 @@
# REPAIR37 — bounded preparation submitted; no acceptance
Two probe corrections preserve recovery inputs/save/restore: typed String snapshot staff versus StringName live staff, and rejected duplicate enqueue bound to the completed resource command. The completion hook still requires success; duplicate rejection must not emit command_completed. All payment, reservation, receipt, ledger, phase roster and Reader assertions remain unchanged.
The adapter loads the existing series parser by spec_from_file_location and records its SHA256. Typed staff and duplicate checks bind both roles to their own completed commands. New pure controls verify every INDEX member sha/bytes before scratch creation, use the actual q36 pair, and require ValueError for the specified mutations including JSON-equal typed changes. Controls remain unexecuted.
Read dependencies: local q36-writer-contract INDEX, TYPED_AUDIT, SAFETY_REAUDIT, command_queue.gd.reference, facility_instance.gd.reference, both before/resource-replay JSON records; series Node/variant and checker loader pattern. Raw fixture decoding and controls are reserved to Root. A shell heredoc failed before Python execution because shell temporary-file creation was denied; subsequent edits used python -c with no temporary files.
Only py_compile and AST parsing are run, as recorded in REPAIR37_STATIC_CHECKS.json. No engine, Git, Runner, native run, other agent or /tmp operation was performed. No functional pass is claimed. Source basis remains 8e25213; counters remain 37, original 30/88, formal 16/88, P04 credit 0 and M c0ea009 frozen. p04-s5-DIAG-r36 remains FAILED without retrospective pass. All six D05 decisions are approved in the actual human record; adoption verification remains pending.
Root order: py_compile → s5_uid_controls → adapter controls with explicit fresh BUILD scratch → fresh check-only plan → at most one fresh source-pinned diagnostic under a new name. UID sources/settings are unchanged. No full184 until the whole batch is ready.
Context gap: whether current runtime submit_command emits command_completed on enqueue rejection is grounded only by the command_queue reference and TYPED_AUDIT raw. Root must observe this in the diagnostic; any emission remains a failure.
Pending: S5 destruction/midnight/exit; S1–S4/collector fresh Q; full 184/329; whole independent Opus review; normal prepare/exact candidate/integration/final/Root join/ledger. No acceptance or completion is claimed.
@@ -0,0 +1,54 @@
# REPAIR38 — superseded by REPAIR39_STATUS.md
The shared-helper constraint below is historical and was explicitly resolved
by the REPAIR39 direction: generalize `_queue` and `_reader` through one
CASE_TABLE while preserving S5A/S5B behavior. It is no longer an open question.
See REPAIR39_STATUS.md for the current batch status and missing source context.
## Historical REPAIR38 record
No implementation or acceptance is submitted by this attempt. No Python or
GDScript source was changed. The A–F batch remains outstanding, not complete
or admitted for native execution.
The direction both freezes `_queue` and `_reader` as shared helpers and asks
for new reservation-bearing cases with before/boundary/next/replay points.
The existing helpers contain case-specific assertions and replay dispatch:
- `s5/p04_s5_power_probe.gd::_queue` requires exactly one reserved inventory ID
only when `_case == "S5B_DEPENDENCY"`; every other case must have zero.
Using this unchanged helper for the required reservation-bearing S5C/S5F
queued request would fail its assertion even with correct runtime behavior.
- `_reader` unconditionally calls `_assert_stopped` after loading boundary,
then replays the literal labels `held`, `recovered`, `duplicate_guard`.
Per-case `_labels` does not control that replay loop. New next/replay points
cannot be independently replayed through this loop as written.
Required clarification: does “shared helpers stay unchanged” allow replacing
these case-specific predicates/dispatch with case-table lookups while keeping
S5A/S5B behavior and every existing assertion equivalent? Alternatively, are
separate new-case queue/replay helpers authorized while the existing helpers
remain exclusively the power-case implementation? No selection between these
interpretations was silently made. This is an implementation-constraint
question, not a request to reopen D05 or A01.
Read context includes AGENTS.md, REPAIR37_STATUS.md, the existing S5 probe and
wrapper, S5_ROOT_RUN.md, PENDING.md, D05_REMAINING_APPROVAL.json, Root's local
q37-remaining-source-map/SOURCE_MAP.json and referenced facility and automatic
defense sources. Root's M runtime reference is present; the worktree runtime
is a different version and must not substitute for that reference.
Only read-only source inspection and this status documentation were performed.
No pure controls, py_compile, AST validation, probe_guard, engine, Git, Runner,
native run, other agent, integration or /tmp operation was performed. No
REPAIR38_STATIC_CHECKS.json claiming validation is supplied because no source
checks were run. PENDING.md is not marked superseded: cases remain unimplemented.
r35/r36 remain FAILED; Q37 remains a successful local diagnostic only. M
c0ea009, original 30/88, formal 16/88 and P04 credit 0 remain unchanged. The
15+EV requirements, seven domains, all six D05 decisions and A01 are unchanged.
After clarification and completion of the entire source batch, Root's required
order remains pure controls, check-only S1–S5 plan, focused fresh native S1–S5,
fresh collect, full184/329 on final Q, index, --verify-only, independent review,
and normal gates with Root join. None of these steps is authorized or claimed
as performed by this worker status record.
@@ -0,0 +1,11 @@
{
"task_id": "P04-01",
"repair": 39,
"status": "blocked",
"source_files_modified": [],
"checks_run": [],
"reason": "Documentation-only blocked record; required exact-version source context missing. No py_compile, AST, probe_guard or functional validation executed.",
"accepted": false,
"native_admissible": false,
"unit_accepted": false
}
@@ -0,0 +1,63 @@
# REPAIR39 — blocked: required exact-version source context unavailable
The REPAIR38 engineering constraint is resolved. The authorized implementation
choice is one CASE_TABLE with reserved-ID counts, replay labels and per-case
dispatch; `_queue` and `_reader` may be generalized without forking them.
No private-refactor or policy question remains open.
The complete A–F batch remains unimplemented in this attempt. No executable
source was changed, no partial batch is submitted, and no native admission or
acceptance is claimed. PENDING.md and S5_ROOT_RUN.md remain unchanged because
the cases and whole-batch prerequisites have not been implemented.
## Required context gap
REPAIR38 records reading Root's `q37-remaining-source-map/SOURCE_MAP.json`
and an M runtime reference, explicitly distinguishing that reference from
the worker runtime. Those materials are not present in this checkout or the
registered runtime directory in this session. Recursive file enumeration used
hidden and ignored files as well. The checkout has no `.review-material`.
The previous owner-handoff references documented in REPAIR36/37 are likewise
absent from the enumerated runtime files.
Direct reads establish:
| Available input | SHA256 / result |
| --- | --- |
| checkout autoload/simulation_runtime.gd | d52a995ae715542bbc550f68d35889540658275d12e04ae0b21ac276f5843f39 |
| relocated R17 product autoload/simulation_runtime.gd | 7f01b2dcdf28bc965c7588173c2dc70054633faf7204b1ac38ba0f4369331b47 |
| tools/run_all_tests.py in both locations | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 |
| tools/run_p13_reference_tests.py in both locations | missing |
The matching runner file is available; it is not itself a missing dependency.
Neither available runtime is established here as the frozen M c0ea009 source.
The phase facts in the direction do not supply the missing function bodies,
exact source mapping or UID helper contract. Substituting the historical R17
product or the worker runtime would not meet exact-version grounding.
Required to resume the same full batch: restore the locally readable,
hash-bound M source map and its referenced source bodies (including runtime,
facility and defense dependencies), and the Q UID helper reference used by
REPAIR36/37. Restore the q36-writer-contract INDEX and its referenced typed
materials for the existing adapter-control dependency. These are context
requirements, not requests for a new policy, acceptance waiver or native run.
## Work and validation actually performed
Read-only file discovery, relevant existing status/probe/wrapper inspection,
local input inspection and SHA256 computation were performed. Only this status,
REPAIR39_STATIC_CHECKS.json and the REPAIR38 supersession notice were written.
No Python or GDScript was modified, so no py_compile, AST or probe_guard check
was run. No controls, engine, Git, Runner, native execution, other agent,
integration or /tmp operation was performed.
r35 and r36 remain FAILED; Q37 remains a successful local diagnostic only.
M c0ea009, formal 16/88, original 30/88, P04 credit 0, the 15+EV membership
and thresholds, seven domains, six D05 decisions, A01 and allowed_paths remain
unchanged. No original-unit completion is asserted.
After the complete source batch, Root's order remains: pure controls;
check-only S1–S5 plan; one heavy lease for fresh S1–S5 with capacity/PID checks
and verified restore manifest; fresh collect; full184/329 once on final Q;
index; --verify-only; independent review; normal prepare/final and Root join.
This blocked attempt does not authorize starting that sequence.
@@ -0,0 +1,118 @@
{
"task_id": "P04-01",
"repair": 40,
"scope": "static only; no execution of probes, wrappers, adapters, controls, engine or Runner",
"python": [
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s1/run_s1_native.py",
"sha256": "bb7afc6cabc4f515318c30adcce5ab30a8932a893d1d358b8c05ff4750f4688f",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s2/run_s2a_native.py",
"sha256": "101431b3a84eeb9aaf8d6a1171a4ebdbba884ffb10fee32a709f04a28b8a1547",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s2b/run_s2b_native.py",
"sha256": "13398072583f9be02a2db3182298f572d77782ab39da8123c503ae8b951c9851",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s3/run_s3_native.py",
"sha256": "118843aa5bc69548634f958cb31f359777577239b54351e59df367f7d0a5e409",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py",
"sha256": "cb43895ee8ee5b22e81aca633dbe9621000f14aaa6999d4e0b77ca8eb0b5602f",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py",
"sha256": "9cfd1b7a4db638c65c0a66a4350b8acae5237d3aee568e72f8fe9fd3c451d2ad",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_power_adapter.py",
"sha256": "307438660ec5ffbbb24e7a12a87374ddf3b0d0db7d0c0fd06e4841622e677525",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_order_adapter.py",
"sha256": "abe02702027946778717aa0139b99d6986d3d03605c1afcd38763c65424b3c01",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_order_adapter_controls.py",
"sha256": "58a13df13f01c5d46268c68a7e969cc38608f97f9990f79b1b77d56b1712736a",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/p04_native_series.py",
"sha256": "2155e697a08bc5f4c38f320a08aedb4ded1fb6c5fcb046482312e1819829da98",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/collect_p04_native.py",
"sha256": "662387af72d2bd7681b81ffff7ec2e54a0019c50e981f86c7cfcf1ed61440e04",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/full_suite_verifier.py",
"sha256": "df3768b7755d603fc079e899da8f06ae4ebb529ae531824a30add0f4d6773a6e",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/build_p04_index.py",
"sha256": "d9be9e773d84bf30f086cc25c157c089025896279e30c8db2eb2995d6616715c",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_series_fixtures.py",
"sha256": "5ec725ad77313287f4f86ab30332012e2092caccafde2d91594ddd2013d8f418",
"AST": "passed",
"py_compile": "passed"
},
{
"path": "tools/check_p04_order_evidence.py",
"sha256": "8f288c127217a9586ddaeba9b97d21351ee4b3dfc6c199632f66e4cdc0554042",
"AST": "passed",
"py_compile": "passed"
}
],
"gdscript": {
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/p04_s5_power_probe.gd",
"sha256": "496dc6a9c828ae355fc129c4886ec83c6c6dcc9a9cd5e484b42060517059b1de",
"probe_guard_regexes": [
"\\bvar\\s+\\w+\\s*=",
"\\bfor\\s+\\w+\\s+in\\b",
"\\.(?:patience_remaining|elapsed_minutes|power_available|capacity|hold_until)\\s*=(?!=)"
],
"result": "passed",
"case_table_static_dispatch": "passed"
},
"not_run": [
"pure controls",
"Godot parse/native",
"S1-S5 check-only plans",
"fresh collection",
"full suite",
"index/verify-only",
"independent review"
],
"formal_acceptance": false
}
@@ -0,0 +1,173 @@
# REPAIR40 status
Step 0: context index SHA-256 verified: 6f0ee990b95a5a897511425cd86ae57ba0364c5b326afdeb9f556fabfea6915c.
| Absolute path | Expected SHA-256 | Observed SHA-256 |
| --- | --- | --- |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_ABSOLUTE_CONTEXT_INDEX.json | 6f0ee990b95a5a897511425cd86ae57ba0364c5b326afdeb9f556fabfea6915c | 6f0ee990b95a5a897511425cd86ae57ba0364c5b326afdeb9f556fabfea6915c |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_NEXT_P04_PLAN.json | 217d9bf4ef593fb95a5e726fee0e4497863a0b06663d27ba20e742d81bb9c049 | 217d9bf4ef593fb95a5e726fee0e4497863a0b06663d27ba20e742d81bb9c049 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR30_DIRECT_CHECKER_PLAN.json | 77801cc6db2a4deb9f76118a746b32eb5e629b2d6980850b8813a12b45016806 | 77801cc6db2a4deb9f76118a746b32eb5e629b2d6980850b8813a12b45016806 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR30_RUN_DECISION.json | be7be3bfaa5a5ab412db8aecd1d951c213894e485b7869fcc12ab1c75b037c7f | be7be3bfaa5a5ab412db8aecd1d951c213894e485b7869fcc12ab1c75b037c7f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR31_CONCRETE_PLAN.json | 857e1acaed2093de56afdd851e69b3129bf9edce72b5da3cdd160ce4b7bfc18a | 857e1acaed2093de56afdd851e69b3129bf9edce72b5da3cdd160ce4b7bfc18a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR32_CONCRETE_PLAN.json | 5b69f850f835bd7af37e9c728c484c236c28efb0bd32113bb53bcbaf7d252c0a | 5b69f850f835bd7af37e9c728c484c236c28efb0bd32113bb53bcbaf7d252c0a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/CURRENT_ROOT_P04_RESUME_FACTS.json | c826726368844a823c54c1df1cdaff43fde5a94a17e638bfc60d8fb2559f8d85 | c826726368844a823c54c1df1cdaff43fde5a94a17e638bfc60d8fb2559f8d85 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/D05_ACTUAL_HUMAN_APPROVAL.json | cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96 | cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_FRESH_Q_INPUT_APPROACH_AFTER34.json | 7a7b91cbf04bb84cdef8e7a99ca2140a9eac2ac6a385570b4f0aa0d474e7da92 | 7a7b91cbf04bb84cdef8e7a99ca2140a9eac2ac6a385570b4f0aa0d474e7da92 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_P04_PRESERVED_TO_CURRENT_SOURCE_AUDIT.json | 6bb86959b06acb62d5cd3c5fd00bb6802a80b66184e69abca3f75c46ddeb7a12 | 6bb86959b06acb62d5cd3c5fd00bb6802a80b66184e69abca3f75c46ddeb7a12 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_PLAN_VERSION_NOTES.json | b4336f900a87f9bf0daa1e86728c3a913aed7c09425569e104cc01290be1c62f | b4336f900a87f9bf0daa1e86728c3a913aed7c09425569e104cc01290be1c62f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/INDEX.json | b2ad602b7bd22dbc4778b60b4a015b1d2f8f06b71278959fb52910f2ee1af57a | b2ad602b7bd22dbc4778b60b4a015b1d2f8f06b71278959fb52910f2ee1af57a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_CHECK_ONLY.json | aab7dcbfcc934f3bda7d937feb4e7638109ddf645da6ebd57f6190588b55287c | aab7dcbfcc934f3bda7d937feb4e7638109ddf645da6ebd57f6190588b55287c |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_GIT.json | e63b1b27244cd042f522a63b4392dea8c7211ce5ca5a927e91856115dfaa9f56 | e63b1b27244cd042f522a63b4392dea8c7211ce5ca5a927e91856115dfaa9f56 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_dirty.log | 3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53 | 3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_untracked.log | 3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53 | 3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_wrong-main.log | 006b9e83c3e106bada560371dda1fb9b4326e3f31fa48fa0c46e7d4903a91e55 | 006b9e83c3e106bada560371dda1fb9b4326e3f31fa48fa0c46e7d4903a91e55 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_wrong-submission.log | 6fefa0256b2dbc1596043fbff65fbaf87279baaa770a04d65a5fe70a6476671d | 6fefa0256b2dbc1596043fbff65fbaf87279baaa770a04d65a5fe70a6476671d |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_wrong-tree.log | 7fb7a1e4f00f201b7008b6d72957b3d4db450be156a1174b26a22c36d48b5e8f | 7fb7a1e4f00f201b7008b6d72957b3d4db450be156a1174b26a22c36d48b5e8f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_RESOURCE_ADMISSION.json | 18ef80f33f36cdd6ab664c862a9ae651a649a532bd32c4c35a81640cb4f078a0 | 18ef80f33f36cdd6ab664c862a9ae651a649a532bd32c4c35a81640cb4f078a0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_STAGE.json | f143045846cf06d79b81a0e52035300251fa576cde9a2d5eeda97d6610fd8591 | f143045846cf06d79b81a0e52035300251fa576cde9a2d5eeda97d6610fd8591 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_check-only.log | 4418f4b6bbe3d88cbf7f0b988084e05b5f0f52c15fe0f466ba82e584408427ce | 4418f4b6bbe3d88cbf7f0b988084e05b5f0f52c15fe0f466ba82e584408427ce |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_pure.log | f77640e0629497389baefc6424cf164d164fb96bbbd48cee6c4d83ed96c253c1 | f77640e0629497389baefc6424cf164d164fb96bbbd48cee6c4d83ed96c253c1 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_REPAIR30_EXECUTION_ORDER_FACTS.json | e18b031e790622929ec2c80ab9a6d5c3d883a364d625b58372fe33fd280ca93f | e18b031e790622929ec2c80ab9a6d5c3d883a364d625b58372fe33fd280ca93f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_REPAIR31_ACTUAL_FACTS.json | 0ea352b442e88263b899d28d58422afed39855393233c35ed3a962fcab67e136 | 0ea352b442e88263b899d28d58422afed39855393233c35ed3a962fcab67e136 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/INDEX.json | ff43786d898ef3475c267cf22758074a001b3d46dbc2bea52782a3782dd5571e | ff43786d898ef3475c267cf22758074a001b3d46dbc2bea52782a3782dd5571e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/autoload/simulation_runtime.gd | 45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0 | 45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scenes/main/main.gd | 92677e4ac57ed8d418a4a716bf0874cbbaea79cff893e5163c82ad1f75e7140a | 92677e4ac57ed8d418a4a716bf0874cbbaea79cff893e5163c82ad1f75e7140a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scenes/main/world_preview.gd | 4bc49a19a38b9c3b4d6bfc243ddf46f1f25469a8273adb5e812911ef9424a1f2 | 4bc49a19a38b9c3b4d6bfc243ddf46f1f25469a8273adb5e812911ef9424a1f2 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/core/save_service.gd | f4c270632225dd046bbff92f9472761d64d63740e93f274828c92dcf912db6a9 | f4c270632225dd046bbff92f9472761d64d63740e93f274828c92dcf912db6a9 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/relationship/relationship_service.gd | d2f6304aa643b98914c5d65bf3eb673ca8cc427476187f43e76b4b941410b1d3 | d2f6304aa643b98914c5d65bf3eb673ca8cc427476187f43e76b4b941410b1d3 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/ui/guest_observation_panel.gd | f5de1004fce5445bbfd3ee8d6ec37b325e7a9813d47c19beaeeeb411f27a50a5 | f5de1004fce5445bbfd3ee8d6ec37b325e7a9813d47c19beaeeeb411f27a50a5 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/ui/room_presentation.gd | 2eda851534777575298ea005e2e6d0ee90785a81357d5b9c34cfb95f615a8181 | 2eda851534777575298ea005e2e6d0ee90785a81357d5b9c34cfb95f615a8181 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/tests/business/test_required_kitchen.gd | 3a9c92f80c24064ef0858fba10bd7caab63203932942837f7e142349578f6b2f | 3a9c92f80c24064ef0858fba10bd7caab63203932942837f7e142349578f6b2f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/tools/regression/suite-policy.json | 7eb085d7e7a383785b4faedb503d0f6002bcad431e3188785aef901ce123769f | 7eb085d7e7a383785b4faedb503d0f6002bcad431e3188785aef901ce123769f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/INDEX.json | a7a3299c4d70ea033368a707882856fd5c7f7f4d5a0d5f86bf2fb9b2fe2e53d1 | a7a3299c4d70ea033368a707882856fd5c7f7f4d5a0d5f86bf2fb9b2fe2e53d1 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/controller-input.json | 24d10b3a91553df54b3b2fd4b1a57dce683cc72a55576e0c73c9e142b335ad40 | 24d10b3a91553df54b3b2fd4b1a57dce683cc72a55576e0c73c9e142b335ad40 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/controller.py | 9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b | 9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/003-receipt.json | 4ce015c160859612c89e215517826aa1da3582534d27c4688af6a44e37f1b641 | 4ce015c160859612c89e215517826aa1da3582534d27c4688af6a44e37f1b641 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/parse-receipt.json | 1ad82022669a3f197f53ed1e23f23aadc927220f0ba1f857c41f80721bafa443 | 1ad82022669a3f197f53ed1e23f23aadc927220f0ba1f857c41f80721bafa443 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/runner-ended.json | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/runner-input.json | 2a76506e923a3a95288ce826b81ed9eab49d4ecee613a2c82ae35e970c68f961 | 2a76506e923a3a95288ce826b81ed9eab49d4ecee613a2c82ae35e970c68f961 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/INDEX.json | 942181cc3efc8207e728233f89626b66eb0c34b582e5c9b0fae294dcf1600c00 | 942181cc3efc8207e728233f89626b66eb0c34b582e5c9b0fae294dcf1600c00 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/ROOT_EXACT_NORMAL_CANDIDATE_72A50A4A.json | 5614c9b1c9eb222dbbcfd9ae1c3b438cc4129c779deba2841d660a8c96b6cfe6 | 5614c9b1c9eb222dbbcfd9ae1c3b438cc4129c779deba2841d660a8c96b6cfe6 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/ROOT_NORMAL_FINAL_72A50A4A.json | b41069126e029c30ab644a62a54cb45ca2e0e504add150020500acba4e249469 | b41069126e029c30ab644a62a54cb45ca2e0e504add150020500acba4e249469 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/ROOT_NORMAL_INTEGRATION_72A50A4A.json | 2f47d39d3f05b3735f0fb3e01adaabf1c66c6a784d60af247063bd90e5ec0d5c | 2f47d39d3f05b3735f0fb3e01adaabf1c66c6a784d60af247063bd90e5ec0d5c |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/INDEX.json | a23f17336a5e701100c224ebcb69f37a8de95aca82658675b692d503798a5232 | a23f17336a5e701100c224ebcb69f37a8de95aca82658675b692d503798a5232 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/OWNER_CLI_REFERENCE.json | 1e360ad1d8057ef649fabe97ac3e98263d2f8c1c4d976d8b6e0a907a49e9158e | 1e360ad1d8057ef649fabe97ac3e98263d2f8c1c4d976d8b6e0a907a49e9158e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/ROOT_SOURCE_REVIEW_REJECTION_20D0AE5.json | d028dd3862ae663586d49b5843e88d9da82ad7985fa082551438e4a81311073e | d028dd3862ae663586d49b5843e88d9da82ad7985fa082551438e4a81311073e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/SOURCE_REWORK_ADAPTER_LOCAL_CHECKS.json | 580f2f19d680a23ee4efe6beab68a1aad69e067bc551f623cc7531c6915d7a78 | 580f2f19d680a23ee4efe6beab68a1aad69e067bc551f623cc7531c6915d7a78 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/SOURCE_REWORK_CURRENT_REFERENCE_INDEX.json | b0ecce7ae523527fdc6272e9784eba6109d67c0cd3745a8aaab64d913ca8adbd | b0ecce7ae523527fdc6272e9784eba6109d67c0cd3745a8aaab64d913ca8adbd |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/core.py.reference | 4c6067bbd57034764873a468ff161a6882d232503043d5640fc83dea0b455856 | 4c6067bbd57034764873a468ff161a6882d232503043d5640fc83dea0b455856 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/current-owner-cli.py.reference | 0cfd9634e4a59755b89d2927d60b6092368529f2ca7188d949da7f88080359aa | 0cfd9634e4a59755b89d2927d60b6092368529f2ca7188d949da7f88080359aa |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/owner-cli.py.reference | 52c327e624334b51612ea3cb1653aeff4a7a192502d1ba9407ce874af1d92410 | 52c327e624334b51612ea3cb1653aeff4a7a192502d1ba9407ce874af1d92410 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/owner-source-rework-20d0ae5.py.reference | 9ecf7bebf666a67a8f13357d66e9c1d8d76940ef8212f0055537b728c75e0cbc | 9ecf7bebf666a67a8f13357d66e9c1d8d76940ef8212f0055537b728c75e0cbc |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/FAILED_EXECUTION.json | 6e48da89ce852dacdbff2d0f93a8903583dccd9e05f5e34bb68be0d63f540332 | 6e48da89ce852dacdbff2d0f93a8903583dccd9e05f5e34bb68be0d63f540332 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/FAILED_IMPORT_COMBINED.log | cd39b1711f530454b0ec263ab2d076d714f674d5a36e26f9ef16788799b76764 | cd39b1711f530454b0ec263ab2d076d714f674d5a36e26f9ef16788799b76764 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/FAILED_OUTER_OWNED_FINALLY.json | ee14a347724aedb2ae8afecc0775250b1e014c17e726210e2535d6108e57edc0 | ee14a347724aedb2ae8afecc0775250b1e014c17e726210e2535d6108e57edc0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/INDEX.json | 0e4334442ce89b0388e10a4b62b5e00acbce2013e3ef1967508a3c48d72dc9c1 | 0e4334442ce89b0388e10a4b62b5e00acbce2013e3ef1967508a3c48d72dc9c1 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/P13_CONTROLLER_REFERENCE_INDEX.json | 48434362232d6b58cca720868c6d87f2af48675f365855b8a4a97eb5071dfee3 | 48434362232d6b58cca720868c6d87f2af48675f365855b8a4a97eb5071dfee3 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/P13_FULL_CONTROLLER_PATTERN.py.reference | 9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b | 9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/ROOT_Q35_DIAGNOSTIC_IMPORT_SOURCE_DELTA.json | 1994e59a498f3dbca1fd589b16b5bc6305d2786c0fa730ac489590469f08b05d | 1994e59a498f3dbca1fd589b16b5bc6305d2786c0fa730ac489590469f08b05d |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/ROOT_Q35_FAILED_IMPORT_UID_CLASSIFICATION.json | bc0a863e52db4f98b4b2ee4bc0b513c73f841726789a2ca99521c1b8618dc6c3 | bc0a863e52db4f98b4b2ee4bc0b513c73f841726789a2ca99521c1b8618dc6c3 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_all_tests.py.reference | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_p13_reference_tests.py.reference | 9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c | 9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/INDEX.json | cef78b200268e27a6e73ccd926ac95d0b2b6e30b9338a8412da9ab48b68ca82a | cef78b200268e27a6e73ccd926ac95d0b2b6e30b9338a8412da9ab48b68ca82a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/SAFETY_REAUDIT.json | 8edf11fe7893ced7c6450feb1ee3db45ab0a145db572254d2102ee70e26ac26e | 8edf11fe7893ced7c6450feb1ee3db45ab0a145db572254d2102ee70e26ac26e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/TYPED_AUDIT.json | e1800e1679b570ecdd9d7537e87e0730c089fa3b4c6197d3e279e60959aad016 | e1800e1679b570ecdd9d7537e87e0730c089fa3b4c6197d3e279e60959aad016 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/command_queue.gd.reference | 09b22e6212fa3ce1bf08f5d6b52224a2d3362b3bc63f03a8c98e89af1c6f5895 | 09b22e6212fa3ce1bf08f5d6b52224a2d3362b3bc63f03a8c98e89af1c6f5895 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/facility_instance.gd.reference | 0c6aa493f3299611e05dd26aa429dda8cf7b5c479e4d09632036fb862f79a324 | 0c6aa493f3299611e05dd26aa429dda8cf7b5c479e4d09632036fb862f79a324 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-before.json | af7b1f0099b37298b1bf0d683f98c0ec84fae96b74f16c33af310cab2efa955b | af7b1f0099b37298b1bf0d683f98c0ec84fae96b74f16c33af310cab2efa955b |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-before.var | 61f749b6a10ddc8e70f6e5b1d6378fcf1c0ae5127161a10c9704d76bcf64813a | 61f749b6a10ddc8e70f6e5b1d6378fcf1c0ae5127161a10c9704d76bcf64813a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-resource-replay.json | 56a7fc36e0972eb64abb19189f1664b87d6a058511bbec0ef7e1497abd2c511e | 56a7fc36e0972eb64abb19189f1664b87d6a058511bbec0ef7e1497abd2c511e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-resource-replay.var | 92aa8694939e2b8b678b556227cce1cf4cda661b6fb1f5a478ac37deba1a072e | 92aa8694939e2b8b678b556227cce1cf4cda661b6fb1f5a478ac37deba1a072e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-before.json | 0f821748eb7f12a8ac196c61bca34a7fe55af6adb3ab43d1acf8748fd2be8652 | 0f821748eb7f12a8ac196c61bca34a7fe55af6adb3ab43d1acf8748fd2be8652 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-before.var | 06b03c6a50a8832a9cab621b908332199e9ab4d10d4e547111a8860c70535bd2 | 06b03c6a50a8832a9cab621b908332199e9ab4d10d4e547111a8860c70535bd2 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-resource-replay.json | 49fb4df6bdaadd9c5146f716a108902c533b137427e2f90f86116393f12c6ea0 | 49fb4df6bdaadd9c5146f716a108902c533b137427e2f90f86116393f12c6ea0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-resource-replay.var | 464b589fa206427a1becd6dd484fc9be05da1b619ffb26ca559dde83e7b09309 | 464b589fa206427a1becd6dd484fc9be05da1b619ffb26ca559dde83e7b09309 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/INDEX.json | a8f44235dc8a74e67c3463698619611131224de5048868259a729791614cf9a9 | a8f44235dc8a74e67c3463698619611131224de5048868259a729791614cf9a9 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q36_REJECTED_ENQUEUE_STATIC_PATH.json | e8adc79d506491973289084c5ade7c3affe9e3e517896ef191f01cad6dcaed92 | e8adc79d506491973289084c5ade7c3affe9e3e517896ef191f01cad6dcaed92 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q37_DIAGNOSTIC_SAFETY_REAUDIT.json | 4d4b059576b3b6d28f71d054eeaf367ead54a74bb499d64bf450d625a137cfa5 | 4d4b059576b3b6d28f71d054eeaf367ead54a74bb499d64bf450d625a137cfa5 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q37_POWER_ADAPTER_RESULT.json | cce1132503457675b50d566ad1afc3f67e902a28135550a8e72b647dacd7d70d | cce1132503457675b50d566ad1afc3f67e902a28135550a8e72b647dacd7d70d |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q37_PREFLIGHT.json | 3554d8f246c0d117c774ecfabcd9eb48eed311155e3a5a3b15413f3e663b6fd7 | 3554d8f246c0d117c774ecfabcd9eb48eed311155e3a5a3b15413f3e663b6fd7 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_R37_ADAPTER_CONTROLS.json | f62fc981f3935bd969ea5c6fafa5d44a111b1264ad0d04fdb08b07fe4f27429e | f62fc981f3935bd969ea5c6fafa5d44a111b1264ad0d04fdb08b07fe4f27429e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/ROOT_MANA_ADOPTION_CURRENT_APPLICABILITY_C0.json | 57ba42e1c92db194a5ddcb8dc80c8e0249bbab817e35a3ae00bd12b0f4c57731 | 57ba42e1c92db194a5ddcb8dc80c8e0249bbab817e35a3ae00bd12b0f4c57731 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/ROOT_Q37_FULL_ROSTER_PREPARE_ONLY.json | c547dcff95184d04bf7089e7c9f6a2cda800a91359c9ec318f48ad4ecf2887c0 | c547dcff95184d04bf7089e7c9f6a2cda800a91359c9ec318f48ad4ecf2887c0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/SOURCE_MAP.json | d1333fc891342be5cc16795973fa71e7910a8c8af06ef4a3e51662537fed63c3 | d1333fc891342be5cc16795973fa71e7910a8c8af06ef4a3e51662537fed63c3 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/core/simulation_kernel.gd | 341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb | 341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/economy/economy_service.gd | 95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e | 95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/facility/facility_service.gd | ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77 | ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/guest/guest_service.gd | 56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e | 56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/operations/operations_coordinator.gd | 871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90 | 871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_autonomy.gd | 28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403 | 28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_cycle.gd | a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357 | a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tools/run_all_tests.py | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/core/simulation_kernel.gd | 341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb | 341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/autoload/simulation_runtime.gd | 45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0 | 45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/facility/facility_service.gd | ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77 | ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/economy/economy_service.gd | 95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e | 95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/operations/operations_coordinator.gd | 871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90 | 871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/guest/guest_service.gd | 56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e | 56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_autonomy.gd | 28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403 | 28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_all_tests.py.reference | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_cycle.gd | a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357 | a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_p13_reference_tests.py.reference | 9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c | 9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c |
## Source batch and helper choice
REPAIR38's helper restriction and REPAIR39's missing-context blocker text are
superseded for this attempt: the exact absolute context was readable and every
hash matched. The old status files and their stops are retained unchanged.
A: one CASE_TABLE dispatches all six S5 cases with reserved-ID counts and ordered
labels. _queue generalizes only its count predicate. _reader loads each boundary,
dispatches its stop assertion, then replays table labels. A/B keep recovery,
duplicate_guard and resource replay. C–F share private preparation/advancement
helpers using public commands, including the operations-enabled paid-midnight
path and the automatic-breach source fixture. No forced guest transition is used.
New-case receipt buffers are restored after formal load; _fresh/_cmd/_capture,
write/read, phase observation and resource replay implementations stay unchanged.
B: wrapper cases/labels/slots derive from the table. New order adapter reuses
Raw, typed parsing, staff_check, duplicate_check and series.variant by file spec;
its output records dependency SHA values. The typed mutation control program
uses explicit absent BUILD scratch and requires actual Root raw for positives.
The existing wrapper/UID controls do not read CASES and were left unchanged.
C: five wrappers select fresh Q through CLI arguments and shared S5 helpers.
UID policies preserve the original execute_phase code object. Historical mode
is read-only. FreshSeries verifies actual Root receipt pins, complete source,
UID/engine/PID/cleanup/formal material and recomputes existing semantic adapters.
Historical RUNS/NATIVE_PINS remain unchanged. Fresh collection is exclusive.
D: full_suite_verifier imports actual Q run_all_tests.py, derives the roster and
parse paths, rejoins raw markers/PIDs/logs/cleanup/source/settings/policy/engine
and UID seals, and binds required-kitchen separately. No totals imply original
acceptance. Its condition entries remain boundary-pending; checker uses fresh
boundary derivations. Normal C provenance is not an input to this verifier.
E: checker/index consume all FRESH_RUNS, enforce S5 approved-order gates and full
suite verification, and retain historical collection separately without union.
The index uses the fresh tested Q and fresh runner material descriptors.
The series fixture retains its existing negatives and adds the fresh roster.
F: this status, REPAIR40_STATIC_CHECKS.json, S5_ROOT_RUN.md and the narrowly
superseded PENDING.md describe the actual batch and Root's unchanged order.
## Verification and remaining evidence
Only static Python AST/py_compile and existing GDScript probe_guard regex checks
are permitted here. See REPAIR40_STATIC_CHECKS.json for checks actually executed.
No pure controls, engine, Git, Runner, native, integration or other agent was run.
The first shell here-document attempt was rejected before execution because the
shell could not create its temporary file; subsequent reads used python -c.
No /tmp file was created or used.
Native behavior, mutation controls, full suite, index verification and independent
review remain unexecuted. No required condition receives credit from this source
submission. In particular, absent fresh shift_completion/same_minute_replay/
paused_midnight evidence remains a failing gate rather than historical reuse.
S5 patience_release and paused_midnight remain pending unless actually observed.
A failed alignment, restore or typed assertion must remain a native failure.
Frozen: M c0ea009; formal 16/88; original 30/88; P04 credit 0; counters 40/unlimited;
seven domains; six D05 decisions and A01; REQUIRED membership/thresholds; product,
Clock, API, values and tests; allowed_paths; permissions, billing and policy.
r35/r36 are FAILED; Q37 is only local diagnostic evidence. No old proof relabelled.
@@ -0,0 +1,259 @@
[
{
"name": "checker_negative_fixtures",
"exit_code": 0,
"result": {
"scope": "Synthetic checker checks only; no engine evidence or formal acceptance",
"py_compile": true,
"results": [
{
"fixture": "synthetic_scalar_only_rejected",
"exit_code": 1,
"result": {
"error": "native bundle required; self-reported scalar evidence is insufficient"
}
},
{
"fixture": "forged_registered_pin",
"exit_code": 1,
"result": {
"error": "registered pin declaration"
}
},
{
"fixture": "false_delta",
"exit_code": 1,
"result": {
"error": "git diff/applicability_delta mismatch"
}
},
{
"fixture": "wrong_reach_anchor",
"exit_code": 1,
"result": {
"error": "unknown reachability anchor"
}
},
{
"fixture": "missing_index",
"exit_code": 1,
"result": {
"error": "missing/outside file: index.json"
}
},
{
"fixture": "duplicate_key",
"exit_code": 1,
"result": {
"error": "duplicate JSON key: schema_version"
}
},
{
"fixture": "symlink",
"exit_code": 1,
"result": {
"error": "symlink: stdout.json"
}
},
{
"fixture": "hash_mismatch",
"exit_code": 1,
"result": {
"error": "artifact hash: stdout"
}
},
{
"fixture": "stale_pin",
"exit_code": 1,
"result": {
"error": "tested game differs from Git: autoload/simulation_runtime.gd"
}
},
{
"fixture": "unexecuted_receipt",
"exit_code": 1,
"result": {
"error": "unexecuted/incomplete receipt"
}
},
{
"fixture": "pending_authority",
"exit_code": 1,
"result": {
"error": "pending/missing authority"
}
},
{
"fixture": "missing_condition",
"exit_code": 1,
"result": {
"error": "mandatory conditions missing: paused_midnight; unknown: "
}
},
{
"fixture": "unsupported_reach_false",
"exit_code": 1,
"result": {
"error": "unsupported reach=false: transport"
}
},
{
"fixture": "owner_hash_mismatch",
"exit_code": 1,
"result": {
"error": "owner approval hash mismatch: D05-P04-SHIFT-1800"
}
}
]
}
},
{
"name": "checker_join_fixtures",
"exit_code": 0,
"result": {
"scope": "semantic controls only; no new native execution",
"results": [
{
"case": "B1_cannot_supply_power_stop",
"result": "rejected",
"error": "power_stop requires S4; B1 is dependency/closure diagnostic only"
},
{
"case": "B1_real_despawn_positive",
"result": "accepted"
},
{
"case": "dependency_reason_relabelled_as_NO_POWER",
"result": "rejected",
"error": "B1 power Runtime facility/service join"
},
{
"case": "B1_missing_at_closure",
"result": "rejected",
"error": "B1 real B before/at closure"
},
{
"case": "B1_synthetic_later_guest",
"result": "rejected",
"error": "B1 normal despawn after departure"
},
{
"case": "B1_wrong_release_minute",
"result": "rejected",
"error": "B1 immutable reservation join"
},
{
"case": "B1_changed_wallet",
"result": "rejected",
"error": "B1 B wallet/no economy charge"
},
{
"case": "B1_missing_departure_history",
"result": "rejected",
"error": "B1 persisted departure join"
},
{
"case": "R2_real_first_1080_positive",
"result": "accepted"
},
{
"case": "R2_paid_midnight_substitution",
"result": "rejected",
"error": "shift raw service join"
},
{
"case": "R2_wrong_transaction",
"result": "rejected",
"error": "native receipt transaction"
},
{
"case": "R2_missing_DAY2",
"result": "rejected",
"error": "shift DAY2 before/after handover"
},
{
"case": "R2_after_staff_still_present",
"result": "rejected",
"error": "shift DAY2 before/after handover"
},
{
"case": "R2_next_extra_receipt",
"result": "rejected",
"error": "native duplicate/empty receipt"
},
{
"case": "R2_dynamic_PID_and_transaction_positive",
"result": "accepted"
},
{
"case": "R2_wrong_PID_join",
"result": "rejected",
"error": "native PID chain"
},
{
"case": "S1_pre_travel_mismatch",
"result": "rejected",
"error": "S1 pre-travel staff cell/task/raw reservation join"
},
{
"case": "S1_no_actual_outage",
"result": "rejected",
"error": "S1 actual reserve exhaustion/tick"
},
{
"case": "historical_receipt_checked_against_current_wrapper",
"result": "rejected",
"error": "S4 historical pin in fresh receipt"
},
{
"case": "current_wrapper_used_as_historical_receipt",
"result": "rejected",
"error": "S4 historical receipt wrapper pin"
},
{
"case": "fresh_receipt_carrying_historical_pin",
"result": "rejected",
"error": "S4 historical pin in fresh receipt"
},
{
"case": "tampered_historical_pinned_copy",
"result": "rejected",
"error": "S4 tampered historical wrapper pin"
},
{
"case": "S4_real_NO_POWER_positive",
"result": "accepted"
},
{
"case": "S4_related_facility_operating_false",
"result": "rejected",
"error": "S4 related facility must remain operating/powered"
},
{
"case": "S4_kitchen_unpowered",
"result": "rejected",
"error": "S4 related facility must remain operating/powered"
},
{
"case": "S4_closure_confound",
"result": "rejected",
"error": "S4 closure/damage/shift confound"
},
{
"case": "S4_no_actual_outage",
"result": "rejected",
"error": "S4 actual NO_POWER path, not relabelled dependency"
},
{
"case": "S4_wrong_transaction_join",
"result": "rejected",
"error": "S4 transaction/service join"
},
{
"case": "S4_dynamic_service_and_sale_positive",
"result": "accepted"
}
]
}
}
]
@@ -0,0 +1,65 @@
{
"M": "c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"sources": {
"scripts/core/command_queue.gd": {
"sha256": "09b22e6212fa3ce1bf08f5d6b52224a2d3362b3bc63f03a8c98e89af1c6f5895",
"functions": {
"enqueue": {
"line": 15,
"body_sha256": "56a1fe8a5dfd00ad81f9844bc8e6f4a6ce9009dadbc9cd2b7ff07d14bff1938c",
"full_body": "func enqueue(command: SimulationCommand) -> CommandResult:\n\tif command == null:\n\t\treturn CommandResult.failed(\n\t\t\tCommandResult.Code.INVALID_COMMAND,\n\t\t\t0,\n\t\t\t\"Command is null.\"\n\t\t)\n\n\tvar validation_error := command.validation_error()\n\tif not validation_error.is_empty():\n\t\treturn CommandResult.failed(\n\t\t\tCommandResult.Code.INVALID_COMMAND,\n\t\t\tcommand.command_id,\n\t\t\tvalidation_error\n\t\t)\n\n\tif _known_command_ids.has(command.command_id):\n\t\treturn CommandResult.failed(\n\t\t\tCommandResult.Code.DUPLICATE_COMMAND_ID,\n\t\t\tcommand.command_id,\n\t\t\t\"command_id has already been accepted.\",\n\t\t\t{\"original_command_id\": command.command_id}\n\t\t)\n\n\tif not command.idempotency_key.is_empty():\n\t\tvar key := command.idempotency_key\n\t\tif _idempotency_to_command_id.has(key):\n\t\t\tvar original_id: int = _idempotency_to_command_id[key]\n\t\t\tvar duplicate_details := {\n\t\t\t\t\"idempotency_key\": String(key),\n\t\t\t\t\"original_command_id\": original_id,\n\t\t\t\t\"processed\": _processed_results.has(original_id),\n\t\t\t}\n\t\t\tif _processed_results.has(original_id):\n\t\t\t\tvar prior: CommandResult = _processed_results[original_id]\n\t\t\t\tduplicate_details[\"original_result\"] = prior.to_dictionary()\n\t\t\treturn CommandResult.failed(\n\t\t\t\tCommandResult.Code.DUPLICATE_IDEMPOTENCY_KEY,\n\t\t\t\tcommand.command_id,\n\t\t\t\t\"idempotency_key has already been accepted.\",\n\t\t\t\tduplicate_details\n\t\t\t)\n\n\tvar queued_command := command.copy()\n\t_pending.append(queued_command)\n\t_known_command_ids[queued_command.command_id] = true\n\t_accepted_metadata[queued_command.command_id] = {\n\t\t\"command_id\": queued_command.command_id,\n\t\t\"idempotency_key\": String(queued_command.idempotency_key),\n\t}\n\tif not queued_command.idempotency_key.is_empty():\n\t\t_idempotency_to_command_id[queued_command.idempotency_key] = queued_command.command_id\n\t_pending.sort_custom(_comes_before)\n\treturn CommandResult.succeeded(queued_command.command_id)\n\n\n"
},
"execute_ready": {
"line": 83,
"body_sha256": "d8c534217e704cd892401904768a883c9a3ec2f3852ae7c0438f2eb854b4f7aa",
"full_body": "func execute_ready(current_tick: int, executor: Callable) -> Array[CommandResult]:\n\tvar results: Array[CommandResult] = []\n\tfor command in drain_ready(current_tick):\n\t\tvar accepted_command_id := command.command_id\n\t\tvar result: CommandResult\n\t\tif not executor.is_valid():\n\t\t\tresult = CommandResult.failed(\n\t\t\t\tCommandResult.Code.EXECUTOR_FAILED,\n\t\t\t\tcommand.command_id,\n\t\t\t\t\"Executor is not callable.\"\n\t\t\t)\n\t\telse:\n\t\t\tvar returned: Variant = executor.call(command)\n\t\t\tif returned is CommandResult:\n\t\t\t\tresult = returned\n\t\t\telif returned is bool and returned:\n\t\t\t\tresult = CommandResult.succeeded(command.command_id)\n\t\t\telse:\n\t\t\t\tresult = CommandResult.failed(\n\t\t\t\t\tCommandResult.Code.EXECUTOR_FAILED,\n\t\t\t\t\tcommand.command_id,\n\t\t\t\t\t\"Executor did not return a successful CommandResult.\"\n\t\t\t\t)\n\n\t\tvar completed_result := complete(accepted_command_id, result)\n\t\tresults.append(completed_result)\n\treturn results\n\n\n"
},
"complete": {
"line": 112,
"body_sha256": "4290ebfe68d9245b4e8ebb6d8a09ba6172f16bcacb6e4294299ad6dc06c56ed7",
"full_body": "func complete(command_id: int, result: CommandResult) -> CommandResult:\n\tif not _in_flight.has(command_id):\n\t\treturn CommandResult.failed(\n\t\t\tCommandResult.Code.NOT_FOUND,\n\t\t\tcommand_id,\n\t\t\t\"Command is not in flight.\"\n\t\t)\n\tif result == null:\n\t\treturn CommandResult.failed(\n\t\t\tCommandResult.Code.INVALID_COMMAND,\n\t\t\tcommand_id,\n\t\t\t\"Result is null.\"\n\t\t)\n\n\tvar stored_result := result.copy()\n\tstored_result.command_id = command_id\n\t_processed_results[command_id] = stored_result\n\t_in_flight.erase(command_id)\n\treturn stored_result.copy()\n\n\n"
},
"get_accepted_command_metadata": {
"line": 174,
"body_sha256": "60841dbff80282e95460e8dfeaeb6ae37a0cc05f2c7654130e8b8c51729e5b39",
"full_body": "func get_accepted_command_metadata() -> Array[Dictionary]:\n\tvar result: Array[Dictionary] = []\n\tvar command_ids: Array = _accepted_metadata.keys()\n\tcommand_ids.sort()\n\tfor command_id: Variant in command_ids:\n\t\tresult.append((_accepted_metadata[command_id] as Dictionary).duplicate(true))\n\treturn result\n\n\n"
},
"create_snapshot": {
"line": 189,
"body_sha256": "15737e59018ae93092c1aca3ce268d2bc354c28a8261d4ffada4aba63af3d241",
"full_body": "func create_snapshot() -> Dictionary:\n\tvar pending_data: Array[Dictionary] = []\n\tfor command in _pending:\n\t\tpending_data.append(command.to_dictionary())\n\tvar in_flight_ids: Array = _in_flight.keys()\n\tin_flight_ids.sort()\n\tvar in_flight_data: Array[Dictionary] = []\n\tfor command_id: Variant in in_flight_ids:\n\t\tvar command: SimulationCommand = _in_flight[command_id]\n\t\tin_flight_data.append(command.to_dictionary())\n\tvar processed_ids: Array = _processed_results.keys()\n\tprocessed_ids.sort()\n\tvar processed_data: Array[Dictionary] = []\n\tfor command_id: Variant in processed_ids:\n\t\tvar result: CommandResult = _processed_results[command_id]\n\t\tprocessed_data.append(result.to_dictionary())\n\tvar idempotency_data := {}\n\tvar idempotency_keys: Array = _idempotency_to_command_id.keys()\n\tidempotency_keys.sort_custom(func(a: Variant, b: Variant) -> bool: return String(a) < String(b))\n\tfor key: Variant in idempotency_keys:\n\t\tidempotency_data[String(key)] = int(_idempotency_to_command_id[key])\n\treturn {\n\t\t\"version\": SNAPSHOT_VERSION,\n\t\t\"pending\": pending_data,\n\t\t\"in_flight\": in_flight_data,\n\t\t\"processed\": processed_data,\n\t\t\"idempotency\": idempotency_data,\n\t\t\"accepted\": get_accepted_command_metadata(),\n\t}\n\n\n"
}
}
},
"scripts/core/stable_id_generator.gd": {
"sha256": "78e0dd691ba18d1f159d9d7abba5894d2e10d36885aa6dc5be02a27f9edd5013",
"functions": {
"next_id": {
"line": 9,
"body_sha256": "cf1cf036adab2eb36acab25a069b5dfc42e7aa281c491bd89ade6d91f6eb2c1d",
"full_body": "func next_id(prefix: StringName) -> StringName:\n\tif not _is_valid_prefix(String(prefix)):\n\t\tpush_error(\"Stable ID prefix must be lowercase ASCII snake_case\")\n\t\treturn &\"\"\n\tvar next_value := int(_counters.get(prefix, 0)) + 1\n\tif next_value > MAX_COUNTER:\n\t\tpush_error(\"Stable ID counter exhausted for '%s'\" % prefix)\n\t\treturn &\"\"\n\t_counters[prefix] = next_value\n\treturn StringName(\"%s.%012d\" % [prefix, next_value])\n\n"
},
"create_snapshot": {
"line": 23,
"body_sha256": "cab243cf59d5d56ff03beb305070f83b66d7a55cce7f3f2f889c0d9a5303e76a",
"full_body": "func create_snapshot() -> Dictionary:\n\tvar counters := {}\n\tvar prefixes: Array = _counters.keys()\n\tprefixes.sort()\n\tfor prefix: Variant in prefixes:\n\t\tcounters[String(prefix)] = int(_counters[prefix])\n\treturn {\n\t\t\"version\": SNAPSHOT_VERSION,\n\t\t\"counters\": counters,\n\t}\n\n"
}
}
},
"scripts/core/domain_event_stream.gd": {
"sha256": "f9b57a4b4b53cf7d67132a159ea90378c633b4f19d8de28dbe7a33ebce8e3d79",
"functions": {
"publish_batch": {
"line": 40,
"body_sha256": "275be0d68c99217732ea3dc2821cf7dcec24a695035e455af7f716d901147167",
"full_body": "func publish_batch(events: Array) -> bool:\n\tif events.size() > MAX_BATCH_SIZE:\n\t\treturn false\n\tvar committed: Array[SimulationDomainEvent] = []\n\tvar batch_ids: Dictionary = {}\n\tfor event_value: Variant in events:\n\t\tif not event_value is SimulationDomainEvent:\n\t\t\treturn false\n\t\tvar event: SimulationDomainEvent = event_value\n\t\tif event == null or not event.is_valid() \\\n\t\tor _published_ids.has(event.event_id) or batch_ids.has(event.event_id):\n\t\t\treturn false\n\t\tbatch_ids[event.event_id] = true\n\t\tcommitted.append(event.copy())\n\tif not committed.is_empty():\n\t\t_snapshot_ids_dirty = true\n\tfor event: SimulationDomainEvent in committed:\n\t\t_published_ids[event.event_id] = true\n\t\t_recent_events.append(event.copy())\n\t\tif _recent_events.size() > RECENT_EVENT_LIMIT:\n\t\t\t_recent_events.pop_front()\n\t\t_pending_deliveries.append(event.copy())\n\t_drain_deliveries()\n\treturn true\n\n\n"
},
"create_snapshot": {
"line": 96,
"body_sha256": "94fc2dd3ef1a953ba7d9b3d3728c0d158bf0f69935874f48722a3c6025447dbf",
"full_body": "func create_snapshot() -> Dictionary:\n\tif _snapshot_ids_dirty:\n\t\t_snapshot_ids.clear()\n\t\tfor event_id: Variant in _published_ids:\n\t\t\t_snapshot_ids.append(String(event_id))\n\t\t_snapshot_ids.sort()\n\t\t_snapshot_ids_dirty = false\n\tvar saved_ids: Array[String] = _snapshot_ids.duplicate()\n\tvar saved_recent: Array[Dictionary] = []\n\tfor event in _recent_events:\n\t\tsaved_recent.append(event.to_dictionary())\n\treturn {\n\t\t\"version\": SNAPSHOT_VERSION,\n\t\t\"published_ids\": saved_ids,\n\t\t\"recent_events\": saved_recent,\n\t}\n\n"
}
}
}
}
}
@@ -0,0 +1,463 @@
{
"repair": 45,
"status": "ready",
"scope": "Worker implementation ready for submission only; whole unit incomplete",
"repair44_attempt": {
"repair": 44,
"status": "blocked",
"scope": "Actual worker checks only; no native or formal acceptance",
"blocker": {
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r43-eb94e1d7/tools/run_all_tests.py",
"operation": "UID pure control module read",
"error": "PermissionError: [Errno 1] Operation not permitted",
"stop_authority": "REPAIR44: stop for an actually unreadable file"
},
"approval_sha256": {
"expected": "cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96",
"actual": "cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96",
"result": "PASS"
},
"spec": {
"raw_bytes": 7000,
"raw_sha256": "d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f",
"one_final_LF_removed_sha256": "9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881",
"existing_protocol": "PASS"
},
"q43_handoff_INDEX": {
"entries": 14,
"exact_raw_bytes_and_sha256": "PASS"
},
"pure_controls": [
{
"name": "negative",
"exit_code": 0
},
{
"name": "join",
"exit_code": 0
},
{
"name": "encoder",
"exit_code": 0
},
{
"name": "approval",
"exit_code": 0
},
{
"name": "candidate",
"exit_code": 0
},
{
"name": "series",
"exit_code": 0
},
{
"name": "wrapper",
"exit_code": 0
},
{
"name": "full-suite-negatives",
"exit_code": 0
},
{
"name": "guard-mutations",
"exit_code": 0
},
{
"name": "UID",
"exit_code": 1
},
{
"name": "power-adapter",
"exit_code": 0
},
{
"name": "repair44",
"exit_code": 0
}
],
"pure_results": {
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/REPAIR44_PURE_RESULTS.json",
"sha256": "4a702903f9d3189af50b68383cc5bc7829a7480b3a0199459e5b9b3ed710733e"
},
"new_controls": {
"source": "s5/repair44_controls.py",
"synthetic_only": true,
"paid_mutations_rejected": 17,
"roster_name_sync_probe_regex_self_check": "PASS",
"no_pyc": "PASS"
},
"not_run": [
"AST and explicit build-cfile py_compile on every touched Python file (stopped before this stage)",
"Check-only S1-S5 plan (stopped before this stage)",
"Fresh native S1-S5 and independent Reader",
"Fresh collect, full184, index, verify-only, registered validation, independent whole-unit review and integration"
],
"formal_acceptance": false
},
"compile_checks": [
{
"file": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_negative_fixtures.py",
"AST_exit_code": 0,
"py_compile_exit_code": 0,
"cfile": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/11.pyc"
},
{
"file": "docs/plans/original-completion-2026-10-02/execution/p04-01/p04_native_series.py",
"AST_exit_code": 0,
"py_compile_exit_code": 0,
"cfile": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/12.pyc"
},
{
"file": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/repair44_controls.py",
"AST_exit_code": 0,
"py_compile_exit_code": 0,
"cfile": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/16.pyc"
},
{
"file": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py",
"AST_exit_code": 0,
"py_compile_exit_code": 0,
"cfile": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/17.pyc"
},
{
"file": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_order_adapter.py",
"AST_exit_code": 0,
"py_compile_exit_code": 0,
"cfile": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/18.pyc"
},
{
"file": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_order_adapter_controls.py",
"AST_exit_code": 0,
"py_compile_exit_code": 0,
"cfile": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/19.pyc"
},
{
"file": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_power_adapter.py",
"AST_exit_code": 0,
"py_compile_exit_code": 0,
"cfile": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/20.pyc"
},
{
"file": "tools/check_p04_order_evidence.py",
"AST_exit_code": 0,
"py_compile_exit_code": 0,
"cfile": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/21.pyc"
}
],
"uid": {
"name": "UID-repair45",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_uid_controls.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/verified-m-engine-free-r45",
"--scratch",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/uid"
],
"exit_code": 0,
"stdout": "{\"accepted\": false, \"Root-only\": true, \"controls\": [\"positive\", \"extra\", \"original\", \"owner\", \"existing-collision\", \"generated-collision\", \"no-newline\", \"crlf\", \"uppercase\", \"too-long\", \"hardlink\", \"symlink\", \"missing\", \"post-seal-reports\"], \"uid_helper\": {\"helper_path\": \"tools/run_p13_reference_tests.py\", \"helper_sha256\": \"9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c\", \"helper_bytes\": 13957, \"functions\": {\"uid_plan\": \"c9b094e12e3ace11b4c81365d134f7a218dd73ca8e6501f5f860acd2af0e980d\", \"uid_snapshot\": \"2987194db9bcfaf781e25808c755a9d8c8b87cb7f57f92a8f8e4292c2823c4e9\"}, \"shared_module\": \"tools/run_all_tests.py\", \"shared_sha256\": \"320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4\"}, \"scratch\": \"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/uid\"}\n",
"stderr": ""
},
"no_pyc": {
"exit_code": 0,
"files": [],
"scope": "execution/p04-01/**/*.pyc and tools/check_p04_order_evidence.py source only"
},
"check_only_initial_argument_refusals": [
{
"series": "s1",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s1/run_s1_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s1-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s1-native"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: fresh-q requires a full HEX40 triple without --historical-r17\n"
},
{
"series": "s2a",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s2/run_s2a_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s2a-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s2a-native"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: fresh-q requires a full HEX40 triple without --historical-r17\n"
},
{
"series": "s2b",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s2b/run_s2b_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s2b-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s2b-native"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: fresh-q requires a full HEX40 triple without --historical-r17\n"
},
{
"series": "s3",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s3/run_s3_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s3-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s3-native"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: fresh-q requires a full HEX40 triple without --historical-r17\n"
},
{
"series": "s4",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s4-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s4-native"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: fresh-q requires a full HEX40 triple without --historical-r17\n"
},
{
"series": "s5",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s5-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s5-native"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: fresh-q requires a full HEX40 triple without --historical-r17\n"
}
],
"check_only": {
"tree_argument_scope": "Actual HEAD tree only; W is dirty, not a final Q or C claim",
"results": [
{
"series": "s1",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s1/run_s1_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s1-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s1-native",
"--tested-tree",
"af5256155815214dc73620d5a2ad04cbcd139274"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: checkout is not clean\n"
},
{
"series": "s2a",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s2/run_s2a_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s2a-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s2a-native",
"--tested-tree",
"af5256155815214dc73620d5a2ad04cbcd139274"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: checkout is not clean\n"
},
{
"series": "s2b",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s2b/run_s2b_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s2b-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s2b-native",
"--tested-tree",
"af5256155815214dc73620d5a2ad04cbcd139274"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: checkout is not clean\n"
},
{
"series": "s3",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s3/run_s3_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s3-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s3-native",
"--tested-tree",
"af5256155815214dc73620d5a2ad04cbcd139274"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: checkout is not clean\n"
},
{
"series": "s4",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s4-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s4-native",
"--tested-tree",
"af5256155815214dc73620d5a2ad04cbcd139274"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: checkout is not clean\n"
},
{
"series": "s5",
"argv": [
"python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py",
"--project-root",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement",
"--main",
"c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"--submission",
"eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97",
"--check-only",
"--plan",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s5-plan.json",
"--output",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair45-1792309312161922000/s5-native",
"--tested-tree",
"af5256155815214dc73620d5a2ad04cbcd139274"
],
"exit_code": 2,
"stdout": "",
"stderr": "ValueError: checkout is not clean\n"
}
]
},
"retained_passes": "REPAIR44 roster positives/negatives, all-consumer name-sync, probe_guard regex self-check, 17 paid-before-incident mutations; no source changed in REPAIR45",
"pure_results": {
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/REPAIR44_PURE_RESULTS.json",
"sha256": "569063467403bd004ff5b342486a822bba430f6e81a3e8081ed44cb50d23e5dd"
},
"formal_acceptance": false,
"not_run": [
"Clean exact-Q check-only after automatic submission (Root)",
"Fresh native S1-S4 and ten S5 cases; independent Reader and fresh order positives",
"Fresh adapters/collect/full184/index/verify-only/registered validation/independent whole-unit review/integration"
]
}
@@ -0,0 +1,468 @@
# REPAIR41 history and REPAIR45 status
## REPAIR45 — implementation ready for submission
The supplied byte-verified M engine-free context resolved the REPAIR44 UID dependency.
UID controls: all 14 PASS, exit 0. Both supplied helper SHA-256 pins match exactly.
AST and explicit fresh BUILD-cfile py_compile passed for all eight touched Python
files, with python3 -B and PYTHONDONTWRITEBYTECODE=1. No source was changed in
REPAIR45; retained passing controls were not rerun. The no-pyc static check
passed again (exit 0); generated compile files exist only under allocated BUILD.
The prior UID failure remains recorded as failed, not replaced with a PASS.
Sequential check-only S1, S2a, S2b, S3, S4 and S5 each returned exit 2:
`ValueError: checkout is not clean`
The initial missing-tested-tree argument refusals are also retained. The later
attempt used the actual HEAD tree solely as a guard input, not a claim of final
Q, clean source or C. No engine started. Root executes clean exact-Q check-only
after automatic submission. Full argv/stdout/stderr and compile paths are in
REPAIR41_STATIC_CHECKS.json. No Git writes, Runner or native run were performed.
Implementation is ready; the whole original unit remains incomplete and P04
credit remains 0. Deferred Root conditions, in order: freeze final Q; affected
pure controls; clean exact-Q check-only; capacity check; one heavy lease with
fresh native S1–S4 and all ten S5 cases; independent Reader and adapters on actual
raw (including fresh Reader order positives); fresh collect; full 184 suite once;
index; --verify-only; registered validation before review; independent whole-unit
Opus review; normal prepare / exact C / integration / final / Root DB join /
ledger / main push. Native Reader and acceptance remain pending.
patience_release stays pending unless fresh S3 raw shows it. Product freeze,
M, allowed paths, REQUIRED membership/thresholds, all seven domains, G1/G2,
R40–R44 and the existing one-trailing-LF spec protocol remain unchanged.
## REPAIR44
**Worker stopped: unreadable required check dependency.** The UID pure control
cannot read `/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r43-eb94e1d7/tools/run_all_tests.py`:
`PermissionError: [Errno 1] Operation not permitted`. REPAIR44 explicitly requires
stopping for an actually unreadable file. No permission bypass or alternate
positive is claimed. REPAIR44_PURE_RESULTS.json retains the failed invocation.
Eleven other pure programs completed successfully (including the new 17 paid
mutation negatives and roster/name-sync/regex/no-pyc controls). The already
launched sequential batch finished power-adapter and repair44 controls after
the UID failure; these results are recorded within their limited scope.
AST/build-cfile compilation of all touched Python files and check-only S1–S5
were not reached. The implementation below is work in progress, not a completed
REPAIR44 submission. Resume requires a readable verified check dependency.
Same original unit, W and submitted S=eb94e1d7dbae3b0be84171b4ef0024b4f6b0ae97;
M=c0ea009b28a7649aca6a433a1a24dc0be5e7ab81. No reset or new counted work.
Original whole unit remains incomplete, formal 16/88, P04 credit 0.
R43 import/parse/Writer passed (2749/0), then run_s5_native.py:525 compared
sorted receipt branches to insertion-order CASES. G/H preceded E/F; all nine
cases were present but Reader never started. R43 native remains FAILED,
alongside r35/r36/R40 native. Q37 remains its own-version local PASS only.
Seven Writer-only typed derivers/G1/G2 and twelve pure/six check-only passes
are not independent Reader, replay or acceptance.
The canonical wrapper roster is now sorted(CASE_TABLE). LABELS, SLOTS and
receipt comparisons derive from it, with exact lengths, uniqueness and set
membership. Reader independently enumerates CASE_TABLE. The new pure controls
reproduce the old failure, accept insertion/reverse order and reject missing,
duplicate or unknown cases and missing/extra/duplicate slots. The ten cases are
`S5A_PURE`, `S5B_DEPENDENCY`, `S5C_DESTRUCTION_COMMAND`, `S5D_DESTRUCTION_RAID`,
`S5D_IN_FLIGHT`, `S5D_PAID_BEFORE_INCIDENT`, `S5E_MIDNIGHT`, `S5F_EXIT`,
`S5G_SHIFT_1080`, `S5H_PAUSED_MIDNIGHT`.
New fixture: primary queues at N-duration-1, starts at N-duration and completes
at N. Secondary queues at N-2 and starts at N-1, holding its own reservation;
two meals are stocked through _stock. Cafeteria definition capacity=12 (line22),
staff_min=2 (line18), base_service_minutes=45 (line24), base_price=25 (line26),
inventory_inputs=one meal (line27), exact file sha256
86d540fe2d78b9dcdbe5a0af6e4a001f4cec54934636ed01deb25a943c79128a.
Staff setup derives staff_min; prices/duration subsequently bind to the primary
service snapshot. Capacity permits the concurrent secondary; no product value
is changed. Seed 420558 is a distinct deterministic fixture seed following the
existing 42055x private-QA family, not a product RNG policy change.
M source proof (full bodies, file hashes and line ranges in
REPAIR44_SOURCE_FACTS.json): simulation_kernel.advance_one_minute line122,
body sha b9587ef722d8c8640248025462819374ae5eca1c3d8bbe600b6bc9c328567777,
runs FACILITY_COMPLETION, VITALS_AND_ENVIRONMENT, INCIDENTS_AND_EVENTS,
FACILITY_QUEUES in that order. _run_phase line236, body sha
52461eeb288892a4bb4b6a99570185af08a30758ef88b0046a911baaa6f318e1,
emits phase-start observations before handlers; therefore completion is
observed as ACTIVE at FACILITY_COMPLETION start and COMPLETED with one receipt
at VITALS_AND_ENVIRONMENT start. Receipt phase is FACILITY_COMPLETION.
Runtime registers the handlers at lines400–428. _advance_relationship_events
line8637, body sha 20ca7abfdcbbc914f91545c3eded46e3e87035ff4153541ffcbf92471b02b03f,
starts the queued automatic event in INCIDENTS_AND_EVENTS. Public registration
and enqueue functions are at lines6878/6887 (full hashes in the source facts).
_validate_event_action line9991, body sha
83e0cce3b59244440b11acdee6f87dd521859701769b1689ff2775db5c92c5f5,
allows SET_FACILITY_STATE for this non-Defense-owned facility. _apply_event_action
line10040, body sha d79e7aca02eed06f500ffc632c6160cd80d76c3d7c5c90dc097f71b60380d365,
calls set_operational_status with durability=0 and suspension_reason=DESTROYED.
The fixture never registers the busy facility as a Defense asset and expects no
guard. FacilityService.start_next_service line449 (body sha
2eb1cf1226fb1496b6b96c39184ad6a767b4fde747923df599097372435ffa4c) checks the
actual instance capacity and starts secondary work with ordinary active staff.
ServiceInstance.mark_failed line128 stores completed_at for failure timing,
body sha 178c6879e64385f0e3ff99fa98ae6ceb4dc67f6c2c981b0effb229f5d4d647fa.
The independent adapter retains payment/release/sales/phase helpers. It proves
the pre-completion state, single typed receipt/Runtime-ledger/idempotency joins,
surviving identical boundary/held sale, one primary wallet debit, financial day
from ledger absolute_minute, positive pre-event durability and BROKEN/DESTROYED
afterward. Secondary stays active/reserved through N and fails/releases once at
N+1 with unchanged wallet, no remaining request/reservation or generated service.
The checker adds this raw-recomputed sub-gate inside D05-P04-DESTRUCTION.
All previous gates and REQUIRED names/thresholds stay intact. Pure mutations
cover every requested failure, including AFTER-copy; they are serializer units,
not substitutes for fresh native Writer/Reader raw.
The six explicitly named __pycache__/*.repair43.pyc were read, byte sizes,
headers and SHA-256 inspected, then deleted; no source/evidence was deleted.
Execution-scope .gitignore now excludes __pycache__/ and *.pyc. Python checks
use -B and explicit py_compile cfile under allocated build. The static control
rejects any remaining *.pyc in the allowed execution tree.
All existing R40–R43 cases, G1/G2 shadow oracle and negatives, R41 diagnostic,
historical/fresh S4 pin separation, 43+ controls and the Step 0 table below are
preserved. Product source/values/guards, permissions, billing, all seven domains
and 15+EV thresholds are unchanged. Approval raw SHA-256 exactly matches
cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96.
The spec raw is 7000 bytes, sha
d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f;
stripping exactly its one final LF gives the registered
9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881.
This is the existing spec-only EOF protocol; all other hashes compare raw bytes.
REPAIR41_STATIC_CHECKS.json records actual worker checks only. Native Reader,
formal acceptance and patience_release remain pending (the last needs fresh S3).
Root freezes final Q and follows the twelve steps in s5/S5_ROOT_RUN.md.
## REPAIR42/43 implementation submission
REPAIR43 supplies the coherent remaining QA batch for the same original unit.
Native applicability and acceptance are **not established**. Formal 16/88,
original 30/88 and P04 credit 0 are unchanged. r35, r36 and R40 native remain
FAILED; Q37 remains PASS only for its own version. D05 x6 and A01 stay approved.
The product, Clock, API, values, product tests, contract and 15+EV criteria are
unchanged. No Git write, engine, Runner, full regression or agent launch occurred.
R42 superseded the closed journal-field list and the literal QA file freeze.
The R41 mandatory-membership diagnostic and historical/fresh S4 pin separation
remain in place. Their 14 negative and 29 join controls passed again. The
118-entry Step 0 table below is retained unchanged; all 118 raw hashes were
recomputed and matched in this turn. The R42 directions were both read in full.
### Oracle and source bindings
`REPAIR43_SOURCE_FACTS.json` stores full function bodies read with `git show`
at M `c0ea009b28a7649aca6a433a1a24dc0be5e7ab81`, not signatures or excerpts.
The boundary is the declaration through the bytes before the next function,
including intervening blank lines, matching the R41 source-fact convention.
| Function | M line | Full-body SHA-256 |
| --- | --- | --- |
| CommandQueue.restore_snapshot | 220 | 60e76b45be29068cff5ba29d2006642ed447eea6daf832c75757103a0c70cfe3 |
| StableIdGenerator.restore_snapshot | 34 | 3142b592d4a54b4455949a69b775e280a2fe72b6592fc646644ec7c443b8718b |
| DomainEventStream.restore_snapshot | 113 | 934648473a09fd4276187ced78d51d551a4047d884bbe279722d798f1b94ef96 |
| Runtime.submit_command | 473 | 85e8d94bd933c11d1b7b2e88344b7f8839069d1b96930aa4ad4c76c7356a2e68 |
| Runtime._process_commands | 5737 | 6e2b20f73eeaa73882081526f8be566a484f11e1aa9fbfd697df22b4fc034aca |
| Runtime._publish_domain_event | 2389 | 6253ddb30d5470673285aef922a7caaff7611adaa855bb068e1d52e89b0761a1 |
| Runtime._execute_create_service_request | 7413 | 084a741b5590c691aafde9b8cf978674428cb21d4deb930a783a5039106da6fa |
| Runtime._execute_register_defense_asset | 7229 | 4834ecafd948ad0db04ef0230b4ecff733f3008679c903363ae577dd43e95a95 |
The private `_guard_failure` helper captures a deep typed BEFORE with the
public Clock paused. Public submit_command executes these guards immediately;
they are not tick-only commands, so a twin tick is unnecessary. Operations are
disabled and pending/in-flight queues are empty. Detached public restores feed
enqueue -> execute_ready -> complete. The independently constructed failed
result uses each exact M message, an empty target, fixed command payload, and
G1's independently known raid_id details. The M failed-result site publishes
exactly one COMMAND_FAILED through the shadow event stream and ID generator.
It increments Runtime.next_command_id once. Normal accepted/processed/
idempotency, sorting, ID counters, ring-buffer and drained delivery behavior
come from those public objects. No journal fields are masked or discarded.
EXPECTED is serialized before the actual command is submitted. Whole typed
Runtime bytes must then match, including all business domains. Consequently
there can be no new reservation/request, charge, wallet change or orphan.
G2's existing active service/reservation remains unchanged. An expected-failure
callback checks the exact failed result once; every other command still must
succeed. `s5_guard_oracle.py` independently derives the serializer output from
BEFORE and the fixed command for the pure adapter. It accepts no AFTER input.
The adapter binds G1 to the non-terminal raid asset and G2 to an actual active
service in BEFORE. Copied AFTER/EXPECTED corruptions fail the independent
derivation. Synthetic serializer controls exercise 968 typed mutations across
G1/G2; the same traversal is also applied to fresh native guard raw by Root.
### S5D reachability and coverage
A lawful in-flight path exists. Runtime `_validate_event_action` L9991
(`83e0cce3b59244440b11acdee6f87dd521859701769b1689ff2775db5c92c5f5`)
accepts SET_FACILITY_STATE conditions for an existing non-Defense-owned facility;
it does not reject active_services. `_execute_event_action_boundary` L9957
(`c53cf8153418237ebd0c45ba6eb4672a925fd06998c3cff8392657a5e3e019e0`)
validates and dispatches `_apply_event_action` L10040
(`d79e7aca02eed06f500ffc632c6160cd80d76c3d7c5c90dc097f71b60380d365`).
That calls FacilityService.set_operational_status L132
(`10275169f4a71ad490c432443c34068d1951f099e11132b3c18b48647e7845c8`),
which publicly accepts durability 0 and suspension_reason DESTROYED.
FacilityInstance.set_operational_conditions L165
(`8574adb2957c69e76219c8d34838cacc4df4ff660d5ccd649bbb577b6d60feea`)
evaluates the BROKEN state without completing/failing active services there.
EventService.start_next_event L273 and Runtime._advance_relationship_events
L8637 execute automatic actions in INCIDENTS_AND_EVENTS, after completion.
Their full bodies and hashes are in the source-facts file.
`S5D_IN_FLIGHT` schedules public enqueue_event for N, with natural completion
due at N+1. It requires active service at N after destruction, N+1 BROKEN
failure, one reservation release, zero charge, and formal snapshot replay.
FacilityService._prepare_service_for_tick L853
(`b35c2c0fb23a04258b71995dd7c3b6dfacbbcdf36106e2e3348acef0e18d21cc`)
defines that next-tick failure. This is a new S5 observation, not S3 B4 reuse.
`S5D_DESTRUCTION_RAID` retains its name/slots for a separate idle OBJECTIVE.
Public get_due_rounds L114
(`c8b469d4bd304e8325b60c17a63de07146a0040f9a1b5dde7f2aae60104bf34f`)
must report earliest_minute exactly N. Runtime._advance_defense L8599
(`db38b51531276d2620999d57eed7a6219b73f8b8d9ff3706cf569f4797918527`)
performs the automatic breach. The adapter requires G1, G2 and the idle breach
together, plus the independent in-flight case. All destruction_stop derivations
remain charges 0. No unreachable criterion or fabricated native PASS is claimed.
### Other cases and private abstractions
- S5G_SHIFT_1080 retains the six historical first-18:00 observation labels on
the current typed phase points. The receipt captures actual DAY staff before
handover; the adapter joins its shift ending at 1080 and subsequent OFF_DUTY
state. Exactly one snapshot-priced sale/payment ID and no extra 1081
completion/charge are required. M ShiftInstance.create_standard L71 and
StaffService._update_shift_states L1398 are included in source facts.
- S5H_PAUSED_MIDNIGHT depletes mana before the last pre-midnight MANA evaluation,
retaining the S5B RELATED_FACILITY_INACTIVE pattern. It checks elapsed,
reservation IDs and request preservation through DAILY_CLOSE, no paused
sale, one joined upkeep/payroll settlement, and one new-day recovered sale
with CONSUMED reservations. The boundary slot is formally restored/replayed.
- S5E Writer and restored Reader call the public coordinator advance_to at the
paid boundary minute and record is_replay plus entire typed BEFORE/AFTER.
This supplies same_minute_replay only after actual raw equality; rejected
enqueue is not used as that proof.
- The literal CASE_TABLE continues to define wrapper CASES/LABELS/SLOTS. The
shared Writer/Reader formal-slot machinery is reused for all nine cases.
Fresh verification and combination call the adapters again over fresh raw.
paused_midnight leaves the adapter's pending list only when derivation
succeeds; patience_release still requires fresh S3 evidence.
`REPAIR43_PURE_RESULTS.json` contains actual command outputs. UID controls first
failed because this base checkout lacks the M helper. The retry used a temporary
QA-only copy of exact `git show M` helper bytes, independently matching the
supplied raw pins; all 14 helper controls passed. That is pure-helper evidence,
not final-Q/native applicability. No product or tool file was added to the
checkout. `REPAIR41_STATIC_CHECKS.json` records only checks actually executed.
Fresh order positives and mutations requiring future Writer/Reader raw remain
Root-only; no such positive has been claimed here.
## REPAIR43 spec identity precheck
The complete recorded REPAIR42 and RUN42 files were read and their exact raw
SHA-256 values match the supplied pins. The R42 raw-only spec stop is withdrawn.
The existing `tools/check_p04_order_evidence.py::verify` condition accepts the
spec: raw SHA-256 is
`d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f`;
removing its single final LF gives the registered
`9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881`.
This protocol applies only to the spec. All other material pins remain exact
raw comparisons. Root's protocol and six controls are recorded in
`build/owner-handoff/p04-after-p26-closure-r01/q43-spec-pin-protocol/ROOT_SPEC_PIN_EOF_PROTOCOL.json`.
The former closed journal-field restriction below is superseded by R42/R43;
allowed QA files may be extended while preserving existing behavior.
Historical REPAIR41 batch status: **BLOCKED**, partial independent fixes only. No native result,
worker-success claim, new counted unit or completion claim. Formal 16/88,
original 30/88 and P04 credit 0 remain unchanged. r35, r36 and R40 remain FAILED;
Q37 remains a local PASS for its own version only. D05 x6 and A01 remain approved.
## Historical source/immutable-oracle conflict (superseded by R42/R43 above)
The clarified G1/G2 oracle permits only the processed-result and idempotency
entries within `command_queue`. M also necessarily adds an `accepted` row.
`CommandQueue.enqueue` records `{ "command_id": command.command_id,
"idempotency_key": String(command.idempotency_key) }` before execution.
`complete` retains this metadata even for a failed result. `create_snapshot`
serializes it as the separate `accepted` array. Consequently an EXPECTED tree
restricted to the enumerated deltas cannot equal AFTER for either guard.
This is a deterministic source-contract conflict, not a routine refactor or a
product defect. No field has been masked and no product change is proposed.
Required clarification: explicitly include the single source-defined `accepted`
metadata row in delta (ii), with exact typed fields derived from the submitted
command, preserving sorted command IDs and every prior row. The row is fully
computable; the blocker is permission to include this additional serialized
delta under the instruction “only these ... deltas.” It is not a missing-file
or hash failure, nor a claim that the serializer is unknowable. The worker has
not silently broadened that oracle.
`REPAIR41_QUEUE_SOURCE_FACTS.json` preserves the full bodies obtained using
read-only `git show` at M `c0ea009b28a7649aca6a433a1a24dc0be5e7ab81`:
| Source function | M line | Full-body SHA-256 |
| --- | --- | --- |
| command_queue.gd enqueue | 15 | 56a1fe8a5dfd00ad81f9844bc8e6f4a6ce9009dadbc9cd2b7ff07d14bff1938c |
| command_queue.gd execute_ready | 83 | d8c534217e704cd892401904768a883c9a3ec2f3852ae7c0438f2eb854b4f7aa |
| command_queue.gd complete | 112 | 4290ebfe68d9245b4e8ebb6d8a09ba6172f16bcacb6e4294299ad6dc06c56ed7 |
| command_queue.gd get_accepted_command_metadata | 174 | 60841dbff80282e95460e8dfeaeb6ae37a0cc05f2c7654130e8b8c51729e5b39 |
| command_queue.gd create_snapshot | 189 | 15737e59018ae93092c1aca3ce268d2bc354c28a8261d4ffada4aba63af3d241 |
| stable_id_generator.gd next_id | 9 | cf1cf036adab2eb36acab25a069b5dfc42e7aa281c491bd89ade6d91f6eb2c1d |
| stable_id_generator.gd create_snapshot | 23 | cab243cf59d5d56ff03beb305070f83b66d7a55cce7f3f2f889c0d9a5303e76a |
| domain_event_stream.gd publish_batch | 40 | 275be0d68c99217732ea3dc2821cf7dcec24a695035e455af7f716d901147167 |
| domain_event_stream.gd create_snapshot | 96 | 94fc2dd3ef1a953ba7d9b3d3728c0d158bf0f69935874f48722a3c6025447dbf |
## Independent repairs implemented
- Mandatory membership is checked before applicability can dereference a missing
condition; the diagnostic names `paused_midnight`. REQUIRED is unchanged.
- Historical S4 receipt verification reads only
`s4/historical/run_s4_native_r28.py.reference`. Provenance:
`befa0ef1f634e734ee156347e8fd02e82eddea49:docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py`.
The unchanged copy hashes to
`2d3be39d2b310abac058e27336ac816c234043a0a1dd7b2c52d84994907dd31b`.
Fresh S4 verification binds the current wrapper and rejects the historical pin.
- Private helpers centralize mandatory membership and choose historical/current
wrapper verification explicitly. They preserve the required membership and all
existing join negatives; four additional version/pin negatives were added.
- Negative fixtures (14) and join fixtures (29) passed. These are pure controls,
not current native evidence. Full results: `REPAIR41_PURE_RESULTS.json`.
Touched Python AST/py_compile and the unchanged GDScript probe regex check passed.
## Historical REPAIR41 unimplemented work / source search status
S5D re-scope, G1/G2, automatic breach revisions, S5G, S5H, same-minute replay,
adapter derivations/mutations and fresh-condition wiring remain unimplemented.
The initial M runtime search found `EventAction.Type.SET_FACILITY_STATE` handling
in `_validate_event_action` around line 10012; this is a candidate requiring
public/natural triggering and phase-alignment analysis. No conclusion that an
in-flight destruction path exists or is absent is claimed. G1/G2 coverage cannot
be claimed before the exact permitted journal envelope is resolved and checked.
No adapter positive raw or future final-Q helper was invented. The full worker
check set has not passed. No engine, Runner, Git mutation or agent launch occurred.
## Step 0
Step 0 precheck: PASS.
q40/q41 INDEX digests are observed baselines; no independent expected digest was supplied for those indexes. Child expected digests come from their indexes.
| Absolute path | Expected SHA-256 | Observed SHA-256 |
| --- | --- | --- |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_ABSOLUTE_CONTEXT_INDEX.json | 6f0ee990b95a5a897511425cd86ae57ba0364c5b326afdeb9f556fabfea6915c | 6f0ee990b95a5a897511425cd86ae57ba0364c5b326afdeb9f556fabfea6915c |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_NEXT_P04_PLAN.json | 217d9bf4ef593fb95a5e726fee0e4497863a0b06663d27ba20e742d81bb9c049 | 217d9bf4ef593fb95a5e726fee0e4497863a0b06663d27ba20e742d81bb9c049 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR30_DIRECT_CHECKER_PLAN.json | 77801cc6db2a4deb9f76118a746b32eb5e629b2d6980850b8813a12b45016806 | 77801cc6db2a4deb9f76118a746b32eb5e629b2d6980850b8813a12b45016806 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR30_RUN_DECISION.json | be7be3bfaa5a5ab412db8aecd1d951c213894e485b7869fcc12ab1c75b037c7f | be7be3bfaa5a5ab412db8aecd1d951c213894e485b7869fcc12ab1c75b037c7f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR31_CONCRETE_PLAN.json | 857e1acaed2093de56afdd851e69b3129bf9edce72b5da3cdd160ce4b7bfc18a | 857e1acaed2093de56afdd851e69b3129bf9edce72b5da3cdd160ce4b7bfc18a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR32_CONCRETE_PLAN.json | 5b69f850f835bd7af37e9c728c484c236c28efb0bd32113bb53bcbaf7d252c0a | 5b69f850f835bd7af37e9c728c484c236c28efb0bd32113bb53bcbaf7d252c0a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/CURRENT_ROOT_P04_RESUME_FACTS.json | c826726368844a823c54c1df1cdaff43fde5a94a17e638bfc60d8fb2559f8d85 | c826726368844a823c54c1df1cdaff43fde5a94a17e638bfc60d8fb2559f8d85 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/D05_ACTUAL_HUMAN_APPROVAL.json | cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96 | cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_FRESH_Q_INPUT_APPROACH_AFTER34.json | 7a7b91cbf04bb84cdef8e7a99ca2140a9eac2ac6a385570b4f0aa0d474e7da92 | 7a7b91cbf04bb84cdef8e7a99ca2140a9eac2ac6a385570b4f0aa0d474e7da92 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_P04_PRESERVED_TO_CURRENT_SOURCE_AUDIT.json | 6bb86959b06acb62d5cd3c5fd00bb6802a80b66184e69abca3f75c46ddeb7a12 | 6bb86959b06acb62d5cd3c5fd00bb6802a80b66184e69abca3f75c46ddeb7a12 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_PLAN_VERSION_NOTES.json | b4336f900a87f9bf0daa1e86728c3a913aed7c09425569e104cc01290be1c62f | b4336f900a87f9bf0daa1e86728c3a913aed7c09425569e104cc01290be1c62f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/INDEX.json | b2ad602b7bd22dbc4778b60b4a015b1d2f8f06b71278959fb52910f2ee1af57a | b2ad602b7bd22dbc4778b60b4a015b1d2f8f06b71278959fb52910f2ee1af57a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_CHECK_ONLY.json | aab7dcbfcc934f3bda7d937feb4e7638109ddf645da6ebd57f6190588b55287c | aab7dcbfcc934f3bda7d937feb4e7638109ddf645da6ebd57f6190588b55287c |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_GIT.json | e63b1b27244cd042f522a63b4392dea8c7211ce5ca5a927e91856115dfaa9f56 | e63b1b27244cd042f522a63b4392dea8c7211ce5ca5a927e91856115dfaa9f56 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_dirty.log | 3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53 | 3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_untracked.log | 3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53 | 3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_wrong-main.log | 006b9e83c3e106bada560371dda1fb9b4326e3f31fa48fa0c46e7d4903a91e55 | 006b9e83c3e106bada560371dda1fb9b4326e3f31fa48fa0c46e7d4903a91e55 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_wrong-submission.log | 6fefa0256b2dbc1596043fbff65fbaf87279baaa770a04d65a5fe70a6476671d | 6fefa0256b2dbc1596043fbff65fbaf87279baaa770a04d65a5fe70a6476671d |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_wrong-tree.log | 7fb7a1e4f00f201b7008b6d72957b3d4db450be156a1174b26a22c36d48b5e8f | 7fb7a1e4f00f201b7008b6d72957b3d4db450be156a1174b26a22c36d48b5e8f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_RESOURCE_ADMISSION.json | 18ef80f33f36cdd6ab664c862a9ae651a649a532bd32c4c35a81640cb4f078a0 | 18ef80f33f36cdd6ab664c862a9ae651a649a532bd32c4c35a81640cb4f078a0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_STAGE.json | f143045846cf06d79b81a0e52035300251fa576cde9a2d5eeda97d6610fd8591 | f143045846cf06d79b81a0e52035300251fa576cde9a2d5eeda97d6610fd8591 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_check-only.log | 4418f4b6bbe3d88cbf7f0b988084e05b5f0f52c15fe0f466ba82e584408427ce | 4418f4b6bbe3d88cbf7f0b988084e05b5f0f52c15fe0f466ba82e584408427ce |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_pure.log | f77640e0629497389baefc6424cf164d164fb96bbbd48cee6c4d83ed96c253c1 | f77640e0629497389baefc6424cf164d164fb96bbbd48cee6c4d83ed96c253c1 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_REPAIR30_EXECUTION_ORDER_FACTS.json | e18b031e790622929ec2c80ab9a6d5c3d883a364d625b58372fe33fd280ca93f | e18b031e790622929ec2c80ab9a6d5c3d883a364d625b58372fe33fd280ca93f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_REPAIR31_ACTUAL_FACTS.json | 0ea352b442e88263b899d28d58422afed39855393233c35ed3a962fcab67e136 | 0ea352b442e88263b899d28d58422afed39855393233c35ed3a962fcab67e136 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/INDEX.json | ff43786d898ef3475c267cf22758074a001b3d46dbc2bea52782a3782dd5571e | ff43786d898ef3475c267cf22758074a001b3d46dbc2bea52782a3782dd5571e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/autoload/simulation_runtime.gd | 45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0 | 45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scenes/main/main.gd | 92677e4ac57ed8d418a4a716bf0874cbbaea79cff893e5163c82ad1f75e7140a | 92677e4ac57ed8d418a4a716bf0874cbbaea79cff893e5163c82ad1f75e7140a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scenes/main/world_preview.gd | 4bc49a19a38b9c3b4d6bfc243ddf46f1f25469a8273adb5e812911ef9424a1f2 | 4bc49a19a38b9c3b4d6bfc243ddf46f1f25469a8273adb5e812911ef9424a1f2 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/core/save_service.gd | f4c270632225dd046bbff92f9472761d64d63740e93f274828c92dcf912db6a9 | f4c270632225dd046bbff92f9472761d64d63740e93f274828c92dcf912db6a9 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/relationship/relationship_service.gd | d2f6304aa643b98914c5d65bf3eb673ca8cc427476187f43e76b4b941410b1d3 | d2f6304aa643b98914c5d65bf3eb673ca8cc427476187f43e76b4b941410b1d3 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/ui/guest_observation_panel.gd | f5de1004fce5445bbfd3ee8d6ec37b325e7a9813d47c19beaeeeb411f27a50a5 | f5de1004fce5445bbfd3ee8d6ec37b325e7a9813d47c19beaeeeb411f27a50a5 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/ui/room_presentation.gd | 2eda851534777575298ea005e2e6d0ee90785a81357d5b9c34cfb95f615a8181 | 2eda851534777575298ea005e2e6d0ee90785a81357d5b9c34cfb95f615a8181 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/tests/business/test_required_kitchen.gd | 3a9c92f80c24064ef0858fba10bd7caab63203932942837f7e142349578f6b2f | 3a9c92f80c24064ef0858fba10bd7caab63203932942837f7e142349578f6b2f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/tools/regression/suite-policy.json | 7eb085d7e7a383785b4faedb503d0f6002bcad431e3188785aef901ce123769f | 7eb085d7e7a383785b4faedb503d0f6002bcad431e3188785aef901ce123769f |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/INDEX.json | a7a3299c4d70ea033368a707882856fd5c7f7f4d5a0d5f86bf2fb9b2fe2e53d1 | a7a3299c4d70ea033368a707882856fd5c7f7f4d5a0d5f86bf2fb9b2fe2e53d1 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/controller-input.json | 24d10b3a91553df54b3b2fd4b1a57dce683cc72a55576e0c73c9e142b335ad40 | 24d10b3a91553df54b3b2fd4b1a57dce683cc72a55576e0c73c9e142b335ad40 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/controller.py | 9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b | 9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/003-receipt.json | 4ce015c160859612c89e215517826aa1da3582534d27c4688af6a44e37f1b641 | 4ce015c160859612c89e215517826aa1da3582534d27c4688af6a44e37f1b641 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/parse-receipt.json | 1ad82022669a3f197f53ed1e23f23aadc927220f0ba1f857c41f80721bafa443 | 1ad82022669a3f197f53ed1e23f23aadc927220f0ba1f857c41f80721bafa443 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/runner-ended.json | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/runner-input.json | 2a76506e923a3a95288ce826b81ed9eab49d4ecee613a2c82ae35e970c68f961 | 2a76506e923a3a95288ce826b81ed9eab49d4ecee613a2c82ae35e970c68f961 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/INDEX.json | 942181cc3efc8207e728233f89626b66eb0c34b582e5c9b0fae294dcf1600c00 | 942181cc3efc8207e728233f89626b66eb0c34b582e5c9b0fae294dcf1600c00 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/ROOT_EXACT_NORMAL_CANDIDATE_72A50A4A.json | 5614c9b1c9eb222dbbcfd9ae1c3b438cc4129c779deba2841d660a8c96b6cfe6 | 5614c9b1c9eb222dbbcfd9ae1c3b438cc4129c779deba2841d660a8c96b6cfe6 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/ROOT_NORMAL_FINAL_72A50A4A.json | b41069126e029c30ab644a62a54cb45ca2e0e504add150020500acba4e249469 | b41069126e029c30ab644a62a54cb45ca2e0e504add150020500acba4e249469 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/ROOT_NORMAL_INTEGRATION_72A50A4A.json | 2f47d39d3f05b3735f0fb3e01adaabf1c66c6a784d60af247063bd90e5ec0d5c | 2f47d39d3f05b3735f0fb3e01adaabf1c66c6a784d60af247063bd90e5ec0d5c |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/INDEX.json | a23f17336a5e701100c224ebcb69f37a8de95aca82658675b692d503798a5232 | a23f17336a5e701100c224ebcb69f37a8de95aca82658675b692d503798a5232 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/OWNER_CLI_REFERENCE.json | 1e360ad1d8057ef649fabe97ac3e98263d2f8c1c4d976d8b6e0a907a49e9158e | 1e360ad1d8057ef649fabe97ac3e98263d2f8c1c4d976d8b6e0a907a49e9158e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/ROOT_SOURCE_REVIEW_REJECTION_20D0AE5.json | d028dd3862ae663586d49b5843e88d9da82ad7985fa082551438e4a81311073e | d028dd3862ae663586d49b5843e88d9da82ad7985fa082551438e4a81311073e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/SOURCE_REWORK_ADAPTER_LOCAL_CHECKS.json | 580f2f19d680a23ee4efe6beab68a1aad69e067bc551f623cc7531c6915d7a78 | 580f2f19d680a23ee4efe6beab68a1aad69e067bc551f623cc7531c6915d7a78 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/SOURCE_REWORK_CURRENT_REFERENCE_INDEX.json | b0ecce7ae523527fdc6272e9784eba6109d67c0cd3745a8aaab64d913ca8adbd | b0ecce7ae523527fdc6272e9784eba6109d67c0cd3745a8aaab64d913ca8adbd |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/core.py.reference | 4c6067bbd57034764873a468ff161a6882d232503043d5640fc83dea0b455856 | 4c6067bbd57034764873a468ff161a6882d232503043d5640fc83dea0b455856 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/current-owner-cli.py.reference | 0cfd9634e4a59755b89d2927d60b6092368529f2ca7188d949da7f88080359aa | 0cfd9634e4a59755b89d2927d60b6092368529f2ca7188d949da7f88080359aa |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/owner-cli.py.reference | 52c327e624334b51612ea3cb1653aeff4a7a192502d1ba9407ce874af1d92410 | 52c327e624334b51612ea3cb1653aeff4a7a192502d1ba9407ce874af1d92410 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/owner-source-rework-20d0ae5.py.reference | 9ecf7bebf666a67a8f13357d66e9c1d8d76940ef8212f0055537b728c75e0cbc | 9ecf7bebf666a67a8f13357d66e9c1d8d76940ef8212f0055537b728c75e0cbc |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/FAILED_EXECUTION.json | 6e48da89ce852dacdbff2d0f93a8903583dccd9e05f5e34bb68be0d63f540332 | 6e48da89ce852dacdbff2d0f93a8903583dccd9e05f5e34bb68be0d63f540332 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/FAILED_IMPORT_COMBINED.log | cd39b1711f530454b0ec263ab2d076d714f674d5a36e26f9ef16788799b76764 | cd39b1711f530454b0ec263ab2d076d714f674d5a36e26f9ef16788799b76764 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/FAILED_OUTER_OWNED_FINALLY.json | ee14a347724aedb2ae8afecc0775250b1e014c17e726210e2535d6108e57edc0 | ee14a347724aedb2ae8afecc0775250b1e014c17e726210e2535d6108e57edc0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/INDEX.json | 0e4334442ce89b0388e10a4b62b5e00acbce2013e3ef1967508a3c48d72dc9c1 | 0e4334442ce89b0388e10a4b62b5e00acbce2013e3ef1967508a3c48d72dc9c1 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/P13_CONTROLLER_REFERENCE_INDEX.json | 48434362232d6b58cca720868c6d87f2af48675f365855b8a4a97eb5071dfee3 | 48434362232d6b58cca720868c6d87f2af48675f365855b8a4a97eb5071dfee3 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/P13_FULL_CONTROLLER_PATTERN.py.reference | 9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b | 9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/ROOT_Q35_DIAGNOSTIC_IMPORT_SOURCE_DELTA.json | 1994e59a498f3dbca1fd589b16b5bc6305d2786c0fa730ac489590469f08b05d | 1994e59a498f3dbca1fd589b16b5bc6305d2786c0fa730ac489590469f08b05d |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/ROOT_Q35_FAILED_IMPORT_UID_CLASSIFICATION.json | bc0a863e52db4f98b4b2ee4bc0b513c73f841726789a2ca99521c1b8618dc6c3 | bc0a863e52db4f98b4b2ee4bc0b513c73f841726789a2ca99521c1b8618dc6c3 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_all_tests.py.reference | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_p13_reference_tests.py.reference | 9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c | 9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/INDEX.json | cef78b200268e27a6e73ccd926ac95d0b2b6e30b9338a8412da9ab48b68ca82a | cef78b200268e27a6e73ccd926ac95d0b2b6e30b9338a8412da9ab48b68ca82a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/SAFETY_REAUDIT.json | 8edf11fe7893ced7c6450feb1ee3db45ab0a145db572254d2102ee70e26ac26e | 8edf11fe7893ced7c6450feb1ee3db45ab0a145db572254d2102ee70e26ac26e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/TYPED_AUDIT.json | e1800e1679b570ecdd9d7537e87e0730c089fa3b4c6197d3e279e60959aad016 | e1800e1679b570ecdd9d7537e87e0730c089fa3b4c6197d3e279e60959aad016 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/command_queue.gd.reference | 09b22e6212fa3ce1bf08f5d6b52224a2d3362b3bc63f03a8c98e89af1c6f5895 | 09b22e6212fa3ce1bf08f5d6b52224a2d3362b3bc63f03a8c98e89af1c6f5895 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/facility_instance.gd.reference | 0c6aa493f3299611e05dd26aa429dda8cf7b5c479e4d09632036fb862f79a324 | 0c6aa493f3299611e05dd26aa429dda8cf7b5c479e4d09632036fb862f79a324 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-before.json | af7b1f0099b37298b1bf0d683f98c0ec84fae96b74f16c33af310cab2efa955b | af7b1f0099b37298b1bf0d683f98c0ec84fae96b74f16c33af310cab2efa955b |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-before.var | 61f749b6a10ddc8e70f6e5b1d6378fcf1c0ae5127161a10c9704d76bcf64813a | 61f749b6a10ddc8e70f6e5b1d6378fcf1c0ae5127161a10c9704d76bcf64813a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-resource-replay.json | 56a7fc36e0972eb64abb19189f1664b87d6a058511bbec0ef7e1497abd2c511e | 56a7fc36e0972eb64abb19189f1664b87d6a058511bbec0ef7e1497abd2c511e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-resource-replay.var | 92aa8694939e2b8b678b556227cce1cf4cda661b6fb1f5a478ac37deba1a072e | 92aa8694939e2b8b678b556227cce1cf4cda661b6fb1f5a478ac37deba1a072e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-before.json | 0f821748eb7f12a8ac196c61bca34a7fe55af6adb3ab43d1acf8748fd2be8652 | 0f821748eb7f12a8ac196c61bca34a7fe55af6adb3ab43d1acf8748fd2be8652 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-before.var | 06b03c6a50a8832a9cab621b908332199e9ab4d10d4e547111a8860c70535bd2 | 06b03c6a50a8832a9cab621b908332199e9ab4d10d4e547111a8860c70535bd2 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-resource-replay.json | 49fb4df6bdaadd9c5146f716a108902c533b137427e2f90f86116393f12c6ea0 | 49fb4df6bdaadd9c5146f716a108902c533b137427e2f90f86116393f12c6ea0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-resource-replay.var | 464b589fa206427a1becd6dd484fc9be05da1b619ffb26ca559dde83e7b09309 | 464b589fa206427a1becd6dd484fc9be05da1b619ffb26ca559dde83e7b09309 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/INDEX.json | a8f44235dc8a74e67c3463698619611131224de5048868259a729791614cf9a9 | a8f44235dc8a74e67c3463698619611131224de5048868259a729791614cf9a9 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q36_REJECTED_ENQUEUE_STATIC_PATH.json | e8adc79d506491973289084c5ade7c3affe9e3e517896ef191f01cad6dcaed92 | e8adc79d506491973289084c5ade7c3affe9e3e517896ef191f01cad6dcaed92 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q37_DIAGNOSTIC_SAFETY_REAUDIT.json | 4d4b059576b3b6d28f71d054eeaf367ead54a74bb499d64bf450d625a137cfa5 | 4d4b059576b3b6d28f71d054eeaf367ead54a74bb499d64bf450d625a137cfa5 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q37_POWER_ADAPTER_RESULT.json | cce1132503457675b50d566ad1afc3f67e902a28135550a8e72b647dacd7d70d | cce1132503457675b50d566ad1afc3f67e902a28135550a8e72b647dacd7d70d |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q37_PREFLIGHT.json | 3554d8f246c0d117c774ecfabcd9eb48eed311155e3a5a3b15413f3e663b6fd7 | 3554d8f246c0d117c774ecfabcd9eb48eed311155e3a5a3b15413f3e663b6fd7 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_R37_ADAPTER_CONTROLS.json | f62fc981f3935bd969ea5c6fafa5d44a111b1264ad0d04fdb08b07fe4f27429e | f62fc981f3935bd969ea5c6fafa5d44a111b1264ad0d04fdb08b07fe4f27429e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/ROOT_MANA_ADOPTION_CURRENT_APPLICABILITY_C0.json | 57ba42e1c92db194a5ddcb8dc80c8e0249bbab817e35a3ae00bd12b0f4c57731 | 57ba42e1c92db194a5ddcb8dc80c8e0249bbab817e35a3ae00bd12b0f4c57731 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/ROOT_Q37_FULL_ROSTER_PREPARE_ONLY.json | c547dcff95184d04bf7089e7c9f6a2cda800a91359c9ec318f48ad4ecf2887c0 | c547dcff95184d04bf7089e7c9f6a2cda800a91359c9ec318f48ad4ecf2887c0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/SOURCE_MAP.json | d1333fc891342be5cc16795973fa71e7910a8c8af06ef4a3e51662537fed63c3 | d1333fc891342be5cc16795973fa71e7910a8c8af06ef4a3e51662537fed63c3 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/core/simulation_kernel.gd | 341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb | 341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/economy/economy_service.gd | 95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e | 95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/facility/facility_service.gd | ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77 | ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/guest/guest_service.gd | 56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e | 56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/operations/operations_coordinator.gd | 871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90 | 871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_autonomy.gd | 28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403 | 28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_cycle.gd | a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357 | a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tools/run_all_tests.py | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/core/simulation_kernel.gd | 341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb | 341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/autoload/simulation_runtime.gd | 45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0 | 45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/facility/facility_service.gd | ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77 | ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/economy/economy_service.gd | 95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e | 95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/operations/operations_coordinator.gd | 871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90 | 871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/guest/guest_service.gd | 56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e | 56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_autonomy.gd | 28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403 | 28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_all_tests.py.reference | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 | 320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_cycle.gd | a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357 | a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_p13_reference_tests.py.reference | 9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c | 9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/INDEX.json | 1e72f10784d639ff509e8175f73c46e8e2479dda8263365f51dd9f67c753709e | 1e72f10784d639ff509e8175f73c46e8e2479dda8263365f51dd9f67c753709e |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/ROOT_Q40_NATIVE_FAILURE_AUDIT.json | 622edabc16a3e9ef6528b4009d44d8307f998bf9aa0c441b4b223bf5a40efeb5 | 622edabc16a3e9ef6528b4009d44d8307f998bf9aa0c441b4b223bf5a40efeb5 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/ROOT_R40_CURRENT_SOURCE_GAPS.json | 306195acb5661f9c4c087428ba16f0a46fe54cf1f8b2dea9933c035b90ad7511 | 306195acb5661f9c4c087428ba16f0a46fe54cf1f8b2dea9933c035b90ad7511 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/ROOT_R40_AFFECTED_PURE_CONTROLS.json | 736860fe730d7b7fa744783f74a0de875afe8ba3ff65e74598bd4c07e29d955a | 736860fe730d7b7fa744783f74a0de875afe8ba3ff65e74598bd4c07e29d955a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/ROOT_R40_ALL_CHECK_ONLY.json | ffec08fd3ed45d346ae27de4c502fbc7768fc51ccadce433ca30805faf127a68 | ffec08fd3ed45d346ae27de4c502fbc7768fc51ccadce433ca30805faf127a68 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/writer-stderr.log | 75ddd2af006162c702751853f9f3931086bded7544a8addd0d65383c47a59a67 | 75ddd2af006162c702751853f9f3931086bded7544a8addd0d65383c47a59a67 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/writer-stdout.log | eebf10b3f84916338ab651af117852cbe852bef28f79032472fdb01342ac0608 | eebf10b3f84916338ab651af117852cbe852bef28f79032472fdb01342ac0608 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/writer.json | ceb971f39afe131fbeccb0fbe06be37ada0d31ef3ee86f216701a1618abe444a | ceb971f39afe131fbeccb0fbe06be37ada0d31ef3ee86f216701a1618abe444a |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/writer-S5D_DESTRUCTION_RAID-commands.json | 19be61a849204ce72731d586f9685ad129231a55fca57a006ddbc723d52d9879 | 19be61a849204ce72731d586f9685ad129231a55fca57a006ddbc723d52d9879 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/execution.json | 7c00af3acee008927faf7f1b99b6a7407671674668674f30acc3504ea6ee21d9 | 7c00af3acee008927faf7f1b99b6a7407671674668674f30acc3504ea6ee21d9 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q41-oracle-source-facts/INDEX.json | 903601cfec6be397f99c30aeba9301f2312c1f659a73f30d5d8a04e1f07ef468 | 903601cfec6be397f99c30aeba9301f2312c1f659a73f30d5d8a04e1f07ef468 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q41-oracle-source-facts/ACTUAL_FAILED_COMMAND_JOURNAL_SOURCE.json | 27d39ab2b01e1e73d4bd38e335a87fe26ddbea3e748fc9c95d82c886dfd14187 | 27d39ab2b01e1e73d4bd38e335a87fe26ddbea3e748fc9c95d82c886dfd14187 |
| /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q41-oracle-source-facts/HISTORICAL_S4_WRAPPER_R28.py.reference | 2d3be39d2b310abac058e27336ac816c234043a0a1dd7b2c52d84994907dd31b | 2d3be39d2b310abac058e27336ac816c234043a0a1dd7b2c52d84994907dd31b |
@@ -0,0 +1,631 @@
{
"spec": {
"raw_sha256": "d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f",
"one_LF_stripped_sha256": "9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881",
"accepted": true,
"controls": [
{
"case": "canonical_without_LF",
"accepted": true,
"expected": true
},
{
"case": "tracked_single_LF",
"accepted": true,
"expected": true
},
{
"case": "double_final_LF",
"accepted": false,
"expected": false
},
{
"case": "CRLF_final",
"accepted": false,
"expected": false
},
{
"case": "BOM",
"accepted": false,
"expected": false
},
{
"case": "interior_mutation",
"accepted": false,
"expected": false
}
]
},
"step0": [
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_ABSOLUTE_CONTEXT_INDEX.json",
"expected": "6f0ee990b95a5a897511425cd86ae57ba0364c5b326afdeb9f556fabfea6915c",
"observed": "6f0ee990b95a5a897511425cd86ae57ba0364c5b326afdeb9f556fabfea6915c"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_NEXT_P04_PLAN.json",
"expected": "217d9bf4ef593fb95a5e726fee0e4497863a0b06663d27ba20e742d81bb9c049",
"observed": "217d9bf4ef593fb95a5e726fee0e4497863a0b06663d27ba20e742d81bb9c049"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR30_DIRECT_CHECKER_PLAN.json",
"expected": "77801cc6db2a4deb9f76118a746b32eb5e629b2d6980850b8813a12b45016806",
"observed": "77801cc6db2a4deb9f76118a746b32eb5e629b2d6980850b8813a12b45016806"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR30_RUN_DECISION.json",
"expected": "be7be3bfaa5a5ab412db8aecd1d951c213894e485b7869fcc12ab1c75b037c7f",
"observed": "be7be3bfaa5a5ab412db8aecd1d951c213894e485b7869fcc12ab1c75b037c7f"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR31_CONCRETE_PLAN.json",
"expected": "857e1acaed2093de56afdd851e69b3129bf9edce72b5da3cdd160ce4b7bfc18a",
"observed": "857e1acaed2093de56afdd851e69b3129bf9edce72b5da3cdd160ce4b7bfc18a"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ACTUAL_OPUS_REPAIR32_CONCRETE_PLAN.json",
"expected": "5b69f850f835bd7af37e9c728c484c236c28efb0bd32113bb53bcbaf7d252c0a",
"observed": "5b69f850f835bd7af37e9c728c484c236c28efb0bd32113bb53bcbaf7d252c0a"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/CURRENT_ROOT_P04_RESUME_FACTS.json",
"expected": "c826726368844a823c54c1df1cdaff43fde5a94a17e638bfc60d8fb2559f8d85",
"observed": "c826726368844a823c54c1df1cdaff43fde5a94a17e638bfc60d8fb2559f8d85"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/D05_ACTUAL_HUMAN_APPROVAL.json",
"expected": "cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96",
"observed": "cd365ded1b777a0327d090709f0a4161f5005562819183455d9f2e106fba3e96"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_FRESH_Q_INPUT_APPROACH_AFTER34.json",
"expected": "7a7b91cbf04bb84cdef8e7a99ca2140a9eac2ac6a385570b4f0aa0d474e7da92",
"observed": "7a7b91cbf04bb84cdef8e7a99ca2140a9eac2ac6a385570b4f0aa0d474e7da92"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_P04_PRESERVED_TO_CURRENT_SOURCE_AUDIT.json",
"expected": "6bb86959b06acb62d5cd3c5fd00bb6802a80b66184e69abca3f75c46ddeb7a12",
"observed": "6bb86959b06acb62d5cd3c5fd00bb6802a80b66184e69abca3f75c46ddeb7a12"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_PLAN_VERSION_NOTES.json",
"expected": "b4336f900a87f9bf0daa1e86728c3a913aed7c09425569e104cc01290be1c62f",
"observed": "b4336f900a87f9bf0daa1e86728c3a913aed7c09425569e104cc01290be1c62f"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/INDEX.json",
"expected": "b2ad602b7bd22dbc4778b60b4a015b1d2f8f06b71278959fb52910f2ee1af57a",
"observed": "b2ad602b7bd22dbc4778b60b4a015b1d2f8f06b71278959fb52910f2ee1af57a"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_CHECK_ONLY.json",
"expected": "aab7dcbfcc934f3bda7d937feb4e7638109ddf645da6ebd57f6190588b55287c",
"observed": "aab7dcbfcc934f3bda7d937feb4e7638109ddf645da6ebd57f6190588b55287c"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_GIT.json",
"expected": "e63b1b27244cd042f522a63b4392dea8c7211ce5ca5a927e91856115dfaa9f56",
"observed": "e63b1b27244cd042f522a63b4392dea8c7211ce5ca5a927e91856115dfaa9f56"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_dirty.log",
"expected": "3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53",
"observed": "3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_untracked.log",
"expected": "3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53",
"observed": "3ad8ef5d71175bc265f93395fe64a39b05ab65252ad509abc108de15a2b9ab53"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_wrong-main.log",
"expected": "006b9e83c3e106bada560371dda1fb9b4326e3f31fa48fa0c46e7d4903a91e55",
"observed": "006b9e83c3e106bada560371dda1fb9b4326e3f31fa48fa0c46e7d4903a91e55"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_wrong-submission.log",
"expected": "6fefa0256b2dbc1596043fbff65fbaf87279baaa770a04d65a5fe70a6476671d",
"observed": "6fefa0256b2dbc1596043fbff65fbaf87279baaa770a04d65a5fe70a6476671d"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_NEGATIVE_wrong-tree.log",
"expected": "7fb7a1e4f00f201b7008b6d72957b3d4db450be156a1174b26a22c36d48b5e8f",
"observed": "7fb7a1e4f00f201b7008b6d72957b3d4db450be156a1174b26a22c36d48b5e8f"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_RESOURCE_ADMISSION.json",
"expected": "18ef80f33f36cdd6ab664c862a9ae651a649a532bd32c4c35a81640cb4f078a0",
"observed": "18ef80f33f36cdd6ab664c862a9ae651a649a532bd32c4c35a81640cb4f078a0"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_STAGE.json",
"expected": "f143045846cf06d79b81a0e52035300251fa576cde9a2d5eeda97d6610fd8591",
"observed": "f143045846cf06d79b81a0e52035300251fa576cde9a2d5eeda97d6610fd8591"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_check-only.log",
"expected": "4418f4b6bbe3d88cbf7f0b988084e05b5f0f52c15fe0f466ba82e584408427ce",
"observed": "4418f4b6bbe3d88cbf7f0b988084e05b5f0f52c15fe0f466ba82e584408427ce"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_Q35_LOCAL_DIAGNOSTIC_INPUTS/ROOT_Q35_pure.log",
"expected": "f77640e0629497389baefc6424cf164d164fb96bbbd48cee6c4d83ed96c253c1",
"observed": "f77640e0629497389baefc6424cf164d164fb96bbbd48cee6c4d83ed96c253c1"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_REPAIR30_EXECUTION_ORDER_FACTS.json",
"expected": "e18b031e790622929ec2c80ab9a6d5c3d883a364d625b58372fe33fd280ca93f",
"observed": "e18b031e790622929ec2c80ab9a6d5c3d883a364d625b58372fe33fd280ca93f"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/ROOT_REPAIR31_ACTUAL_FACTS.json",
"expected": "0ea352b442e88263b899d28d58422afed39855393233c35ed3a962fcab67e136",
"observed": "0ea352b442e88263b899d28d58422afed39855393233c35ed3a962fcab67e136"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/INDEX.json",
"expected": "ff43786d898ef3475c267cf22758074a001b3d46dbc2bea52782a3782dd5571e",
"observed": "ff43786d898ef3475c267cf22758074a001b3d46dbc2bea52782a3782dd5571e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/autoload/simulation_runtime.gd",
"expected": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"observed": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scenes/main/main.gd",
"expected": "92677e4ac57ed8d418a4a716bf0874cbbaea79cff893e5163c82ad1f75e7140a",
"observed": "92677e4ac57ed8d418a4a716bf0874cbbaea79cff893e5163c82ad1f75e7140a"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scenes/main/world_preview.gd",
"expected": "4bc49a19a38b9c3b4d6bfc243ddf46f1f25469a8273adb5e812911ef9424a1f2",
"observed": "4bc49a19a38b9c3b4d6bfc243ddf46f1f25469a8273adb5e812911ef9424a1f2"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/core/save_service.gd",
"expected": "f4c270632225dd046bbff92f9472761d64d63740e93f274828c92dcf912db6a9",
"observed": "f4c270632225dd046bbff92f9472761d64d63740e93f274828c92dcf912db6a9"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/relationship/relationship_service.gd",
"expected": "d2f6304aa643b98914c5d65bf3eb673ca8cc427476187f43e76b4b941410b1d3",
"observed": "d2f6304aa643b98914c5d65bf3eb673ca8cc427476187f43e76b4b941410b1d3"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/ui/guest_observation_panel.gd",
"expected": "f5de1004fce5445bbfd3ee8d6ec37b325e7a9813d47c19beaeeeb411f27a50a5",
"observed": "f5de1004fce5445bbfd3ee8d6ec37b325e7a9813d47c19beaeeeb411f27a50a5"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/scripts/ui/room_presentation.gd",
"expected": "2eda851534777575298ea005e2e6d0ee90785a81357d5b9c34cfb95f615a8181",
"observed": "2eda851534777575298ea005e2e6d0ee90785a81357d5b9c34cfb95f615a8181"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/tests/business/test_required_kitchen.gd",
"expected": "3a9c92f80c24064ef0858fba10bd7caab63203932942837f7e142349578f6b2f",
"observed": "3a9c92f80c24064ef0858fba10bd7caab63203932942837f7e142349578f6b2f"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/tools/regression/suite-policy.json",
"expected": "7eb085d7e7a383785b4faedb503d0f6002bcad431e3188785aef901ce123769f",
"observed": "7eb085d7e7a383785b4faedb503d0f6002bcad431e3188785aef901ce123769f"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/INDEX.json",
"expected": "a7a3299c4d70ea033368a707882856fd5c7f7f4d5a0d5f86bf2fb9b2fe2e53d1",
"observed": "a7a3299c4d70ea033368a707882856fd5c7f7f4d5a0d5f86bf2fb9b2fe2e53d1"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/controller-input.json",
"expected": "24d10b3a91553df54b3b2fd4b1a57dce683cc72a55576e0c73c9e142b335ad40",
"observed": "24d10b3a91553df54b3b2fd4b1a57dce683cc72a55576e0c73c9e142b335ad40"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/controller.py",
"expected": "9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b",
"observed": "9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/003-receipt.json",
"expected": "4ce015c160859612c89e215517826aa1da3582534d27c4688af6a44e37f1b641",
"observed": "4ce015c160859612c89e215517826aa1da3582534d27c4688af6a44e37f1b641"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/parse-receipt.json",
"expected": "1ad82022669a3f197f53ed1e23f23aadc927220f0ba1f857c41f80721bafa443",
"observed": "1ad82022669a3f197f53ed1e23f23aadc927220f0ba1f857c41f80721bafa443"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/runner-ended.json",
"expected": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"observed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/full-standard-schema-example/run/runner-input.json",
"expected": "2a76506e923a3a95288ce826b81ed9eab49d4ecee613a2c82ae35e970c68f961",
"observed": "2a76506e923a3a95288ce826b81ed9eab49d4ecee613a2c82ae35e970c68f961"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/INDEX.json",
"expected": "942181cc3efc8207e728233f89626b66eb0c34b582e5c9b0fae294dcf1600c00",
"observed": "942181cc3efc8207e728233f89626b66eb0c34b582e5c9b0fae294dcf1600c00"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/ROOT_EXACT_NORMAL_CANDIDATE_72A50A4A.json",
"expected": "5614c9b1c9eb222dbbcfd9ae1c3b438cc4129c779deba2841d660a8c96b6cfe6",
"observed": "5614c9b1c9eb222dbbcfd9ae1c3b438cc4129c779deba2841d660a8c96b6cfe6"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/ROOT_NORMAL_FINAL_72A50A4A.json",
"expected": "b41069126e029c30ab644a62a54cb45ca2e0e504add150020500acba4e249469",
"observed": "b41069126e029c30ab644a62a54cb45ca2e0e504add150020500acba4e249469"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/normal-candidate-example/ROOT_NORMAL_INTEGRATION_72A50A4A.json",
"expected": "2f47d39d3f05b3735f0fb3e01adaabf1c66c6a784d60af247063bd90e5ec0d5c",
"observed": "2f47d39d3f05b3735f0fb3e01adaabf1c66c6a784d60af247063bd90e5ec0d5c"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/INDEX.json",
"expected": "a23f17336a5e701100c224ebcb69f37a8de95aca82658675b692d503798a5232",
"observed": "a23f17336a5e701100c224ebcb69f37a8de95aca82658675b692d503798a5232"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/OWNER_CLI_REFERENCE.json",
"expected": "1e360ad1d8057ef649fabe97ac3e98263d2f8c1c4d976d8b6e0a907a49e9158e",
"observed": "1e360ad1d8057ef649fabe97ac3e98263d2f8c1c4d976d8b6e0a907a49e9158e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/ROOT_SOURCE_REVIEW_REJECTION_20D0AE5.json",
"expected": "d028dd3862ae663586d49b5843e88d9da82ad7985fa082551438e4a81311073e",
"observed": "d028dd3862ae663586d49b5843e88d9da82ad7985fa082551438e4a81311073e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/SOURCE_REWORK_ADAPTER_LOCAL_CHECKS.json",
"expected": "580f2f19d680a23ee4efe6beab68a1aad69e067bc551f623cc7531c6915d7a78",
"observed": "580f2f19d680a23ee4efe6beab68a1aad69e067bc551f623cc7531c6915d7a78"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/SOURCE_REWORK_CURRENT_REFERENCE_INDEX.json",
"expected": "b0ecce7ae523527fdc6272e9784eba6109d67c0cd3745a8aaab64d913ca8adbd",
"observed": "b0ecce7ae523527fdc6272e9784eba6109d67c0cd3745a8aaab64d913ca8adbd"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/core.py.reference",
"expected": "4c6067bbd57034764873a468ff161a6882d232503043d5640fc83dea0b455856",
"observed": "4c6067bbd57034764873a468ff161a6882d232503043d5640fc83dea0b455856"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/current-owner-cli.py.reference",
"expected": "0cfd9634e4a59755b89d2927d60b6092368529f2ca7188d949da7f88080359aa",
"observed": "0cfd9634e4a59755b89d2927d60b6092368529f2ca7188d949da7f88080359aa"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/owner-cli.py.reference",
"expected": "52c327e624334b51612ea3cb1653aeff4a7a192502d1ba9407ce874af1d92410",
"observed": "52c327e624334b51612ea3cb1653aeff4a7a192502d1ba9407ce874af1d92410"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/owner-normal-gates-reference/owner-source-rework-20d0ae5.py.reference",
"expected": "9ecf7bebf666a67a8f13357d66e9c1d8d76940ef8212f0055537b728c75e0cbc",
"observed": "9ecf7bebf666a67a8f13357d66e9c1d8d76940ef8212f0055537b728c75e0cbc"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/FAILED_EXECUTION.json",
"expected": "6e48da89ce852dacdbff2d0f93a8903583dccd9e05f5e34bb68be0d63f540332",
"observed": "6e48da89ce852dacdbff2d0f93a8903583dccd9e05f5e34bb68be0d63f540332"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/FAILED_IMPORT_COMBINED.log",
"expected": "cd39b1711f530454b0ec263ab2d076d714f674d5a36e26f9ef16788799b76764",
"observed": "cd39b1711f530454b0ec263ab2d076d714f674d5a36e26f9ef16788799b76764"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/FAILED_OUTER_OWNED_FINALLY.json",
"expected": "ee14a347724aedb2ae8afecc0775250b1e014c17e726210e2535d6108e57edc0",
"observed": "ee14a347724aedb2ae8afecc0775250b1e014c17e726210e2535d6108e57edc0"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/INDEX.json",
"expected": "0e4334442ce89b0388e10a4b62b5e00acbce2013e3ef1967508a3c48d72dc9c1",
"observed": "0e4334442ce89b0388e10a4b62b5e00acbce2013e3ef1967508a3c48d72dc9c1"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/P13_CONTROLLER_REFERENCE_INDEX.json",
"expected": "48434362232d6b58cca720868c6d87f2af48675f365855b8a4a97eb5071dfee3",
"observed": "48434362232d6b58cca720868c6d87f2af48675f365855b8a4a97eb5071dfee3"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/P13_FULL_CONTROLLER_PATTERN.py.reference",
"expected": "9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b",
"observed": "9e03ecba1819c449c83a9dfba0f60c0e01f94aad728c46f60dd1db179224a89b"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/ROOT_Q35_DIAGNOSTIC_IMPORT_SOURCE_DELTA.json",
"expected": "1994e59a498f3dbca1fd589b16b5bc6305d2786c0fa730ac489590469f08b05d",
"observed": "1994e59a498f3dbca1fd589b16b5bc6305d2786c0fa730ac489590469f08b05d"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/ROOT_Q35_FAILED_IMPORT_UID_CLASSIFICATION.json",
"expected": "bc0a863e52db4f98b4b2ee4bc0b513c73f841726789a2ca99521c1b8618dc6c3",
"observed": "bc0a863e52db4f98b4b2ee4bc0b513c73f841726789a2ca99521c1b8618dc6c3"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_all_tests.py.reference",
"expected": "320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4",
"observed": "320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_p13_reference_tests.py.reference",
"expected": "9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c",
"observed": "9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/INDEX.json",
"expected": "cef78b200268e27a6e73ccd926ac95d0b2b6e30b9338a8412da9ab48b68ca82a",
"observed": "cef78b200268e27a6e73ccd926ac95d0b2b6e30b9338a8412da9ab48b68ca82a"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/SAFETY_REAUDIT.json",
"expected": "8edf11fe7893ced7c6450feb1ee3db45ab0a145db572254d2102ee70e26ac26e",
"observed": "8edf11fe7893ced7c6450feb1ee3db45ab0a145db572254d2102ee70e26ac26e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/TYPED_AUDIT.json",
"expected": "e1800e1679b570ecdd9d7537e87e0730c089fa3b4c6197d3e279e60959aad016",
"observed": "e1800e1679b570ecdd9d7537e87e0730c089fa3b4c6197d3e279e60959aad016"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/command_queue.gd.reference",
"expected": "09b22e6212fa3ce1bf08f5d6b52224a2d3362b3bc63f03a8c98e89af1c6f5895",
"observed": "09b22e6212fa3ce1bf08f5d6b52224a2d3362b3bc63f03a8c98e89af1c6f5895"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/facility_instance.gd.reference",
"expected": "0c6aa493f3299611e05dd26aa429dda8cf7b5c479e4d09632036fb862f79a324",
"observed": "0c6aa493f3299611e05dd26aa429dda8cf7b5c479e4d09632036fb862f79a324"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-before.json",
"expected": "af7b1f0099b37298b1bf0d683f98c0ec84fae96b74f16c33af310cab2efa955b",
"observed": "af7b1f0099b37298b1bf0d683f98c0ec84fae96b74f16c33af310cab2efa955b"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-before.var",
"expected": "61f749b6a10ddc8e70f6e5b1d6378fcf1c0ae5127161a10c9704d76bcf64813a",
"observed": "61f749b6a10ddc8e70f6e5b1d6378fcf1c0ae5127161a10c9704d76bcf64813a"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-resource-replay.json",
"expected": "56a7fc36e0972eb64abb19189f1664b87d6a058511bbec0ef7e1497abd2c511e",
"observed": "56a7fc36e0972eb64abb19189f1664b87d6a058511bbec0ef7e1497abd2c511e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5A_PURE-resource-replay.var",
"expected": "92aa8694939e2b8b678b556227cce1cf4cda661b6fb1f5a478ac37deba1a072e",
"observed": "92aa8694939e2b8b678b556227cce1cf4cda661b6fb1f5a478ac37deba1a072e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-before.json",
"expected": "0f821748eb7f12a8ac196c61bca34a7fe55af6adb3ab43d1acf8748fd2be8652",
"observed": "0f821748eb7f12a8ac196c61bca34a7fe55af6adb3ab43d1acf8748fd2be8652"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-before.var",
"expected": "06b03c6a50a8832a9cab621b908332199e9ab4d10d4e547111a8860c70535bd2",
"observed": "06b03c6a50a8832a9cab621b908332199e9ab4d10d4e547111a8860c70535bd2"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-resource-replay.json",
"expected": "49fb4df6bdaadd9c5146f716a108902c533b137427e2f90f86116393f12c6ea0",
"observed": "49fb4df6bdaadd9c5146f716a108902c533b137427e2f90f86116393f12c6ea0"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract/writer-S5B_DEPENDENCY-resource-replay.var",
"expected": "464b589fa206427a1becd6dd484fc9be05da1b619ffb26ca559dde83e7b09309",
"observed": "464b589fa206427a1becd6dd484fc9be05da1b619ffb26ca559dde83e7b09309"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/INDEX.json",
"expected": "a8f44235dc8a74e67c3463698619611131224de5048868259a729791614cf9a9",
"observed": "a8f44235dc8a74e67c3463698619611131224de5048868259a729791614cf9a9"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q36_REJECTED_ENQUEUE_STATIC_PATH.json",
"expected": "e8adc79d506491973289084c5ade7c3affe9e3e517896ef191f01cad6dcaed92",
"observed": "e8adc79d506491973289084c5ade7c3affe9e3e517896ef191f01cad6dcaed92"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q37_DIAGNOSTIC_SAFETY_REAUDIT.json",
"expected": "4d4b059576b3b6d28f71d054eeaf367ead54a74bb499d64bf450d625a137cfa5",
"observed": "4d4b059576b3b6d28f71d054eeaf367ead54a74bb499d64bf450d625a137cfa5"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q37_POWER_ADAPTER_RESULT.json",
"expected": "cce1132503457675b50d566ad1afc3f67e902a28135550a8e72b647dacd7d70d",
"observed": "cce1132503457675b50d566ad1afc3f67e902a28135550a8e72b647dacd7d70d"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_Q37_PREFLIGHT.json",
"expected": "3554d8f246c0d117c774ecfabcd9eb48eed311155e3a5a3b15413f3e663b6fd7",
"observed": "3554d8f246c0d117c774ecfabcd9eb48eed311155e3a5a3b15413f3e663b6fd7"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-power-result/ROOT_R37_ADAPTER_CONTROLS.json",
"expected": "f62fc981f3935bd969ea5c6fafa5d44a111b1264ad0d04fdb08b07fe4f27429e",
"observed": "f62fc981f3935bd969ea5c6fafa5d44a111b1264ad0d04fdb08b07fe4f27429e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/ROOT_MANA_ADOPTION_CURRENT_APPLICABILITY_C0.json",
"expected": "57ba42e1c92db194a5ddcb8dc80c8e0249bbab817e35a3ae00bd12b0f4c57731",
"observed": "57ba42e1c92db194a5ddcb8dc80c8e0249bbab817e35a3ae00bd12b0f4c57731"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/ROOT_Q37_FULL_ROSTER_PREPARE_ONLY.json",
"expected": "c547dcff95184d04bf7089e7c9f6a2cda800a91359c9ec318f48ad4ecf2887c0",
"observed": "c547dcff95184d04bf7089e7c9f6a2cda800a91359c9ec318f48ad4ecf2887c0"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/SOURCE_MAP.json",
"expected": "d1333fc891342be5cc16795973fa71e7910a8c8af06ef4a3e51662537fed63c3",
"observed": "d1333fc891342be5cc16795973fa71e7910a8c8af06ef4a3e51662537fed63c3"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/core/simulation_kernel.gd",
"expected": "341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb",
"observed": "341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/economy/economy_service.gd",
"expected": "95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e",
"observed": "95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/facility/facility_service.gd",
"expected": "ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77",
"observed": "ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/guest/guest_service.gd",
"expected": "56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e",
"observed": "56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/operations/operations_coordinator.gd",
"expected": "871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90",
"observed": "871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_autonomy.gd",
"expected": "28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403",
"observed": "28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_cycle.gd",
"expected": "a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357",
"observed": "a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tools/run_all_tests.py",
"expected": "320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4",
"observed": "320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/core/simulation_kernel.gd",
"expected": "341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb",
"observed": "341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/current-main-source/autoload/simulation_runtime.gd",
"expected": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"observed": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/facility/facility_service.gd",
"expected": "ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77",
"observed": "ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/economy/economy_service.gd",
"expected": "95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e",
"observed": "95aedd0a0421c93e8fa39f0f76fa890cd0a46905d9a25c88c8b17c4d6d47728e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/operations/operations_coordinator.gd",
"expected": "871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90",
"observed": "871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/scripts/guest/guest_service.gd",
"expected": "56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e",
"observed": "56880410e9a00816f9a95d30821982955532de8dd976980934e12016a9f2b21e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_autonomy.gd",
"expected": "28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403",
"observed": "28ca81ddde4da49442b427ed4c55ddcf213ecb389712db585b64cd416636c403"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_all_tests.py.reference",
"expected": "320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4",
"observed": "320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q37-remaining-source-map/source/tests/s5/test_runtime_defense_cycle.gd",
"expected": "a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357",
"observed": "a909e2af73aae43590cdd91d07ed2548f4fd2f675d26fa63aa74f6a5cda34357"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q35-uid-diagnostic/run_p13_reference_tests.py.reference",
"expected": "9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c",
"observed": "9adc8aa2a7662df8dd70386ddb0bff34574e44d7411de3b6128ddd15eb24675c"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/INDEX.json",
"expected": "1e72f10784d639ff509e8175f73c46e8e2479dda8263365f51dd9f67c753709e",
"observed": "1e72f10784d639ff509e8175f73c46e8e2479dda8263365f51dd9f67c753709e"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/ROOT_Q40_NATIVE_FAILURE_AUDIT.json",
"expected": "622edabc16a3e9ef6528b4009d44d8307f998bf9aa0c441b4b223bf5a40efeb5",
"observed": "622edabc16a3e9ef6528b4009d44d8307f998bf9aa0c441b4b223bf5a40efeb5"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/ROOT_R40_CURRENT_SOURCE_GAPS.json",
"expected": "306195acb5661f9c4c087428ba16f0a46fe54cf1f8b2dea9933c035b90ad7511",
"observed": "306195acb5661f9c4c087428ba16f0a46fe54cf1f8b2dea9933c035b90ad7511"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/ROOT_R40_AFFECTED_PURE_CONTROLS.json",
"expected": "736860fe730d7b7fa744783f74a0de875afe8ba3ff65e74598bd4c07e29d955a",
"observed": "736860fe730d7b7fa744783f74a0de875afe8ba3ff65e74598bd4c07e29d955a"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/ROOT_R40_ALL_CHECK_ONLY.json",
"expected": "ffec08fd3ed45d346ae27de4c502fbc7768fc51ccadce433ca30805faf127a68",
"observed": "ffec08fd3ed45d346ae27de4c502fbc7768fc51ccadce433ca30805faf127a68"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/writer-stderr.log",
"expected": "75ddd2af006162c702751853f9f3931086bded7544a8addd0d65383c47a59a67",
"observed": "75ddd2af006162c702751853f9f3931086bded7544a8addd0d65383c47a59a67"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/writer-stdout.log",
"expected": "eebf10b3f84916338ab651af117852cbe852bef28f79032472fdb01342ac0608",
"observed": "eebf10b3f84916338ab651af117852cbe852bef28f79032472fdb01342ac0608"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/writer.json",
"expected": "ceb971f39afe131fbeccb0fbe06be37ada0d31ef3ee86f216701a1618abe444a",
"observed": "ceb971f39afe131fbeccb0fbe06be37ada0d31ef3ee86f216701a1618abe444a"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/writer-S5D_DESTRUCTION_RAID-commands.json",
"expected": "19be61a849204ce72731d586f9685ad129231a55fca57a006ddbc723d52d9879",
"observed": "19be61a849204ce72731d586f9685ad129231a55fca57a006ddbc723d52d9879"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q40-source-and-native-findings/execution.json",
"expected": "7c00af3acee008927faf7f1b99b6a7407671674668674f30acc3504ea6ee21d9",
"observed": "7c00af3acee008927faf7f1b99b6a7407671674668674f30acc3504ea6ee21d9"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q41-oracle-source-facts/INDEX.json",
"expected": "903601cfec6be397f99c30aeba9301f2312c1f659a73f30d5d8a04e1f07ef468",
"observed": "903601cfec6be397f99c30aeba9301f2312c1f659a73f30d5d8a04e1f07ef468"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q41-oracle-source-facts/ACTUAL_FAILED_COMMAND_JOURNAL_SOURCE.json",
"expected": "27d39ab2b01e1e73d4bd38e335a87fe26ddbea3e748fc9c95d82c886dfd14187",
"observed": "27d39ab2b01e1e73d4bd38e335a87fe26ddbea3e748fc9c95d82c886dfd14187"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/q41-oracle-source-facts/HISTORICAL_S4_WRAPPER_R28.py.reference",
"expected": "2d3be39d2b310abac058e27336ac816c234043a0a1dd7b2c52d84994907dd31b",
"observed": "2d3be39d2b310abac058e27336ac816c234043a0a1dd7b2c52d84994907dd31b"
}
]
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,131 @@
{
"M": "c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"files": {
"scripts/core/simulation_kernel.gd": {
"sha256": "341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb",
"bytes": 7602,
"functions": {
"advance_one_minute": {
"line": 122,
"end_line": 158,
"sha256": "b9587ef722d8c8640248025462819374ae5eca1c3d8bbe600b6bc9c328567777",
"body": "func advance_one_minute() -> void:\n\t_abort_current_tick_requested = false\n\t_last_tick_advanced = false\n\ttick_started.emit(absolute_minute)\n\t_run_phase(TickPhase.APPLY_COMMANDS)\n\t# A Runtime gate can reject the tick before the Clock changes. This is\n\t# distinct from an ordinary pause raised by a command that already committed\n\t# for the upcoming minute.\n\tif _abort_current_tick_requested:\n\t\t_abort_current_tick_requested = false\n\t\treturn\n\n\tvar previous_absolute_minute := absolute_minute\n\tabsolute_minute += 1\n\t_sync_calendar_fields()\n\t_handle_time_boundaries(previous_absolute_minute)\n\t_run_phase(TickPhase.TIME_BOUNDARIES)\n\n\tfor phase in [\n\t\tTickPhase.MANA,\n\t\tTickPhase.CONSTRUCTION,\n\t\tTickPhase.LOGISTICS,\n\t\tTickPhase.FACILITY_COMPLETION,\n\t\tTickPhase.VITALS_AND_ENVIRONMENT,\n\t\tTickPhase.INCIDENTS_AND_EVENTS,\n\t\tTickPhase.FACILITY_QUEUES,\n\t\tTickPhase.AI_DECISIONS,\n\t\tTickPhase.PUBLISH_SNAPSHOT,\n\t]:\n\t\t_run_phase(phase)\n\n\tsnapshot_version += 1\n\ttick_completed.emit(absolute_minute)\n\t_emit_current_time()\n\t_abort_current_tick_requested = false\n\t_last_tick_advanced = true\n\n"
},
"_run_phase": {
"line": 236,
"end_line": 249,
"sha256": "52461eeb288892a4bb4b6a99570185af08a30758ef88b0046a911baaa6f318e1",
"body": "func _run_phase(phase: TickPhase) -> void:\n\ttick_phase_started.emit(phase, absolute_minute)\n\tif not _phase_handlers.has(phase):\n\t\treturn\n\tvar handlers: Dictionary = _phase_handlers[phase]\n\tvar handler_ids: Array = handlers.keys()\n\thandler_ids.sort_custom(func(left: Variant, right: Variant) -> bool:\n\t\treturn String(left) < String(right)\n\t)\n\tfor handler_id: Variant in handler_ids:\n\t\tvar callback: Callable = handlers[handler_id]\n\t\tif callback.is_valid():\n\t\t\tcallback.call(absolute_minute)\n\n"
}
}
},
"autoload/simulation_runtime.gd": {
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"bytes": 616434,
"functions": {
"_execute_register_event_definition": {
"line": 6878,
"end_line": 6886,
"sha256": "6c271786ca52115a233f9c3ad2d19f93ef101f2da533672118165757aac3347d",
"body": "func _execute_register_event_definition(command: SimulationCommand) -> CommandResult:\n\tvar raw_definition: Variant = command.payload.get(&\"definition\", command.payload.get(\"definition\", null))\n\tvar definition := EventDefinition.from_variant(raw_definition)\n\tif definition == null:\n\t\treturn CommandResult.failed(CommandResult.Code.INVALID_PAYLOAD, command.command_id, \"Event definition is malformed.\")\n\tvar result := event_service.register_definition(definition)\n\tresult.command_id = command.command_id\n\treturn result\n\n"
},
"_execute_enqueue_event": {
"line": 6887,
"end_line": 6895,
"sha256": "5e5d5fb5e225dbcb09aeb2addb92c0011965c7e8f6b12cda91ca05d98e240c08",
"body": "func _execute_enqueue_event(command: SimulationCommand) -> CommandResult:\n\tvar event_id := StringName(command.payload.get(&\"event_id\", command.payload.get(\"event_id\", \"\")))\n\tvar actor_ids := _name_array(command.payload.get(&\"actor_ids\", command.payload.get(\"actor_ids\", [])))\n\tvar raw_options: Variant = command.payload.get(&\"options\", command.payload.get(\"options\", {}))\n\tvar options: Dictionary = raw_options.duplicate(true) if raw_options is Dictionary else {}\n\tvar result := event_service.enqueue_candidate(event_id, actor_ids, _runtime_event_minute(), options)\n\tresult.command_id = command.command_id\n\treturn result\n\n"
},
"_advance_relationship_events": {
"line": 8637,
"end_line": 8655,
"sha256": "20ca7abfdcbbc914f91545c3eded46e3e87035ff4153541ffcbf92471b02b03f",
"body": "func _advance_relationship_events(absolute_minute: int) -> void:\n\tif _operations_tick_blocked:\n\t\treturn\n\tif _operations_morning_already_processed(absolute_minute):\n\t\treturn\n\tevent_service.process_expired(absolute_minute)\n\tevent_service.audit_actor_availability(absolute_minute)\n\t_enqueue_pending_relationship_candidates()\n\tif event_service.get_foreground_instance() == null:\n\t\tvar started := event_service.start_next_event(\n\t\t\tabsolute_minute,\n\t\t\t_build_event_context(absolute_minute)\n\t\t)\n\t\tif started.is_success() and bool(started.details.get(&\"waiting_for_choice\", false)):\n\t\t\t_clock.set_paused(true)\n\tif event_service.pause_requested:\n\t\t_clock.set_paused(true)\n\n\n"
},
"_validate_event_action": {
"line": 9991,
"end_line": 10039,
"sha256": "83e0cce3b59244440b11acdee6f87dd521859701769b1689ff2775db5c92c5f5",
"body": "func _validate_event_action(action: EventAction) -> Dictionary:\n\tmatch action.type:\n\t\tEventAction.Type.ADD_LEDGER_ENTRY:\n\t\t\tvar from_account := StringName(action.payload.get(&\"from_account\", action.payload.get(\"from_account\", PLAYER_CASH_ACCOUNT)))\n\t\t\tvar to_account := StringName(action.payload.get(&\"to_account\", action.payload.get(\"to_account\", OPERATING_EXPENSE_ACCOUNT)))\n\t\t\tvar amount := int(action.payload.get(&\"amount\", action.payload.get(\"amount\", 0)))\n\t\t\tif amount <= 0 or not economy_service.has_account(from_account) or not economy_service.has_account(to_account):\n\t\t\t\treturn {&\"ok\": false, &\"error\": \"Ledger Action has invalid accounts or amount.\"}\n\t\t\tif not economy_service.account_allows_negative(from_account) and economy_service.get_balance(from_account) < amount:\n\t\t\t\treturn {&\"ok\": false, &\"error\": \"Ledger Action source cannot fund the amount.\"}\n\t\tEventAction.Type.ADD_OR_REMOVE_ITEM:\n\t\t\tvar inventory_id := StringName(action.payload.get(&\"inventory_id\", action.payload.get(\"inventory_id\", \"\")))\n\t\t\tvar item_id := StringName(action.payload.get(&\"item_id\", action.payload.get(\"item_id\", \"\")))\n\t\t\tvar delta := int(action.payload.get(&\"quantity_delta\", action.payload.get(\"quantity_delta\", 0)))\n\t\t\tif inventory_id.is_empty() or item_id.is_empty() or delta == 0:\n\t\t\t\treturn {&\"ok\": false, &\"error\": \"Inventory Action requires inventory, item and non-zero delta.\"}\n\t\t\tif delta < 0 and inventory_service.available_quantity(inventory_id, item_id) < -delta:\n\t\t\t\treturn {&\"ok\": false, &\"error\": \"Inventory Action stock is unavailable.\"}\n\t\tEventAction.Type.CREATE_TASK:\n\t\t\tif StringName(action.payload.get(&\"task_type\", action.payload.get(\"task_type\", \"\"))).is_empty():\n\t\t\t\treturn {&\"ok\": false, &\"error\": \"CREATE_TASK requires task_type.\"}\n\t\tEventAction.Type.SET_FACILITY_STATE:\n\t\t\tvar facility_id := StringName(action.payload.get(&\"facility_id\", action.payload.get(\"facility_id\", \"\")))\n\t\t\tvar conditions_value: Variant = action.payload.get(&\"conditions\", action.payload.get(\"conditions\", null))\n\t\t\tif not facility_service.has_instance(facility_id) or not conditions_value is Dictionary:\n\t\t\t\treturn {&\"ok\": false, &\"error\": \"Facility Action target or conditions are invalid.\"}\n\t\t\tvar defense_owner: StringName = _defense_lock_owner(facility_id, &\"ASSET\")\n\t\t\tif not defense_owner.is_empty() \\\n\t\t\t\t\tand (conditions_value.has(&\"durability\") or conditions_value.has(\"durability\")):\n\t\t\t\treturn {&\"ok\": false, &\"error\": \"Event Action cannot mutate Defense-owned Facility durability.\"}\n\t\tEventAction.Type.TELEPORT_ENTITY_FOR_RECOVERY:\n\t\t\tvar entity_id := StringName(action.payload.get(&\"entity_id\", action.payload.get(\"entity_id\", \"\")))\n\t\t\tvar cell_value: Variant = _parse_world_cell(\n\t\t\t\taction.payload.get(&\"cell\", action.payload.get(\"cell\", null))\n\t\t\t)\n\t\t\tif not _event_actor_exists(entity_id) or cell_value == null:\n\t\t\t\treturn {&\"ok\": false, &\"error\": \"Recovery teleport target is invalid.\"}\n\t\t\tvar target_cell: Vector3i = cell_value\n\t\t\tvar traffic := path_service.get_cell_traffic(target_cell)\n\t\t\tvar actor_id := (\n\t\t\t\t_guest_path_actor_id(entity_id)\n\t\t\t\tif guest_service.has_guest(entity_id)\n\t\t\t\telse _staff_path_actor_id(entity_id)\n\t\t\t)\n\t\t\tif traffic.is_empty() or bool(traffic.get(&\"temporary_block\", false)) \\\n\t\t\t\t\tor not path_service.has_actor_projection(actor_id):\n\t\t\t\treturn {&\"ok\": false, &\"error\": \"Recovery teleport requires a projected actor and an unblocked walkable target.\"}\n\treturn {&\"ok\": true}\n\n"
},
"_apply_event_action": {
"line": 10040,
"end_line": 10123,
"sha256": "d79e7aca02eed06f500ffc632c6160cd80d76c3d7c5c90dc097f71b60380d365",
"body": "func _apply_event_action(action: EventAction, context: Dictionary) -> Dictionary:\n\tvar instance_id := StringName(context.get(&\"event_instance_id\", \"\"))\n\tmatch action.type:\n\t\tEventAction.Type.CREATE_DEFENSE_RAID:\n\t\t\treturn _apply_event_defense_raid(action, context)\n\t\tEventAction.Type.ADD_LEDGER_ENTRY:\n\t\t\tvar from_account := StringName(action.payload.get(&\"from_account\", action.payload.get(\"from_account\", PLAYER_CASH_ACCOUNT)))\n\t\t\tvar to_account := StringName(action.payload.get(&\"to_account\", action.payload.get(\"to_account\", OPERATING_EXPENSE_ACCOUNT)))\n\t\t\tvar amount := int(action.payload.get(&\"amount\", action.payload.get(\"amount\", 0)))\n\t\t\tvar result := economy_service.transfer(\n\t\t\t\tfrom_account, to_account, amount, _runtime_event_minute(),\n\t\t\t\t&\"EVENT_ACTION\", instance_id,\n\t\t\t\tStringName(\"event.action.%s.%s\" % [instance_id, action.action_id])\n\t\t\t)\n\t\t\treturn {&\"ok\": result.is_success(), &\"error\": result.message}\n\t\tEventAction.Type.ADD_OR_REMOVE_ITEM:\n\t\t\tvar inventory_id := StringName(action.payload.get(&\"inventory_id\", action.payload.get(\"inventory_id\", \"\")))\n\t\t\tvar item_id := StringName(action.payload.get(&\"item_id\", action.payload.get(\"item_id\", \"\")))\n\t\t\tvar delta := int(action.payload.get(&\"quantity_delta\", action.payload.get(\"quantity_delta\", 0)))\n\t\t\tif delta > 0:\n\t\t\t\tvar added := inventory_service.add_stack(inventory_id, item_id, delta, 100, -1, _runtime_event_minute())\n\t\t\t\treturn {&\"ok\": bool(added.get(&\"ok\", false)), &\"error\": added.get(&\"message\", \"\")}\n\t\t\tvar reserved := inventory_service.reserve_item(\n\t\t\t\tinventory_id, item_id, -delta, instance_id, &\"event_action\",\n\t\t\t\t_runtime_event_minute(), _runtime_event_minute() + 1,\n\t\t\t\tStringName(\"event.item.reserve.%s.%s\" % [instance_id, action.action_id])\n\t\t\t)\n\t\t\tif not bool(reserved.get(&\"ok\", false)):\n\t\t\t\treturn {&\"ok\": false, &\"error\": reserved.get(&\"message\", \"Item reservation failed.\")}\n\t\t\tvar consumed := inventory_service.consume_reservations(\n\t\t\t\t_name_array(reserved.get(&\"reservation_ids\", [])),\n\t\t\t\tStringName(\"event.item.consume.%s.%s\" % [instance_id, action.action_id]),\n\t\t\t\t_runtime_event_minute()\n\t\t\t)\n\t\t\treturn {&\"ok\": bool(consumed.get(&\"ok\", false)), &\"error\": consumed.get(&\"message\", \"\")}\n\t\tEventAction.Type.CREATE_TASK:\n\t\t\tvar raw_options: Variant = action.payload.get(&\"options\", action.payload.get(\"options\", {}))\n\t\t\tvar options: Dictionary = raw_options.duplicate(true) if raw_options is Dictionary else {}\n\t\t\tvar created := staff_service.create_task(\n\t\t\t\tStringName(action.payload.get(&\"task_type\", action.payload.get(\"task_type\", \"\"))),\n\t\t\t\tint(action.payload.get(&\"priority\", action.payload.get(\"priority\", 50))),\n\t\t\t\t_runtime_event_minute(),\n\t\t\t\toptions,\n\t\t\t\tStringName(action.payload.get(&\"task_id\", action.payload.get(\"task_id\", \"\")))\n\t\t\t)\n\t\t\treturn {&\"ok\": created.is_success(), &\"error\": created.message}\n\t\tEventAction.Type.SET_FACILITY_STATE:\n\t\t\tvar updated := facility_service.set_operational_status(\n\t\t\t\tStringName(action.payload.get(&\"facility_id\", action.payload.get(\"facility_id\", \"\"))),\n\t\t\t\taction.payload.get(&\"conditions\", action.payload.get(\"conditions\", {})),\n\t\t\t\t_runtime_event_minute()\n\t\t\t)\n\t\t\treturn {&\"ok\": updated.is_success(), &\"error\": updated.message}\n\t\tEventAction.Type.TELEPORT_ENTITY_FOR_RECOVERY:\n\t\t\tvar entity_id := StringName(action.payload.get(&\"entity_id\", action.payload.get(\"entity_id\", \"\")))\n\t\t\tvar cell: Vector3i = _parse_world_cell(action.payload.get(&\"cell\", action.payload.get(\"cell\", null)))\n\t\t\tvar guest := guest_service.get_guest(entity_id)\n\t\t\tvar actor_id: StringName\n\t\t\tvar moved := false\n\t\t\tif guest != null:\n\t\t\t\tactor_id = _guest_path_actor_id(entity_id)\n\t\t\t\tmoved = guest_service.record_path_success(\n\t\t\t\t\tentity_id, cell, _runtime_event_minute()\n\t\t\t\t)\n\t\t\telse:\n\t\t\t\tvar staff := staff_service.get_staff(entity_id)\n\t\t\t\tactor_id = _staff_path_actor_id(entity_id)\n\t\t\t\tstaff.current_cell = cell\n\t\t\t\tmoved = true\n\t\t\tif not moved or not path_service.project_actor_position(\n\t\t\t\tactor_id, cell, _runtime_event_minute()\n\t\t\t):\n\t\t\t\treturn {&\"ok\": false, &\"error\": \"Recovery teleport could not commit its Path projection.\"}\n\t\t\t_movement_credits[actor_id] = {\n\t\t\t\t&\"credit\": 0,\n\t\t\t\t&\"updated_at\": _runtime_event_minute(),\n\t\t\t}\n\t\t\t_publish_actor_event(&\"ENTITY_RECOVERY_TELEPORTED\", &\"event_service\", [entity_id, actor_id], {\n\t\t\t\t&\"cell\": cell,\n\t\t\t\t&\"path_actor_id\": actor_id,\n\t\t\t})\n\t\t\treturn {&\"ok\": true}\n\treturn {&\"ok\": false, &\"error\": \"Unsupported Event Action.\"}\n\n"
},
"_advance_facilities": {
"line": 8504,
"end_line": 8509,
"sha256": "f1efd0c23bdd60d1ef19a21879640b53b8b4d88844c0c881fe7cd724387ec274",
"body": "func _advance_facilities(absolute_minute: int) -> void:\n\tif _operations_tick_blocked:\n\t\treturn\n\tfacility_service.advance_one_minute(absolute_minute)\n\tkitchen_production.advance_one_minute(absolute_minute)\n\n"
},
"_process_tick_commands": {
"line": 5765,
"end_line": 5775,
"sha256": "9de66a4bb84b12304300d49085f44546412319bd4aee91e67b61becf97e50294",
"body": "func _process_tick_commands(current_absolute_minute: int) -> void:\n\tif _operations_enabled:\n\t\t_operations_tick_blocked = _operations_should_block_tick()\n\t\tif _operations_tick_blocked:\n\t\t\t_clock.set_paused(true)\n\t\t\t_clock.request_current_tick_abort()\n\t\t\treturn\n\t_process_commands(current_absolute_minute + 1)\n\t_synchronize_operations_population()\n\n\n"
}
}
},
"scripts/facility/facility_service.gd": {
"sha256": "ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77",
"bytes": 44951,
"functions": {
"start_next_service": {
"line": 449,
"end_line": 524,
"sha256": "2eb1cf1226fb1496b6b96c39184ad6a767b4fde747923df599097372435ffa4c",
"body": "func start_next_service(\n\tinstance_id: StringName,\n\tabsolute_minute: int = -1,\n\tvalidator: Callable = Callable()\n) -> CommandResult:\n\tvar instance := get_instance(instance_id)\n\tif instance == null:\n\t\treturn _not_found(\"Facility instance\", instance_id)\n\tvar minute := _resolve_minute(absolute_minute)\n\t_resolve_operating_dependency(instance_id, minute, {}, {})\n\tinstance.apply_pending_policy(minute)\n\tvar old_state := instance.state\n\tinstance.evaluate_state(minute)\n\t_emit_state_change(instance, old_state)\n\tif not instance.can_start_service(minute):\n\t\treturn _invalid(\n\t\t\t\"Facility cannot start a service in its current state.\",\n\t\t\t{\n\t\t\t\t&\"instance_id\": instance_id,\n\t\t\t\t&\"state\": FacilityInstanceType.State.keys()[instance.state],\n\t\t\t\t&\"reasons\": instance.state_reasons.duplicate(),\n\t\t\t}\n\t\t)\n\t_cleanup_missing_queue_requests(instance)\n\tif instance.queue_entries.is_empty():\n\t\treturn _not_found(\"Queued service request\", &\"\")\n\tvar request := get_request(instance.queue_entries[0])\n\tif request == null:\n\t\treturn _invalid(\"The next queue entry is corrupt.\")\n\tif not instance.can_accept_customers(request.guest_ids):\n\t\treturn _invalid(\"Simultaneous customer limit reached.\", {&\"reason\": &\"CUSTOMER_CAPACITY\"})\n\tvar effective_validator := validator if validator.is_valid() else _start_validator\n\tvar callback_failure := _run_boundary_callback(\n\t\teffective_validator,\n\t\t[request, instance, minute],\n\t\t\"Service start validation failed.\",\n\t\tCommandResultType.Code.VALIDATION_FAILED\n\t)\n\tif callback_failure != null:\n\t\tcallback_failure.details[&\"request_id\"] = request.request_id\n\t\tcallback_failure.details[&\"instance_id\"] = instance_id\n\t\treturn callback_failure\n\n\tvar service_id := _next_service_id()\n\tvar service := ServiceInstanceType.new().configure(\n\t\tservice_id,\n\t\trequest.request_id,\n\t\tinstance_id,\n\t\tminute,\n\t\trequest.service_minutes if request.service_minutes > 0 else instance.base_service_minutes,\n\t\trequest.guest_ids,\n\t\tinstance.active_staff_ids,\n\t\t{\n\t\t\t&\"quality_snapshot\": request.expected_quality,\n\t\t\t&\"price_snapshot\": request.quoted_price,\n\t\t\t&\"policy_snapshot\": request.policy_snapshot,\n\t\t\t&\"inventory_reservations\": request.reserved_inventory_ids,\n\t\t}\n\t)\n\tinstance.queue_entries.remove_at(0)\n\t# Report this start's service index, independent of customer headcount and callbacks.\n\tvar slot := instance.active_services.size()\n\tinstance.active_services[service_id] = service\n\t_known_service_ids[service_id] = true\n\t_increment_stat(instance.statistics_today, &\"services_started\")\n\t_increment_stat(instance.lifetime_statistics, &\"services_started\")\n\tservice_started.emit(service)\n\tlast_error = \"\"\n\treturn _success({\n\t\t&\"instance_id\": instance_id,\n\t\t&\"request_id\": request.request_id,\n\t\t&\"service_id\": service_id,\n\t\t&\"slot\": slot,\n\t})\n\n\n"
},
"_fail_service": {
"line": 933,
"end_line": 947,
"sha256": "56f61b255217bddb4c8a6ad3af6ed1f9edc3b6a6e928dacf2105be6698936de5",
"body": "func _fail_service(\n\tinstance: FacilityInstance,\n\tservice: ServiceInstance,\n\treason: StringName,\n\tabsolute_minute: int\n) -> void:\n\tservice.mark_failed(reason, absolute_minute)\n\tinstance.active_services.erase(service.service_id)\n\t_requests.erase(service.request_id)\n\t_service_history[service.service_id] = service\n\t_increment_stat(instance.statistics_today, &\"services_failed\")\n\t_increment_stat(instance.lifetime_statistics, &\"services_failed\")\n\tservice_failed.emit(service, reason)\n\n\n"
},
"set_operational_status": {
"line": 132,
"end_line": 177,
"sha256": "10275169f4a71ad490c432443c34068d1951f099e11132b3c18b48647e7845c8",
"body": "func set_operational_status(\n\tinstance_id: StringName,\n\tconditions: Dictionary,\n\tabsolute_minute: int = -1\n) -> CommandResult:\n\tvar instance := get_instance(instance_id)\n\tif instance == null:\n\t\treturn _not_found(\"Facility instance\", instance_id)\n\tvar old_state := instance.state\n\tif _has_value(conditions, &\"related_facility_id\"):\n\t\tvar raw_related: Variant = _value(conditions, &\"related_facility_id\", null)\n\t\tif typeof(raw_related) not in [TYPE_STRING, TYPE_STRING_NAME]:\n\t\t\treturn _invalid(\"Related facility must be one facility ID.\")\n\t\tvar related := StringName(raw_related)\n\t\tif related == instance_id or (not related.is_empty() and not has_instance(related)):\n\t\t\treturn _invalid(\"Related facility is missing or refers to itself.\")\n\t\tif instance.requires_operating_kitchen() and not related.is_empty():\n\t\t\tvar kitchen := get_instance(related)\n\t\t\tif kitchen.definition_id != &\"kitchen\" or kitchen.origin.z != WorldService.LAYER_BACK:\n\t\t\t\treturn _invalid(\"Dining facilities require one existing BACK kitchen.\", {&\"reason\": &\"INVALID_RELATED_KITCHEN\"})\n\t\t\tif not _required_related_placement_matches(instance, kitchen):\n\t\t\t\treturn _invalid(\"The BACK kitchen must lie inside this FRONT dining facility's XY footprint.\", {&\"reason\": &\"INVALID_RELATED_KITCHEN_PLACEMENT\"})\n\t\tvar seen := {instance_id: true}\n\t\tvar cursor := related\n\t\twhile not cursor.is_empty() and has_instance(cursor):\n\t\t\tif seen.has(cursor):\n\t\t\t\treturn _invalid(\"Related facilities cannot form a cycle.\")\n\t\t\tseen[cursor] = true\n\t\t\tcursor = get_instance(cursor).related_facility_id\n\tif _has_value(conditions, &\"related_facility_operating\") or _has_value(conditions, &\"operation_state\"):\n\t\treturn _invalid(\"Operating flags are computed from actual facility conditions.\")\n\tif _has_value(conditions, &\"suspension_reason\") and (typeof(_value(conditions, &\"suspension_reason\", null)) not in [TYPE_STRING, TYPE_STRING_NAME] or StringName(_value(conditions, &\"suspension_reason\", &\"\")) not in [&\"DESTROYED\", &\"RAIDED\"]):\n\t\treturn _invalid(\"Suspension recovery is not specified.\")\n\tvar minute := _resolve_minute(absolute_minute)\n\tinstance.set_operational_conditions(conditions, minute)\n\tif old_state != instance.state or _has_value(conditions, &\"related_facility_id\"):\n\t\trefresh_operating_dependencies(minute)\n\t_emit_state_change(instance, old_state)\n\tlast_error = \"\"\n\treturn _success({\n\t\t&\"instance_id\": instance_id,\n\t\t&\"state\": FacilityInstanceType.State.keys()[instance.state],\n\t\t&\"state_reasons\": instance.state_reasons.duplicate(),\n\t})\n\n\n"
}
}
},
"scripts/facility/facility_instance.gd": {
"sha256": "0c6aa493f3299611e05dd26aa429dda8cf7b5c479e4d09632036fb862f79a324",
"bytes": 22815,
"functions": {
"can_start_service": {
"line": 243,
"end_line": 247,
"sha256": "39ab5458947ddce7d26129d0174f82dfcec0e87358c058220f61c483f43a9cd5",
"body": "func can_start_service(absolute_minute: int) -> bool:\n\tevaluate_state(absolute_minute)\n\treturn state in [State.OPEN, State.DEGRADED] and available_slots() > 0\n\n\n"
},
"can_accept_customers": {
"line": 267,
"end_line": 278,
"sha256": "3d0984f009ca82b40057c57e0a10a1b68200026843b55a9e63d821064292046f",
"body": "func can_accept_customers(guest_ids: Array[StringName]) -> bool:\n\tif customer_capacity < 0:\n\t\treturn true\n\tvar customers: Dictionary = {}\n\tfor service: ServiceInstance in active_services.values():\n\t\tfor guest_id: StringName in service.guest_ids:\n\t\t\tcustomers[guest_id] = true\n\tfor guest_id: StringName in guest_ids:\n\t\tcustomers[guest_id] = true\n\treturn customers.size() <= customer_capacity\n\n\n"
}
}
},
"scripts/facility/service_instance.gd": {
"sha256": "629a142f80cbc31b97b6d08483d94e029e448969bb6d39fdc8dd39931654dd35",
"bytes": 7320,
"functions": {
"mark_failed": {
"line": 128,
"end_line": 134,
"sha256": "178c6879e64385f0e3ff99fa98ae6ceb4dc67f6c2c981b0effb229f5d4d647fa",
"body": "func mark_failed(reason: StringName, absolute_minute: int) -> void:\n\tstate = State.FAILED\n\tfailure_reason = reason\n\tcompleted_at = absolute_minute\n\tstaff_grace_deadline = NO_DEADLINE\n\n\n"
}
}
},
"data/facilities/cafeteria.tres": {
"sha256": "86d540fe2d78b9dcdbe5a0af6e4a001f4cec54934636ed01deb25a943c79128a",
"bytes": 867,
"functions": {},
"source": "[gd_resource type=\"Resource\" script_class=\"FacilityDefinition\" load_steps=2 format=3]\n\n[ext_resource type=\"Script\" path=\"res://scripts/data/facility_definition.gd\" id=\"1\"]\n\n[resource]\nscript = ExtResource(\"1\")\nid = &\"cafeteria\"\ndisplay_name = \"大衆食堂\"\ndescription = \"低価格で多くの客の食欲を満たす。裏層の厨房から料理を受け取る。\"\nzone = 0\nlayer = 0\nfootprint = Vector2i(4, 2)\nconstruction_cost = {&\"gold\": 800, &\"materials\": 12}\nbuild_minutes = 180\nweight_per_cell = 2\nmaintenance_gold = 4\nmaintenance_mana = 2\nstaff_min = 2\nstaff_max = 4\nrequired_roles = Array[StringName]([&\"cook\", &\"server\", &\"attendant\"])\nprimary_skill = &\"cooking\"\ncapacity = 12\nqueue_capacity = 24\nbase_service_minutes = 45\nbase_quality = 55\nbase_price = 25\ninventory_inputs = {&\"ingredient/basic_meal\": 1}\ntags = Array[StringName]([&\"dining\", &\"social\"])\n"
}
}
}
@@ -35,36 +35,29 @@ def payload(build, gate=None):
native = build / 'audit-support/native-first-current'
c = gate.verify_native(native)
raw = gate.combine_native_series(build, c)
source = gate.product_manifest(gate.tree_entries(gate.TESTED_PRODUCT))
gate.require(len(source) == 1338, 'complete native source required')
series_spec = importlib.util.spec_from_file_location('p04_index_series', Path(__file__).with_name('p04_native_series.py'))
series_module = importlib.util.module_from_spec(series_spec)
series_spec.loader.exec_module(series_module)
fresh_bindings = series_module.fresh_bindings(build)
tested = fresh_bindings['Q_tree']
source = gate.selected_manifest(gate.tree_entries(tested))
source_map = {p: v['sha256'] for p, v in source.items()}
# Resolve content from supplied roots only; never open original provenance
# paths, never omit required source/config/input/environment material.
supplied = {}
roots = [build / 'audit-support' / name for name in
('native-first-current', 'p04-whole-closure-r01', 'p04-current-native-series-r01',
'p04-r17-full-inputs-r01')]
for root in roots:
if not root.exists():
continue
for path in sorted(root.rglob('*')):
if path.is_file():
gate.safe(root, path.relative_to(root).as_posix())
pin = descriptor(path)
supplied.setdefault(pin['sha256'], pin)
runners = []
for run in gate.NATIVE_RUNS:
path = native / run / 'runner-input.json'
for name in series_module.FRESH_RUNS:
run_binding = fresh_bindings['series'][name]
path = gate.safe(build, run_binding['run'] + '/runner-input.json')
inputs = gate.load(path)
row = descriptor(path)
row['materials'] = {}
for pin in inputs.get('fixed_input_pins', []) + [inputs['QA']]:
gate.require(pin['sha256'] in supplied, 'missing supplied runner material: ' + pin['path'])
actual = supplied[pin['sha256']]
gate.require(actual['bytes'] == pin['bytes'], 'runner material length')
row['materials'][pin['path']] = actual
gate.require(inputs['wrapper_sha256'] in supplied, 'missing supplied native wrapper')
row['wrapper'] = supplied[inputs['wrapper_sha256']]
material = descriptor(Path(pin['path']))
gate.require(material['bytes'] == pin['bytes'] and material['sha256'] == pin['sha256'],
'fresh material changed')
gate.supplied_file(build, material)
row['materials'][pin['path']] = material
wrapper = next(p for p in inputs['fixed_input_pins']
if p['sha256'] == inputs['wrapper_sha256'])
row['wrapper'] = descriptor(Path(wrapper['path']))
runners.append(row)
# C references retain every lifecycle, raw phase, source, environment and
# formal member mapping; Stage R retains its complete original->relocated map.
@@ -74,19 +67,19 @@ def payload(build, gate=None):
for row in gate.load(native / 'OWNERSHIP_RAW_PROVENANCE.json')['copied']:
references['C/' + row['target']] = descriptor(gate.safe(native, row['target']))
series = {}
collection = build / 'audit-support/p04-raw-collect-r22'
for name in ('s1', 's2a', 's2b', 's3', 's4'):
collection = build / raw['fresh_collection']
for name in series_module.FRESH_RUNS:
series[name] = gate.load(collection / (name + '.json'))
relocation = gate.load(build / 'audit-support/p04-r17-full-inputs-r01/MANIFEST.json')
authorities = {}
for ref in sorted({r for _, refs, _ in gate.REQUIRED.values() for r in refs}):
relative = (gate.DOC_SCOPE + 'D05_OWNER_APPROVAL.json' if ref.startswith('D05-P04-') else
relative = (gate.OWNER_BINDINGS[ref][0] if ref.startswith('D05-P04-') else
'docs/traceability/original/BASELINE.txt' if ref.startswith('BASELINE:') else
'docs/DESIGN_DECISIONS.md' if ref == 'D-034' else
'docs/plans/original-completion-2026-10-02/execution/p04-01-input-r01/ORDER_CONTRACT_DRAFT.md')
path = gate.safe(gate.ROOT, relative)
if ref.startswith('D05-P04-'):
gate.require(gate.sha(path) == gate.OWNER_HASH, 'owner approval hash')
gate.owner_authority(ref, {'source': relative, 'status': 'approved'}, path)
authorities[ref] = {'source': relative, 'sha256': gate.sha(path),
'status': 'approved' if not ref.startswith('BASELINE:') else 'original'}
conditions = {cid: {'case_id': cid, 'authority_refs': list(refs), 'nativeWindows': 'pending',
@@ -103,30 +96,31 @@ def payload(build, gate=None):
for name, rows in gate.REACH_REFS.items():
refs = []
for path, function, digest, lines in rows:
gate.resolve_anchor(gate.git_bytes('show', gate.TESTED_PRODUCT + ':' + path), function, digest, lines)
gate.resolve_anchor(gate.git_bytes('show', tested + ':' + path), function, digest, lines)
refs.append({'path': path, 'sha256': source_map[path], 'function': function,
'anchor_sha256': digest, 'line_count': lines})
reachability[name] = {'reach': name == 'EV', 'case_id': 'EV' if name == 'EV' else None, 'source_refs': refs,
'raw_verified': 'EV' in raw['verified_conditions'] if name == 'EV' else None}
delta = gate.source_delta(gate.REGISTERED_COMMIT, gate.TESTED_PRODUCT)
delta = gate.source_delta(gate.REGISTERED_COMMIT, tested)
index = {'schema_version': 2, 'task_id': 'P04-01', 'formal_acceptance': False,
'versions': {'registered': gate.REGISTERED_COMMIT, 'execution_origin': gate.EXECUTION_ORIGIN,
'tested': gate.TESTED_PRODUCT},
'product_binding': {'tested_product': gate.TESTED_PRODUCT, 'runner_inputs': runners},
'tested': tested},
'product_binding': {'tested_product': tested, 'runner_inputs': runners},
'source_map': source_map, 'registered_pins': gate.load(gate.SPEC)['current_source_pins'],
'applicability_delta': delta,
'delta_cases': {r['path'] + ':' + r['function']: {cid: cid for cid in
gate.boundary_conditions(r['path'], r['function'])} for r in delta},
'domains': domains, 'authority': authorities, 'conditions': conditions,
'reachability': reachability, 'raw_conditions': raw, 'raw_references': references,
'series': series, 'source_config_input_environment_and_formal': relocation,
'series': series, 'fresh_run_bindings': fresh_bindings,
'historical_source_config_input_environment_and_formal': relocation,
'native_bundle': descriptor(native / 'OWNERSHIP_RAW_PROVENANCE.json'),
'original_audit': {'sha256': gate.sha(gate.ROOT / gate.DOC_SCOPE / 'order-audit.json'),
'content': gate.load(gate.ROOT / gate.DOC_SCOPE / 'order-audit.json')},
'review_status': 'pending_review', 'original_credit': '13/88',
'review_status': 'pending_review', 'original_credit': '16/88; P04=0',
'safety_outcomes': ['no charging while legitimately stopped',
'no double midnight settlement', 'no orphan reservations']}
gate.applicability(index, gate.load(gate.SPEC), source_map, gate.TESTED_PRODUCT)
gate.applicability(index, gate.load(gate.SPEC), source_map, tested)
return index
@@ -140,13 +134,14 @@ def main():
args = parser.parse_args()
gate = checker()
os.environ['BUILD_OUTPUT_DIR'] = str(args.build.resolve(strict=True))
gate.require(args.registered_ref == gate.REGISTERED_COMMIT and args.tested_ref == gate.TESTED_PRODUCT,
'source refs differ from immutable evidence roles')
output = args.output.absolute()
gate.require(not output.exists() and not output.is_symlink(), 'output must be fresh')
for path in output.parents:
gate.require(not path.is_symlink(), 'output parent symlink')
index = payload(args.build, gate)
gate.require(args.registered_ref == gate.REGISTERED_COMMIT and
args.tested_ref == index['versions']['tested'],
'source refs differ from immutable evidence roles')
with gate.isolated_objects():
_, role = gate.verify_roles(index, args.build.resolve())
# The historical invocation is separate from the reusable evidence index.
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Root-only disposable repository controls; never original acceptance evidence."""
"""Isolated disposable repository controls; never original acceptance evidence."""
import importlib.util
import os
from pathlib import Path
@@ -24,8 +24,9 @@ def run():
spec = importlib.util.spec_from_file_location('bulk_gate', ROOT / 'tools/check_p04_order_evidence.py')
gate = importlib.util.module_from_spec(spec)
spec.loader.exec_module(gate)
with tempfile.TemporaryDirectory(prefix='p04-bulk-fixture-') as temporary:
with tempfile.TemporaryDirectory(prefix='p04-bulk-fixture-', dir='/tmp') as temporary:
base = Path(temporary)
assert not base.resolve().is_relative_to(ROOT.resolve())
repo = base / 'repo'
repo.mkdir()
gate.ROOT = repo
@@ -14,7 +14,7 @@ ROOT = Path(__file__).resolve().parents[5]
spec = importlib.util.spec_from_file_location('p04_gate', ROOT / 'tools/check_p04_order_evidence.py')
gate = importlib.util.module_from_spec(spec)
spec.loader.exec_module(gate)
PRODUCTION = '5f6bc11d6bb6e92d22d787989b219fef3a435bc1'
PRODUCTION = gate.MAIN_ANCHOR
def run(native_bundle=None):
@@ -0,0 +1,57 @@
#!/usr/bin/env python3
"""Read-only authority controls; no Git writes, engine or acceptance execution."""
import copy
import importlib.util
import json
from pathlib import Path
import sys
from unittest.mock import patch
sys.dont_write_bytecode = True
ROOT = Path(__file__).resolve().parents[5]
spec = importlib.util.spec_from_file_location('p04_authority', ROOT / 'tools/check_p04_order_evidence.py')
gate = importlib.util.module_from_spec(spec)
spec.loader.exec_module(gate)
def run():
results = []
original = gate.load(ROOT / gate.DOC_SCOPE / 'D05_REMAINING_APPROVAL.json')
source = gate.git_bytes('show', 'c0ea009b28a7649aca6a433a1a24dc0be5e7ab81:' +
'docs/plans/original-completion-2026-10-02/execution/' +
'p04-01-owner-approval-20261018/D05_ACTUAL_HUMAN_APPROVAL.json')
import hashlib
assert all(row['sha256'] == hashlib.sha256(source).hexdigest()
for row in original['source_bindings'])
human = {row['id']: row for row in json.loads(source)['approved']}
for choice in original['approved_choices']:
assert all(choice[k] == human[choice['source_id']][k]
for k in ('answer_exact', 'approved_question_policy'))
for ref, (relative, digest) in gate.OWNER_BINDINGS.items():
entry = {'source': relative, 'status': 'approved'}
path = ROOT / relative
gate.owner_authority(ref, entry, path)
results.append({'id': ref, 'case': 'positive', 'result': 'accepted'})
for label in ('missing', 'wrong_hash', 'pending', 'wrong_path'):
changed = copy.deepcopy(entry)
if label == 'missing':
changed = {}
elif label == 'pending':
changed['status'] = 'pending'
elif label == 'wrong_path':
changed['source'] = gate.DOC_SCOPE + 'D05_REMAINING_ORDER_CANDIDATE.json'
try:
if label == 'wrong_hash':
with patch.object(gate, 'sha', return_value='0' * 64):
gate.owner_authority(ref, changed, path)
else:
gate.owner_authority(ref, changed, path)
except ValueError as exc:
results.append({'id': ref, 'case': label, 'result': 'rejected', 'error': str(exc)})
else:
raise AssertionError('negative accepted: ' + ref + ':' + label)
return {'scope': 'authority fixtures only; no native or acceptance proof', 'results': results}
if __name__ == '__main__':
print(json.dumps(run(), ensure_ascii=False, indent=2))
@@ -0,0 +1,82 @@
#!/usr/bin/env python3
"""Candidate structure controls; no provenance or whole-role/native credit."""
import argparse
import importlib.util
import json
from pathlib import Path
import subprocess
import sys
import tempfile
sys.dont_write_bytecode = True
ROOT = Path(__file__).resolve().parents[5]
def load_gate():
spec = importlib.util.spec_from_file_location('candidate_gate', ROOT / 'tools/check_p04_order_evidence.py')
gate = importlib.util.module_from_spec(spec)
spec.loader.exec_module(gate)
return gate
def expected_candidate(commit, tree, main, submitted, composed):
return {'structure_qualified': True, 'provenance_verified_by_checker': False,
'provenance_owner': 'actual Runner.prepare_integration/integrate and Root normal_c_join AFTER final before original credit',
'join': {'C': commit, 'S': submitted, 'M': main, 'C_tree': tree, 'Q': composed}}
def run_pure():
"""Three identity negatives and one exact positive; no Git or engine."""
gate = load_gate()
commit = '1111111111111111111111111111111111111111'
tree = '2222222222222222222222222222222222222222'
submitted = '3333333333333333333333333333333333333333'
other = '4444444444444444444444444444444444444444'
for args in ((commit, other, gate.MAIN_ANCHOR, submitted, tree),
(commit, tree, other, submitted, tree),
(submitted, tree, gate.MAIN_ANCHOR, submitted, tree)):
try:
gate.qualify_normal_candidate(*args)
except ValueError as exc:
assert str(exc) == 'normal candidate identity mismatch', str(exc)
else:
raise AssertionError('invalid candidate structure qualified')
args = (commit, tree, gate.MAIN_ANCHOR, submitted, tree)
assert gate.qualify_normal_candidate(*args) == expected_candidate(*args)
return {'scope': 'pure structure only', 'negative_controls': 3,
'exact_positive_controls': 1, 'formal_acceptance': False}
def run():
gate = load_gate()
env = gate.git_environment()
env.update(GIT_AUTHOR_NAME='P04 isolated fixture', GIT_AUTHOR_EMAIL='fixture@invalid',
GIT_COMMITTER_NAME='P04 isolated fixture', GIT_COMMITTER_EMAIL='fixture@invalid')
with tempfile.TemporaryDirectory(prefix='p04-candidate-fixture-', dir='/tmp') as temp:
repo = Path(temp) / 'objects.git'
assert not repo.resolve().is_relative_to(ROOT.resolve())
subprocess.run(['git', '-c', 'core.hooksPath=/dev/null', 'clone', '--bare', '--shared',
str(ROOT), str(repo)], env=env, check=True, capture_output=True)
def git(*args):
return subprocess.check_output(['git', '-c', 'core.hooksPath=/dev/null', *args],
cwd=repo, env=env, text=True).strip()
submission = git('rev-parse', 'HEAD')
main = gate.MAIN_ANCHOR
tree = git('merge-tree', '--write-tree', main, submission)
synthetic = git('commit-tree', tree, '-p', main, '-p', submission,
'-m', 'synthetic C; no Root qualification')
assert git('show', '-s', '--format=%P', synthetic).split() == [main, submission]
assert git('rev-parse', synthetic + '^{tree}') == tree
result = gate.qualify_normal_candidate(synthetic, tree, main, submission, tree)
assert result == expected_candidate(synthetic, tree, main, submission, tree)
return {'scope': 'isolated candidate structure only; provenance remains external',
'synthetic_equal_parents_and_tree': result, 'formal_acceptance': False}
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--pure-only', action='store_true', help='no Git, engine or scratch directory')
args = parser.parse_args()
print(json.dumps(run_pure() if args.pure_only else run(), indent=2))
@@ -108,6 +108,25 @@ def run(build):
# S4 is deliberately unavailable until the single Root collection exists.
# Never substitute B1 or manufacture a positive raw fixture for it.
s4 = series.S4Series(build)
current_wrapper = series.digest((series.HERE / 's4/run_s4_native.py').read_bytes())
historical_wrapper = series.S4_HISTORICAL_WRAPPER_SHA256
series.verify_s4_wrapper(historical_wrapper, historical=True)
series.verify_s4_wrapper(current_wrapper, historical=False)
reject('historical_receipt_checked_against_current_wrapper',
lambda: series.verify_s4_wrapper(historical_wrapper, historical=False))
reject('current_wrapper_used_as_historical_receipt',
lambda: series.verify_s4_wrapper(current_wrapper, historical=True))
reject('fresh_receipt_carrying_historical_pin',
lambda: series.verify_s4_wrapper(historical_wrapper, historical=False))
original_read_bytes = Path.read_bytes
def tampered_pin(path):
data = original_read_bytes(path)
return data + b'\n' if path == series.S4_HISTORICAL_WRAPPER else data
with patch.object(Path, 'read_bytes', tampered_pin):
reject('tampered_historical_pinned_copy',
lambda: series.verify_s4_wrapper(historical_wrapper, historical=True))
series.power_stop(s4)
results.append({'case': 'S4_real_NO_POWER_positive', 'result': 'accepted'})
s4_value = s4.value
@@ -5,6 +5,7 @@ import hashlib
import importlib.util
import json
import os
import py_compile
from pathlib import Path
import subprocess
import sys
@@ -23,9 +24,10 @@ def run():
results = []
with tempfile.TemporaryDirectory(prefix='.checker-fixtures-', dir=Path(__file__).parent) as temp:
base = Path(temp)
# Keep py_compile output inside allowed_paths; delete with the fixture.
env = dict(os.environ, PYTHONPYCACHEPREFIX=str(base / 'pycache'))
subprocess.run(['python3', '-m', 'py_compile', str(CHECKER)], env=env, check=True)
# Generated bytecode belongs in allocated build, never tracked docs.
build = Path(os.environ['BUILD_OUTPUT_DIR']).resolve(strict=True)
with tempfile.TemporaryDirectory(prefix='p04-compile-', dir=build) as compiled:
py_compile.compile(str(CHECKER), cfile=str(Path(compiled) / 'checker.pyc'), doraise=True)
evidence = base / 'p04-evidence'
evidence.mkdir()
artifacts = {}
@@ -48,10 +50,13 @@ def run():
add('decisions', (ROOT / 'docs/DESIGN_DECISIONS.md').read_bytes(), 'authority')
add('a01', (ROOT / 'docs/plans/original-completion-2026-10-02/execution/p04-01-input-r01/ORDER_CONTRACT_DRAFT.md').read_bytes(), 'authority')
add('owner', (ROOT / 'docs/plans/original-completion-2026-10-02/execution/p04-01/D05_OWNER_APPROVAL.json').read_bytes(), 'authority')
add('remaining_owner', (ROOT / gate.DOC_SCOPE / 'D05_REMAINING_APPROVAL.json').read_bytes(), 'authority')
authority = {ref: dict(status='approved', artifact_id=(
'owner' if ref.startswith('D05-P04-') else 'baseline' if ref.startswith('BASELINE:')
('owner' if gate.OWNER_BINDINGS[ref][0].endswith('/D05_OWNER_APPROVAL.json') else 'remaining_owner') if ref.startswith('D05-P04-') else 'baseline' if ref.startswith('BASELINE:')
else 'decisions' if ref == 'D-034' else 'a01'))
for _, refs, _ in gate.REQUIRED.values() for ref in refs}
for ref, (relative, digest) in gate.OWNER_BINDINGS.items():
authority[ref]['source'] = relative
add('stdout', b'SYNTHETIC fixture log', 'stdout')
add('native_log', b'SYNTHETIC fixture log', 'native_log')
domains = {d: dict(source_refs=[dict(path='autoload/simulation_runtime.gd', function='_advance_facilities',
@@ -23,8 +23,11 @@ def run(build, evidence):
for name in ('GIT_DIR', 'GIT_WORK_TREE', 'GIT_INDEX_FILE', 'GIT_OBJECT_DIRECTORY',
'GIT_ALTERNATE_OBJECT_DIRECTORIES'):
env.pop(name, None)
with tempfile.TemporaryDirectory(prefix='p04-role-fixtures-', dir=build) as temp:
# Never let a task build path put Git objects inside the source repository.
# /tmp is explicit so an inherited TMPDIR cannot redirect writes into it.
with tempfile.TemporaryDirectory(prefix='p04-role-fixtures-', dir='/tmp') as temp:
base = Path(temp)
assert not base.resolve().is_relative_to(ROOT.resolve())
checkout = base / 'checkout'
subprocess.run(['git', 'clone', '--shared', '--no-checkout', str(ROOT), str(checkout)],
env=env, check=True, capture_output=True)
@@ -33,7 +36,7 @@ def run(build, evidence):
return subprocess.check_output(['git', '-c', 'core.hooksPath=/dev/null', *args], cwd=checkout, env=env).decode().strip()
actual = git('rev-parse', 'HEAD')
anchor = '9b1a18c1eb25ca1300dcd59da78423c0dda2f498'
anchor = 'c0ea009b28a7649aca6a433a1a24dc0be5e7ab81'
ancestry = subprocess.run(['git', 'merge-base', '--is-ancestor', anchor, actual], cwd=checkout, env=env)
submission = git('show', '-s', '--format=%P', actual).split()[1] if ancestry.returncode == 0 else actual
git('checkout', '--detach', submission)
@@ -49,7 +52,7 @@ def run(build, evidence):
' g.verify_roles(json.loads(Path(sys.argv[1]).read_text()),Path(sys.argv[2]))\n')
index_path = base / 'index.json'
def check(name, index=None, positive=False, full=False):
def check(name, index=None, positive=False, full=False, no_context_gap=False):
index_path.write_text(json.dumps(original if index is None else index))
if full:
directory = base / name
@@ -61,8 +64,12 @@ def run(build, evidence):
command = [sys.executable, str(probe), str(index_path), str(build)]
process_env = env
process = subprocess.run(command, cwd=checkout, env=process_env, capture_output=True, text=True)
assert (process.returncode == 0) == positive, (name, process.stdout, process.stderr)
results.append({'case': name, 'result': 'accepted' if positive else 'rejected',
if no_context_gap:
assert 'qualification context gap' not in process.stderr, (name, process.stderr)
if positive is not None:
assert (process.returncode == 0) == positive, (name, process.stdout, process.stderr)
results.append({'case': name, 'result': 'command_completed' if process.returncode == 0 else 'command_rejected',
'returncode': process.returncode, 'formal_acceptance': False,
'stdout': process.stdout, 'stderr': process.stderr})
check('real_submission_positive', positive=True)
@@ -101,8 +108,23 @@ def run(build, evidence):
git('checkout', '--detach', anchor)
git('merge', '--no-ff', '--no-edit', submission)
merged = git('rev-parse', 'HEAD')
check('real_integration_positive', positive=True)
check('real_final_positive', positive=True)
# A normal commit C cannot be relabelled as tested non-production Q.
changed = copy.deepcopy(original)
changed['product_binding']['tested_product'] = merged
check('normal_C_cannot_impersonate_Q', changed)
changed = copy.deepcopy(original)
changed['product_binding']['tested_product'] = git('rev-parse', anchor + '^{tree}')
check('main_tree_cannot_impersonate_Q', changed)
# A merge made by this fixture has no independent normal-C provenance.
# Structure qualifies; provenance and credit remain external.
check('unqualified_merge_structure', positive=True, no_context_gap=True)
check('unqualified_merge_downstream', positive=None, full=True, no_context_gap=True)
synthetic = git('commit-tree', git('rev-parse', merged + '^{tree}'),
'-p', anchor, '-p', submission, '-m', 'synthetic normal C')
git('checkout', '--detach', synthetic)
check('synthetic_identical_parents_tree_structure', positive=True, no_context_gap=True)
check('synthetic_identical_parents_tree_downstream', positive=None, full=True, no_context_gap=True)
git('checkout', '--detach', merged)
game.unlink()
git('add', '-u')
git('commit', '--amend', '--no-edit')
@@ -113,7 +135,8 @@ def run(build, evidence):
changed = copy.deepcopy(original)
changed['conditions']['power_stop']['required_measurements']['charges'] = 9
check('forged_index', changed, full=True)
return {'scope': 'fixture controls only', 'results': results}
return {'scope': 'fixture controls only', 'formal_acceptance': False,
'condition_credit': 0, 'results': results}
if __name__ == '__main__':
@@ -19,6 +19,9 @@ import p04_native_series as s
def run(build):
results = []
assert set(s.FRESH_RUNS) == {'s1', 's2a', 's2b', 's3', 's4', 's5'}
assert all(callable(getattr(s, 'verify_fresh_' + name)) for name in s.FRESH_RUNS)
results.append({'series': 'fresh', 'class': 'fresh_roster_and_entrypoints', 'result': 'pass'})
def reject(series, name, action):
try:
@@ -2,6 +2,7 @@
"""Deterministic reference-only Stage R collector; never writes the final index."""
import argparse
import json
import re
from pathlib import Path
import shutil
import sys
@@ -14,28 +15,35 @@ def encoded(value):
return (json.dumps(value, sort_keys=True, indent=2, ensure_ascii=False) + '\n').encode()
def collect(build):
def collect(build, fresh=None):
build = Path(build).absolute()
destination = build / 'audit-support/p04-raw-collect-r22'
if fresh is not None:
series.require(re.fullmatch(r'q[0-9]+', fresh) is not None, 'fresh collection must be q<N>')
destination = build / ('audit-support/p04-raw-collect-' + fresh if fresh else 'audit-support/p04-raw-collect-r22')
series.require(not destination.exists() and not destination.is_symlink(), 'collection destination already exists')
for p in (destination.parent, *destination.parents):
series.require(not p.is_symlink(), 'collection parent symlink')
payloads = {}
bindings = {}
for name in series.RUNS:
result = getattr(series, 'verify_' + name)(build)
for name in (series.FRESH_RUNS if fresh else series.RUNS):
result = getattr(series, ('verify_fresh_' if fresh else 'verify_') + name)(build)
result['verifier_sha256'] = series.digest(Path(series.__file__).read_bytes())
data = encoded(result)
filename = name + '.json'
payloads[filename] = data
bindings[name] = {'path': filename, 'bytes': len(data), 'sha256': series.digest(data),
'relocation_manifest_sha256': series.MANIFEST_SHA256}
**({} if fresh else {'relocation_manifest_sha256': series.MANIFEST_SHA256})}
manifest = {'protocol': 'p04-native-series-collection-v1', 'formal_acceptance': False,
'stage_A': 'candidate binding stage A pending', 'series': bindings,
'relocation_manifest_sha256': series.MANIFEST_SHA256,
'relocation_manifest': 'audit-support/p04-r17-full-inputs-r01/MANIFEST.json',
'collector_sha256': series.digest(Path(__file__).read_bytes()),
'large_payloads_copied': 0}
if fresh:
manifest = {'protocol': 'p04-fresh-native-series-collection-v1', 'series': bindings,
'collection': fresh, 'formal_acceptance': False,
'collector_sha256': series.digest(Path(__file__).read_bytes()),
'historical_merged': False, 'large_payloads_copied': 0}
payloads['MANIFEST.json'] = encoded(manifest)
estimate = sum(len(v) for v in payloads.values())
# The estimate precedes all writes. Reserve extra directory/allocation space.
@@ -54,8 +62,10 @@ def collect(build):
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--build', type=Path, required=True)
parser.add_argument('--fresh', metavar='qN')
try:
collect(parser.parse_args().build)
args = parser.parse_args()
collect(args.build, args.fresh)
except (ValueError, OSError, KeyError, TypeError) as exc:
print(json.dumps({'collected': False, 'error': str(exc)}))
sys.exit(1)
@@ -0,0 +1,250 @@
#!/usr/bin/env python3
"""Read-only full Q verification. No normal-C join and no acceptance from counts."""
import hashlib
import importlib.util
import json
from pathlib import Path
def require(value, message):
if not value:
raise ValueError(message)
def module(name, path):
spec = importlib.util.spec_from_file_location(name, path)
result = importlib.util.module_from_spec(spec)
spec.loader.exec_module(result)
return result
def sha(path):
return hashlib.sha256(Path(path).read_bytes()).hexdigest()
def content(refs):
return {name: {key: row[key] for key in ('bytes', 'sha256')} for name, row in refs.items()}
def roster_gate(expected, actual):
require(len(expected) == len(set(expected)) and actual == expected, 'missing/extra/reordered suite')
def pid_gate(row, start, end, owner):
pid = row['actual_pid']
require(type(pid) is int and pid > 0 and start['actual_pid'] == end['actual_pid'] == pid
and row['native_process']['pid'] == pid, 'PID mismatch')
require(start['owner_pid'] == end['owner_pid'] == owner
and start['current_process_identity']['pid'] == pid
and start['current_process_identity']['ppid'] == owner, 'PID owner')
require(start['command'] == end['command'] == row['command'] == row['native_process']['argv'], 'PID argv')
require(start['monotonic_ns'] < end['monotonic_ns'] and end['engine_ended'] is True
and end['exit_code'] == end['actual_process_exit_code'] == 0
and end['timed_out'] is False and end['lifecycle_error'] is None, 'PID end')
def cleanup_gate(rows, count):
require(len(rows) == count, 'cleanup roster')
for row in rows:
cleanup = row['cleanup']
require(row['engine_ended'] is True and row['outer_cleanup_errors'] == []
and cleanup['engine_ended'] is True and cleanup['errors'] == []
and cleanup['actual_process_exit_code'] == 0, 'dirty cleanup')
require(cleanup['attempts'], 'cleanup attempts')
for attempt in cleanup['attempts']:
require(attempt['errors'] == [] and attempt['kill_attempted'] is False
and attempt['wait_completed'] is True and attempt['wait_returned_code'] == 0,
'dirty cleanup wait')
def settings_gate(before, after, selected):
for name in ('project.godot', 'export_presets.cfg'):
require(before[name] == after[name] == selected[name], 'settings drift: ' + name)
def controls():
"""Pure contract negatives, independent of native success or test totals."""
import copy
results = []
def reject(name, callback):
try:
callback()
except ValueError:
results.append(name)
return
raise ValueError('negative accepted: ' + name)
roster_gate(['a', 'b'], ['a', 'b'])
reject('missing-suite', lambda: roster_gate(['a', 'b'], ['a']))
reject('extra-suite', lambda: roster_gate(['a', 'b'], ['a', 'b', 'c']))
row = {'actual_pid': 1, 'native_process': {'pid': 2}}
reject('PID-mismatch', lambda: pid_gate(row, {'actual_pid': 1}, {'actual_pid': 1}, 9))
dirty = [{'engine_ended': False, 'outer_cleanup_errors': [], 'cleanup': {}}]
reject('dirty-cleanup', lambda: cleanup_gate(dirty, 1))
source = {name: {'bytes': 1, 'sha256': 'a'} for name in ('project.godot', 'export_presets.cfg')}
settings_gate(source, source, source)
changed = copy.deepcopy(source)
changed['project.godot']['sha256'] = 'b'
reject('settings-drift', lambda: settings_gate(source, changed, source))
return {'controls': results, 'native_run': False, 'formal_acceptance': False}
def verify(root, run, required):
root, run = Path(root).resolve(strict=True), Path(run).resolve(strict=True)
references = {}
def read(relative):
require(not Path(relative).is_absolute() and '..' not in Path(relative).parts, 'full raw traversal')
path = run / relative
require(path.is_file() and all(not p.is_symlink() for p in (path, *path.parents)), 'full raw ordinary file')
data = path.read_bytes()
references[relative] = {'bytes': len(data), 'sha256': hashlib.sha256(data).hexdigest()}
return data
def load(relative):
return json.loads(read(relative))
full = module('p04_actual_q_full', root / 'tools/run_all_tests.py')
wrapper = module('p04_full_uid', Path(__file__).parent / 's5/run_s5_native.py')
source = full.source_refs(root)
before = load('source-start.json')
after = full.source_refs(root)
require(before == source == after, 'full source before/after/current')
roster = full.roster(root)
parse_paths = ['res://' + n for n in sorted(source) if n.endswith('.gd')]
inputs, ended = load('runner-input.json'), load('runner-ended.json')
roster_gate(roster, inputs['roster'])
require(inputs['selected_source_map'] == {n: p['sha256'] for n, p in source.items()}, 'full exact Q source map')
settings_gate(content(before), content(after), content(source))
require(inputs['runner_sha256'] == sha(root / 'tools/run_all_tests.py')
and inputs['marker_module_sha256'] == sha(root / 'tools/strict_test_markers.py'), 'actual runner/marker module')
engine = wrapper.engine_pin(Path(inputs['engine']))
require(inputs['engine_sha256'] == engine['sha256'], 'full engine pin')
require(ended['passed'] is True and ended['error'] is None
and ended['cleanup_errors'] == ended['guard_errors'] == [] and ended['engine_ended'] is True,
'full run failed')
require(inputs['run_id'] == ended['run_id'] and inputs['owner_runner_pid'] == ended['owner_runner_pid'], 'full run identity')
require(inputs['default_player_before'] == ended['default_player_after'], 'protected profile changed')
markers = module('p04_full_markers', root / 'tools/strict_test_markers.py')
contract_path = root / wrapper.C_REL
require(sha(contract_path) == inputs['marker_contract_sha256'], 'full contracts SHA')
contracts = markers.load_contracts(contract_path)
policy_path = full.SUPPORT / 'suite-policy.json'
policy = full.read(policy_path)
require(source['tools/regression/suite-policy.json']['sha256'] == sha(policy_path), 'source-bound full policy')
full.policy_coverage(roster, source, policy)
diagnostics = module('p04_full_diagnostics', full.SUPPORT / 'diagnostic_gate.py')
native = module('p04_full_native', full.SUPPORT / 'owned_diagnostic_process.py')
owners = module('p04_full_owners', full.SUPPORT / 'ordinary_proof_gate.py')
audio = module('p04_full_audio', full.SUPPORT / 'audio_evidence_gate.py')
sequence = [('import', None), ('parse', None)] + [(str(i).zfill(3), n) for i, n in enumerate(roster)]
require([(p['phase'], p['test']) for p in ended['phases']] == sequence, 'entire derived phase roster')
all_tests = load('all-tests.json')
require(references['all-tests.json']['sha256'] == ended['all_tests_sha256'], 'full all-tests SHA')
roster_gate(roster, [p['test'] for p in all_tests])
require(load('parse-paths.json') == parse_paths, 'complete parse roster')
uid_plan, uid_snapshot, binding = wrapper.load_uid_helper(root, full, source)
plan = uid_plan(source)
accepted = load('accepted-uids.json')
require(load('uid-plan.json') == plan, 'derived full UID plan')
generated, pids, suite_rows = {}, [], {}
for index, (label, test) in enumerate(sequence):
row = load(label + '-receipt.json')
enriched = dict(row)
if test:
enriched.update(sequence=index - 2, godot=inputs['engine'])
require(enriched == all_tests[index - 2], 'full test raw row join')
require(enriched == ended['phases'][index] and row['passed'] is True and row['failed'] is False
and row['validation_error'] is None and not row.get('guard_error')
and row['default_player_entire_profile_unchanged'] is True, 'full phase guards')
process = load(label + '/process.json')
require(process == row['native_process'], 'native process receipt binding')
pid_gate(row, load(label + '/started.json'), load(label + '/ended.json'), inputs['owner_runner_pid'])
pids.append(row['actual_pid'])
stdout, stderr, logger = [read(label + '/' + name).decode() for name in ('stdout.log', 'stderr.log', 'engine-native.log')]
require(references[label + '/stdout.log']['sha256'] == process['stdout_sha256']
and references[label + '/stderr.log']['sha256'] == process['stderr_sha256'], 'full streams SHA')
require(all(references[label + '/engine-native.log'][k] == row['raw_native_log'][k]
for k in ('bytes', 'sha256')), 'native logger pin')
raw = stdout + stderr
require(read(row['log']).decode() == raw and references[row['log']]['sha256'] == row['log_sha256'], 'full raw log join')
review = diagnostics.review_streams(native, {'stdout': stdout, 'stderr': stderr, 'native_file': logger},
test, root / test if test else None)
require(review == row['finite_original_diagnostic_review']
and diagnostics.diagnostic_result_gate(process, review)
and full.process_gate(process, review['allowed_e31_error_lines']), 'full strict diagnostics')
require(row['outer_actual_capture']['passed'] is True
and row['outer_actual_capture']['foreign_process_or_group_signals'] == 0, 'owned capture')
if test:
parsed = markers.parse_raw(test, raw, contracts, source[test]['sha256'])
require(parsed == row['completion'] and parsed['passed'] is True and parsed['failures'] == 0,
'literal source-bound marker')
require(row['policy'] == full.phase_policy(test, root / test, policy['suite_policies']), 'phase policy drift')
p = row['policy']
route = policy['outside_routes'].get(test)
if route:
require(full.routed_report(run / (label + '-evidence'), route, test, row['actual_pid'], raw,
run / 'stage', source[test]['sha256']) == row['outside_report'],
'full routed proof')
proof = run / (label + '-teardown')
if p['ordinary_cleanup_prepared']:
require(owners.ordinary_gate(proof, row['actual_pid'], run, p['ordinary_control_labels']) ==
row['ordinary_owner_pairs'], 'full ordinary ownership proof')
if p['old_bounded_teardown'] or test == 'tests/ui/test_ui_audio_feedback.gd':
require(audio.teardown_gate(proof, row['actual_pid'], run) == row['old_bounded_proof'],
'full bounded teardown proof')
if test == 'tests/ui/test_ui_audio_feedback.gd':
audio_dir = run / (label + '-audio-proof')
require(audio.command_gate(audio_dir / 'actual-command-result-buffer-proof.json', audio_dir,
row['actual_pid']) == row['actual_command_evidence'], 'full audio commands')
require(audio.ogg_gate(audio_dir / 'actual-ogg-decode-player-state.json', row['actual_pid'],
inputs['selected_source_map']) == row['actual_ogg_evidence'], 'full actual OGG')
suite_rows[test] = {'phase': label, 'pid': row['actual_pid'], 'source_sha256': source[test]['sha256'],
'marker': parsed, 'log_sha256': row['log_sha256']}
if label == 'parse':
require(row['actual_parse_checks'] == len(parse_paths), 'derived parse count')
uid = load(label + '-uids.json')
require(uid.get('error') is None and uid['before'] == ({} if label == 'import' else accepted)
and uid['after'] == accepted, 'full phase UID seals')
for kind in ('startup', 'runtime'):
snapshot = row.get('whole_' + kind + '_profile_after')
if snapshot:
require(full.inventory(run / 'profiles' / label / kind) == snapshot['files'],
'complete retained private profile')
for name, descriptor in row['generated_reports'].items():
require(name not in source and name not in generated, 'unique generated report')
pin = {k: descriptor[k] for k in ('bytes', 'sha256')}
read('stage/' + name)
require(references['stage/' + name] == pin, 'generated report raw')
generated[name] = pin
require(len(set(pids)) == len(sequence) and pids == ended['actual_captured_PIDs'], 'all full unique PIDs')
cleanup_gate(ended['final_owned_cleanup'], len(sequence))
require(uid_snapshot(run / 'stage', dict(content(source), **generated), plan) == accepted, 'retained exact stage/UID/settings')
totals = full.totals(all_tests, roster)
require(all(ended[k] == v for k, v in totals.items()) and not totals['remaining_unexecuted_tests']
and not totals['missing_marker_paths'], 'recomputed full totals')
kitchen = [n for n in roster if Path(n).name == 'test_required_kitchen.gd']
require(len(kitchen) == 1, 'separate required-kitchen roster binding')
# A suite pass supplies exact-version applicability, not domain boundary proof.
conditions = {name: {'status': 'pending_boundary_raw', 'full_suite_applicable': True}
for name in sorted(set(required) | {'EV'})}
return {'verified': True, 'suites': len(roster), 'parse_files': len(parse_paths),
'source_files': len(source), 'totals': totals, 'owned_pids': pids,
'required_kitchen': dict(suite_rows[kitchen[0]], test=kitchen[0]),
'conditions': conditions, 'references': references, 'source_sha256': inputs['selected_source_map'],
'policy_sha256': sha(policy_path), 'engine_sha256': engine['sha256'],
'normal_c_join': 'Root post-final only', 'formal_acceptance': False}
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--controls', action='store_true')
parser.add_argument('--root', type=Path)
parser.add_argument('--run', type=Path)
args = parser.parse_args()
if args.controls:
print(json.dumps(controls(), sort_keys=True))
else:
require(args.root is not None and args.run is not None, 'root and run required')
gate = module('full_required_membership', args.root / 'tools/check_p04_order_evidence.py')
print(json.dumps(verify(args.root, args.run, gate.REQUIRED), sort_keys=True))
@@ -0,0 +1,132 @@
#!/usr/bin/env python3
"""Root-only, read-only join of actual Runner records; never grants acceptance.
Root must select the real Runner state.sqlite, not a hand-written export. This
checks consistency, not authenticity of an arbitrary caller-supplied database.
No Git, engine, Runner API, SQL mutation or temporary file is used.
Root retains a read-only Runner snapshot taken after approve; integrate deletes
the live approval. Final evidence is read separately from the current database.
"""
import argparse
import hashlib
import json
from pathlib import Path
import re
import sqlite3
MAIN = "c0ea009b28a7649aca6a433a1a24dc0be5e7ab81"
SPEC = "9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881"
def require(value, message):
if not value:
raise ValueError(message)
def unique(pairs):
out = {}
for key, value in pairs:
require(key not in out, "duplicate JSON key")
out[key] = value
return out
def read(path, hashes):
path = Path(path)
require(path.is_file() and not path.is_symlink(), "ordinary record required: " + str(path))
require("normal-candidate-example" not in path.parts, "format samples are not authority")
data = path.read_bytes()
hashes[str(path)] = hashlib.sha256(data).hexdigest()
result = json.loads(data, object_pairs_hook=unique)
require(isinstance(result, dict) and not result.get("example_only_not_P04_authority"), "actual record required")
return result
def verify(database, approved_database, candidate, submission, hashes):
for sha in (candidate, submission):
require(re.fullmatch(r"[0-9a-f]{40}", sha), "full commit SHA required")
database = database.resolve(strict=True)
require(database.is_file(), "Runner database required")
# mode=ro deliberately reads live WAL consistently; immutable=1 would hide it.
with sqlite3.connect(database.as_uri() + "?mode=ro", uri=True) as db:
db.row_factory = sqlite3.Row
db.execute("PRAGMA query_only=ON")
db.execute("BEGIN")
task = db.execute("SELECT * FROM tasks WHERE id=?", ("P04-01",)).fetchone()
require(task is not None, "Runner task missing")
require(task["submitted"] == submission and task["candidate"] == candidate
and task["main_base"] == MAIN and candidate != submission,
"Runner candidate/submission/main_base mismatch")
require(task["state"] in ("approved", "completed"), "Runner approval state required")
contract = json.loads(task["contract"], object_pairs_hook=unique)
require(contract["id"] == "P04-01" and contract["spec_sha256"] == SPEC
and contract["validation_ids"] == ["p04-acceptance"]
and contract["acceptance_ids"] == ["P04-01"], "immutable contract mismatch")
approved_database = approved_database.resolve(strict=True)
with sqlite3.connect(approved_database.as_uri() + "?mode=ro", uri=True) as approved:
approved.row_factory = sqlite3.Row
approved.execute("PRAGMA query_only=ON")
approved.execute("BEGIN")
approved_task = approved.execute("SELECT * FROM tasks WHERE id=?", ("P04-01",)).fetchone()
require(approved_task is not None and approved_task["state"] == "approved"
and all(approved_task[k] == task[k] for k in ("submitted", "candidate", "main_base", "contract")),
"Root-retained actual approved Runner snapshot mismatch")
approval = approved.execute("SELECT * FROM approvals WHERE task_id=?", ("P04-01",)).fetchone()
require(approval is not None and approval["candidate"] == candidate
and approval["main_base"] == MAIN and approval["owner"].strip(), "exact Runner approval required")
rows = []
for kind, sha in (("validation", submission), ("review", submission),
("integration", candidate), ("final", candidate)):
records = db.execute("SELECT * FROM evidence WHERE task_id=? AND kind=? AND commit_sha=? AND passed=1",
("P04-01", kind, sha)).fetchall()
require(records, "Runner evidence missing: " + kind)
for record in records:
value = read(record["artifact"], hashes)
require(value.get("task_id") == "P04-01" and value.get("commit") == sha, "evidence identity mismatch")
if kind == "review":
require(value.get("status") == "pass" and value.get("acceptance_ids") == ["P04-01"], "independent review failed")
require(isinstance(value.get("findings"), list) and all(
f.get("severity") == "low" for f in value["findings"]), "review finding blocks join")
else:
require(value.get("kind") == kind and value.get("passed") is True, "verification kind/result mismatch")
checks = value.get("checks")
require(isinstance(checks, list) and len(checks) == 1, "exact validation roster required")
check = checks[0]
require(check.get("id") == "p04-acceptance" and type(check.get("exit_code")) is int
and check["exit_code"] == 0 and check.get("passed") is True, "failed validation check")
artifact = Path(check["artifact"])
require(artifact.is_dir(), "registered validation artifact directory missing")
for name in ("command.json", "stdout.log", "stderr.log"):
path = artifact / name
require(path.is_file() and not path.is_symlink(), "registered validation log missing")
hashes[str(path)] = hashlib.sha256(path.read_bytes()).hexdigest()
rows.append(dict(record))
# Hash the logical transaction snapshot, not mutable SQLite/WAL bytes.
snapshot = dict(task=dict(task), approval=dict(approval), evidence=rows)
digest = hashlib.sha256(json.dumps(snapshot, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
return dict(protocol="p04-normal-c-runner-join-v1", runner_database=str(database),
approved_runner_database=str(approved_database),
runner_records_sha256=digest, join={"C": candidate, "S": submission, "M": MAIN},
runner_records_consistent=True, structure_verified=False,
source_Q_applicability_verified=False, input_sha256=hashes,
whole_goal_accepted=False, unit_accepted=False)
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--runner-db", type=Path, required=True)
parser.add_argument("--approved-runner-db", type=Path, required=True,
help="Root-retained actual Runner snapshot after approve, before integrate deletes approval")
parser.add_argument("--candidate", required=True)
parser.add_argument("--submission", required=True)
args = parser.parse_args()
try:
print(json.dumps(verify(args.runner_db, args.approved_runner_db, args.candidate, args.submission, {}), sort_keys=True))
except (OSError, ValueError, KeyError, TypeError, sqlite3.Error) as error:
print(json.dumps({"runner_records_consistent": False, "error": str(error), "whole_goal_accepted": False}))
return 1
return 0
if __name__ == "__main__":
raise SystemExit(main())
@@ -0,0 +1,85 @@
#!/usr/bin/env python3
"""Root-run synthetic boundary fixtures. Never P04 authority; no default scratch."""
import argparse
import importlib.util
import json
from pathlib import Path
import sqlite3
import sys
sys.dont_write_bytecode = True
HERE = Path(__file__).resolve().parent
spec = importlib.util.spec_from_file_location("normal_c_join", HERE / "normal_c_join.py")
join = importlib.util.module_from_spec(spec)
spec.loader.exec_module(join)
def fixture(root, change):
root.mkdir()
submission, candidate = "1" * 40, "2" * 40
contract = dict(id="P04-01", spec_sha256=join.SPEC,
validation_ids=["p04-acceptance"], acceptance_ids=["P04-01"])
db_path = root / "runner.sqlite"
with sqlite3.connect(db_path) as db:
db.executescript("CREATE TABLE tasks(id,contract,state,submitted,candidate,main_base);"
"CREATE TABLE approvals(task_id,candidate,main_base,owner,created);"
"CREATE TABLE evidence(id,task_id,kind,commit_sha,artifact,passed);")
db.execute("INSERT INTO tasks VALUES(?,?,?,?,?,?)",
("P04-01", json.dumps(contract), "approved", submission, candidate, join.MAIN))
db.execute("INSERT INTO approvals VALUES(?,?,?,?,?)", ("P04-01", candidate, join.MAIN, "fixture-only", 1.0))
for number, kind in enumerate(("validation", "review", "integration", "final")):
sha = submission if kind in ("validation", "review") else candidate
value = dict(task_id="P04-01", commit=sha)
if kind == "review":
value.update(status="pass", acceptance_ids=["P04-01"], findings=[])
if change == "medium":
value["findings"] = [{"severity": "medium", "message": "synthetic"}]
else:
logs = root / (kind + "-logs")
logs.mkdir()
for name in ("command.json", "stdout.log", "stderr.log"):
(logs / name).write_text("{}" if name.endswith("json") else "synthetic fixture only\n")
check = dict(id="p04-acceptance", exit_code=0, artifact=str(logs), passed=True)
value.update(kind=kind, passed=True, checks=[check])
if kind == "final":
if change == "wrong_C": value["commit"] = "3" * 40
if change == "kind_missing": del value["kind"]
if change == "failed_check": check["exit_code"] = 1
if change == "extra_id": value["checks"].append(dict(check, id="extra"))
if change == "missing_id": value["checks"] = []
if change == "task_mismatch": value["task_id"] = "P26-01"
if change == "missing_artifact": check["artifact"] = str(root / "missing")
artifact = root / (kind + ".json")
artifact.write_text(json.dumps(value))
db.execute("INSERT INTO evidence VALUES(?,?,?,?,?,?)", (number, "P04-01", kind, sha, str(artifact), 1))
if change == "wrong_M": db.execute("UPDATE tasks SET main_base=?", ("3" * 40,))
if change == "wrong_approval": db.execute("UPDATE approvals SET candidate=?", ("3" * 40,))
if change == "no_final": db.execute("DELETE FROM evidence WHERE kind='final'")
return db_path, submission, candidate
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--scratch", type=Path, required=True)
args = parser.parse_args()
root = args.scratch.resolve()
if root.exists() or root.is_relative_to(HERE.parents[4]) or root == Path("/tmp").resolve() or Path("/tmp").resolve() in root.parents:
raise ValueError("fresh external scratch required; /tmp and repository are prohibited")
root.mkdir(parents=True)
results = []
for name in ("positive", "wrong_C", "wrong_M", "kind_missing", "failed_check", "extra_id",
"missing_id", "task_mismatch", "medium", "missing_artifact", "wrong_approval", "no_final"):
path, submission, candidate = fixture(root / name, name)
try:
result = join.verify(path, path, candidate, submission, {})
if name != "positive" or result["whole_goal_accepted"] is not False:
raise AssertionError("unexpected qualification: " + name)
except ValueError:
if name == "positive": raise
results.append(name)
print(json.dumps(dict(synthetic_controls=results, whole_goal_accepted=False)))
return 0
if __name__ == "__main__":
raise SystemExit(main())
@@ -1,6 +1,6 @@
{
"revision": "repair29",
"status": "SOURCE-READY / NOTRUN; Root measurements separately recorded",
"revision": "repair30",
"status": "BLOCKED: partial implementation; no native admission",
"task_id": "P04-01",
"current_table": true,
"scope": {
@@ -14,166 +14,296 @@
],
"packages": 30,
"deliveries": 88,
"original_credit": "13/88 unchanged; P04 receives zero credit",
"original_credit": "16/88 formal; P04 receives zero credit",
"CurrentAlphaScope": "unchanged",
"main_9b": "frozen; nothing integrated"
"frozen_main": "c0ea009b28a7649aca6a433a1a24dc0be5e7ab81"
},
"domains": [
{
"domain": "閉店",
"normative_rule": "D-034: direct closure releases waiting requests and continues started service. Approved dependency closure holds progress/payment and preserves reservation/service ID until one completion.",
"normative_rule": "D-034 preserves started services on direct closure and releases waiting requests. Dependency closure stops progress and charging, retains reservations/service identity, and completes once after recovery. RELATED_FACILITY_INACTIVE wins over NO_POWER when both apply.",
"current_source": [
"Runtime _process_tick_commands:5743",
"FacilityService _prepare_service_for_tick:853",
"Runtime _release_closed_business_queues:12624"
{
"path": "autoload/simulation_runtime.gd",
"function": "_process_tick_commands",
"line": 5765,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "9de66a4bb84b12304300d49085f44546412319bd4aee91e67b61becf97e50294"
},
{
"path": "scripts/facility/facility_service.gd",
"function": "_prepare_service_for_tick",
"line": 853,
"sha256": "ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77",
"function_sha256": "b35c2c0fb23a04258b71995dd7c3b6dfacbbcdf36106e2e3348acef0e18d21cc"
},
{
"path": "autoload/simulation_runtime.gd",
"function": "_release_closed_business_queues",
"line": 12672,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "3a05fbe94877eeb750fb0d692501954555ab6a8005448ab3b6023dab9bad816b"
}
],
"evidence": "I native_bundle C; R/s2a.json; R/s3.json B1",
"approved_authority": [
"D-034",
"D05-P04-DEPENDENCY"
],
"pending_D05": [
"D05(a) simultaneous reason selection"
"D05-P04-DEPENDENCY",
"D05-P04-PAUSE-REASON"
],
"pending_D05": [],
"phase": "APPLY_COMMANDS / FACILITY_COMPLETION / FACILITY_QUEUES",
"relative_priority": "Command closure before completion; dependency hold during preparation; closed queue release after completion.",
"status": "approved",
"observation_status": "observed-current"
"status": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"historical_evidence": "I native_bundle C; R/s2a.json; R/s3.json B1",
"evidence": "Fresh exact-Q native proof pending; no old raw reused as Q",
"nativeWindows": "pending"
},
{
"domain": "停電",
"normative_rule": "BASELINE:183 mana depletion stops facilities. A legitimately power-stopped service must not progress/charge; retain reservation identity and complete once after recovery. This does not approve a simultaneous-cause priority.",
"normative_rule": "BASELINE:183 covers real mana depletion. Legitimately stopped service has no progress or charge and preserves reservations. D05-P04-PAUSE-REASON makes dependency closure the displayed reason when dependency closure and power loss coincide.",
"current_source": [
"Runtime _advance_mana:10694",
"FacilityService _prepare_service_for_tick:853"
{
"path": "autoload/simulation_runtime.gd",
"function": "_advance_mana",
"line": 10716,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "05c54626ce6e355acd92994ab80aaf2177c5cf194885e66934552139e087599e"
},
{
"path": "scripts/facility/facility_service.gd",
"function": "_prepare_service_for_tick",
"line": 853,
"sha256": "ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77",
"function_sha256": "b35c2c0fb23a04258b71995dd7c3b6dfacbbcdf36106e2e3348acef0e18d21cc"
}
],
"evidence": "R/s4.json; B/p04-s4-native-r28; R/s3.json B1 combined diagnostic",
"approved_authority": [
"BASELINE:183",
"P04-01 safety acceptance"
],
"pending_D05": [
"D05(a)"
"P04-01 safety acceptance",
"D05-P04-PAUSE-REASON"
],
"pending_D05": [],
"phase": "MANA → FACILITY_COMPLETION",
"relative_priority": "Projection before completion; RELATED chosen before NO_POWER.",
"status": "observed-current",
"observation_status": "observed-current",
"evidence_scope": "S4 probe calls disconnect_nodes directly: isolated NO_POWER, not global depletion. Global depletion appears only in S3 B1 combined diagnostic. S1 covers separate staff/EV safety."
"status": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"evidence_scope": "S4 probe calls disconnect_nodes directly: isolated NO_POWER, not global depletion. Global depletion appears only in S3 B1 combined diagnostic. S1 covers separate staff/EV safety.",
"historical_evidence": "R/s4.json; B/p04-s4-native-r28; R/s3.json B1 combined diagnostic",
"evidence": "Fresh exact-Q native proof pending; no old raw reused as Q",
"nativeWindows": "pending"
},
{
"domain": "破壊",
"normative_rule": "No charge while legitimately failed/stopped and no orphan reservation. Distinguish command destruction before facility processing from late INCIDENTS event destruction after completion; observation is not normative priority approval.",
"normative_rule": "Command destruction precedes completion. Accident/raid destruction follows completion and charging in minute N; that sale remains valid. Failure and reservation release for affected unfinished service occurs in N+1. D05-P04-DESTRUCTION is the authority, not BASELINE:183.",
"current_source": [
"Runtime _process_tick_commands:5743",
"_advance_defense:8577",
"_apply_defense_outcome_boundary:9804",
"FacilityService _prepare_service_for_tick:853"
{
"path": "autoload/simulation_runtime.gd",
"function": "_process_tick_commands",
"line": 5765,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "9de66a4bb84b12304300d49085f44546412319bd4aee91e67b61becf97e50294"
},
{
"path": "autoload/simulation_runtime.gd",
"function": "_advance_defense",
"line": 8599,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "db38b51531276d2620999d57eed7a6219b73f8b8d9ff3706cf569f4797918527"
},
{
"path": "autoload/simulation_runtime.gd",
"function": "_apply_defense_outcome_boundary",
"line": 9826,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "182c48282d96c6ccd1e5f636751db9de8cef2770ad433b291db89111c5fb5043"
},
{
"path": "scripts/facility/facility_service.gd",
"function": "_prepare_service_for_tick",
"line": 853,
"sha256": "ceb4a3e9224587423f273cdb2b56e6843ab176ac1fc4fe79dd498b5ed5c33b77",
"function_sha256": "b35c2c0fb23a04258b71995dd7c3b6dfacbbcdf36106e2e3348acef0e18d21cc"
}
],
"evidence": "R/s3.json B4a/B4b",
"approved_authority": [
"P04-01 safety acceptance (original); explicit destruction rule pending D05"
],
"pending_D05": [
"D05(b); BASELINE:183 is mana depletion, not destruction authority; destruction_stop registry correction only after approval"
"D05-P04-DESTRUCTION"
],
"pending_D05": [],
"phase": "APPLY_COMMANDS vs INCIDENTS_AND_EVENTS",
"relative_priority": "Command destruction before completion; incident destruction after completion: B4a charges25G then destroys in same tick; B4b next-tick failure/release.",
"status": "pending D05",
"observation_status": "observed-current"
"status": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"historical_evidence": "R/s3.json B4a/B4b",
"evidence": "Fresh exact-Q native proof pending; no old raw reused as Q",
"nativeWindows": "pending"
},
{
"domain": "退出",
"normative_rule": "Leave/abandon releases the owned reservation once; no orphan or duplicate charge. Preserve D-034. Completion, queue release and later normal despawn are distinct observations.",
"normative_rule": "D-034 release safety remains. Command exit precedes completion; AI planned exit follows completion and only applies to a deciding guest. Later despawn is distinct.",
"current_source": [
"Runtime _execute_leave_facility_queue:7553",
"_advance_guest_ai_decisions:8738"
{
"path": "autoload/simulation_runtime.gd",
"function": "_execute_leave_facility_queue",
"line": 7575,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "04733da2c6f9627e6d831f8bb6b620018d63305fe43bb927abf21a969288d90d"
},
{
"path": "autoload/simulation_runtime.gd",
"function": "_advance_guest_ai_decisions",
"line": 8760,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "e33b41294e88dba840affd5cc0a5c58fe5d46f5d98a80a8d5f4e907a3b9a7b93"
}
],
"evidence": "R/s3.json B2a/B2b/B3 and B1 departure history",
"approved_authority": [
"D-034",
"P04-01 safety acceptance"
],
"pending_D05": [
"D05(c)"
"P04-01 safety acceptance",
"D05-P04-EXIT"
],
"pending_D05": [],
"phase": "APPLY_COMMANDS vs AI_DECISIONS",
"relative_priority": "Command exit before completion/charging; AI PLANNED_EXIT after them; despawn later.",
"status": "pending D05",
"observation_status": "observed-current"
"status": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"historical_evidence": "R/s3.json B2a/B2b/B3 and B1 departure history",
"evidence": "Fresh exact-Q native proof pending; no old raw reused as Q",
"nativeWindows": "pending"
},
{
"domain": "課金",
"normative_rule": "No stopped charge; one sale per completed service and idempotent resend. Reservation consumption, actual sale and payment key must join by service ID and original priceSnapshot.",
"normative_rule": "Charge only completed service, once per idempotency key; retain original price snapshot and reservation/ledger joins. At 00:00 prior-day settlement and upkeep precede completion; the sale belongs to the new day.",
"current_source": [
"Runtime _advance_facility_upkeep:1855",
"_complete_service_transaction:11769",
"_apply_service_transaction:11785",
"coordinator _process_daily_close:1125"
{
"path": "autoload/simulation_runtime.gd",
"function": "_advance_facility_upkeep",
"line": 1876,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "33a969a14d1a15296059cecadc4bf7e5a35c9eb61d82cb9e2d6d9bbcf5c32c68"
},
{
"path": "autoload/simulation_runtime.gd",
"function": "_complete_service_transaction",
"line": 11817,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "f2b6e96a8eeef3dd3f8419b4d9d5ef4e1d13241600ce970bdd78a924428cac6c"
},
{
"path": "autoload/simulation_runtime.gd",
"function": "_apply_service_transaction",
"line": 11833,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "950474ff3ca8a867ee025c2b7635586d79f2385f79586fc66107191ceb329a9a"
},
{
"path": "scripts/operations/operations_coordinator.gd",
"function": "_process_daily_close",
"line": 1125,
"sha256": "871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90",
"function_sha256": "665ac0ac4d4c220e68e98810da063fd2ad7ae7dc9e1997944a1e7bea7a3c30e6"
}
],
"evidence": "I native_bundle C; R/s2a.json; R/s4.json",
"approved_authority": [
"P04-01 safety acceptance",
"D05-P04-DEPENDENCY",
"D05-P04-SHIFT-1800"
],
"pending_D05": [
"D05(d), beyond approved A01 and18:00; timing/attribution mandatory P04, numeric math D04/P05 separate"
"D05-P04-SHIFT-1800",
"D05-P04-MIDNIGHT-DAY"
],
"pending_D05": [],
"phase": "TIME_BOUNDARIES → FACILITY_COMPLETION",
"relative_priority": "Upkeep/daily close before sale; post-increment sale timestamp, exclusive close period_end;00:00 sale belongs to new day.",
"status": "pending D05",
"observation_status": "observed-current"
"status": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"historical_evidence": "I native_bundle C; R/s2a.json; R/s4.json",
"evidence": "Fresh exact-Q native proof pending; no old raw reused as Q",
"nativeWindows": "pending"
},
{
"domain": "シフト交代",
"normative_rule": "Approved [17:59,18:00) work belongs to day staff: complete/pay once at18:00 then switch; night work starts [18:00,18:01).",
"normative_rule": "Approved 18:00 order remains: completion and payment before handover. No renewal of prior approval.",
"current_source": [
"Runtime _advance_facilities:8482",
"_advance_staff_ai:8658",
"StaffService advance_one_minute:700"
{
"path": "autoload/simulation_runtime.gd",
"function": "_advance_facilities",
"line": 8504,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "f1efd0c23bdd60d1ef19a21879640b53b8b4d88844c0c881fe7cd724387ec274"
},
{
"path": "autoload/simulation_runtime.gd",
"function": "_advance_staff_ai",
"line": 8680,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "0e222987f7c5e25583dbaba8fe63784aa563715067396e8d31d10bd191e7179b"
}
],
"evidence": "I C first1080 sale joins; R/s2b.json no-night1081/overtime",
"approved_authority": [
"BASELINE:64",
"BASELINE:67",
"D05-P04-SHIFT-1800"
],
"pending_D05": [
"Already approved; do not re-ask"
],
"pending_D05": [],
"phase": "FACILITY_COMPLETION → AI_DECISIONS",
"relative_priority": "18:00 completion/payment before shift handover; day staff [17:59,18:00), night [18:00,18:01).",
"status": "approved",
"observation_status": "observed-current"
"status": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"historical_evidence": "I C first1080 sale joins; R/s2b.json no-night1081/overtime",
"evidence": "Fresh exact-Q native proof pending; no old raw reused as Q",
"nativeWindows": "pending"
},
{
"domain": "00:00決算",
"normative_rule": "A01 approved ownership-prorated upkeep at midnight is retained. One daily close/payroll/upkeep, no duplicate replay/reload; distinguish prior [0,1440) accounting and sale at1440.",
"normative_rule": "A01 ownership-based upkeep is unchanged. Prior-day settlement/upkeep precede 00:00 service completion; its sale belongs to the new day. Replay/restore must not duplicate settlement.",
"current_source": [
"Kernel _handle_time_boundaries:254",
"Runtime _advance_operations_time:1898",
"coordinator _process_minute_boundaries:882",
"_process_daily_close:1125"
{
"path": "scripts/core/simulation_kernel.gd",
"function": "_handle_time_boundaries",
"line": 254,
"sha256": "341c0c878c4894adbac628d0db6362ff69fc3347bdd9e61e50936e15dc2d1edb",
"function_sha256": "2ced47a2911b36def9d89de82a43afc69148ead44d19db6a2a6c7bce5a910ae9"
},
{
"path": "autoload/simulation_runtime.gd",
"function": "_advance_operations_time",
"line": 1919,
"sha256": "45514aea9367ff678f4dc05166bb9b58121f240d4b5565edeb7ab258e3ded8e0",
"function_sha256": "511580d1fac3d2785072e94c2981065fa47ba18b1c97122922645dac5c0d94ab"
},
{
"path": "scripts/operations/operations_coordinator.gd",
"function": "_process_minute_boundaries",
"line": 882,
"sha256": "871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90",
"function_sha256": "1312166dc17aee0ef470069a73ff3fe6b86d11d04ca7de76f3d04f1d2d14674e"
},
{
"path": "scripts/operations/operations_coordinator.gd",
"function": "_process_daily_close",
"line": 1125,
"sha256": "871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90",
"function_sha256": "665ac0ac4d4c220e68e98810da063fd2ad7ae7dc9e1997944a1e7bea7a3c30e6"
}
],
"evidence": "I C paused/formal; R/s2a.json nonzero payroll/upkeep, replay and typed restore",
"approved_authority": [
"BASELINE:71",
"BASELINE:72",
"A01",
"D05-P04-DEPENDENCY"
],
"pending_D05": [
"A01 approved ownership-based midnight upkeep not reopened; extra attribution D05(d)"
"D05-P04-DEPENDENCY",
"D05-P04-MIDNIGHT-DAY"
],
"pending_D05": [],
"phase": "pre-TIME_BOUNDARIES signals → TIME_BOUNDARIES → FACILITY_COMPLETION",
"relative_priority": "Midnight signals, then upkeep/close, then completion.",
"status": "approved",
"observation_status": "observed-current"
"status": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"historical_evidence": "I C paused/formal; R/s2a.json nonzero payroll/upkeep, replay and typed restore",
"evidence": "Fresh exact-Q native proof pending; no old raw reused as Q",
"nativeWindows": "pending"
}
],
"source_facts": "REPAIR29_STATIC_SOURCE.json",
"authority": "D05_OWNER_APPROVAL.json approves dependency and shift only; original BASELINE/D-034/A01 retain their scope",
"source_facts": "REPAIR30_SOURCE_FACTS.json",
"authority": "D05_OWNER_APPROVAL.json preserves dependency/18:00; D05_REMAINING_APPROVAL.json binds all four actual 2026-10-18 answers; BASELINE/D-034/A01 unchanged.",
"historical_superseded": [
"REPAIR17_STATUS.md",
"REPAIR18_STATUS.md",
@@ -184,18 +314,16 @@
"REPAIR21_STATUS.md",
"REPAIR22–28 creation-time status and runbooks"
],
"history_policy": "Creation-time NOT RUN in REPAIR22–28 and runbooks is historical; CURRENT_STATUS.md canonical table overrides execution status. Historical files unchanged.",
"evidence_policy": "Root-measured S4r28 4/4 PASS, controls, local8, r22 collection, schema2 index, registered validation PASS28s; worker SOURCE-READY / NOTRUN.",
"history_policy": "Historical source/proof pins retain their original revisions; CURRENT_STATUS.md is canonical. New approvals are not new native evidence.",
"evidence_policy": "All old S1-S4/r22/native/full178 records are historical. None is relabelled as Q. Fresh native S1-S5 and full184/329 on final Q remain NOT RUN.",
"pending": [
"Owner D05 a–d approval or explicit non-mandatory ruling; unknown mandatory rules stay pending",
"Post-approval normal checker/registry repair (a61 unchanged here)",
"support53cb normal registered rebind",
"final full1339 against final checker; none exists against a61",
"independent review and integration: P04 first, support on main9b afterward",
"nativeWindows obligations individually if required"
"Complete current-Q collector/wrapper/index binding and S5 drivers; see REPAIR30_STATUS.md",
"Fresh native S1-S5 on final Q, then full184/329 on the same Q including checker",
"Truthful index, formal registered validation on S --verify-only, whole-unit independent review, normal C integration",
"nativeWindows individually pending for every condition"
],
"priority_candidates_if_required": "D05_REMAINING_ORDER_CANDIDATE.json",
"collection_plan": "s4/S4_ROOT_RUN.md",
"priority_candidates_if_required": "D05_REMAINING_ORDER_CANDIDATE.json (superseded history)",
"collection_plan": "REPAIR30_STATUS.md",
"formal_acceptance": false,
"original_unit_complete": false,
"phase_order": [
@@ -436,5 +564,24 @@
],
"observed-current": "All phase and source behavior observations; not approval"
},
"full178_applicability_context": "REPAIR29_STATIC_SOURCE.json full_source_static_comparison: full178 selected1339 includes f5; one test-source mismatch (test_required_kitchen.gd), no game-source mismatch; preserve Runner applicability binding, no blanket1338 identity or a61 full proof."
"full178_applicability_context": "REPAIR29_STATIC_SOURCE.json full_source_static_comparison: full178 selected1339 includes f5; one test-source mismatch (test_required_kitchen.gd), no game-source mismatch; preserve Runner applicability binding, no blanket1338 identity or a61 full proof.",
"current_source_commit": "c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"nativeWindows": {
"EV": "pending",
"closure_release": "pending",
"dependency_stop": "pending",
"destruction_stop": "pending",
"exit_release": "pending",
"midnight_replay": "pending",
"midnight_settlement": "pending",
"night_staff_absent": "pending",
"overtime_task": "pending",
"patience_release": "pending",
"paused_midnight": "pending",
"power_stop": "pending",
"recovery_completion": "pending",
"same_minute_replay": "pending",
"save_restore": "pending",
"shift_completion": "pending"
}
}
@@ -381,6 +381,10 @@ def persistence_pins(s):
pin = s.resolver.manifest['product_source'][path]
source = s.resolver.read(pin['path'], pin)
bodies = function_bodies(source)
if getattr(s, 'fresh', False):
for function, expected in PERSISTENCE_BODIES.items():
require(digest(bodies[function]) == expected, 'fresh persistence function: ' + function)
return
report = loads(s.read_build('audit-support/p04-repair19-close-r01/ROOT_ACTUAL_PERSISTENCE_CALL_CHAIN.json'))
require(digest(source) == report['full_file_sha256'] ==
'871a248ee101b6df543fd5cf0440b5d4b0f02c21fa145a99f0687888c1bc6f90', 'persistence whole-source pin')
@@ -993,6 +997,23 @@ def verify_s4_engine(pin, identity):
all(value == pin for value in identity['during']), 'S4 before/during/after engine identity')
S4_HISTORICAL_WRAPPER_SHA256 = '2d3be39d2b310abac058e27336ac816c234043a0a1dd7b2c52d84994907dd31b'
S4_HISTORICAL_WRAPPER = HERE / 's4/historical/run_s4_native_r28.py.reference'
def verify_s4_wrapper(receipt_sha256, *, historical):
if historical:
# befa0ef1f634e734ee156347e8fd02e82eddea49:s4/run_s4_native.py
# Never read the mutable current wrapper in this branch.
expected = digest(S4_HISTORICAL_WRAPPER.read_bytes())
require(expected == S4_HISTORICAL_WRAPPER_SHA256, 'S4 tampered historical wrapper pin')
require(receipt_sha256 == expected, 'S4 historical receipt wrapper pin')
else:
require(receipt_sha256 != S4_HISTORICAL_WRAPPER_SHA256, 'S4 historical pin in fresh receipt')
require(receipt_sha256 == digest((HERE / 's4/run_s4_native.py').read_bytes()),
'S4 current receipt wrapper pin')
class S4Series(Series):
"""Fresh S4: own-B materials and exact installed engine; profiles are provenance."""
def __init__(self, build):
@@ -1012,8 +1033,8 @@ class S4Series(Series):
require(all(pin[k] == product[name][k] for k in ('bytes', 'sha256')), 'S4 product pin')
self.resolver.read(product[name]['path'], product[name])
qa = HERE / 's4/p04_s4_power_probe.gd'
require(inputs['QA']['sha256'] == digest(qa.read_bytes()) and
inputs['wrapper_sha256'] == digest((HERE / 's4/run_s4_native.py').read_bytes()), 'S4 exact QA/wrapper version')
require(inputs['QA']['sha256'] == digest(qa.read_bytes()), 'S4 exact QA version')
verify_s4_wrapper(inputs['wrapper_sha256'], historical=True)
selected = {k: v['sha256'] for k, v in source.items()}
require(inputs['QA_overrides'] == ['tests/s3/test_runtime_staff_assignment.gd'], 'S4 sole QA override')
selected[inputs['QA_overrides'][0]] = digest(qa.read_bytes())
@@ -1221,6 +1242,208 @@ def verify_s3(build):
return s.result(conditions, facts)
FRESH_RUNS = ('s1', 's2a', 's2b', 's3', 's4', 's5')
FRESH_BINDINGS = 'audit-support/p04-fresh-runs.json'
def fresh_bindings(build):
value = loads(ordinary(Path(build) / FRESH_BINDINGS).read_bytes())
require(value['protocol'] == 'p04-fresh-runs-v1' and set(value['series']) == set(FRESH_RUNS),
'Root fresh run binding roster')
return value
class FreshResolver:
def __init__(self, source):
self.manifest = {'product_source': source}
self.allowed = {r['path']: r for r in source.values()}
self.used = {}
def read(self, path, pin):
require(path in self.allowed and pin == self.allowed[path], 'fresh source membership')
data = checked(ordinary(path).read_bytes(), pin, path)
self.used[path] = pin
return data
class FreshSeries(Series):
"""Actual Root input/receipt pins; no historical native pin or relocation fallback."""
fresh = True
def __init__(self, build, name):
self.name, self.build = name, Path(build).resolve(strict=True)
bindings = fresh_bindings(self.build)
binding = bindings['series'][name]
self.run = binding['run']
require(not Path(self.run).is_absolute() and '..' not in Path(self.run).parts, 'fresh run relative path')
self.base = self.build / self.run
self.references, self.nodes, self.pids, self.phase_pairs = {}, {}, [], 0
self.inputs = loads(self.read('runner-input.json', binding['runner_input']))
self.execution = loads(self.read('runner-ended.json', binding['runner_ended']))
require(self.inputs['mode'] == 'fresh-q' and not self.inputs['historical_r17'], 'fresh input only')
if name == 's4':
verify_s4_wrapper(self.inputs['wrapper_sha256'], historical=False)
provenance = self.inputs['provenance']
require(all(provenance[k] == bindings[k] for k in ('M', 'S', 'Q_tree')), 'same fresh Q across all runs')
self.source = loads(self.read('source_before.json'))
require(self.source == self.inputs['source_before'] == loads(self.read('source_after.json')), 'whole fresh source before/after')
self.resolver = FreshResolver(self.source)
for pin in self.source.values():
self.resolver.read(pin['path'], pin)
qa = self.inputs['QA']
checked(ordinary(qa['path']).read_bytes(), qa, 'fresh QA')
require(self.inputs['QA_overrides'] == ['tests/s3/test_runtime_staff_assignment.gd'], 'single fresh QA override')
selected = {k: v['sha256'] for k, v in self.source.items()}
selected[self.inputs['QA_overrides'][0]] = qa['sha256']
require(self.inputs['selected_source_map'] == selected, 'fresh selected manifest')
for pin in self.inputs['fixed_input_pins']:
checked(ordinary(pin['path']).read_bytes(), pin, 'fresh fixed input')
execution = self.execution
require(execution['passed'] is True and execution['error'] is None
and execution['guard_errors'] == execution['cleanup_errors'] == [], 'fresh native guards')
require([p['phase'] for p in execution['phases']] == ['import', 'parse', 'writer', 'reader'], 'fresh four phases')
for phase_row in execution['phases']:
require(phase_row['passed'] is True and phase_row['engine_ended'] is True, 'fresh phase passed/ended')
self.ownership(phase_row)
require(len(set(self.pids)) == 4 and self.pids == execution['actual_captured_PIDs'], 'fresh PID roster')
pid_set = loads(self.read('PID-set.json'))
require(pid_set['engine_PIDs'] == self.pids and
pid_set['owner_runner_pid'] == self.inputs['owner_runner_pid'], 'fresh PID set binding')
require(len(execution['cleanup']) == 4 and all(r['engine_ended'] is True for r in execution['cleanup']), 'fresh strict cleanup')
for row in execution['cleanup']:
cleanup = row['cleanup']
require(row['outer_cleanup_errors'] == [] and cleanup['errors'] == []
and cleanup['actual_process_exit_code'] == 0 and cleanup['attempts'], 'fresh cleanup errors')
require(all(a['errors'] == [] and a['kill_attempted'] is False
and a['wait_completed'] is True and a['wait_returned_code'] == 0
for a in cleanup['attempts']), 'fresh cleanup abnormal wait')
self.inventory = loads(self.read('raw-inventory.json', binding['raw_inventory']))
for name, pin in self.inventory.items():
self.read('raw/' + name, pin)
if self.name in ('s1', 's2a', 's2b', 's3'):
for path in self.inventory:
if path.startswith('writer-') and '-phase-' in path:
other = 'reader-' + path[len('writer-'):]
require(other in self.inventory and self.read('raw/' + path) == self.read('raw/' + other),
'fresh altered phase pair')
if path.endswith('.var'): self.phase_pairs += 1
if self.name == 's3':
require(self.phase_pairs == 176, 'unchanged S3 complete phase roster')
wrapper_path = Path(__file__).parent / 's5/run_s5_native.py'
import importlib.util
spec = importlib.util.spec_from_file_location('fresh_series_wrapper', wrapper_path)
wrapper = importlib.util.module_from_spec(spec)
spec.loader.exec_module(wrapper)
root = Path(self.inputs['project_root'])
runner = wrapper.module('fresh_series_runner', root / 'tools/run_all_tests.py')
refs = dict(self.source)
refs[self.inputs['QA_overrides'][0]] = qa
uid_plan, uid_snapshot, uid_binding = wrapper.load_uid_helper(root, runner, self.source)
plan = uid_plan(refs)
require(plan == self.inputs['uid_plan'], 'independently derived fresh UID plan')
source = {n: {k: p[k] for k in ('bytes', 'sha256')} for n, p in refs.items()}
accepted = uid_snapshot(self.base / 'stage', source, plan)
require(accepted == loads(self.read('accepted-uids.json')), 'retained fresh UID seal')
for role in ('import', 'parse', 'writer', 'reader'):
require(loads(self.read(role + '-uids.json')) ==
{'before': {} if role == 'import' else accepted, 'after': accepted}, 'phase UID seals')
require(wrapper.engine_pin(Path(self.inputs['engine']['path'])) == self.inputs['engine'], 'fresh engine identity')
if self.name == 's5':
verify_s4_engine(self.inputs['engine'], execution['engine_identity'])
else:
observations = loads(self.read('fresh-engine-checks.json'))
require([r['label'] for r in observations] ==
['fixed', 'before-import', 'before-parse', 'before-writer', 'before-reader', 'fixed'],
'fresh engine observation roster')
require(all(r['descriptor'] == self.inputs['engine'] for r in observations), 'fresh engine drift')
self.formal_pin = binding['formal_relocation']
self.formal()
def formal(self):
before = self.execution['formal_before']
require(before and before == self.execution['formal_after'], 'fresh formal source unchanged')
relocated = loads(self.read('formal-relocation.json', self.formal_pin))
require(set(relocated) == {'writer', 'reader'}, 'fresh whole formal mirror')
writer, reader = [loads(self.read('raw/' + role + '.json')) for role in ('writer', 'reader')]
require(writer['profile'] != reader['profile'] and writer['pid'] != reader['pid'], 'fresh independent Reader')
inodes = set()
for role in ('writer', 'reader'):
receipt = loads(self.read('raw/' + role + '.json'))
require(set(receipt['slots']) == set(before) == set(relocated[role]), 'fresh formal roster')
for slot, original in receipt['slots'].items():
row = relocated[role][slot]
require(row['provenance'] == original and row['members'] == before[slot], 'fresh restore manifest binding')
require(set(row['members']) == {'journal.log', 'manifest.json', 'thumbnail.png', 'world.bin'}, 'all four members')
require(row['relative'] == 'formal/' + role + '/' + slot and
{p.name for p in (self.base / row['relative']).iterdir()} == set(row['members']),
'exact formal directory membership')
for member, pin in row['members'].items():
self.read(row['relative'] + '/' + member, pin)
st = ordinary(self.base / row['relative'] / member).stat()
require((st.st_dev, st.st_ino) not in inodes, 'formal independent inodes')
inodes.add((st.st_dev, st.st_ino))
def result(self, conditions, facts=None):
return {'series': self.name, 'mode': 'fresh-q', 'verified_conditions': sorted(set(conditions)),
'facts': facts or {}, 'provenance': self.inputs['provenance'],
'source_files': len(self.source), 'owned_pids': self.pids,
'references': self.references, 'formal_acceptance': False}
def verify_fresh_s1(build):
s = FreshSeries(build, 's1')
return s.result(s1_semantics(s))
def verify_fresh_s2a(build):
s = FreshSeries(build, 's2a')
return s.result(s2a_semantics(s))
def verify_fresh_s2b(build):
s = FreshSeries(build, 's2b')
return s.result(s2b_semantics(s))
def verify_fresh_s3(build):
s = FreshSeries(build, 's3')
conditions, facts = s3_semantics(s)
# Event B4 is historical case logic, never the approved automatic-raid gate.
return s.result([c for c in conditions if c != 'destruction_stop'], facts)
def verify_fresh_s4(build):
s = FreshSeries(build, 's4')
S4Series.formal_s4(s)
return s.result(['power_stop'], power_stop(s))
def verify_fresh_s5(build):
s = FreshSeries(build, 's5')
import importlib.util
path = Path(__file__).parent / 's5/s5_order_adapter.py'
spec = importlib.util.spec_from_file_location('fresh_order_adapter', path)
adapter = importlib.util.module_from_spec(spec)
spec.loader.exec_module(adapter)
arguments = (s.base / 'raw', s.inventory['writer.json']['sha256'], s.inventory['reader.json']['sha256'])
power = adapter.power.derive(*arguments)
order = adapter.derive(*arguments)
require(set(order['cases']) == set(adapter.DERIVERS)
and set(power['cases']) == set(adapter.power.CASES), 'complete fresh adapter case sets')
conditions = ['power_stop', 'dependency_stop', 'recovery_completion', 'destruction_stop', 'exit_release',
'midnight_settlement', 'midnight_replay', 'save_restore', 'shift_completion',
'paused_midnight', 'same_minute_replay']
require(order['cases']['S5D_DESTRUCTION_RAID']['G1'] is True
and order['cases']['S5D_IN_FLIGHT']['G2'] is True
and order['cases']['S5D_DESTRUCTION_RAID']['idle_objective_breach'] is True
and order['cases']['S5D_PAID_BEFORE_INCIDENT']['paid_before_incident'] is True,
'fresh destruction requires both guards and exact-N idle breach')
for case, key in [('S5G_SHIFT_1080', 'shift_completion'), ('S5H_PAUSED_MIDNIGHT', 'paused_midnight'),
('S5E_MIDNIGHT', 'same_minute_replay')]:
require(type(order['cases'][case][key]) is dict, 'fresh typed adapter derivation: ' + key)
return s.result(conditions, {'power': power, 'order': order})
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--build', type=Path, required=True)
@@ -2,6 +2,7 @@
"""S1-only native entry. --check-only never loads ownership helpers or starts Godot."""
from pathlib import Path
import argparse
import copy
import hashlib
import importlib.util
import json
@@ -52,16 +53,39 @@ def main():
parser.add_argument("--cache-run", type=Path, default=CACHE_RUN)
parser.add_argument("--godot", type=Path, default=ENGINE)
parser.add_argument("--check-only", action="store_true")
parser.add_argument("--main")
parser.add_argument("--submission")
parser.add_argument("--tested-tree")
parser.add_argument("--historical-r17", action="store_true")
args = parser.parse_args()
shared = module("fresh_q_shared", HERE.parent / "s5/run_s5_native.py")
mode = shared.select_mode(args)
fresh = mode == "fresh-q"
if fresh and "--project-root" not in sys.argv:
raise ValueError("fresh-q requires explicit --project-root")
if fresh and "--cache-run" not in sys.argv:
args.cache_run = None
engine_descriptor = shared.engine_pin(args.godot) if fresh else None
provenance = None
if args.project_root.is_symlink():
raise ValueError("project root symlink")
root = args.project_root.resolve()
out = args.output.resolve()
if fresh:
if not out.is_relative_to(BUILD.resolve()) or not args.plan.resolve().is_relative_to(BUILD.resolve()):
raise ValueError("fresh plan/output must stay inside BUILD")
if out.exists() or out.is_symlink() or (args.check_only and args.plan.exists()):
raise ValueError("fresh output and plan required")
r = module("s1_standard_runner", root / "tools/run_all_tests.py")
# Preserve the reviewed source_refs -> exactly one QA override order.
source_before = r.source_refs(root)
if fresh:
provenance = shared.fresh_q_guard(root, args.main, args.submission, args.tested_tree)
refs = dict(source_before)
refs[TEST] = pin(QA)
expected = {n: dict(bytes=p["bytes"], sha256=p["sha256"]) for n, p in refs.items()}
fixed = [pin(p) for p in MATERIALS + [
fixed = [pin(p) for p in ([] if fresh else MATERIALS) + [
QA, Path(__file__), HERE / "S1_ROOT_RUN.md",
root / "tests/transport/test_runtime_transport.gd",
root / "tests/staff/test_rescue_elevator.gd",
@@ -70,7 +94,7 @@ def main():
selected = dict(root_before=source_before, map={n: p["sha256"] for n, p in refs.items()}, timeout=1200)
cache_note = None
cache_receipts = []
for leaf in ["runner-ended.json", "runner-input.json"]:
for leaf in (["runner-ended.json", "runner-input.json"] if args.cache_run is not None else []):
path = args.cache_run / leaf
try:
cache_receipts.append(pin(path))
@@ -84,6 +108,16 @@ def main():
cache_receipts=cache_receipts, cache_access=cache_note,
phases=["import", "parse", "writer", "reader"],
native_engine_launches=0, whole_goal_accepted=False, unit_accepted=False)
if fresh:
uid_plan, uid_snapshot, uid_binding = shared.load_uid_helper(root, r, source_before)
uid_source = copy.deepcopy(expected)
uid_plan_map = uid_plan(refs)
plan.update(protocol="p04-s1-fresh-q-v1", mode=mode, provenance=provenance, engine=engine_descriptor,
engine_sha256=engine_descriptor["sha256"], uid_helper=uid_binding,
uid_plan=uid_plan_map, import_mode="fresh" if args.cache_run is None else "cache",
historical_r17=False, fresh_q_evidence=False)
fixed.append(pin(HERE.parent / "s5/run_s5_native.py"))
# No historical execution is admitted.
# Check-only only reads source/materials and writes the plan in task build.
# It deliberately does not read default-player data, inspect processes or stat Godot.
if args.check_only:
@@ -96,18 +130,30 @@ def main():
QA_overrides=[TEST], fixed_pins=len(fixed), plan=str(args.plan),
plan_sha256=r.sha(args.plan), cache_access=cache_note), ensure_ascii=False))
return 0
r.require(fresh, "historical mode is read-only")
r.require(args.plan.is_file() and r.read(args.plan) == plan, "run exact check-only plan first")
reports, phase_call, uid_state = shared.make_uid_policy(r, uid_snapshot, uid_source, uid_plan_map, out)
engine_checks = []
def fresh_engine_check(label):
value = shared.engine_pin(args.godot, engine_descriptor)
engine_checks.append(dict(label=label, descriptor=value))
def fixed_guard():
fresh_engine_check("fixed")
r.require(shared.fresh_q_guard(root, args.main, args.submission, args.tested_tree) == provenance,
"fresh Q provenance changed")
r.require(pin(root / uid_binding["helper_path"])["sha256"] == uid_binding["helper_sha256"],
"UID helper changed")
for value in fixed + cache_receipts:
r.require(pin(value["path"]) == value, "fixed input changed: " + value["path"])
fixed_guard()
# Native admission is Root-only and fails closed on unreadable cache.
r.require(cache_note is None, "Root must read exact cache receipts: " + str(cache_note))
old = args.cache_run
r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed")
old_map = r.read(old / "runner-input.json")["selected_source_map"]
current_map = {n: p["sha256"] for n, p in source_before.items()}
r.require(old_map == current_map, "ended cache selected source must equal current product")
if old is not None:
r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed")
old_map = r.read(old / "runner-input.json")["selected_source_map"]
current_map = {n: p["sha256"] for n, p in source_before.items()}
r.require(old_map == current_map, "ended cache selected source must equal current product")
protected = r.default_player(root)
outer = module("s1_owned_outer", r.SUPPORT / "owned_outer.py")
r.require(not outer.native.helper["live_engines"](), "another Godot owns CPU")
@@ -152,20 +198,21 @@ def main():
data = value["text"].encode()
r.require(hashlib.sha256(data).hexdigest() == value["sha256"], "bootstrap pin")
(out / "bootstrap" / name).write_bytes(data)
cache = old / "stage/.godot"
cache_before = r.inventory(cache)
r.require(bool(cache_before), "nonempty ended cache")
for name in cache_before:
src = cache / name
dst = stage / ".godot" / name
dst.parent.mkdir(parents=True, exist_ok=True)
subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True)
r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino),
"cache clone is a separate inode")
r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes")
r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts,
whole_cache=cache_before, independent_inode=True,
ordinary_import_required=True, ordinary_parse_required=True))
if old is not None:
cache = old / "stage/.godot"
cache_before = r.inventory(cache)
r.require(bool(cache_before), "nonempty ended cache")
for name in cache_before:
src = cache / name
dst = stage / ".godot" / name
dst.parent.mkdir(parents=True, exist_ok=True)
subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True)
r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino),
"cache clone is a separate inode")
r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes")
r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts,
whole_cache=cache_before, independent_inode=True,
ordinary_import_required=True, ordinary_parse_required=True))
paths = ["res://" + n for n in sorted(refs) if n.endswith(".gd")]
r.write(out / "parse-paths.json", paths)
markers = module("s1_markers", root / "tools/strict_test_markers.py")
@@ -187,7 +234,10 @@ def main():
writer = r.read(out / "raw/writer.json")
formal_before = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()}
r.require(len(formal_before) == 14, "all fourteen formal writer points")
row = r.execute_phase(str(engine), stage, out, phase, test, selected, expected,
fresh_engine_check("before-" + phase)
if phase == "import" and old is None:
r.require(not (stage / ".godot").exists(), "fresh import cache absent")
row = phase_call(str(engine), stage, out, phase, test, selected, expected,
previous, policy, contracts, paths, public, protected, root,
outer, markers, diagnostics, owners, audio)
phases.append(row)
@@ -220,6 +270,8 @@ def main():
# Fixed guard always follows ownership cleanup, even if setup or an engine failed.
try:
fixed_guard()
r.require(uid_snapshot(stage, uid_source, uid_plan_map) == uid_state["accepted"], "UID seal after cleanup")
r.write(out / "fresh-engine-checks.json", engine_checks)
after = r.source_refs(root)
r.write(out / "source_after.json", after)
r.require(after == source_before, "whole product source unchanged")
@@ -231,9 +283,15 @@ def main():
except BaseException as caught:
guards.append(type(caught).__name__ + ": " + str(caught))
pids = [p.pid for p in outer.OWNED]
passed = (error is None and not guards and not cleanup_errors and len(phases) == 4
passed = (uid_state["accepted"] is not None and error is None and not guards and not cleanup_errors and len(phases) == 4
and all(p["passed"] for p in phases) and len(pids) == len(set(pids)) == 4
and all(p["engine_ended"] for p in cleanup))
if passed:
try:
shared.mirror_formal(r, out, formal_before)
except BaseException as caught:
guards.append("formal mirror: " + str(caught))
passed = False
execution = dict(passed=passed, error=error, guard_errors=guards, phases=phases,
actual_captured_PIDs=pids, cleanup=cleanup, cleanup_errors=cleanup_errors,
formal_before=formal_before, formal_after=formal_after,
@@ -2,6 +2,7 @@
"""S2a-only native entry. --check-only never loads ownership helpers or starts Godot."""
from pathlib import Path
import argparse
import copy
import hashlib
import importlib.util
import json
@@ -73,17 +74,40 @@ def main():
parser.add_argument("--cache-run", type=Path, default=CACHE_RUN)
parser.add_argument("--godot", type=Path, default=ENGINE)
parser.add_argument("--check-only", action="store_true")
parser.add_argument("--main")
parser.add_argument("--submission")
parser.add_argument("--tested-tree")
parser.add_argument("--historical-r17", action="store_true")
args = parser.parse_args()
shared = module("fresh_q_shared", HERE.parent / "s5/run_s5_native.py")
mode = shared.select_mode(args)
fresh = mode == "fresh-q"
if fresh and "--project-root" not in sys.argv:
raise ValueError("fresh-q requires explicit --project-root")
if fresh and "--cache-run" not in sys.argv:
args.cache_run = None
engine_descriptor = shared.engine_pin(args.godot) if fresh else None
provenance = None
if args.project_root.is_symlink():
raise ValueError("project root symlink")
root = args.project_root.resolve()
out = args.output.resolve()
if fresh:
if not out.is_relative_to(BUILD.resolve()) or not args.plan.resolve().is_relative_to(BUILD.resolve()):
raise ValueError("fresh plan/output must stay inside BUILD")
if out.exists() or out.is_symlink() or (args.check_only and args.plan.exists()):
raise ValueError("fresh output and plan required")
r = module("s2a_standard_runner", root / "tools/run_all_tests.py")
# Preserve the reviewed source_refs -> exactly one QA override order.
source_before = r.source_refs(root)
if fresh:
provenance = shared.fresh_q_guard(root, args.main, args.submission, args.tested_tree)
refs = dict(source_before)
refs[TEST] = pin(QA)
template_guard()
if not fresh: template_guard()
expected = {n: dict(bytes=p["bytes"], sha256=p["sha256"]) for n, p in refs.items()}
fixed = [pin(p) for p in MATERIALS + [
fixed = [pin(p) for p in ([] if fresh else MATERIALS) + [
QA, Path(__file__), HERE / "S2_ROOT_RUN.md",
root / "tests/transport/test_runtime_transport.gd",
root / "tests/staff/test_rescue_elevator.gd",
@@ -92,7 +116,7 @@ def main():
selected = dict(root_before=source_before, map={n: p["sha256"] for n, p in refs.items()}, timeout=1200)
cache_note = None
cache_receipts = []
for leaf in ["runner-ended.json", "runner-input.json"]:
for leaf in (["runner-ended.json", "runner-input.json"] if args.cache_run is not None else []):
path = args.cache_run / leaf
try:
cache_receipts.append(pin(path))
@@ -106,6 +130,16 @@ def main():
cache_receipts=cache_receipts, cache_access=cache_note,
phases=["import", "parse", "writer", "reader"],
native_engine_launches=0, whole_goal_accepted=False, unit_accepted=False)
if fresh:
uid_plan, uid_snapshot, uid_binding = shared.load_uid_helper(root, r, source_before)
uid_source = copy.deepcopy(expected)
uid_plan_map = uid_plan(refs)
plan.update(protocol="p04-s2a-fresh-q-v1", mode=mode, provenance=provenance, engine=engine_descriptor,
engine_sha256=engine_descriptor["sha256"], uid_helper=uid_binding,
uid_plan=uid_plan_map, import_mode="fresh" if args.cache_run is None else "cache",
historical_r17=False, fresh_q_evidence=False)
fixed.append(pin(HERE.parent / "s5/run_s5_native.py"))
# No historical execution is admitted.
# Check-only only reads source/materials and writes the plan in task build.
# It deliberately does not read default-player data, inspect processes or stat Godot.
if args.check_only:
@@ -118,19 +152,31 @@ def main():
QA_overrides=[TEST], fixed_pins=len(fixed), plan=str(args.plan),
plan_sha256=r.sha(args.plan), cache_access=cache_note), ensure_ascii=False))
return 0
r.require(fresh, "historical mode is read-only")
r.require(args.plan.is_file() and r.read(args.plan) == plan, "run exact check-only plan first")
reports, phase_call, uid_state = shared.make_uid_policy(r, uid_snapshot, uid_source, uid_plan_map, out)
engine_checks = []
def fresh_engine_check(label):
value = shared.engine_pin(args.godot, engine_descriptor)
engine_checks.append(dict(label=label, descriptor=value))
def fixed_guard():
template_guard()
fresh_engine_check("fixed")
r.require(shared.fresh_q_guard(root, args.main, args.submission, args.tested_tree) == provenance,
"fresh Q provenance changed")
r.require(pin(root / uid_binding["helper_path"])["sha256"] == uid_binding["helper_sha256"],
"UID helper changed")
if not fresh: template_guard()
for value in fixed + cache_receipts:
r.require(pin(value["path"]) == value, "fixed input changed: " + value["path"])
fixed_guard()
# Native admission is Root-only and fails closed on unreadable cache.
r.require(cache_note is None, "Root must read exact cache receipts: " + str(cache_note))
old = args.cache_run
r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed")
old_map = r.read(old / "runner-input.json")["selected_source_map"]
current_map = {n: p["sha256"] for n, p in source_before.items()}
r.require(old_map == current_map, "ended cache selected source must equal current product")
if old is not None:
r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed")
old_map = r.read(old / "runner-input.json")["selected_source_map"]
current_map = {n: p["sha256"] for n, p in source_before.items()}
r.require(old_map == current_map, "ended cache selected source must equal current product")
protected = r.default_player(root)
outer = module("s2a_owned_outer", r.SUPPORT / "owned_outer.py")
r.require(not outer.native.helper["live_engines"](), "another Godot owns CPU")
@@ -175,20 +221,21 @@ def main():
data = value["text"].encode()
r.require(hashlib.sha256(data).hexdigest() == value["sha256"], "bootstrap pin")
(out / "bootstrap" / name).write_bytes(data)
cache = old / "stage/.godot"
cache_before = r.inventory(cache)
r.require(bool(cache_before), "nonempty ended cache")
for name in cache_before:
src = cache / name
dst = stage / ".godot" / name
dst.parent.mkdir(parents=True, exist_ok=True)
subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True)
r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino),
"cache clone is a separate inode")
r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes")
r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts,
whole_cache=cache_before, independent_inode=True,
ordinary_import_required=True, ordinary_parse_required=True))
if old is not None:
cache = old / "stage/.godot"
cache_before = r.inventory(cache)
r.require(bool(cache_before), "nonempty ended cache")
for name in cache_before:
src = cache / name
dst = stage / ".godot" / name
dst.parent.mkdir(parents=True, exist_ok=True)
subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True)
r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino),
"cache clone is a separate inode")
r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes")
r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts,
whole_cache=cache_before, independent_inode=True,
ordinary_import_required=True, ordinary_parse_required=True))
paths = ["res://" + n for n in sorted(refs) if n.endswith(".gd")]
r.write(out / "parse-paths.json", paths)
markers = module("s2a_markers", root / "tools/strict_test_markers.py")
@@ -210,7 +257,10 @@ def main():
writer = r.read(out / "raw/writer.json")
formal_before = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()}
r.require(len(formal_before) == 1, "one C3 formal writer point")
row = r.execute_phase(str(engine), stage, out, phase, test, selected, expected,
fresh_engine_check("before-" + phase)
if phase == "import" and old is None:
r.require(not (stage / ".godot").exists(), "fresh import cache absent")
row = phase_call(str(engine), stage, out, phase, test, selected, expected,
previous, policy, contracts, paths, public, protected, root,
outer, markers, diagnostics, owners, audio)
phases.append(row)
@@ -245,6 +295,8 @@ def main():
# Fixed guard always follows ownership cleanup, even if setup or an engine failed.
try:
fixed_guard()
r.require(uid_snapshot(stage, uid_source, uid_plan_map) == uid_state["accepted"], "UID seal after cleanup")
r.write(out / "fresh-engine-checks.json", engine_checks)
after = r.source_refs(root)
r.write(out / "source_after.json", after)
r.require(after == source_before, "whole product source unchanged")
@@ -260,9 +312,15 @@ def main():
except BaseException as caught:
guards.append(type(caught).__name__ + ": " + str(caught))
pids = [p.pid for p in outer.OWNED]
passed = (error is None and not guards and not cleanup_errors and len(phases) == 4
passed = (uid_state["accepted"] is not None and error is None and not guards and not cleanup_errors and len(phases) == 4
and all(p["passed"] for p in phases) and len(pids) == len(set(pids)) == 4
and all(p["engine_ended"] for p in cleanup))
if passed:
try:
shared.mirror_formal(r, out, formal_before)
except BaseException as caught:
guards.append("formal mirror: " + str(caught))
passed = False
execution = dict(passed=passed, error=error, guard_errors=guards, phases=phases,
actual_captured_PIDs=pids, cleanup=cleanup, cleanup_errors=cleanup_errors,
formal_before=formal_before, formal_after=formal_after,
@@ -2,6 +2,7 @@
"""S2b-only native entry. --check-only never loads ownership helpers or starts Godot."""
from pathlib import Path
import argparse
import copy
import hashlib
import importlib.util
import json
@@ -62,19 +63,42 @@ def main():
parser.add_argument("--cache-run", type=Path, default=CACHE_RUN)
parser.add_argument("--godot", type=Path, default=ENGINE)
parser.add_argument("--check-only", action="store_true")
parser.add_argument("--main")
parser.add_argument("--submission")
parser.add_argument("--tested-tree")
parser.add_argument("--historical-r17", action="store_true")
args = parser.parse_args()
shared = module("fresh_q_shared", HERE.parent / "s5/run_s5_native.py")
mode = shared.select_mode(args)
fresh = mode == "fresh-q"
if fresh and "--project-root" not in sys.argv:
raise ValueError("fresh-q requires explicit --project-root")
if fresh and "--cache-run" not in sys.argv:
args.cache_run = None
engine_descriptor = shared.engine_pin(args.godot) if fresh else None
provenance = None
if args.project_root.is_symlink():
raise ValueError("project root symlink")
root = args.project_root.resolve()
out = args.output.resolve()
if fresh:
if not out.is_relative_to(BUILD.resolve()) or not args.plan.resolve().is_relative_to(BUILD.resolve()):
raise ValueError("fresh plan/output must stay inside BUILD")
if out.exists() or out.is_symlink() or (args.check_only and args.plan.exists()):
raise ValueError("fresh output and plan required")
if not out.is_relative_to(BUILD.resolve()) or not args.plan.resolve().is_relative_to(BUILD.resolve()):
raise ValueError("plan/output must stay in task build")
r = module("s2b_standard_runner", root / "tools/run_all_tests.py")
# Preserve the reviewed source_refs -> exactly one QA override order.
source_before = r.source_refs(root)
if fresh:
provenance = shared.fresh_q_guard(root, args.main, args.submission, args.tested_tree)
refs = dict(source_before)
refs[TEST] = pin(QA)
template_guard(root)
if not fresh: template_guard(root)
expected = {n: dict(bytes=p["bytes"], sha256=p["sha256"]) for n, p in refs.items()}
fixed = [pin(p) for p in MATERIALS + [
fixed = [pin(p) for p in ([] if fresh else MATERIALS) + [
QA, Path(__file__), HERE / "S2B_ROOT_RUN.md",
root / "tests/transport/test_runtime_transport.gd",
root / "tests/staff/test_rescue_elevator.gd",
@@ -83,7 +107,7 @@ def main():
selected = dict(root_before=source_before, map={n: p["sha256"] for n, p in refs.items()}, timeout=1200)
cache_note = None
cache_receipts = []
for leaf in ["runner-ended.json", "runner-input.json"]:
for leaf in (["runner-ended.json", "runner-input.json"] if args.cache_run is not None else []):
path = args.cache_run / leaf
try:
cache_receipts.append(pin(path))
@@ -97,6 +121,16 @@ def main():
cache_receipts=cache_receipts, cache_access=cache_note,
phases=["import", "parse", "writer", "reader"],
native_engine_launches=0, whole_goal_accepted=False, unit_accepted=False)
if fresh:
uid_plan, uid_snapshot, uid_binding = shared.load_uid_helper(root, r, source_before)
uid_source = copy.deepcopy(expected)
uid_plan_map = uid_plan(refs)
plan.update(protocol="p04-s2b-fresh-q-v1", mode=mode, provenance=provenance, engine=engine_descriptor,
engine_sha256=engine_descriptor["sha256"], uid_helper=uid_binding,
uid_plan=uid_plan_map, import_mode="fresh" if args.cache_run is None else "cache",
historical_r17=False, fresh_q_evidence=False)
fixed.append(pin(HERE.parent / "s5/run_s5_native.py"))
# No historical execution is admitted.
# Check-only only reads source/materials and writes the plan in task build.
# It deliberately does not read default-player data, inspect processes or stat Godot.
if args.check_only:
@@ -109,20 +143,31 @@ def main():
QA_overrides=[TEST], fixed_pins=len(fixed), plan=str(args.plan),
plan_sha256=r.sha(args.plan), cache_access=cache_note), ensure_ascii=False))
return 0
r.require(root == PRODUCT.resolve() and len(source_before) == 1338, "Root native requires product 1338; worker plan is not native evidence")
r.require(fresh, "historical mode is read-only")
r.require(args.plan.is_file() and r.read(args.plan) == plan, "run exact check-only plan first")
reports, phase_call, uid_state = shared.make_uid_policy(r, uid_snapshot, uid_source, uid_plan_map, out)
engine_checks = []
def fresh_engine_check(label):
value = shared.engine_pin(args.godot, engine_descriptor)
engine_checks.append(dict(label=label, descriptor=value))
def fixed_guard():
template_guard(root)
fresh_engine_check("fixed")
r.require(shared.fresh_q_guard(root, args.main, args.submission, args.tested_tree) == provenance,
"fresh Q provenance changed")
r.require(pin(root / uid_binding["helper_path"])["sha256"] == uid_binding["helper_sha256"],
"UID helper changed")
if not fresh: template_guard(root)
for value in fixed + cache_receipts:
r.require(pin(value["path"]) == value, "fixed input changed: " + value["path"])
fixed_guard()
# Native admission is Root-only and fails closed on unreadable cache.
r.require(cache_note is None, "Root must read exact cache receipts: " + str(cache_note))
old = args.cache_run
r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed")
old_map = r.read(old / "runner-input.json")["selected_source_map"]
current_map = {n: p["sha256"] for n, p in source_before.items()}
r.require(old_map == current_map, "ended cache selected source must equal current product")
if old is not None:
r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed")
old_map = r.read(old / "runner-input.json")["selected_source_map"]
current_map = {n: p["sha256"] for n, p in source_before.items()}
r.require(old_map == current_map, "ended cache selected source must equal current product")
protected = r.default_player(root)
outer = module("s2b_owned_outer", r.SUPPORT / "owned_outer.py")
r.require(not outer.native.helper["live_engines"](), "another Godot owns CPU")
@@ -167,20 +212,21 @@ def main():
data = value["text"].encode()
r.require(hashlib.sha256(data).hexdigest() == value["sha256"], "bootstrap pin")
(out / "bootstrap" / name).write_bytes(data)
cache = old / "stage/.godot"
cache_before = r.inventory(cache)
r.require(bool(cache_before), "nonempty ended cache")
for name in cache_before:
src = cache / name
dst = stage / ".godot" / name
dst.parent.mkdir(parents=True, exist_ok=True)
subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True)
r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino),
"cache clone is a separate inode")
r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes")
r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts,
whole_cache=cache_before, independent_inode=True,
ordinary_import_required=True, ordinary_parse_required=True))
if old is not None:
cache = old / "stage/.godot"
cache_before = r.inventory(cache)
r.require(bool(cache_before), "nonempty ended cache")
for name in cache_before:
src = cache / name
dst = stage / ".godot" / name
dst.parent.mkdir(parents=True, exist_ok=True)
subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True)
r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino),
"cache clone is a separate inode")
r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes")
r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts,
whole_cache=cache_before, independent_inode=True,
ordinary_import_required=True, ordinary_parse_required=True))
paths = ["res://" + n for n in sorted(refs) if n.endswith(".gd")]
r.write(out / "parse-paths.json", paths)
markers = module("s2b_markers", root / "tools/strict_test_markers.py")
@@ -202,7 +248,10 @@ def main():
writer = r.read(out / "raw/writer.json")
formal_before = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()}
r.require(len(formal_before) == 6, "three formal points for each of two fresh branches")
row = r.execute_phase(str(engine), stage, out, phase, test, selected, expected,
fresh_engine_check("before-" + phase)
if phase == "import" and old is None:
r.require(not (stage / ".godot").exists(), "fresh import cache absent")
row = phase_call(str(engine), stage, out, phase, test, selected, expected,
previous, policy, contracts, paths, public, protected, root,
outer, markers, diagnostics, owners, audio)
phases.append(row)
@@ -237,6 +286,8 @@ def main():
# Fixed guard always follows ownership cleanup, even if setup or an engine failed.
try:
fixed_guard()
r.require(uid_snapshot(stage, uid_source, uid_plan_map) == uid_state["accepted"], "UID seal after cleanup")
r.write(out / "fresh-engine-checks.json", engine_checks)
after = r.source_refs(root)
r.write(out / "source_after.json", after)
r.require(after == source_before, "whole product source unchanged")
@@ -252,9 +303,15 @@ def main():
except BaseException as caught:
guards.append(type(caught).__name__ + ": " + str(caught))
pids = [p.pid for p in outer.OWNED]
passed = (error is None and not guards and not cleanup_errors and len(phases) == 4
passed = (uid_state["accepted"] is not None and error is None and not guards and not cleanup_errors and len(phases) == 4
and all(p["passed"] for p in phases) and len(pids) == len(set(pids)) == 4
and all(p["engine_ended"] for p in cleanup))
if passed:
try:
shared.mirror_formal(r, out, formal_before)
except BaseException as caught:
guards.append("formal mirror: " + str(caught))
passed = False
execution = dict(passed=passed, error=error, guard_errors=guards, phases=phases,
actual_captured_PIDs=pids, cleanup=cleanup, cleanup_errors=cleanup_errors,
formal_before=formal_before, formal_after=formal_after,
@@ -2,6 +2,7 @@
"""S3-only native entry. --check-only never loads ownership helpers or starts Godot."""
from pathlib import Path
import argparse
import copy
import hashlib
import importlib.util
import json
@@ -30,21 +31,22 @@ SLOTS = sorted(case + "-" + label for case in CASES for label in LABELS[case])
MATERIALS = [MANIFEST, AUDIT, HERE.parent / "s2b/run_s2b_native.py",
HERE.parent / "s2b/p04_s2b_shift_probe.gd", HERE.parent / "s2b/S2B_ROOT_RUN.md"]
def template_guard(root):
if pin(MANIFEST)["sha256"] != MANIFEST_SHA:
raise ValueError("supplied seven-source manifest changed")
manifest = json.loads(MANIFEST.read_text())
if len(manifest["files"]) != 7:
raise ValueError("exact seven source files required")
for row in manifest["files"]:
actual = pin(row["supplied"])
if (actual["bytes"], actual["sha256"]) != (row["bytes"], row["sha256"]):
raise ValueError("supplied template SHA mismatch: " + row["supplied"])
audit = json.loads(AUDIT.read_text())
for row in audit["source_pins"]:
actual = pin(root / row["path"])
if (actual["bytes"], actual["sha256"]) != (row["production_bytes"], row["production_sha256"]):
raise ValueError("Root source audit mismatch: " + row["path"])
def template_guard(root, historical=True):
if historical:
if pin(MANIFEST)["sha256"] != MANIFEST_SHA:
raise ValueError("supplied seven-source manifest changed")
manifest = json.loads(MANIFEST.read_text())
if len(manifest["files"]) != 7:
raise ValueError("exact seven source files required")
for row in manifest["files"]:
actual = pin(row["supplied"])
if (actual["bytes"], actual["sha256"]) != (row["bytes"], row["sha256"]):
raise ValueError("supplied template SHA mismatch: " + row["supplied"])
audit = json.loads(AUDIT.read_text())
for row in audit["source_pins"]:
actual = pin(root / row["path"])
if (actual["bytes"], actual["sha256"]) != (row["production_bytes"], row["production_sha256"]):
raise ValueError("Root source audit mismatch: " + row["path"])
probe = QA.read_text()
if ":=" in probe:
raise ValueError("probe requires explicit typed declarations")
@@ -80,19 +82,42 @@ def main():
parser.add_argument("--cache-run", type=Path, default=CACHE_RUN)
parser.add_argument("--godot", type=Path, default=ENGINE)
parser.add_argument("--check-only", action="store_true")
parser.add_argument("--main")
parser.add_argument("--submission")
parser.add_argument("--tested-tree")
parser.add_argument("--historical-r17", action="store_true")
args = parser.parse_args()
shared = module("fresh_q_shared", HERE.parent / "s5/run_s5_native.py")
mode = shared.select_mode(args)
fresh = mode == "fresh-q"
if fresh and "--project-root" not in sys.argv:
raise ValueError("fresh-q requires explicit --project-root")
if fresh and "--cache-run" not in sys.argv:
args.cache_run = None
engine_descriptor = shared.engine_pin(args.godot) if fresh else None
provenance = None
if args.project_root.is_symlink():
raise ValueError("project root symlink")
root = args.project_root.resolve()
out = args.output.resolve()
if fresh:
if not out.is_relative_to(BUILD.resolve()) or not args.plan.resolve().is_relative_to(BUILD.resolve()):
raise ValueError("fresh plan/output must stay inside BUILD")
if out.exists() or out.is_symlink() or (args.check_only and args.plan.exists()):
raise ValueError("fresh output and plan required")
if not out.is_relative_to(BUILD.resolve()) or not args.plan.resolve().is_relative_to(BUILD.resolve()):
raise ValueError("plan/output must stay in task build")
r = module("s3_standard_runner", root / "tools/run_all_tests.py")
# Preserve the reviewed source_refs -> exactly one QA override order.
source_before = r.source_refs(root)
if fresh:
provenance = shared.fresh_q_guard(root, args.main, args.submission, args.tested_tree)
refs = dict(source_before)
refs[TEST] = pin(QA)
template_guard(root)
template_guard(root, historical=not fresh)
expected = {n: dict(bytes=p["bytes"], sha256=p["sha256"]) for n, p in refs.items()}
fixed = [pin(p) for p in MATERIALS + [Path(row["supplied"]) for row in json.loads(MANIFEST.read_text())["files"]] + [
fixed = [pin(p) for p in ([] if fresh else MATERIALS + [Path(row["supplied"]) for row in json.loads(MANIFEST.read_text())["files"]]) + [
QA, Path(__file__), HERE / "S3_ROOT_RUN.md",
root / "tests/transport/test_runtime_transport.gd",
root / "tests/staff/test_rescue_elevator.gd",
@@ -101,7 +126,7 @@ def main():
selected = dict(root_before=source_before, map={n: p["sha256"] for n, p in refs.items()}, timeout=1200)
cache_note = None
cache_receipts = []
for leaf in ["runner-ended.json", "runner-input.json"]:
for leaf in (["runner-ended.json", "runner-input.json"] if args.cache_run is not None else []):
path = args.cache_run / leaf
try:
cache_receipts.append(pin(path))
@@ -115,6 +140,16 @@ def main():
cache_receipts=cache_receipts, cache_access=cache_note,
phases=["import", "parse", "writer", "reader"],
native_engine_launches=0, whole_goal_accepted=False, unit_accepted=False)
if fresh:
uid_plan, uid_snapshot, uid_binding = shared.load_uid_helper(root, r, source_before)
uid_source = copy.deepcopy(expected)
uid_plan_map = uid_plan(refs)
plan.update(protocol="p04-s3-fresh-q-v1", mode=mode, provenance=provenance, engine=engine_descriptor,
engine_sha256=engine_descriptor["sha256"], uid_helper=uid_binding,
uid_plan=uid_plan_map, import_mode="fresh" if args.cache_run is None else "cache",
historical_r17=False, fresh_q_evidence=False)
fixed.append(pin(HERE.parent / "s5/run_s5_native.py"))
# No historical execution is admitted.
# Check-only only reads source/materials and writes the plan in task build.
# It deliberately does not read default-player data, inspect processes or stat Godot.
if args.check_only:
@@ -127,20 +162,31 @@ def main():
QA_overrides=[TEST], fixed_pins=len(fixed), plan=str(args.plan),
plan_sha256=r.sha(args.plan), cache_access=cache_note), ensure_ascii=False))
return 0
r.require(root == PRODUCT.resolve() and len(source_before) == 1338, "Root native requires product 1338; worker plan is not native evidence")
r.require(fresh, "historical mode is read-only")
r.require(args.plan.is_file() and r.read(args.plan) == plan, "run exact check-only plan first")
reports, phase_call, uid_state = shared.make_uid_policy(r, uid_snapshot, uid_source, uid_plan_map, out)
engine_checks = []
def fresh_engine_check(label):
value = shared.engine_pin(args.godot, engine_descriptor)
engine_checks.append(dict(label=label, descriptor=value))
def fixed_guard():
template_guard(root)
fresh_engine_check("fixed")
r.require(shared.fresh_q_guard(root, args.main, args.submission, args.tested_tree) == provenance,
"fresh Q provenance changed")
r.require(pin(root / uid_binding["helper_path"])["sha256"] == uid_binding["helper_sha256"],
"UID helper changed")
template_guard(root, historical=not fresh)
for value in fixed + cache_receipts:
r.require(pin(value["path"]) == value, "fixed input changed: " + value["path"])
fixed_guard()
# Native admission is Root-only and fails closed on unreadable cache.
r.require(cache_note is None, "Root must read exact cache receipts: " + str(cache_note))
old = args.cache_run
r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed")
old_map = r.read(old / "runner-input.json")["selected_source_map"]
current_map = {n: p["sha256"] for n, p in source_before.items()}
r.require(old_map == current_map, "ended cache selected source must equal current product")
if old is not None:
r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed")
old_map = r.read(old / "runner-input.json")["selected_source_map"]
current_map = {n: p["sha256"] for n, p in source_before.items()}
r.require(old_map == current_map, "ended cache selected source must equal current product")
protected = r.default_player(root)
outer = module("s3_owned_outer", r.SUPPORT / "owned_outer.py")
r.require(not outer.native.helper["live_engines"](), "another Godot owns CPU")
@@ -185,20 +231,21 @@ def main():
data = value["text"].encode()
r.require(hashlib.sha256(data).hexdigest() == value["sha256"], "bootstrap pin")
(out / "bootstrap" / name).write_bytes(data)
cache = old / "stage/.godot"
cache_before = r.inventory(cache)
r.require(bool(cache_before), "nonempty ended cache")
for name in cache_before:
src = cache / name
dst = stage / ".godot" / name
dst.parent.mkdir(parents=True, exist_ok=True)
subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True)
r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino),
"cache clone is a separate inode")
r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes")
r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts,
whole_cache=cache_before, independent_inode=True,
ordinary_import_required=True, ordinary_parse_required=True))
if old is not None:
cache = old / "stage/.godot"
cache_before = r.inventory(cache)
r.require(bool(cache_before), "nonempty ended cache")
for name in cache_before:
src = cache / name
dst = stage / ".godot" / name
dst.parent.mkdir(parents=True, exist_ok=True)
subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True)
r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino),
"cache clone is a separate inode")
r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes")
r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts,
whole_cache=cache_before, independent_inode=True,
ordinary_import_required=True, ordinary_parse_required=True))
paths = ["res://" + n for n in sorted(refs) if n.endswith(".gd")]
r.write(out / "parse-paths.json", paths)
markers = module("s3_markers", root / "tools/strict_test_markers.py")
@@ -220,7 +267,10 @@ def main():
writer = r.read(out / "raw/writer.json")
formal_before = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()}
r.require(sorted(formal_before) == SLOTS, "all 22 formal points for six fresh cases")
row = r.execute_phase(str(engine), stage, out, phase, test, selected, expected,
fresh_engine_check("before-" + phase)
if phase == "import" and old is None:
r.require(not (stage / ".godot").exists(), "fresh import cache absent")
row = phase_call(str(engine), stage, out, phase, test, selected, expected,
previous, policy, contracts, paths, public, protected, root,
outer, markers, diagnostics, owners, audio)
phases.append(row)
@@ -256,6 +306,8 @@ def main():
# Fixed guard always follows ownership cleanup, even if setup or an engine failed.
try:
fixed_guard()
r.require(uid_snapshot(stage, uid_source, uid_plan_map) == uid_state["accepted"], "UID seal after cleanup")
r.write(out / "fresh-engine-checks.json", engine_checks)
after = r.source_refs(root)
r.write(out / "source_after.json", after)
r.require(after == source_before, "whole product source unchanged")
@@ -271,9 +323,15 @@ def main():
except BaseException as caught:
guards.append(type(caught).__name__ + ": " + str(caught))
pids = [p.pid for p in outer.OWNED]
passed = (error is None and not guards and not cleanup_errors and len(phases) == 4
passed = (uid_state["accepted"] is not None and error is None and not guards and not cleanup_errors and len(phases) == 4
and all(p["passed"] for p in phases) and len(pids) == len(set(pids)) == 4
and all(p["engine_ended"] for p in cleanup))
if passed:
try:
shared.mirror_formal(r, out, formal_before)
except BaseException as caught:
guards.append("formal mirror: " + str(caught))
passed = False
execution = dict(passed=passed, error=error, guard_errors=guards, phases=phases,
actual_captured_PIDs=pids, cleanup=cleanup, cleanup_errors=cleanup_errors,
formal_before=formal_before, formal_after=formal_after,
@@ -0,0 +1,405 @@
#!/usr/bin/env python3
"""S4-only native entry. --check-only never loads ownership helpers or starts Godot."""
from pathlib import Path
import argparse
import copy
import hashlib
import importlib.util
import json
import os
import shutil
import subprocess
import stat
import sys
sys.dont_write_bytecode = True
HERE = Path(__file__).resolve().parent
BUILD = Path("/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build")
PRODUCT = BUILD / "audit-support/p04-r17-full-inputs-r01/product"
CACHE_RUN = BUILD / "p04-final-product-full-r01"
TEST = "tests/s3/test_runtime_staff_assignment.gd"
QA = HERE / "p04_s4_power_probe.gd"
ENGINE = Path("/Applications/Godot.app/Contents/MacOS/Godot")
ENGINE_SHA256 = "c7cccbf8fb143e34e02fd6521e09be2c2b974f0d5db080b19071c9c570718ccf"
MANIFEST = BUILD / "audit-support/p04-r17-full-inputs-r01/MANIFEST.json"
MANIFEST_SHA = "a15f29fa12537f6d8aaf7cabea390922a9f16e3eb9c10981e5742aafc8c4c8a8"
CONTRACTS = BUILD / "audit-support/p04-r17-full-inputs-r01/fixed/6ce6b28c5985e8a4f13b78bfeb1f1e09f6216d874fb01e0656ec1633bfa01cd7/completion_marker_contracts.json"
CASES = ["S4"]
LABELS = {"S4": ["boundary", "held", "recovered"]}
SLOTS = ["S4-" + label for label in sorted(LABELS["S4"])]
MATERIALS = [MANIFEST, BUILD / "audit-support/p04-review-repair22-r01/ACTUAL_CURRENT_PUBLIC_POWER_FUNCTIONS.json"]
def template_guard(root):
if root != PRODUCT.resolve() or not HERE.is_relative_to(BUILD.resolve()):
raise ValueError("Root must stage this exact QA/wrapper/plan inside own B")
if pin(MANIFEST)["sha256"] != MANIFEST_SHA:
raise ValueError("immutable full R17 relocation manifest")
manifest = json.loads(MANIFEST.read_text())
for name, source in manifest["product_source"].items():
# Old absolute paths are lookup keys only. Never open them.
row = manifest["original_to_relocated"][source["path"]]
actual = pin(root / name)
if Path(row["relocated"]).resolve() != root / name or any(
actual[k] != source[k] or actual[k] != row[k] for k in ("bytes", "sha256")):
raise ValueError("relocated product differs: " + name)
probe = QA.read_text()
import re
if ":=" in probe or re.search(r"\bvar\s+\w+\s*=", probe) or re.search(r"\bfor\s+\w+\s+in\b", probe):
raise ValueError("explicit typed declarations/loops required")
if re.search(r"\.(?:patience_remaining|elapsed_minutes|power_available|capacity|hold_until)\s*=(?!=)", probe):
raise ValueError("forbidden direct state mutation")
for forbidden in ["evaluate_now(", "configure_operations(", "._update_shift_states(", ".record_duty_minute("]:
if forbidden in probe:
raise ValueError("forbidden bypass: " + forbidden)
# Constants and public bodies are read from the actual selected source, not a memo.
mana = (root / "scripts/mana/mana_network_service.gd").read_text()
for key in ("EVALUATION_INTERVAL_MINUTES", "MINIMUM_OFF_HOLD_MINUTES"):
if not re.search(r"const " + key + r" := 10\b", mana):
raise ValueError("source timing changed: " + key)
def module(name, path):
spec = importlib.util.spec_from_file_location(name, path)
value = importlib.util.module_from_spec(spec)
spec.loader.exec_module(value)
return value
def pin(path):
path = Path(path)
if path.is_symlink() or not path.is_file():
raise ValueError("missing exact input: " + str(path))
data = path.read_bytes()
return dict(path=str(path), bytes=len(data), sha256=hashlib.sha256(data).hexdigest())
def engine_pin(path, expected=None):
path = Path(path)
if path != ENGINE or any(p.is_symlink() for p in (path, *path.parents)):
raise ValueError("exact installed engine required; no symlink or relocated input")
if path.resolve(strict=True) != ENGINE:
raise ValueError("installed engine resolved path changed")
before = path.stat()
if not stat.S_ISREG(before.st_mode):
raise ValueError("installed engine must be regular")
digest = hashlib.sha256(path.read_bytes()).hexdigest()
after = path.stat()
fields = ("st_dev", "st_ino", "st_size", "st_mtime_ns", "st_ctime_ns", "st_mode")
if any(getattr(before, k) != getattr(after, k) for k in fields):
raise ValueError("engine changed while hashing")
if any(p.is_symlink() for p in (path, *path.parents)) or path.resolve(strict=True) != ENGINE:
raise ValueError("engine path changed while hashing")
value = dict(path=str(path), resolved_path=str(path.resolve(strict=True)),
bytes=after.st_size, mtime_ns=after.st_mtime_ns, mode=after.st_mode,
device=after.st_dev, inode=after.st_ino, ctime_ns=after.st_ctime_ns, sha256=digest)
if digest != ENGINE_SHA256:
raise ValueError("engine differs from installed engine constant")
if expected is not None and value != expected:
raise ValueError("engine identity changed")
return value
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--project-root", type=Path, default=PRODUCT)
parser.add_argument("--output", type=Path, default=BUILD / "p04-s4-native-r28")
parser.add_argument("--plan", type=Path, default=BUILD / "p04-s4-plan-r28.json")
parser.add_argument("--cache-run", type=Path, default=None,
help="optional passed registered cache; default is fresh, without cache access")
parser.add_argument("--godot", type=Path, default=ENGINE)
parser.add_argument("--check-only", action="store_true")
args = parser.parse_args()
engine_descriptor = engine_pin(args.godot)
if args.cache_run is not None and args.cache_run.resolve() != CACHE_RUN.resolve():
raise ValueError("only registered own-B full-run cache")
root = args.project_root.resolve()
out = args.output.resolve()
if not out.is_relative_to(BUILD.resolve()) or not args.plan.resolve().is_relative_to(BUILD.resolve()):
raise ValueError("plan/output must stay in task build")
if out.exists() or out.is_symlink():
raise ValueError("fresh output required")
if args.check_only and (args.plan.exists() or args.plan.is_symlink()):
raise ValueError("fresh plan required")
r = module("s4_standard_runner", root / "tools/run_all_tests.py")
# Preserve the reviewed source_refs -> exactly one QA override order.
source_before = r.source_refs(root)
refs = dict(source_before)
refs[TEST] = pin(QA)
template_guard(root)
expected = {n: dict(bytes=p["bytes"], sha256=p["sha256"]) for n, p in refs.items()}
fixed = [pin(p) for p in MATERIALS + [
QA, Path(__file__), HERE / "S4_ROOT_RUN.md",
root / "tests/transport/test_runtime_transport.gd",
root / "tests/staff/test_rescue_elevator.gd",
CONTRACTS,
]]
selected = dict(root_before=source_before, map={n: p["sha256"] for n, p in refs.items()}, timeout=1200)
cache_note = None
cache_receipts = []
if args.cache_run is not None:
# Reject failed caches before reading their inputs or cache contents.
r.require(r.read(args.cache_run / "runner-ended.json")["passed"] is True,
"failed cache is ineligible")
for leaf in (["runner-ended.json", "runner-input.json"] if args.cache_run is not None else []):
path = args.cache_run / leaf
try:
cache_receipts.append(pin(path))
except OSError as caught:
cache_note = dict(path=str(path), error=type(caught).__name__ + ": " + str(caught),
required_before_native=True)
break
plan = dict(protocol="p04-s4-preparation-v1", project_root=str(root), output=str(out), engine_path=str(args.godot.resolve()),
source_before=source_before, selected_source_map=selected["map"],
QA_overrides=[TEST], fixed_input_pins=fixed,
cache_run=str(args.cache_run) if args.cache_run is not None else None,
import_mode="cache" if args.cache_run is not None else "fresh",
engine_sha256=ENGINE_SHA256, engine=engine_descriptor,
cache_receipts=cache_receipts, cache_access=cache_note,
phases=["import", "parse", "writer", "reader"],
native_engine_launches=0, whole_goal_accepted=False, unit_accepted=False)
# Check-only only reads source/materials and writes the plan in task build.
# Reads engine identity; never launches Godot or inspects players/processes.
if args.check_only:
args.plan.parent.mkdir(parents=True, exist_ok=True)
r.write(args.plan, plan)
print(json.dumps(dict(check_only=True, engines=0, source_files=len(source_before),
QA_overrides=[TEST], fixed_pins=len(fixed), plan=str(args.plan),
plan_sha256=r.sha(args.plan), cache_access=cache_note), ensure_ascii=False))
return 0
r.require(root == PRODUCT.resolve() and len(source_before) == 1338, "Root native requires product 1338; worker plan is not native evidence")
r.require(args.plan.is_file() and r.read(args.plan) == plan, "run exact check-only plan first")
engine_observations = []
engine_identity = dict(before=engine_descriptor, during=[], after=None)
def repin(label):
try:
value = engine_pin(args.godot, engine_descriptor)
engine_observations.append(dict(stage=label, descriptor=value))
if label == "after-cleanup":
engine_identity["after"] = value
else:
engine_identity["during"].append(value)
except BaseException as caught:
engine_observations.append(dict(stage=label, error=str(caught)))
raise
def fixed_guard():
repin("cleanup-fixed-guard")
template_guard(root)
for value in fixed + cache_receipts:
r.require(pin(value["path"]) == value, "fixed input changed: " + value["path"])
fixed_guard()
old = args.cache_run
if old is not None:
# Native cache admission remains Root-only and fails closed.
r.require(cache_note is None, "Root must read exact cache receipts: " + str(cache_note))
r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed")
cache_input = r.read(old / "runner-input.json")
r.require(cache_input["engine_sha256"] == ENGINE_SHA256, "cache engine identity")
old_map = cache_input["selected_source_map"]
current_map = {n: p["sha256"] for n, p in source_before.items()}
r.require({k: v for k, v in old_map.items() if k != "tools/check_p04_order_evidence.py"} == current_map and len(old_map) == 1339, "immutable full cache: all 1338 product inputs equal; checker is not parsed/executed by product suites")
protected = r.default_player(root)
outer = module("s4_owned_outer", r.SUPPORT / "owned_outer.py")
r.require(not outer.native.helper["live_engines"](), "another Godot owns CPU")
engine = ENGINE
repin("native-admission")
r.require(shutil.disk_usage(out.parent).free >= 1024**3 + engine.stat().st_size + 136*1024**2,
"reviewed native disk admission")
r.require(not out.exists(), "fresh output required; preserve previous attempts")
out.mkdir()
stage = out / "stage"
stage.mkdir()
(out / "starters").mkdir()
(out / "bootstrap").mkdir()
phases = []
previous = {}
error = None
guards = []
cleanup = []
cleanup_errors = []
cache_before = None
formal_before = None
formal_after = None
original_phase = outer.run_phase
def run_phase(argv, folder, timeout, env, **kwargs):
env = dict(env)
if folder.name in ["writer", "reader"]:
env.update(THE_TREE_S4_EVIDENCE=str(out / "raw"), THE_TREE_S4_MODE=folder.name)
return original_phase(argv, folder, timeout, env, **kwargs)
outer.run_phase = run_phase
try:
r.write(out / "runner-started.json", dict(started=r.now(), owner_runner_pid=os.getpid(),
plan=pin(args.plan), engines_launched=0))
r.write(out / "source_before.json", source_before)
r.write(out / "selected-source-map.json", refs)
# Private source stage first, then literal reviewed bootstrap.
for name, value in refs.items():
target = stage / name
target.parent.mkdir(parents=True, exist_ok=True)
r.copy_source(Path(value["path"]), target)
r.require(r.inventory(stage, stage=True) == expected, "whole private source")
for name, value in r.read(r.SUPPORT / "bootstrap-scripts.json").items():
data = value["text"].encode()
r.require(hashlib.sha256(data).hexdigest() == value["sha256"], "bootstrap pin")
(out / "bootstrap" / name).write_bytes(data)
if old is not None:
cache = old / "stage/.godot"
cache_before = r.inventory(cache)
r.require(bool(cache_before), "nonempty ended cache")
for name in cache_before:
src = cache / name
dst = stage / ".godot" / name
dst.parent.mkdir(parents=True, exist_ok=True)
subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True)
r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino),
"cache clone is a separate inode")
r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes")
r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts,
whole_cache=cache_before, independent_inode=True,
ordinary_import_required=True, ordinary_parse_required=True))
paths = ["res://" + n for n in sorted(refs) if n.endswith(".gd")]
r.require(len(paths) == 316, "complete 316-script parse roster")
r.write(out / "parse-paths.json", paths)
markers = module("s4_markers", root / "tools/strict_test_markers.py")
contracts = markers.load_contracts(CONTRACTS)
contracts[TEST] = dict(test=TEST, template="S4 power: <checks> checks, <failures> failures", required=True)
policy = r.read(r.SUPPORT / "suite-policy.json")
r.require(TEST not in policy["suite_policies"], "no normal suite watchdog/policy override")
r.write(out / "contracts.json", contracts)
r.write(out / "runner-input.json", dict(plan, owner_runner_pid=os.getpid(),
wrapper_sha256=r.sha(__file__), QA=pin(QA), engine=engine_descriptor,
engine_identity_before=engine_descriptor, engine_identity_initial=copy.deepcopy(engine_identity),
runner_sha256=r.sha(root / "tools/run_all_tests.py"),
default_player_before=protected, fixed_input_pins=fixed,
functional_watchdog_seconds=1200, source_adoption=False))
diagnostics = module("s4_diagnostics", r.SUPPORT / "diagnostic_gate.py")
owners = module("s4_owners", r.SUPPORT / "ordinary_proof_gate.py")
audio = module("s4_audio", r.SUPPORT / "audio_evidence_gate.py")
public = (stage / "project.godot").read_bytes()
for phase, test in [("import", None), ("parse", None), ("writer", TEST), ("reader", TEST)]:
if phase == "reader":
writer = r.read(out / "raw/writer.json")
formal_before = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()}
r.require(sorted(formal_before) == SLOTS, "exact three formal points for isolated power case")
if phase == "import" and old is None:
r.require(not (stage / ".godot").exists() and not (stage / ".godot").is_symlink(),
"fresh private .godot absent at actual import")
repin("before-" + phase)
r.write(out / ("engine-identity-before-" + phase + ".json"),
dict(engine_observations[-1], observation_index=len(engine_observations)-1))
row = r.execute_phase(str(engine), stage, out, phase, test, selected, expected,
previous, policy, contracts, paths, public, protected, root,
outer, markers, diagnostics, owners, audio)
phases.append(row)
# execute_phase writer/reader share out/<test>.log via write_text.
# Keep binary per-phase copies under these existing unique names.
# The shared runner log is not write-once; see S4_ROOT_RUN.md.
if test and row.get("log"):
(out / (phase + "-combined-raw.log")).write_bytes((out / row["log"]).read_bytes())
row["strict_runner_log_path"] = row["log"]
row["log"] = phase + "-combined-raw.log"
r.write(out / (phase + "-actual-phase.json"), row)
print(json.dumps(dict(phase=phase, passed=row["passed"], error=row.get("validation_error"))), flush=True)
r.require(row["passed"], "first strict phase failure: " + phase)
if phase in ["writer", "reader"]:
receipt = r.read(out / ("raw/" + phase + ".json"))
r.require(receipt["checks"] > 0 and receipt["failures"] == 0,
"S4 actual outcome receipt")
r.require(sorted(receipt["branches"]) == CASES,
"exact one independent Writer/Reader case")
r.require(sorted(receipt["slots"]) == SLOTS, "all formal point slots")
r.require(receipt["pid"] == row["actual_pid"], "actual native PID/receipt")
repin("after-collection")
writer = r.read(out / "raw/writer.json")
reader = r.read(out / "raw/reader.json")
r.require(writer["pid"] != reader["pid"] and writer["profile"] != reader["profile"], "distinct formal processes")
formal_after = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()}
r.require(formal_before == formal_after, "Reader leaves Writer packages unchanged")
except BaseException as caught:
error = type(caught).__name__ + ": " + str(caught)
finally:
try:
cleanup, cleanup_errors = outer.finish_captured(outer.OWNED)
except BaseException as caught:
cleanup_errors.append(str(caught))
try:
r.write(out / "outer-owned-finally.json", dict(cleanup=cleanup, errors=cleanup_errors))
except BaseException as caught:
guards.append("finally receipt: " + type(caught).__name__ + ": " + str(caught))
# Explicit re-pin after cleanup is independent of other fixed-input guards.
try:
repin("after-cleanup")
except BaseException as caught:
guards.append(type(caught).__name__ + ": " + str(caught))
# Fixed guard always follows ownership cleanup, even if setup or an engine failed.
try:
fixed_guard()
after = r.source_refs(root)
r.write(out / "source_after.json", after)
r.require(after == source_before, "whole product source unchanged")
r.require(r.default_player(root) == protected, "default player unchanged")
if (stage / "project.godot").exists():
r.require(r.inventory(stage, stage=True) == dict(expected, **previous), "whole private source unchanged")
if cache_before is not None:
r.require(r.inventory(old / "stage/.godot") == cache_before, "original cache unchanged")
if formal_before is not None:
writer = r.read(out / "raw/writer.json")
formal_after = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()}
r.require(formal_before == formal_after, "Writer formal packages unchanged after Reader, including failure")
except BaseException as caught:
guards.append(type(caught).__name__ + ": " + str(caught))
pids = [p.pid for p in outer.OWNED]
passed = (error is None and not guards and not cleanup_errors and len(phases) == 4
and all(p["passed"] for p in phases) and len(pids) == len(set(pids)) == 4
and all(p["engine_ended"] for p in cleanup))
execution = dict(passed=passed, error=error, guard_errors=guards, phases=phases,
actual_captured_PIDs=pids, cleanup=cleanup, cleanup_errors=cleanup_errors,
formal_before=formal_before, formal_after=formal_after,
whole_goal_accepted=False, unit_accepted=False)
# IO1 has already copied all four members into a separate Reader profile.
# Mirror those exact complete directories to own B for read-only R verification.
# Original profile paths are provenance after this step, never verifier inputs.
try:
if passed:
relocated = {}
for role in ("writer", "reader"):
receipt = r.read(out / ("raw/" + role + ".json"))
relocated[role] = {}
for slot, original in receipt["slots"].items():
target = out / "formal" / role / slot
target.mkdir(parents=True)
members = r.inventory(Path(original))
r.require(set(members) == {"journal.log", "manifest.json", "thumbnail.png", "world.bin"}, "all formal members")
for member in members:
shutil.copyfile(Path(original) / member, target / member)
r.require(r.inventory(target) == members == formal_before[slot], "whole formal mirror")
relocated[role][slot] = dict(provenance=original, relative=str(target.relative_to(out)), members=members)
r.write(out / "formal-relocation.json", relocated)
r.write(out / "raw-inventory.json", r.inventory(out / "raw"))
r.write(out / "PID-set.json", dict(owner_runner_pid=os.getpid(), engine_PIDs=pids))
except BaseException as caught:
guards.append("output collection: " + type(caught).__name__ + ": " + str(caught))
passed = False
execution["passed"] = False
try:
repin("after-output-collection")
except BaseException as caught:
guards.append(str(caught))
passed = False
execution["passed"] = False
try:
r.write(out / "engine-identity.json",
dict(observations=engine_observations, identity=engine_identity))
except BaseException as caught:
guards.append("engine identity receipt: " + type(caught).__name__ + ": " + str(caught))
passed = False
execution["passed"] = False
execution["engine_observations"] = engine_observations
execution["engine_identity"] = engine_identity
r.write(out / "execution.json", execution)
r.write(out / "runner-ended.json", dict(execution, ended=r.now()))
print(json.dumps(dict(passed=passed, error=error, guard_errors=guards, output=str(out))))
return 0 if passed else 1
if __name__ == "__main__":
try:
raise SystemExit(main())
except Exception as caught:
print(type(caught).__name__ + ": " + str(caught), file=sys.stderr)
raise SystemExit(2)
@@ -29,19 +29,20 @@ LABELS = {"S4": ["boundary", "held", "recovered"]}
SLOTS = ["S4-" + label for label in sorted(LABELS["S4"])]
MATERIALS = [MANIFEST, BUILD / "audit-support/p04-review-repair22-r01/ACTUAL_CURRENT_PUBLIC_POWER_FUNCTIONS.json"]
def template_guard(root):
if root != PRODUCT.resolve() or not HERE.is_relative_to(BUILD.resolve()):
raise ValueError("Root must stage this exact QA/wrapper/plan inside own B")
if pin(MANIFEST)["sha256"] != MANIFEST_SHA:
raise ValueError("immutable full R17 relocation manifest")
manifest = json.loads(MANIFEST.read_text())
for name, source in manifest["product_source"].items():
# Old absolute paths are lookup keys only. Never open them.
row = manifest["original_to_relocated"][source["path"]]
actual = pin(root / name)
if Path(row["relocated"]).resolve() != root / name or any(
actual[k] != source[k] or actual[k] != row[k] for k in ("bytes", "sha256")):
raise ValueError("relocated product differs: " + name)
def template_guard(root, historical=True):
if historical:
if root != PRODUCT.resolve() or not HERE.is_relative_to(BUILD.resolve()):
raise ValueError("Root must stage this exact QA/wrapper/plan inside own B")
if pin(MANIFEST)["sha256"] != MANIFEST_SHA:
raise ValueError("immutable full R17 relocation manifest")
manifest = json.loads(MANIFEST.read_text())
for name, source in manifest["product_source"].items():
# Old absolute paths are lookup keys only. Never open them.
row = manifest["original_to_relocated"][source["path"]]
actual = pin(root / name)
if Path(row["relocated"]).resolve() != root / name or any(
actual[k] != source[k] or actual[k] != row[k] for k in ("bytes", "sha256")):
raise ValueError("relocated product differs: " + name)
probe = QA.read_text()
import re
if ":=" in probe or re.search(r"\bvar\s+\w+\s*=", probe) or re.search(r"\bfor\s+\w+\s+in\b", probe):
@@ -105,12 +106,33 @@ def main():
help="optional passed registered cache; default is fresh, without cache access")
parser.add_argument("--godot", type=Path, default=ENGINE)
parser.add_argument("--check-only", action="store_true")
parser.add_argument("--main")
parser.add_argument("--submission")
parser.add_argument("--tested-tree")
parser.add_argument("--historical-r17", action="store_true")
args = parser.parse_args()
shared = module("fresh_q_shared", HERE.parent / "s5/run_s5_native.py")
mode = shared.select_mode(args)
fresh = mode == "fresh-q"
if fresh and "--project-root" not in sys.argv:
raise ValueError("fresh-q requires explicit --project-root")
if fresh and "--cache-run" not in sys.argv:
args.cache_run = None
engine_descriptor = shared.engine_pin(args.godot) if fresh else None
provenance = None
engine_descriptor = engine_pin(args.godot)
if args.cache_run is not None and args.cache_run.resolve() != CACHE_RUN.resolve():
raise ValueError("only registered own-B full-run cache")
if args.project_root.is_symlink():
raise ValueError("project root symlink")
root = args.project_root.resolve()
out = args.output.resolve()
if fresh:
if not out.is_relative_to(BUILD.resolve()) or not args.plan.resolve().is_relative_to(BUILD.resolve()):
raise ValueError("fresh plan/output must stay inside BUILD")
if out.exists() or out.is_symlink() or (args.check_only and args.plan.exists()):
raise ValueError("fresh output and plan required")
if not out.is_relative_to(BUILD.resolve()) or not args.plan.resolve().is_relative_to(BUILD.resolve()):
raise ValueError("plan/output must stay in task build")
if out.exists() or out.is_symlink():
@@ -120,15 +142,17 @@ def main():
r = module("s4_standard_runner", root / "tools/run_all_tests.py")
# Preserve the reviewed source_refs -> exactly one QA override order.
source_before = r.source_refs(root)
if fresh:
provenance = shared.fresh_q_guard(root, args.main, args.submission, args.tested_tree)
refs = dict(source_before)
refs[TEST] = pin(QA)
template_guard(root)
template_guard(root, historical=not fresh)
expected = {n: dict(bytes=p["bytes"], sha256=p["sha256"]) for n, p in refs.items()}
fixed = [pin(p) for p in MATERIALS + [
fixed = [pin(p) for p in ([] if fresh else MATERIALS) + [
QA, Path(__file__), HERE / "S4_ROOT_RUN.md",
root / "tests/transport/test_runtime_transport.gd",
root / "tests/staff/test_rescue_elevator.gd",
CONTRACTS,
root / shared.C_REL if fresh else CONTRACTS,
]]
selected = dict(root_before=source_before, map={n: p["sha256"] for n, p in refs.items()}, timeout=1200)
cache_note = None
@@ -154,6 +178,16 @@ def main():
cache_receipts=cache_receipts, cache_access=cache_note,
phases=["import", "parse", "writer", "reader"],
native_engine_launches=0, whole_goal_accepted=False, unit_accepted=False)
if fresh:
uid_plan, uid_snapshot, uid_binding = shared.load_uid_helper(root, r, source_before)
uid_source = copy.deepcopy(expected)
uid_plan_map = uid_plan(refs)
plan.update(protocol="p04-s4-fresh-q-v1", mode=mode, provenance=provenance, engine=engine_descriptor,
engine_sha256=engine_descriptor["sha256"], uid_helper=uid_binding,
uid_plan=uid_plan_map, import_mode="fresh" if args.cache_run is None else "cache",
historical_r17=False, fresh_q_evidence=False)
fixed.append(pin(HERE.parent / "s5/run_s5_native.py"))
# No historical execution is admitted.
# Check-only only reads source/materials and writes the plan in task build.
# Reads engine identity; never launches Godot or inspects players/processes.
if args.check_only:
@@ -163,7 +197,7 @@ def main():
QA_overrides=[TEST], fixed_pins=len(fixed), plan=str(args.plan),
plan_sha256=r.sha(args.plan), cache_access=cache_note), ensure_ascii=False))
return 0
r.require(root == PRODUCT.resolve() and len(source_before) == 1338, "Root native requires product 1338; worker plan is not native evidence")
r.require(fresh, "historical mode is read-only")
r.require(args.plan.is_file() and r.read(args.plan) == plan, "run exact check-only plan first")
engine_observations = []
engine_identity = dict(before=engine_descriptor, during=[], after=None)
@@ -178,9 +212,19 @@ def main():
except BaseException as caught:
engine_observations.append(dict(stage=label, error=str(caught)))
raise
reports, phase_call, uid_state = shared.make_uid_policy(r, uid_snapshot, uid_source, uid_plan_map, out)
engine_checks = []
def fresh_engine_check(label):
value = shared.engine_pin(args.godot, engine_descriptor)
engine_checks.append(dict(label=label, descriptor=value))
def fixed_guard():
fresh_engine_check("fixed")
r.require(shared.fresh_q_guard(root, args.main, args.submission, args.tested_tree) == provenance,
"fresh Q provenance changed")
r.require(pin(root / uid_binding["helper_path"])["sha256"] == uid_binding["helper_sha256"],
"UID helper changed")
repin("cleanup-fixed-guard")
template_guard(root)
template_guard(root, historical=not fresh)
for value in fixed + cache_receipts:
r.require(pin(value["path"]) == value, "fixed input changed: " + value["path"])
fixed_guard()
@@ -257,7 +301,7 @@ def main():
r.require(len(paths) == 316, "complete 316-script parse roster")
r.write(out / "parse-paths.json", paths)
markers = module("s4_markers", root / "tools/strict_test_markers.py")
contracts = markers.load_contracts(CONTRACTS)
contracts = markers.load_contracts(root / shared.C_REL if fresh else CONTRACTS)
contracts[TEST] = dict(test=TEST, template="S4 power: <checks> checks, <failures> failures", required=True)
policy = r.read(r.SUPPORT / "suite-policy.json")
r.require(TEST not in policy["suite_policies"], "no normal suite watchdog/policy override")
@@ -283,7 +327,10 @@ def main():
repin("before-" + phase)
r.write(out / ("engine-identity-before-" + phase + ".json"),
dict(engine_observations[-1], observation_index=len(engine_observations)-1))
row = r.execute_phase(str(engine), stage, out, phase, test, selected, expected,
fresh_engine_check("before-" + phase)
if phase == "import" and old is None:
r.require(not (stage / ".godot").exists(), "fresh import cache absent")
row = phase_call(str(engine), stage, out, phase, test, selected, expected,
previous, policy, contracts, paths, public, protected, root,
outer, markers, diagnostics, owners, audio)
phases.append(row)
@@ -330,6 +377,8 @@ def main():
# Fixed guard always follows ownership cleanup, even if setup or an engine failed.
try:
fixed_guard()
r.require(uid_snapshot(stage, uid_source, uid_plan_map) == uid_state["accepted"], "UID seal after cleanup")
r.write(out / "fresh-engine-checks.json", engine_checks)
after = r.source_refs(root)
r.write(out / "source_after.json", after)
r.require(after == source_before, "whole product source unchanged")
@@ -345,7 +394,7 @@ def main():
except BaseException as caught:
guards.append(type(caught).__name__ + ": " + str(caught))
pids = [p.pid for p in outer.OWNED]
passed = (error is None and not guards and not cleanup_errors and len(phases) == 4
passed = (uid_state["accepted"] is not None and error is None and not guards and not cleanup_errors and len(phases) == 4
and all(p["passed"] for p in phases) and len(pids) == len(set(pids)) == 4
and all(p["engine_ended"] for p in cleanup))
execution = dict(passed=passed, error=error, guard_errors=guards, phases=phases,
@@ -0,0 +1,145 @@
# REPAIR45 — whole unit remains incomplete
## REPAIR45 — implementation ready for submission
The supplied byte-verified M engine-free context resolved the REPAIR44 UID dependency.
UID controls: all 14 PASS, exit 0. Both supplied helper SHA-256 pins match exactly.
AST and explicit fresh BUILD-cfile py_compile passed for all eight touched Python
files, with python3 -B and PYTHONDONTWRITEBYTECODE=1. No source was changed in
REPAIR45; retained passing controls were not rerun. The no-pyc static check
passed again (exit 0); generated compile files exist only under allocated BUILD.
The prior UID failure remains recorded as failed, not replaced with a PASS.
Sequential check-only S1, S2a, S2b, S3, S4 and S5 each returned exit 2:
`ValueError: checkout is not clean`
The initial missing-tested-tree argument refusals are also retained. The later
attempt used the actual HEAD tree solely as a guard input, not a claim of final
Q, clean source or C. No engine started. Root executes clean exact-Q check-only
after automatic submission. Full argv/stdout/stderr and compile paths are in
REPAIR41_STATIC_CHECKS.json. No Git writes, Runner or native run were performed.
Implementation is ready; the whole original unit remains incomplete and P04
credit remains 0. Deferred Root conditions, in order: freeze final Q; affected
pure controls; clean exact-Q check-only; capacity check; one heavy lease with
fresh native S1–S4 and all ten S5 cases; independent Reader and adapters on actual
raw (including fresh Reader order positives); fresh collect; full 184 suite once;
index; --verify-only; registered validation before review; independent whole-unit
Opus review; normal prepare / exact C / integration / final / Root DB join /
ledger / main push. Native Reader and acceptance remain pending.
patience_release stays pending unless fresh S3 raw shows it. Product freeze,
M, allowed paths, REQUIRED membership/thresholds, all seven domains, G1/G2,
R40–R44 and the existing one-trailing-LF spec protocol remain unchanged.
# REPAIR44 — original whole unit incomplete
Worker status is **blocked**, not ready for Root native execution. UID pure
control could not read the supplied Q checkout's tools/run_all_tests.py
(PermissionError). See ../REPAIR41_STATUS.md and ../REPAIR41_STATIC_CHECKS.json.
AST/build compilation for every touched Python file and check-only S1–S5
remain unexecuted; resume worker verification before freezing a final Q.
Native Reader and acceptance remain pending. The current ten-case roster is
`S5A_PURE`, `S5B_DEPENDENCY`, `S5C_DESTRUCTION_COMMAND`, `S5D_DESTRUCTION_RAID`,
`S5D_IN_FLIGHT`, `S5D_PAID_BEFORE_INCIDENT`, `S5E_MIDNIGHT`, `S5F_EXIT`,
`S5G_SHIFT_1080`, `S5H_PAUSED_MIDNIGHT`.
The new case supplies a typed raw derivation for N completion/payment, public
event destruction after payment, and N+1 failure/release of the secondary.
It does not supply executed native evidence. The D05 destruction gate requires
it in addition to every existing command/guard/idle/in-flight gate.
patience_release stays pending unless fresh S3 raw proves it.
r35, r36, R40 native and R43 native remain FAILED. Q37 is a local PASS for its
own version only. R43 Writer 2749/0, seven Writer-only derivers plus G1/G2, twelve
pure controls and six check-only steps retain their limited historical scope;
none is independent Reader proof. Original credit 30/88, formal credit 16/88,
P04 credit 0; no new task/unit/worker or completion claim.
REPAIR41_STATIC_CHECKS.json records only worker checks actually executed.
Root must freeze final Q, then follow S5_ROOT_RUN.md, including fresh S1–S5,
Reader/adapters, collect, full 184 suite once, index, verify-only, registered
validation, independent review and normal integration. Historical text below
does not replace this order or the current ten-case roster.
# Historical REPAIR43 — native evidence and formal acceptance pending
The R42/R43 implementation batch now includes the public-restored G1/G2
journal shadows, independent typed adapter oracle, exact-N idle OBJECTIVE
breach, S5D_IN_FLIGHT event destruction, S5G_SHIFT_1080, S5H_PAUSED_MIDNIGHT,
and S5E public same-minute advance_to after formal restore. See
`../REPAIR41_STATUS.md` and `../REPAIR43_SOURCE_FACTS.json` for source bodies,
lines, hashes and the spec EOF protocol. The closed-field/file-freeze blockers
are superseded. The spec passes its existing checker protocol without edits.
Implementation is not native proof. Root must run the fresh nine-case S5
Writer/Reader and adapters alongside fresh S1–S4 in the prescribed single
batch. The new shift/paused/replay keys are emitted only after fresh typed raw
derivation; paused_midnight is then removed from the adapter pending list.
patience_release remains pending unless fresh S3 independently supplies it.
Future-raw positives and mutations are Root-only. No historical run supplies
these new keys. All 15+EV requirements and thresholds remain mandatory.
Pure results are in `../REPAIR43_PURE_RESULTS.json`; static results are in
`../REPAIR41_STATIC_CHECKS.json`. r35/r36/R40 native remain FAILED, Q37 is only
its own-version local PASS, and P04 credit remains 0. Registered validation
precedes formal independent whole-unit review. No native/full run was performed
by this worker; no completion claim or new counted unit is made.
## Historical REPAIR41 partial repair (superseded implementation status)
See `../REPAIR41_STATUS.md`: M serializes an additional `command_queue.accepted`
metadata row for both guard failures, outside the explicitly enumerated G1/G2
queue deltas. Its inclusion needs clarification before claiming exact equality.
Only the mandatory-condition diagnostic and historical/fresh S4 wrapper
separation are implemented and supersede their earlier repair-pending entries.
S5D re-scope/G1/G2/breach, S5G/S5H, same-minute replay, adapter derivations and
fresh-condition wiring remain pending. R40 native S5D remains FAILED; its prior
source implementation below is not an accepted fixture. No P04 credit is earned.
## Historical REPAIR40 implementation supersession
The implementation-pending statements below are superseded only for S5A/S5B
power, S5C command destruction, S5D automatic raid destruction, S5E paid midnight
and S5F command/planned exit. The single CASE_TABLE now dispatches these cases.
No case is relabelled as an executed proof. Root must establish every outcome
from fresh Q raw; an unalignable raid or unsupported condition fails normally.
The S5 order adapter does not infer patience_release or paused_midnight.
Fresh S3 can supply patience_release only from its own actually observed raw.
The remaining frozen REQUIRED conditions, including shift_completion,
same_minute_replay and paused_midnight, are not supplied by historical union.
The final checker must remain failed if any required condition is missing.
The earlier text is retained as historical planning context:
# S5 — pending implementation, not a native run plan
No S5 executable driver or native receipt is supplied by this partial repair.
Do not start the once-only Q native/full batch from this directory.
The four required cases remain unchanged:
1. Real mana depletion, NO_POWER, no charge/progress, reservation retained,
recovery and one completion. S4's `disconnect_nodes` is not depletion.
The existing cafeteria fixture has an operating kitchen prerequisite;
global depletion can select RELATED_FACILITY_INACTIVE first. A driver must
observe that distinction rather than relabel the reason or mutate power
availability directly. A separate combined-cause case must prove the
approved RELATED-before-NO_POWER reason priority.
2. Actual accident or raid destruction during completion: valid minute-N
sale; next-minute failure/release for unfinished affected work; compare
command destruction before completion. S3 B4a/B4b use a registered event
with SET_FACILITY_STATE and must not simply be renamed an actual raid.
3. 00:00 completion: retain the S2a paid-midnight setup and full typed
snapshots, add phase observations proving prior-day settlement/upkeep
precede the sale, and independently join the sale to the new accounting
day. Retain replay/no-double-settlement proof.
4. Command exit versus AI planned exit at completion: retain actual public
commands and guest/service/reservation/ledger joins. Observe the AI
DECIDING predicate after completion, without forcing guest state or
treating a due exit time as universal active-service cancellation.
All prices, durations, resource rules and thresholds come from the selected
Q definitions and current public runtime. No new original values or rules
are supplied here. These notes identify implementation work; they are not
engine evidence and confer no condition credit.
@@ -0,0 +1,310 @@
# REPAIR45 handoff
## REPAIR45 — implementation ready for submission
The supplied byte-verified M engine-free context resolved the REPAIR44 UID dependency.
UID controls: all 14 PASS, exit 0. Both supplied helper SHA-256 pins match exactly.
AST and explicit fresh BUILD-cfile py_compile passed for all eight touched Python
files, with python3 -B and PYTHONDONTWRITEBYTECODE=1. No source was changed in
REPAIR45; retained passing controls were not rerun. The no-pyc static check
passed again (exit 0); generated compile files exist only under allocated BUILD.
The prior UID failure remains recorded as failed, not replaced with a PASS.
Sequential check-only S1, S2a, S2b, S3, S4 and S5 each returned exit 2:
`ValueError: checkout is not clean`
The initial missing-tested-tree argument refusals are also retained. The later
attempt used the actual HEAD tree solely as a guard input, not a claim of final
Q, clean source or C. No engine started. Root executes clean exact-Q check-only
after automatic submission. Full argv/stdout/stderr and compile paths are in
REPAIR41_STATIC_CHECKS.json. No Git writes, Runner or native run were performed.
Implementation is ready; the whole original unit remains incomplete and P04
credit remains 0. Deferred Root conditions, in order: freeze final Q; affected
pure controls; clean exact-Q check-only; capacity check; one heavy lease with
fresh native S1–S4 and all ten S5 cases; independent Reader and adapters on actual
raw (including fresh Reader order positives); fresh collect; full 184 suite once;
index; --verify-only; registered validation before review; independent whole-unit
Opus review; normal prepare / exact C / integration / final / Root DB join /
ledger / main push. Native Reader and acceptance remain pending.
patience_release stays pending unless fresh S3 raw shows it. Product freeze,
M, allowed paths, REQUIRED membership/thresholds, all seven domains, G1/G2,
R40–R44 and the existing one-trailing-LF spec protocol remain unchanged.
# REPAIR44 — ten cases, final Q must be frozen by Root
**Worker blocked on an unreadable UID-check dependency; do not start native
execution from this partial repair.** See ../REPAIR41_STATUS.md. Remaining
worker AST/compile and check-only checks must finish before this Root order.
The complete roster is `S5A_PURE`, `S5B_DEPENDENCY`, `S5C_DESTRUCTION_COMMAND`,
`S5D_DESTRUCTION_RAID`, `S5D_IN_FLIGHT`, `S5D_PAID_BEFORE_INCIDENT`,
`S5E_MIDNIGHT`, `S5F_EXIT`, `S5G_SHIFT_1080`, `S5H_PAUSED_MIDNIGHT`.
CASES is sorted from CASE_TABLE; LABELS and all 23 slots derive from it.
Receipt membership is order-independent and rejects missing/duplicate/extra
cases or slots. Reader independently enumerates CASE_TABLE.
The new case completes and pays the primary at N, destroys through the public
automatic event in INCIDENTS_AND_EVENTS at N, and fails/releases the unfinished
secondary at N+1. See ../REPAIR44_SOURCE_FACTS.json and the REPAIR44 section in
../REPAIR41_STATUS.md. No Defense asset registration or guard bypass is used.
Run repair44_controls.py in addition to every existing pure control. Synthetic
typed controls are not native evidence. R43 Writer 2749/0 and Writer-only typed
analysis did not run the Reader; R43 native remains FAILED.
Authoritative Root order, after freezing the final Q:
1. Affected pure controls, including repair44_controls.py.
2. Check-only S1–S5 plan (after controls finish writing temporary fixtures).
3. Capacity check.
4. One heavy lease: fresh native S1–S5, all ten S5 cases.
5. Independent Reader and adapters on actual raw.
6. Fresh collect, recomputing the new D05 sub-gate from raw.
7. Full 184 exact-Q regression once.
8. Index.
9. --verify-only.
10. Registered validation.
11. Independent whole-unit Opus review.
12. Normal prepare / exact C / integration / final / Root DB join / ledger / main push.
No worker engine/native/full regression or Git write is authorized. Whole-unit
acceptance and patience_release remain pending. Local checks earn no credit.
# Historical REPAIR43 submission — superseded current roster
The R41 closed journal-field restriction and R42 raw-only spec stop are
superseded. The spec passes the existing one-final-LF checker condition.
`../REPAIR41_STATUS.md` describes the complete R42/R43 implementation and
`../REPAIR43_SOURCE_FACTS.json` contains full current-M source bodies/hashes.
This is a QA submission, not admission, native PASS or formal completion.
The case table now includes S5A/B/C, S5D_DESTRUCTION_RAID (idle OBJECTIVE plus
G1), S5D_IN_FLIGHT (event path plus G2), S5E/F, S5G_SHIFT_1080 and
S5H_PAUSED_MIDNIGHT. The wrapper already derives CASES/LABELS/SLOTS from this
table. Preserve the table-driven full roster. G1/G2 use public paused immediate
submission with detached public-restored shadows; business state is identical
and the whole typed journal is independently recomputed by the adapter.
Stage the entire QA hierarchy, including new `s5_guard_oracle.py`, with the
selected exact Q. Worker static/pure outputs do not establish Q applicability.
Run `s5_order_adapter_controls.py --pure-only` among affected pure controls.
After fresh Reader raw exists, run its ordinary explicit
`--raw-root/--writer-sha256/--reader-sha256/--scratch` mode as well; this executes
the actual-data derivations and all typed order/guard mutations. Preserve the
failed R40 native result and never reuse its missing Reader as a positive.
Authoritative corrected Root order:
1. Affected pure controls.
2. Check-only S1–S5 plans.
3. Capacity check under existing permissions, with no unapproved deletion.
4. One heavy lease for fresh native S1–S5 including S5D/G/H, PID/cleanup checks
and complete restore manifests.
5. Reader and adapter on actual raw, including the fresh-raw mutation controls.
6. Fresh collect.
7. Full suite once, after source and controls are ready.
8. Index.
9. --verify-only.
10. Registered validation.
11. Formal independent whole-unit Opus review.
12. Prepare / exact-C standing authorization / integration / final / DB join /
ledger / push under the existing Root workflow.
No heavy tests while the worker is active. A second batch is only for defects
revealed by observed native raw. The obsolete 500000-byte review-material cap
does not apply; do not omit source/evidence or compress merely to meet it.
## Historical REPAIR41 direction (superseded by the order above)
The exact G1/G2 oracle has a source-contract conflict documented in
`../REPAIR41_STATUS.md`. M also serializes one new `command_queue.accepted` row.
Only the mandatory-condition diagnostic and historical/fresh S4 wrapper pin
separation are repaired. S5D/G/H and adapter/fresh wiring remain unimplemented.
Do not treat the partial pure-check results as worker success or native evidence.
After a complete submission, the recorded Root order remains:
1. Affected pure controls.
2. Check-only S1–S5 plan.
3. Capacity check before the single heavy lease (about 3 GB free; OS swap is
separate from evidence); only verified compression or approved cold-drive
offload if needed, with no unapproved deletion.
4. One heavy lease for fresh native S1–S5 including S5D/G/H, PID/cleanup checks,
complete Git restore manifest and reuse of the ended Q.
5. Reader and S5 order adapter on actual raw.
6. Fresh collect.
7. Full suite 184/329 once on final Q.
8. Index.
9. --verify-only.
10. Independent Opus review of the whole unit.
11. Registered validation.
12. Normal prepare/final, exact-C approval, integration, Root DB join, ledger
and main push.
This list preserves the latest recorded order over the earlier condensed list
below. A second batch is only for defects revealed by observed native raw.
# REPAIR40 A–F source batch — Root verification required
This section supersedes earlier implementation-pending directions below only
for the code now supplied. It is not admission, a native result, original credit,
or permission to repeat the once-only final full run.
Root order (unchanged):
1. Affected pure controls. Keep every previous negative. Run full_suite_verifier.py
--controls. New S5 typed mutation controls require actual fresh native raw;
their positives remain unexecuted until that raw exists.
2. Check-only S1–S5 plans on the final Q.
3. One heavy lease: fresh native S1–S5, capacity/PID checks and verified complete
Writer/Reader restore manifests. Within this step, evaluate the order adapter
and its typed mutation controls against actual S5 raw when available.
4. Fresh collect to a new exclusive audit-support/p04-raw-collect-q<N>.
5. Full 184/329 once on final Q; derive actual roster/parse/source counts.
6. Index.
7. --verify-only.
8. Independent review.
9. Normal prepare/final and Root post-final normal_c_join.
Stage the complete unchanged directory hierarchy (including shared s5 wrapper,
adapters and series dependencies) under BUILD/audit-support/p04-fresh-context.
Stage the actual Q source there as well, preserving source bytes. Native outputs
must be separate directories under BUILD, outside that context directory.
Use --main M --submission S --tested-tree Qt --project-root <actual-Q> for every
run_s*_native.py. No global monkeypatching is used to select Q.
Historical --historical-r17 --check-only remains read-only. No historical native
execution is admissible. All fresh plans/outputs are exclusive and must be absent.
The single QA override and the selected source/UID/engine/ownership gates remain.
Before fresh collection Root writes audit-support/p04-fresh-runs.json from the
actual receipts (no baked receipt SHA values):
- protocol: p04-fresh-runs-v1
- M, S, Q_tree: the actual full HEX40 inputs
- collection: audit-support/p04-raw-collect-q<N>
- series: exactly s1, s2a, s2b, s3, s4, s5; each entry has run (BUILD-relative)
and byte/SHA descriptors named runner_input, runner_ended, raw_inventory,
formal_relocation, read from the corresponding actual output files.
- full_suite: run (BUILD-relative), runner_input and runner_ended descriptors
from the final full run. These fields are consumed at index/checker time,
so fresh collection precedes and does not depend on the full run.
Use collect_p04_native.py --build <BUILD> --fresh q<N>.
Never overwrite r22 and never merge its verified_conditions.
The full run uses the actual Q tools/run_all_tests.py standard schema and the
Root finite-UID controller contract illustrated in the hash-verified context.
Retain source-start.json, runner-input/ended, all-tests, parse-paths, every phase
receipt/process/started/ended/log, UID plan/seals, retained stage and generated
reports. full_suite_verifier imports that actual Q runner and marker/diagnostic
modules. Its 15+EV entries explicitly distinguish suite applicability from
boundary proof. test_required_kitchen is separately bound. It consumes no C,
prepare/final or independent-review result; normal C remains Root's later join.
S5 has one CASE_TABLE for reserved counts, ordered labels and prepare/advance/
stop/assert methods. S5A/B retain their original recovery and duplicate path.
S5C–F use public commands and ordinary ticks. The automatic raid uses the
autonomy fixture strengths with the service facility as OBJECTIVE; its queried
earliest_minute must equal N. New cases replay independently after formal load.
The adapter uses typed nodes, complete typed restore/replay equality and raw
phase/receipt joins. It fails rather than fabricating an unavailable observation.
The private receipt buffer is restored for C–F because their boundary already
contains transactions; the A/B boundary receipt behavior is unchanged.
No worker engine, Git, Runner, native or controls run occurred. Only the recorded
static checks were performed. r35/r36 remain FAILED; worker38/39 stops remain
historical records; Q37 remains a local diagnostic. Original credit remains zero.
## Retained earlier directions
# Concrete32 power pair — unexecuted, not batch admission
`p04_s5_power_probe.gd` supplies S5A_PURE (paid public bath, genuine mana
depletion) and S5B_DEPENDENCY (cafeteria plus kitchen, RELATED-before-NO_POWER).
Both use public resource commands, observed recovery, formal packages, independent
Reader replay, phase raw and resource-command replay receipts. The bath has no
item reservation; the dependent case retains and consumes the actual meal ID.
`run_s5_native.py` retains the S4 ownership/engine/cleanup safeguards. REPAIR35
adds fresh-Q input binding and separates historical R17 relocation checks from
the unchanged probe checks. All source and parse counts are derived. Historical
R17 requires `--historical-r17 --check-only` and is read-only. Only historical
mode defaults `--project-root` to PRODUCT. Fresh-Q requires an explicit root and
all three full lowercase HEX40 inputs. R17 MANIFEST and repair22 power-functions
JSON are historical_not_inputs in fresh-Q plans, never fresh-Q fixed pins.
No old S1–S4 record is renamed or reused as fresh proof.
REPAIR36 supplies a bounded UID diagnostic, not native/batch admission. Full admission still awaits S5
destruction/midnight/exit, S1–S4/collector fresh Q, 184 suites / 329 parse and the
truthful index are ready. Root run order and exact-candidate qualification also
remain pending. The native implementation is retained for later Root admission;
this change and a check-only plan give no admission or acceptance credit.
After the final submission, Root alone prepares Q using these steps (not performed by the worker):
1. Set S to the final submission and M to
`c0ea009b28a7649aca6a433a1a24dc0be5e7ab81`; derive Qt with
`git merge-tree --write-tree "$M" "$S"`.
2. Create X with `git commit-tree "$Qt" -m 'nonproduction Q checkout'` with
**no parents**, then create a clean worktree at X. X is a nonproduction
checkout carrier of Q, never normal Runner C. R34 and Root normal_c_join
remain unchanged.
3. Stage the s5 directory under Root's own B, the registered BUILD directory.
4. Follow the REPAIR37 order below, with fresh output and plan paths:
```sh
BUILD_OUTPUT_DIR="$B" python3 "$B/.../run_s5_native.py" \
--project-root "$wt" --main "$M" --submission "$S" --tested-tree "$Qt" \
--check-only --plan "$B/p04-s5-plan-r37.json" --output "$B/p04-s5-DIAG-r37"
```
5. Pure fixtures and controls follow the order below. Their JSON has accepted=false.
6. In separate controlled check-only cases, require rejection for: a dirty file;
an untracked file; HEAD tree unequal to --tested-tree; wrong --submission;
--main unequal to the frozen anchor. Preserve each actual rejection receipt
and restore a clean carrier between cases. These Git negatives and all pure
fixtures are unexecuted in this worker submission. No engine runs.
Root later stages the wrapper, probe and this document in its own build area.
The adapter takes `--raw-root`, `--writer-sha256`, `--reader-sha256` from verified
native records. It verifies referenced typed/JSON hashes and derives existing
measurement keys. It does not qualify source, engine, settings or full evidence.
S5 destruction, midnight and exit cases remain unimplemented. The preserved
`PENDING.md` is historical partial31 text; this document records only the added,
unexecuted power pair. D05 six approvals, A01, frozen M, 16/88 and P04 credit 0
are unchanged. All 7 domains + EV and original 30/88 remain fixed. Root alone
performs later qualification; no engine is authorized for this worker.
## REPAIR36 UID diagnostic protocol and Root order
Protocol `p04-s5-fresh-q-uid-diagnostic-v1` is a diagnostic composite with
standard_execute_phase_context=false, native_admissible=false and
fresh_q_evidence=false. The wrapper extracts only uid_plan and uid_snapshot
from the actual pinned Q helper using AST, binding shared to the actual Q
runner. It does not execute the helper module. Plans derive finite UID owners
from staged refs; import alone seals exact UID bytes. Private function globals
replace declared_reports while preserving the execute_phase code object.
All four phase UID receipts and the post-cleanup seal are required.
Historical mode has no UID instrumentation and remains read-only.
Root order for REPAIR37, all unexecuted by this worker (supersedes the earlier r36 order):
1. py_compile the wrapper, adapter and pure controls.
2. Run s5_uid_controls with explicit fresh BUILD scratch; UID sources/settings remain unchanged.
3. Run the adapter controls against the read-only q36-writer-contract bundle:
`python3 "$B/.../s5_power_adapter_controls.py" --fixture-dir "$fixture" --scratch "$B/p04-s5-adapter-controls-r37"`.
Scratch must be explicit, absolute, absent, outside project/fixture, with existing parent inside registered BUILD.
Verify accepted=false and root_only=true; this grants no acceptance.
4. Produce a fresh source-pinned check-only plan with the command above.
5. Perform at most one fresh source-pinned diagnostic under a new name, removing only --check-only.
Preserve p04-s5-DIAG-r36 as FAILED without retrospective pass. No full184 run.
Observe whether submit_command enqueue rejection emits command_completed: the probe's existing success expectation is unchanged, so such emission remains a failure.
Current grounding for this behavior is limited to command_queue.gd.reference and TYPED_AUDIT raw.
All six D05 decisions are approved in the actual human record; adoption verification is pending.
Counters stay 37; M c0ea009, original 30/88, formal 16/88 and P04 credit 0 remain frozen.
Whole independent Opus review and normal prepare/exact candidate/integration/final/Root join/ledger remain pending.
No full184 until the whole batch is ready.
Root must confirm the actual Q run_all_tests.py matches the supplied reference
(sha256 prefix 320ca668); the worker read only the mirror for Q API context.
Runtime helper fingerprints and source/provenance guards bind the actual Q.
No full regression, 15+EV batch or original credit is claimed. The S5
destruction/midnight/exit drivers, S1–S4/collector fresh Q, derived 184 suites /
329 parse, truthful index and Root exact-candidate qualification remain pending.
@@ -0,0 +1,799 @@
extends "res://tests/s3/test_runtime_actor_hardening.gd"
const CASE_TABLE: Dictionary = {
"S5A_PURE": {"expected_reserved_ids": 0, "labels": ["boundary", "held", "recovered", "duplicate_guard"], "prepare": "_prepare", "advance": "_advance", "stop": "_assert_stopped", "assert": "_assert_outcome"},
"S5B_DEPENDENCY": {"expected_reserved_ids": 1, "labels": ["boundary", "held", "recovered", "duplicate_guard"], "prepare": "_prepare", "advance": "_advance", "stop": "_assert_stopped", "assert": "_assert_outcome"},
"S5C_DESTRUCTION_COMMAND": {"expected_reserved_ids": 1, "labels": ["boundary", "held"], "prepare": "_prepare_order", "advance": "_advance_order", "stop": "_assert_order_stop", "assert": "_assert_order"},
"S5D_DESTRUCTION_RAID": {"expected_reserved_ids": 0, "labels": ["boundary", "held"], "prepare": "_prepare_idle_breach", "advance": "_advance_order", "stop": "_assert_idle_breach", "assert": "_assert_idle_order"},
"S5D_IN_FLIGHT": {"expected_reserved_ids": 1, "labels": ["boundary", "held"], "prepare": "_prepare_order", "advance": "_advance_order", "stop": "_assert_in_flight", "assert": "_assert_in_flight_order"},
"S5D_PAID_BEFORE_INCIDENT": {"expected_reserved_ids": 1, "labels": ["boundary", "held"], "prepare": "_prepare_order", "advance": "_advance_order", "stop": "_assert_paid_incident", "assert": "_assert_paid_incident_order"},
"S5G_SHIFT_1080": {"expected_reserved_ids": 1, "labels": ["boundary", "held"], "prepare": "_prepare_order", "advance": "_advance_order", "stop": "_assert_order_stop", "assert": "_assert_order"},
"S5H_PAUSED_MIDNIGHT": {"expected_reserved_ids": 1, "labels": ["boundary", "held", "recovered"], "prepare": "_prepare_order", "advance": "_advance_paused_midnight", "stop": "_assert_paused_midnight", "assert": "_assert_paused_midnight_order"},
"S5E_MIDNIGHT": {"expected_reserved_ids": 1, "labels": ["boundary", "recalled"], "prepare": "_prepare_order", "advance": "_advance_order", "stop": "_assert_order_stop", "assert": "_assert_order"},
"S5F_EXIT": {"expected_reserved_ids": 1, "labels": ["boundary", "held"], "prepare": "_prepare_order", "advance": "_advance_order", "stop": "_assert_order_stop", "assert": "_assert_order"}
}
const SEEDS: Dictionary = {"S5A_PURE": 420550, "S5B_DEPENDENCY": 420551, "S5C_DESTRUCTION_COMMAND": 420552, "S5D_DESTRUCTION_RAID": 420553, "S5D_IN_FLIGHT": 420553, "S5D_PAID_BEFORE_INCIDENT": 420558, "S5E_MIDNIGHT": 424242, "S5F_EXIT": 420555, "S5G_SHIFT_1080": 420556, "S5H_PAUSED_MIDNIGHT": 424242}
const GUEST: StringName = &"p04.s5.guest.a"
const REQUEST: StringName = &"p04.s5.request.a"
const QUEUED_GUEST: StringName = &"p04.s5.guest.b"
const QUEUED_REQUEST: StringName = &"p04.s5.request.b"
const SERVERS: Array[StringName] = [&"p04.order.server.a", &"p04.order.server.b"]
const SNAPSHOT_SERVERS: Array[String] = ["p04.order.server.a", "p04.order.server.b"]
var _evidence_dir: String = ""
var _mode: String = ""
var _case: String = ""
var _serial: int = 0
var _facility_id: StringName = &""
var _service_id: StringName = &""
var _boundary: int = 960
var _price: int = 0
var _duration: int = 0
var _patience: int = 0
var _reserve: int = 0
var _resource_command: Dictionary = {}
var _recovery: Dictionary = {}
var _commands: Array = []
var _results: Array = []
var _receipts: Array = []
var _phases: Array = []
var _points: Dictionary = {}
var _branches: Dictionary = {}
var _slots: Dictionary = {}
var _replay_reference: Dictionary = {}
var _guard_references: Dictionary = {}
var _expected_failure: Dictionary = {}
var _observed_phase: String = ""
func _run() -> void:
_evidence_dir = OS.get_environment("THE_TREE_S5_EVIDENCE")
_mode = OS.get_environment("THE_TREE_S5_MODE")
if _evidence_dir.is_empty() or _mode not in ["writer", "reader"]:
quit(2)
return
_expect(DirAccess.make_dir_recursive_absolute(_evidence_dir) == OK, "external evidence directory")
if _mode == "writer":
for branch: String in CASE_TABLE:
_case = branch
_writer_case()
else:
_reader()
_write(_mode, {&"pid": OS.get_process_id(), &"profile": OS.get_user_data_dir(), &"slots": _slots,
&"branches": _branches, &"checks": _checks, &"failures": _failures,
&"whole_goal_accepted": false, &"unit_accepted": false}, true)
_cleanup()
print("S5 power: %d checks, %d failures" % [_checks, _failures])
quit(1 if _failures else 0)
func _fresh() -> void:
_serial = 0
_facility_id = &""
_service_id = &""
_boundary = 960
_price = 0
_duration = 0
_patience = 0
_reserve = 0
_resource_command = {}
_recovery = {}
_replay_reference = {}
_guard_references = {}
_expected_failure = {}
_observed_phase = ""
_commands = []
_results = []
_receipts = []
_phases = []
_points = {}
_reset_runtime(SEEDS[_case])
_runtime.configure_save_policy({&"enabled": false, &"daily_checkpoint_enabled": false})
_runtime.command_completed.connect(func(result: CommandResult) -> void:
_results.append({&"minute": _clock.absolute_minute, &"result": result.to_dictionary()})
if not _expected_failure.is_empty() and result.command_id == _expected_failure["command_id"]:
_expect(var_to_bytes(result.to_dictionary()) == var_to_bytes(_expected_failure), "independently bound expected guard failure")
else:
_expect(result.is_success(), "actual public command completion " + str(result.command_id))
)
func _cmd(kind: StringName, payload: Dictionary, at: int = -1) -> CommandResult:
_serial += 1
var key: StringName = StringName("p04.s5.%s.command.%d" % [_case, _serial])
var result: CommandResult = _runtime.submit_command(kind, payload, &"player", &"", 10, at, key)
_commands.append({&"serial": _serial, &"kind": kind, &"payload": payload.duplicate(true),
&"at": at, &"issued_at": _clock.absolute_minute, &"idempotency_key": key, &"result": result.to_dictionary()})
_expect(result.is_success(), "public command " + String(kind))
return result
func _queue(guest_id: StringName, request_id: StringName, exit_at: int) -> void:
_cmd(&"spawn_guest", {&"guest_id": guest_id, &"guest_type_id": &"traveler", &"gold": _price * 2,
&"options": {&"state": GuestRuntime.State.DECIDING, &"current_cell": Vector3i.ZERO, &"planned_exit_at": exit_at}})
_cmd(&"create_service_request", {&"facility_id": _facility_id, &"request_id": request_id, &"guest_ids": [guest_id]})
var guest: GuestRuntime = _runtime.guest_service.get_guest(guest_id)
var request: ServiceRequest = _runtime.facility_service.get_request(request_id)
_expect(guest != null and request != null, "actual Guest and request exist")
if guest == null or request == null: return
_expect(guest.state == GuestRuntime.State.QUEUING and guest.queue_request_id == request_id, "actual queued ownership before advancing clock")
_expect(request.quoted_price == _price and request.service_minutes == _duration and request.reserved_inventory_ids.size() == CASE_TABLE[_case]["expected_reserved_ids"], "definition price/duration and one meal reservation")
for id: StringName in request.reserved_inventory_ids:
var reservation: InventoryReservation = _runtime.inventory_service.get_reservation(id)
_expect(reservation != null and reservation.is_active() and reservation.requester_id == request_id, "public queue actually reserves meal")
func _prepare() -> bool:
_fresh()
var facility: FacilityInstance
if _case == "S5B_DEPENDENCY":
facility = _build_cafeteria(true)
else:
var bath: FacilityDefinition = _runtime.definition_registry.get_facility(&"public_bath")
_expect(bath != null and bath.build_minutes > 0, "registered public bath definition")
if bath == null: return false
var build: CommandResult = _cmd(&"build_facility", {&"definition_id": &"public_bath", &"origin": Vector3i(-5, 0, WorldService.LAYER_FRONT)})
if not build.is_success(): return false
var began: int = _clock.absolute_minute
while _runtime.construction_service.get_facilities().is_empty() and _clock.absolute_minute <= began + bath.build_minutes:
_clock.advance_one_minute()
var built: Array[Dictionary] = _runtime.construction_service.get_facilities()
_expect(built.size() == 1 and _clock.absolute_minute - began == bath.build_minutes, "definition build duration and one constructed bath")
if built.size() != 1: return false
facility = _runtime.facility_service.get_instance(StringName(built[0][&"instance_id"]))
if facility == null: return false
_facility_id = facility.instance_id
var definition: FacilityDefinition = _runtime.definition_registry.get_facility(facility.definition_id)
_price = definition.base_price
_duration = definition.base_service_minutes
_patience = _runtime.guest_service.get_definition(&"traveler").base_patience
_expect(_price > 0 and _duration > 1, "paid natural service definition")
var staff_ids: Array[StringName] = []
for index: int in range(definition.staff_min):
var id: StringName = StringName("p04.s5.staff.%d" % index)
staff_ids.append(id)
_cmd(&"register_staff", {&"staff_id": id, &"role_id": &"server" if _case == "S5B_DEPENDENCY" else &"attendant", &"options": {&"state": StaffRuntime.State.OFF_DUTY, &"current_cell": Vector3i.ZERO}})
_cmd(&"set_staff_work_assignment", {&"staff_id": id, &"template_id": &"DAY", &"facility_id": _facility_id})
_expect(_clock.absolute_minute < _boundary - _duration - 1, "setup before fixed boundary")
if _clock.absolute_minute >= _boundary - _duration - 1: return false
_clock.advance_minutes(_boundary - _duration - 1 - _clock.absolute_minute)
_expect(facility.active_staff_ids == staff_ids, "public staff attendance")
if _case == "S5B_DEPENDENCY":
_expect(_stock(facility.local_inventory_id, &"ingredient/basic_meal", 1, &"p04.s5.stock"), "one actual meal")
_queue(GUEST, REQUEST, _boundary + _duration + 1)
_clock.advance_one_minute()
var active: Array = _runtime.facility_service.get_active_services(_facility_id)
_expect(active.size() == 1, "one actual started service")
if active.size() != 1: return false
var service: ServiceInstance = active[0]
_service_id = service.service_id
_expect(service.started_at + _duration == _boundary, "natural completion boundary")
_clock.advance_minutes(_boundary - 1 - _clock.absolute_minute)
_reserve = _state.get_resource(&"mana")
_recovery = {&"staff_ids": staff_ids, &"resume_minute": -1}
_expect(_reserve > 0 and service.elapsed_minutes == _duration - 1, "positive reserve and duration-1 progress")
return _clock.absolute_minute == _boundary - 1
func _prepare_order() -> bool:
_fresh()
var midnight: bool = _case in ["S5E_MIDNIGHT", "S5H_PAUSED_MIDNIGHT"]
if _case == "S5G_SHIFT_1080": _boundary = 1080
if midnight:
_boundary = 1440
var enabled: Dictionary = _runtime.enable_production_operations()
_expect(bool(enabled.get(&"ok", false)), "S2a public operations path")
if not bool(enabled.get(&"ok", false)): return false
var facility: FacilityInstance = _build_cafeteria(true)
if facility == null: return false
_facility_id = facility.instance_id
var definition: FacilityDefinition = _runtime.definition_registry.get_facility(facility.definition_id)
_price = definition.base_price
_duration = definition.base_service_minutes
_patience = _runtime.guest_service.get_definition(&"traveler").base_patience
if midnight:
_prepare_paid_reception()
_cmd(&"set_staff_work_assignment", {&"staff_id": StringName("fixture.kitchen.worker.%s" % _facility_id), &"template_id": &"NIGHT", &"facility_id": facility.related_facility_id})
var staff_ids: Array[StringName] = []
for index: int in range(definition.staff_min):
var id: StringName = StringName("p04.s5.staff.%d" % index)
staff_ids.append(id)
_cmd(&"register_staff", {&"staff_id": id, &"role_id": &"server", &"options": {&"state": StaffRuntime.State.OFF_DUTY, &"current_cell": Vector3i.ZERO}})
_cmd(&"set_staff_work_assignment", {&"staff_id": id, &"template_id": &"NIGHT" if midnight else &"DAY", &"facility_id": _facility_id})
var queue_at: int = _boundary - _duration - 1
if _case == "S5D_IN_FLIGHT": queue_at += 1
_expect(_price > 0 and _duration > 1 and queue_at > _clock.absolute_minute, "natural paid service before boundary")
if queue_at <= _clock.absolute_minute or _duration <= 1: return false
if _case == "S5D_DESTRUCTION_RAID":
_expect(_duration > 5, "raid setup fits before natural completion")
if _duration <= 5: return false
_clock.advance_minutes(queue_at - _clock.absolute_minute)
_expect(facility.active_staff_ids == staff_ids, "ordinary physical attendance")
var second: bool = _case in ["S5D_DESTRUCTION_RAID", "S5F_EXIT", "S5D_PAID_BEFORE_INCIDENT"]
_expect(_stock(facility.local_inventory_id, &"ingredient/basic_meal", 2 if second else 1, &"p04.s5.order.stock"), "actual reservable meals")
_queue(GUEST, REQUEST, _boundary if _case == "S5F_EXIT" else _boundary + _duration + 1)
_clock.advance_one_minute()
var active: Array = _runtime.facility_service.get_active_services(_facility_id)
_expect(active.size() == 1, "one natural primary service")
if active.size() != 1: return false
var service: ServiceInstance = active[0]
_service_id = service.service_id
_expect(service.started_at + _duration == _boundary + (1 if _case == "S5D_IN_FLIGHT" else 0), "natural completion from snapshot duration")
_price = service.price_snapshot
_duration = service.duration_minutes
if _case == "S5D_PAID_BEFORE_INCIDENT":
_expect(definition.capacity >= 2 and facility.active_staff_ids.size() >= definition.staff_min, "definition supports concurrent services with ordinary staff")
if definition.capacity < 2: return false
_clock.advance_minutes(_boundary - 2 - _clock.absolute_minute)
_queue(QUEUED_GUEST, QUEUED_REQUEST, _boundary + _duration + 1)
if _case == "S5D_DESTRUCTION_RAID":
_clock.advance_minutes(_boundary - 5 - _clock.absolute_minute)
_prepare_breach()
_clock.advance_minutes(_boundary - 2 - _clock.absolute_minute)
_queue(QUEUED_GUEST, QUEUED_REQUEST, _boundary + _duration + 1)
if _case == "S5H_PAUSED_MIDNIGHT":
_expect(_duration > 11, "pause begins before last pre-midnight MANA evaluation")
_clock.advance_minutes(_boundary - 11 - _clock.absolute_minute)
_reserve = _state.get_resource(&"mana")
_cmd(&"spend_resources", {&"cost": {&"mana": _reserve}})
_clock.advance_minutes(_boundary - 1 - _clock.absolute_minute)
if _case == "S5F_EXIT": _queue(QUEUED_GUEST, QUEUED_REQUEST, _boundary + _duration + 1)
if _case != "S5H_PAUSED_MIDNIGHT": _reserve = _state.get_resource(&"mana")
_recovery = {&"staff_ids": staff_ids, &"resume_minute": _boundary}
if _case == "S5D_IN_FLIGHT":
_guard_failure("G2", &"register_defense_asset", {&"raid_id": &"p04.s5.guard.raid", &"asset_id": _facility_id, &"kind": &"OBJECTIVE", &"max_integrity": 10000}, "A busy Facility cannot become a Defense asset.", {})
if _case in ["S5D_IN_FLIGHT", "S5D_PAID_BEFORE_INCIDENT"]:
_cmd(&"register_event_definition", {&"definition": {&"event_id": &"p04.s5.break", &"category": &"FLAVOR", &"priority": 100, &"foreground": false, &"transaction_policy": &"ROLLBACK_ALL", &"automatic_actions": [{&"action_id": &"break", &"type": &"SET_FACILITY_STATE", &"payload": {&"facility_id": _facility_id, &"conditions": {&"durability": 0, &"suspension_reason": &"DESTROYED"}}}]}})
if _case not in ["S5D_IN_FLIGHT", "S5H_PAUSED_MIDNIGHT"]:
_expect(service.elapsed_minutes == _duration - 1, "duration minus one at N-1")
return _clock.absolute_minute == _boundary - 1
func _prepare_paid_reception() -> void:
# S2a paid-midnight fixture, with catalog wages and ordinary assignments.
var definition: FacilityDefinition = _runtime.definition_registry.get_facility(&"reception")
_cmd(&"build_facility", {&"definition_id": &"reception", &"origin": Vector3i(2, 0, WorldService.LAYER_FRONT)})
_clock.advance_minutes(definition.build_minutes)
var reception_id: StringName = &""
for instance: FacilityInstance in _runtime.facility_service.get_instances():
if instance.definition_id == &"reception": reception_id = instance.instance_id
_expect(not reception_id.is_empty(), "public paid reception completed")
var catalog: Dictionary = JSON.parse_string(FileAccess.get_file_as_string("res://data/characters/mvp_staff_candidates.json"))
for candidate_id: StringName in [&"staff_akane", &"staff_bardo"]:
var wage: int = -1
for row: Dictionary in catalog["entries"]:
if StringName(row["id"]) == candidate_id: wage = int(row["daily_wage"])
_cmd(&"hire_staff_candidate", {&"candidate_id": candidate_id})
var worker: StaffRuntime = _runtime.staff_service.get_staff(candidate_id)
_expect(worker != null and wage > 0 and worker.get_effective_daily_wage() == wage, "unchanged paid catalog wage")
_cmd(&"set_staff_work_assignment", {&"staff_id": candidate_id, &"template_id": &"DAY" if candidate_id == &"staff_akane" else &"NIGHT", &"facility_id": reception_id})
func _prepare_breach() -> void:
# Exact autonomy fixture strengths; the real service facility is the objective.
_cmd(&"set_facility_conditions", {&"facility_id": _facility_id, &"conditions": {&"durability": 1}})
_cmd(&"register_staff", {&"staff_id": &"p04.s5.guard", &"role_id": &"security", &"options": {&"state": StaffRuntime.State.AVAILABLE, &"health": 100, &"fatigue": 0, &"skills": {&"combat": 100}}})
var wave: Dictionary = {&"wave_id": &"p04.s5.wave", &"threat_strength": 1000, &"retreat_threshold": 0, &"max_rounds": 1, &"entry_points": [&"gate.north"]}
_cmd(&"create_defense_raid", {&"raid_id": &"p04.s5.raid", &"definition": {&"source_id": &"runtime_test", &"entry_points": [&"gate.north", &"gate.south"], &"objective_ids": [_facility_id], &"waves": [wave], &"round_minutes": 5, &"max_duration_minutes": 180, &"retreat_policy": &"HOLD", &"defender_retreat_threshold": 0}})
_cmd(&"register_defense_combatant", {&"raid_id": &"p04.s5.raid", &"actor_id": &"p04.s5.guard", &"side": &"DEFENDER", &"combat": 0, &"max_health": 100, &"options": {&"armor": 2}})
_cmd(&"register_defense_asset", {&"raid_id": &"p04.s5.raid", &"asset_id": _facility_id, &"kind": &"OBJECTIVE", &"max_integrity": 10000, &"defense": 0, &"options": {&"target_order": 1}})
_cmd(&"register_defense_combatant", {&"raid_id": &"p04.s5.raid", &"actor_id": &"p04.s5.attacker", &"side": &"ATTACKER", &"combat": 1000, &"max_health": 100, &"options": {&"wave_id": &"p04.s5.wave", &"entry_point_id": &"gate.north"}})
_cmd(&"start_defense_raid", {&"raid_id": &"p04.s5.raid"})
var due: Array[Dictionary] = _runtime.defense_service.get_due_rounds(_boundary)
_expect(due.size() == 1 and due[0][&"earliest_minute"] == _boundary and due[0][&"raid_id"] == &"p04.s5.raid", "automatic breach due at exactly N; no substitute")
_recovery[&"due_rounds"] = due.duplicate(true)
func _guard_failure(label: String, kind: StringName, payload: Dictionary, message: String, details: Dictionary) -> void:
# Paused immediate public execution: no tick/business transition is permitted.
_clock.set_paused(true)
var before: Dictionary = _runtime.create_snapshot().duplicate(true)
var expected: Dictionary = before.duplicate(true)
var journal: Dictionary = expected[&"systems"][&"runtime"]
_expect(journal[&"command_queue"]["pending"].is_empty() and journal[&"command_queue"]["in_flight"].is_empty(), "isolated guard command")
_expect(not journal[&"operations"][&"enabled"], "guard has no population synchronization")
var queue: CommandQueue = CommandQueue.new()
var ids: StableIdGenerator = StableIdGenerator.new()
var events: DomainEventStream = DomainEventStream.new()
_expect(queue.restore_snapshot(journal[&"command_queue"]), "shadow queue public restore")
_expect(ids.restore_snapshot(journal[&"id_generator"]), "shadow ID public restore")
_expect(events.restore_snapshot(journal[&"domain_events"]), "shadow stream public restore")
_serial += 1
var key: StringName = StringName("p04.s5.%s.command.%d" % [_case, _serial])
var command: SimulationCommand = SimulationCommand.new(journal[&"next_command_id"], _clock.absolute_minute, _clock.absolute_minute, 10, kind, &"player", &"", payload, key)
var failure: CommandResult = CommandResult.failed(CommandResult.Code.VALIDATION_FAILED, command.command_id, message, details)
_expected_failure = failure.to_dictionary()
_expect(queue.enqueue(command).is_success(), "shadow enqueue")
var completed: Array[CommandResult] = queue.execute_ready(_clock.absolute_minute, func(_command: SimulationCommand) -> CommandResult: return failure.copy())
_expect(completed.size() == 1, "one shadow failure")
var entities: Array[StringName] = []
var event: SimulationDomainEvent = SimulationDomainEvent.new(ids.next_id(&"domain_event"), &"COMMAND_FAILED", _clock.absolute_minute, &"simulation_runtime", entities, failure.to_dictionary(), command.command_id)
_expect(events.publish(event), "exact M failed-result event")
journal[&"next_command_id"] += 1
journal[&"command_queue"] = queue.create_snapshot()
journal[&"id_generator"] = ids.create_snapshot()
journal[&"domain_events"] = events.create_snapshot()
# EXPECTED is complete before submit, never read back from AFTER.
var expected_bytes: PackedByteArray = var_to_bytes(expected)
var actual: CommandResult = _runtime.submit_command(kind, payload, &"player", &"", 10, -1, key)
var after: Dictionary = _runtime.create_snapshot()
_expect(var_to_bytes(actual.to_dictionary()) == var_to_bytes(failure.to_dictionary()), "guard exact failed result")
_expect(expected_bytes == var_to_bytes(after), "whole typed guard equality with no masks")
var callbacks: int = 0
for row: Dictionary in _results:
if row[&"result"]["command_id"] == command.command_id: callbacks += 1
_expect(callbacks == 1, "one failed command_completed callback")
_guard_references[label] = _write(label, {&"before": before, &"expected": expected, &"after": after, &"command": command.to_dictionary(), &"result": actual.to_dictionary(), &"guard": label})
_expected_failure = {}
func _prepare_idle_breach() -> bool:
_fresh()
var facility: FacilityInstance = _build_cafeteria(true)
if facility == null: return false
_facility_id = facility.instance_id
_recovery = {&"staff_ids": [], &"resume_minute": _boundary}
_clock.advance_minutes(_boundary - 5 - _clock.absolute_minute)
_prepare_breach()
_guard_failure("G1", &"create_service_request", {&"facility_id": _facility_id, &"request_id": REQUEST, &"guest_ids": [GUEST]}, "A Facility assigned to a non-terminal Defense Raid cannot accept service requests.", {&"raid_id": &"p04.s5.raid"})
_clock.advance_minutes(_boundary - 1 - _clock.absolute_minute)
return _clock.absolute_minute == _boundary - 1
func _assert_idle_breach(point: Dictionary) -> void:
_expect(point[&"facility"][&"durability"] == 0 and point[&"facility"][&"state"] == "BROKEN" and point[&"facility"][&"suspension_reason"] == "DESTROYED", "idle OBJECTIVE automatically destroyed")
_expect(point[&"active_services"] == 0 and point[&"service"].is_empty() and point[&"reservations"].is_empty(), "idle breach has no services or reservations")
for request: Dictionary in point[&"requests"].values(): _expect(request.is_empty(), "idle breach no request/orphan")
for entry: Dictionary in point[&"ledger"]: _expect(entry[&"category"] != "SERVICE_SALE", "idle breach no sale")
func _assert_idle_order(_before: Dictionary, point: Dictionary) -> void:
_assert_idle_breach(point)
func _assert_in_flight(point: Dictionary) -> void:
_expect(point[&"facility"][&"durability"] == 0 and point[&"facility"][&"state"] == "BROKEN", "event destroys active facility")
_expect(point[&"service"][&"state"] == ("ACTIVE" if point[&"minute"] == _boundary else "FAILED"), "N active then N+1 failure")
func _assert_in_flight_order(before: Dictionary, point: Dictionary) -> void:
_assert_in_flight(point)
_expect(point[&"wallets"] == before[&"wallets"], "in-flight destruction zero charge")
if point[&"minute"] > _boundary: _assert_reservation(before, point, REQUEST, "RELEASED", _boundary + 1)
else: _assert_reservation(before, point, REQUEST, "ACTIVE", -1)
func _advance_paused_midnight(label: String) -> void:
if label != "recovered":
_clock.advance_one_minute()
return
_cmd(&"change_resources", {&"deltas": {&"mana": _reserve}})
_recovery[&"resume_minute"] = -1
while _clock.absolute_minute < _boundary + _duration + 20:
_clock.advance_one_minute()
if _runtime.facility_service.get_service(_service_id).state == ServiceInstance.State.COMPLETED:
_recovery[&"resume_minute"] = _clock.absolute_minute
break
_expect(_recovery[&"resume_minute"] > _boundary, "bounded new-day completion")
func _assert_paused_midnight(point: Dictionary) -> void:
_expect(point[&"service"][&"state"] == "PAUSED" and point[&"service"][&"interruption_reason"] == "RELATED_FACILITY_INACTIVE", "legitimate dependency pause across DAILY_CLOSE")
_expect(point[&"operations_enabled"] and not point[&"actual_coordinator_absent"], "real DAILY_CLOSE coordinator")
func _assert_paused_midnight_order(before: Dictionary, point: Dictionary) -> void:
if point[&"minute"] <= _boundary + 1:
_assert_paused_midnight(point)
_expect(point[&"service"][&"elapsed_minutes"] == before[&"service"][&"elapsed_minutes"], "paused elapsed unchanged")
_expect(point[&"wallets"] == before[&"wallets"], "no paused payment")
_assert_reservation(before, point, REQUEST, "ACTIVE", -1)
else:
_expect(point[&"service"][&"state"] == "COMPLETED", "new-day recovered completion")
_expect(point[&"wallets"][String(GUEST)] == before[&"wallets"][String(GUEST)] - _price, "one recovered price snapshot debit")
_assert_reservation(before, point, REQUEST, "CONSUMED", point[&"minute"])
func _advance_order(label: String) -> void:
if label == "boundary":
if _case in ["S5D_IN_FLIGHT", "S5D_PAID_BEFORE_INCIDENT"]: _cmd(&"enqueue_event", {&"event_id": &"p04.s5.break", &"actor_ids": [&"player"]}, _boundary)
if _case == "S5C_DESTRUCTION_COMMAND": _cmd(&"set_facility_conditions", {&"facility_id": _facility_id, &"conditions": {&"durability": 0}}, _boundary)
if _case == "S5F_EXIT": _cmd(&"leave_facility_queue", {&"facility_id": _facility_id, &"request_id": QUEUED_REQUEST}, _boundary)
if label == "recalled":
var before: Dictionary = _runtime.create_snapshot()
var replay: CommandResult = _runtime.operations_coordinator.advance_to(_boundary)
_expect(replay.is_success() and replay.is_replay, "same midnight is a replay")
_expect(var_to_bytes(before) == var_to_bytes(_runtime.create_snapshot()), "same-minute replay changes no typed state")
_recovery[&"midnight_replay"] = replay.to_dictionary()
_replay_reference = _write("same-minute-replay", {&"before": before, &"after": _runtime.create_snapshot(), &"result": replay.to_dictionary(), &"minute": _boundary})
else:
_clock.advance_one_minute()
func _assert_paid_incident(point: Dictionary) -> void:
_expect(point[&"service"][&"state"] == "COMPLETED" and point[&"service"][&"completed_at"] == _boundary, "primary paid at N")
_expect(point[&"facility"][&"durability"] == 0 and point[&"facility"][&"state"] == "BROKEN" and point[&"facility"][&"suspension_reason"] == "DESTROYED", "public event destruction after completion")
var secondary: Array = []
var facilities: Dictionary = point[&"snapshot"][&"systems"][&"runtime"][&"facilities"]
for instance: Dictionary in facilities[&"instances"]:
for service: Dictionary in instance[&"active_services"]:
if service[&"request_id"] == QUEUED_REQUEST: secondary.append(service)
for service: Dictionary in facilities[&"service_history"]:
if service[&"request_id"] == QUEUED_REQUEST: secondary.append(service)
_expect(secondary.size() == 1, "one secondary service without duplicate generation")
if secondary.size() != 1: return
_expect(secondary[0][&"state"] == ("ACTIVE" if point[&"minute"] == _boundary else "FAILED"), "secondary unfinished at N and failed at N+1")
if point[&"minute"] > _boundary:
_expect(secondary[0][&"failure_reason"] == "BROKEN" and secondary[0][&"completed_at"] == _boundary + 1, "secondary broken failure timestamp")
func _assert_paid_incident_order(before: Dictionary, point: Dictionary) -> void:
_assert_paid_incident(point)
_expect(point[&"wallets"][String(GUEST)] == before[&"wallets"][String(GUEST)] - _price, "one primary snapshot price debit")
_expect(point[&"wallets"][String(QUEUED_GUEST)] == before[&"wallets"][String(QUEUED_GUEST)], "secondary uncharged")
_assert_reservation(before, point, REQUEST, "CONSUMED", _boundary)
_assert_reservation(before, point, QUEUED_REQUEST, "ACTIVE" if point[&"minute"] == _boundary else "RELEASED", -1 if point[&"minute"] == _boundary else _boundary + 1)
func _assert_order_stop(point: Dictionary) -> void:
if _case == "S5C_DESTRUCTION_COMMAND":
_expect(point[&"service"][&"state"] == "FAILED" and point[&"service"][&"failure_reason"] == String(FacilityService.INTERRUPTION_BROKEN), "command destruction interrupts before payment")
else:
_expect(point[&"service"][&"state"] == "COMPLETED", "natural completion precedes later boundary effects")
if _case in ["S5C_DESTRUCTION_COMMAND", "S5D_DESTRUCTION_RAID"]:
_expect(point[&"facility"][&"durability"] == 0 and point[&"facility"][&"state"] == "BROKEN", "destroyed facility")
if _case == "S5D_DESTRUCTION_RAID":
_expect(point[&"facility"][&"suspension_reason"] == "DESTROYED", "automatic breach suspension")
if _case == "S5E_MIDNIGHT":
_expect(point[&"operations_enabled"] and not point[&"actual_coordinator_absent"], "operations-enabled midnight")
func _assert_order(before: Dictionary, point: Dictionary) -> void:
_assert_order_stop(point)
var paid: bool = _case != "S5C_DESTRUCTION_COMMAND"
_expect(point[&"wallets"][String(GUEST)] == before[&"wallets"][String(GUEST)] - (_price if paid else 0), "exact primary wallet delta")
_assert_reservation(before, point, REQUEST, "CONSUMED" if paid else "RELEASED", _boundary)
if _case == "S5F_EXIT" or (_case == "S5D_DESTRUCTION_RAID" and point[&"minute"] > _boundary):
_assert_reservation(before, point, QUEUED_REQUEST, "RELEASED", _boundary if _case == "S5F_EXIT" else _boundary + 1)
_expect(point[&"wallets"][String(QUEUED_GUEST)] == before[&"wallets"][String(QUEUED_GUEST)], "secondary request never charged")
if _case == "S5F_EXIT" and point[&"minute"] == _boundary:
_expect(point[&"guests"][String(GUEST)][&"state"] == "LEAVING", "planned exit after completed service")
func _connect_observations() -> void:
_runtime.economy_service.transaction_posted.connect(func(id: StringName, entries: Array) -> void:
var rows: Array = []
for entry: LedgerEntry in entries: rows.append(entry.to_dictionary())
var staff_at_receipt: Array = []
for staff_id: StringName in _recovery.get(&"staff_ids", []):
staff_at_receipt.append(_runtime.staff_service.get_staff(staff_id).create_snapshot())
_receipts.append({&"id": id, &"minute": _clock.absolute_minute, &"phase": _observed_phase, &"entries": rows, &"staff_at_receipt": staff_at_receipt})
)
_clock.tick_phase_started.connect(func(phase: int, minute: int) -> void:
_observed_phase = SimulationKernel.TickPhase.keys()[phase]
var label: String = "phase-%d-%s" % [minute, SimulationKernel.TickPhase.keys()[phase]]
var row: Dictionary = _capture()
row[&"phase"] = SimulationKernel.TickPhase.keys()[phase]
if _case == "S5G_SHIFT_1080" and minute == 1080:
var historical: Dictionary = {SimulationKernel.TickPhase.FACILITY_COMPLETION: "first-18-00-before-facility", SimulationKernel.TickPhase.VITALS_AND_ENVIRONMENT: "first-18-00-after-facility", SimulationKernel.TickPhase.PUBLISH_SNAPSHOT: "first-18-00-after-staff"}
row[&"order_label"] = historical.get(phase, "")
_assert_phase(row)
_phases.append(_write(label, row))
)
func _assert_phase(point: Dictionary) -> void:
_expect(point.has(&"snapshot") and point.has(&"mana"), "complete raw phase observation")
func _capture() -> Dictionary:
var snapshot: Dictionary = _runtime.create_snapshot()
var operations: Dictionary = snapshot[&"systems"][&"runtime"][&"operations"]
var facility: FacilityInstance = _runtime.facility_service.get_instance(_facility_id)
var service: ServiceInstance = _runtime.facility_service.get_service(_service_id)
var event: EventInstance = _runtime.event_service.get_instance(&"p04.destroy.instance")
var kitchen: FacilityInstance = _runtime.facility_service.get_instance(facility.related_facility_id)
var actors: Dictionary = {}
var requests: Dictionary = {}
var wallets: Dictionary = {}
for id: StringName in [GUEST, QUEUED_GUEST]:
var guest: GuestRuntime = _runtime.guest_service.get_guest(id)
actors[String(id)] = guest.create_snapshot() if guest != null else {}
wallets[String(id)] = _runtime.economy_service.get_balance(StringName("GUEST_WALLET:" + String(id)))
for id: StringName in [REQUEST, QUEUED_REQUEST]:
var request: ServiceRequest = _runtime.facility_service.get_request(id)
requests[String(id)] = request.create_snapshot() if request != null else {}
var reservations: Array = []
for reservation: InventoryReservation in _runtime.inventory_service.get_reservations(false): reservations.append(reservation.create_snapshot())
var ledger: Array = []
for entry: LedgerEntry in _runtime.economy_service.get_entries(): ledger.append(entry.to_dictionary())
return {&"snapshot": snapshot, &"minute": _clock.absolute_minute,
&"order_label": ({1079: "first-before-17-59", 1080: "first-18-00-tick-complete", 1081: "first-18-01-tick-complete"}.get(_clock.absolute_minute, "") if _case == "S5G_SHIFT_1080" else ""),
&"inputs": {&"case": _case, &"seed": SEEDS[_case], &"serial": _serial, &"facility_id": _facility_id, &"service_id": _service_id,
&"boundary": _boundary, &"price": _price, &"duration": _duration, &"patience": _patience, &"reserve": _reserve, &"recovery": _recovery.duplicate(true),
&"kitchen_premise": "ActorHardening physical FLEX fixture; not natural hire/unlock"},
&"related_facility_operating": facility.related_facility_operating, &"mana": _state.get_resource(&"mana"), &"kitchen": kitchen.create_snapshot() if kitchen != null else {}, &"graph_invariants": _runtime.mana_network_service.validate_invariants(),
&"facility": facility.create_snapshot(), &"service": service.create_snapshot() if service != null else {},
&"event": event.create_snapshot() if event != null else {}, &"guests": actors, &"requests": requests, &"wallets": wallets,
&"reservations": reservations, &"ledger": ledger, &"receipts": _receipts.duplicate(true),
&"player_cash": _runtime.economy_service.get_balance(_runtime.PLAYER_CASH_ACCOUNT),
&"available_meals": _runtime.inventory_service.available_quantity(facility.local_inventory_id, &"ingredient/basic_meal"),
&"active_services": _runtime.facility_service.get_active_services(_facility_id).size(),
&"operations_enabled": operations[&"enabled"], &"saved_coordinator": operations[&"coordinator"],
&"actual_coordinator_absent": _runtime.operations_coordinator == null, &"unrelated_getters_called": false}
func _labels() -> Array[String]:
var labels: Array[String] = []
for label: String in CASE_TABLE[_case]["labels"]:
if label != "duplicate_guard": labels.append(label)
return labels
func _advance(label: String) -> void:
if label == "boundary":
_cmd(&"spend_resources", {&"cost": {&"mana": _reserve}})
_clock.advance_one_minute()
elif label == "recovered":
_expect(_clock.absolute_minute == _boundary + 1, "recover only after held")
_cmd(&"change_resources", {&"deltas": {&"mana": _reserve}})
_resource_command = {&"key": _commands.back()[&"idempotency_key"], &"command_id": int(_commands.back()[&"result"][&"command_id"])}
_recovery[&"key"] = _commands.back()[&"idempotency_key"]
while _clock.absolute_minute < _boundary + _duration:
_clock.advance_one_minute()
var point: Dictionary = _capture()
if point[&"service"][&"state"] == "COMPLETED":
_recovery[&"resume_minute"] = _clock.absolute_minute
break
_assert_stopped(point)
_expect(_recovery[&"resume_minute"] > 0, "bounded observed recovery completion")
elif label == "duplicate_guard":
var before_replay: Dictionary = _runtime.create_snapshot()
var replay: CommandResult = _runtime.submit_command(&"change_resources", {&"deltas": {&"mana": _reserve}}, &"player", &"", 10, -1, _recovery[&"key"])
var after_replay: Dictionary = _runtime.create_snapshot()
var key: StringName = _resource_command[&"key"]
var command_id: int = _resource_command[&"command_id"]
var originals: Array[Dictionary] = []
for row: Dictionary in _results:
if int(row[&"result"][&"command_id"]) == command_id: originals.append(row[&"result"])
_expect(originals.size() == 1, "one completed original resource command")
if originals.size() != 1: return
var original: Dictionary = originals[0]
var result: Dictionary = replay.to_dictionary()
var details: Dictionary = result[&"details"]
_expect(result[&"code"] == "DUPLICATE_IDEMPOTENCY_KEY" and not replay.is_replay, "duplicate enqueue rejected without replay")
_expect(details["processed"] == true and details["idempotency_key"] == String(key) and int(details["original_command_id"]) == command_id and var_to_bytes(details["original_result"]) == var_to_bytes(original), "duplicate details bind completed original")
var queue: Dictionary = before_replay[&"systems"][&"runtime"][&"command_queue"]
_expect(queue["idempotency"][String(key)] == command_id, "typed idempotency binding")
var processed: Array[Dictionary] = []
for row: Dictionary in queue["processed"]:
if int(row["command_id"]) == command_id: processed.append(row)
_expect(processed.size() == 1, "one typed processed original")
if processed.size() == 1: _expect(var_to_bytes(processed[0]) == var_to_bytes(original), "typed processed original bytes")
_expect(var_to_bytes(before_replay) == var_to_bytes(after_replay), "same key replay changes no Runtime field")
_replay_reference = _write("resource-replay", {&"before": before_replay, &"after": after_replay, &"result": result, &"recorded_command": {&"key": key, &"command_id": command_id, &"original": original}})
_clock.advance_one_minute()
else:
_clock.advance_one_minute()
func _writer_case() -> void:
if not Callable(self, CASE_TABLE[_case]["prepare"]).call(): return
var before: Dictionary = _capture()
if _case in ["S5A_PURE", "S5B_DEPENDENCY"]: _assert_before(before)
_points["before"] = _write("before", before)
_connect_observations()
for label: String in _labels():
Callable(self, CASE_TABLE[_case]["advance"]).call(label)
var actual: Dictionary = _capture()
Callable(self, CASE_TABLE[_case]["assert"]).call(before, actual)
_save_point(label, actual)
if "duplicate_guard" in CASE_TABLE[_case]["labels"]:
_advance("duplicate_guard")
var guard: Dictionary = _capture()
_assert_outcome(before, guard)
_points["duplicate_guard"] = _write("duplicate_guard", guard)
_branches[_case] = _write("case", {&"resource_replay": _replay_reference, &"guards": _guard_references, &"points": _points.duplicate(true), &"phases": _phases.duplicate(true),
&"commands": _write("commands", {&"submitted": _commands, &"completed_including_fixture": _results})})
func _assert_before(point: Dictionary) -> void:
_assert_unconfounded(point)
_expect(point[&"mana"] > 0 and point[&"facility"][&"power_available"] and point[&"related_facility_operating"], "initial power and dependency")
_expect(point[&"service"][&"state"] == "ACTIVE" and point[&"service"][&"elapsed_minutes"] == _duration - 1, "natural pre-completion point")
func _snapshot_staff_ids() -> Array[String]:
var result: Array[String] = []
for id: StringName in _recovery[&"staff_ids"]: result.append(String(id))
return result
func _assert_unconfounded(point: Dictionary) -> void:
_expect(not point[&"operations_enabled"] and point[&"actual_coordinator_absent"], "isolated fixture")
_expect(point[&"facility"][&"operator_open"] and point[&"facility"][&"durability"] > 0 and point[&"event"].is_empty(), "no closure or destruction")
var ids: Variant = point[&"facility"][&"active_staff_ids"]
_expect(ids is Array and ids.is_typed() and ids.get_typed_builtin() == TYPE_STRING and ids.size() == _recovery[&"staff_ids"].size() and ids == _snapshot_staff_ids() and var_to_bytes(ids) == var_to_bytes(_snapshot_staff_ids()) and _runtime.facility_service.get_instance(_facility_id).active_staff_ids == _recovery[&"staff_ids"], "no shift confound")
_expect(point[&"graph_invariants"][&"valid"], "graph invariants")
if point[&"service"][&"state"] != "COMPLETED":
_expect(point[&"guests"][String(GUEST)][&"state"] == "RECEIVING_SERVICE" and point[&"guests"][String(GUEST)][&"planned_exit_at"] > point[&"minute"], "guest ownership and no exit")
func _assert_stopped(point: Dictionary) -> void:
_assert_unconfounded(point)
var expected_reason: String = "RELATED_FACILITY_INACTIVE" if _case == "S5B_DEPENDENCY" and not point[&"related_facility_operating"] else "NO_POWER"
_expect(point[&"service"][&"state"] == "PAUSED" and point[&"service"][&"interruption_reason"] == expected_reason, "approved actual reason priority")
_expect(point[&"service"][&"elapsed_minutes"] == _duration - 1 and point[&"receipts"].is_empty(), "stopped progress and no payment")
if point[&"minute"] <= _boundary + 1:
_expect(point[&"mana"] == 0 and not point[&"facility"][&"power_available"], "real depleted reserve projects no power")
if _case == "S5B_DEPENDENCY":
_expect(point[&"kitchen"][&"state"] == "NO_POWER" and not point[&"related_facility_operating"], "kitchen NO_POWER before dependent reason")
else:
_expect(point[&"related_facility_operating"], "pure no dependency")
func _assert_reservation(before: Dictionary, point: Dictionary, request_id: StringName, state: String, terminal: int) -> void:
var prior: Array = []
var current: Array = []
for row: Dictionary in before[&"reservations"]:
if row[&"requester_id"] == String(request_id): prior.append(row)
for row: Dictionary in point[&"reservations"]:
if row[&"requester_id"] == String(request_id): current.append(row)
_expect(prior.size() == 1 and current.size() == 1, "one original reservation per request")
if prior.size() != 1 or current.size() != 1: return
_expect(prior[0][&"reservation_id"] == current[0][&"reservation_id"] and current[0][&"state"] == state and current[0][&"terminal_at"] == terminal, "same reservation ID/state/terminal time; no second release")
if state == "ACTIVE":
_expect(var_to_bytes(prior[0]) == var_to_bytes(current[0]), "entire held reservation unchanged")
var request: Dictionary = point[&"requests"][String(request_id)]
_expect(not request.is_empty() and request[&"reserved_inventory_ids"].has(current[0][&"reservation_id"]), "active reservation has live request owner")
else:
_expect(point[&"requests"][String(request_id)].is_empty(), "terminal reservation has no orphan request")
if state == "RELEASED":
var release_count: int = 0
var inventory: Dictionary = point[&"snapshot"][&"systems"][&"runtime"][&"inventory"]
for operation: Dictionary in inventory[&"idempotency_results"]:
var result: Dictionary = operation[&"result"]
if operation[&"action"] == "release" and String(result.get(&"reservation_id", "")) == current[0][&"reservation_id"]:
release_count += 1
_expect(bool(result.get(&"ok", false)) and result.get(&"quantity", 0) == current[0][&"quantity"], "release returned actual reserved quantity, not an orphan repair/retry")
_expect(release_count == 1, "one raw inventory release operation for original reservation")
func _assert_outcome(before: Dictionary, point: Dictionary) -> void:
_assert_unconfounded(point)
var service: Dictionary = point[&"service"]
_expect(service[&"service_id"] == before[&"service"][&"service_id"], "same service ID")
var paid: bool = service[&"state"] == "COMPLETED"
if not paid:
_assert_stopped(point)
_expect(var_to_bytes(point[&"ledger"]) == var_to_bytes(before[&"ledger"]), "entire stopped ledger unchanged")
_expect(var_to_bytes(point[&"requests"][String(REQUEST)]) == var_to_bytes(before[&"requests"][String(REQUEST)]), "same live request and ownership")
else:
_expect(point[&"facility"][&"power_available"] and service[&"elapsed_minutes"] == _duration and point[&"active_services"] == 0, "one recovered completion")
_expect(point[&"receipts"].size() == 1, "exactly one receipt")
var expected: Array = before[&"ledger"].duplicate(true)
for receipt: Dictionary in point[&"receipts"]: expected.append_array(receipt[&"entries"])
_expect(var_to_bytes(expected) == var_to_bytes(point[&"ledger"]), "ledger exactly one receipt")
if _case == "S5B_DEPENDENCY":
_assert_reservation(before, point, REQUEST, "CONSUMED" if paid else "ACTIVE", service[&"completed_at"] if paid else -1)
else:
_expect(point[&"reservations"].is_empty(), "bath has no item inputs; ownership proven through request, service and guest")
_expect(point[&"wallets"][String(GUEST)] == _price * (1 if paid else 2) and point[&"player_cash"] == before[&"player_cash"] + (_price if paid else 0), "one price or zero")
func _save_point(label: String, point: Dictionary) -> void:
_points[label] = _write(label, point)
var path: String = "user://saves/p04_s5/" + _case + "-" + label
var saved: Dictionary = SaveService.save_snapshot(path, point[&"snapshot"])
var inspected: Dictionary = SaveService.inspect_snapshot(path)
_expect(bool(saved.get(&"ok", false)) and bool(inspected.get(&"ok", false)) and bool(inspected.get(&"read_only", false)), "public formal save/inspect")
_expect(var_to_bytes(inspected.get(&"snapshot", {})) == var_to_bytes(point[&"snapshot"]), "all typed fields preserved by formal package")
_expect(var_to_bytes(_runtime.create_snapshot()) == var_to_bytes(point[&"snapshot"]), "formal saving leaves Runtime unchanged")
_slots[_case + "-" + label] = ProjectSettings.globalize_path(path)
# Snapshot bytes exist once in point raw and once in the required formal
# package; indexes do not embed inspection/load copies of those bytes.
func _write(label: String, value: Variant, global_name: bool = false) -> Dictionary:
var name: String = label if global_name else _mode + "-" + _case + "-" + label
var reference: Dictionary = {}
for extension: String in ["var", "json"]:
var path: String = _evidence_dir.path_join(name + "." + extension)
_expect(not FileAccess.file_exists(path), "raw point written exactly once " + name)
var file: FileAccess = FileAccess.open(path, FileAccess.WRITE)
_expect(file != null, "raw file " + name)
if file == null: continue
if extension == "var": file.store_buffer(var_to_bytes(value))
else: file.store_string(JSON.stringify(value, "\t"))
file.flush()
file.close()
reference[extension] = {&"path": path, &"sha256": FileAccess.get_sha256(path)}
return reference
func _read(reference: Dictionary) -> Dictionary:
var item: Dictionary = reference["var"]
var path: String = item["path"]
_expect(FileAccess.get_sha256(path) == item["sha256"], "raw typed SHA")
var json_ref: Dictionary = reference["json"]
_expect(FileAccess.get_sha256(json_ref["path"]) == json_ref["sha256"], "raw JSON SHA")
var file: FileAccess = FileAccess.open(path, FileAccess.READ)
_expect(file != null, "typed input readable")
if file == null: return {}
var value: Variant = bytes_to_var(file.get_buffer(file.get_length()))
file.close()
_expect(value is Dictionary, "typed input dictionary")
return value if value is Dictionary else {}
func _restore_inputs(point: Dictionary) -> void:
var inputs: Dictionary = point[&"inputs"]
_expect(_serial == 0, "Reader starts with serial zero before importing external inputs")
_serial = inputs[&"serial"]
_facility_id = inputs[&"facility_id"]
_service_id = inputs[&"service_id"]
_boundary = inputs[&"boundary"]
_price = inputs[&"price"]
_duration = inputs[&"duration"]
_patience = inputs[&"patience"]
_reserve = inputs[&"reserve"]
_recovery = inputs[&"recovery"].duplicate(true)
func _load_point(path: String, expected: Dictionary) -> bool:
_fresh()
_restore_inputs(expected)
var loaded: Dictionary = SaveService.load_snapshot(path)
_expect(bool(loaded.get(&"ok", false)), "public formal load")
if not bool(loaded.get(&"ok", false)): return false
_expect(var_to_bytes(loaded[&"snapshot"]) == var_to_bytes(expected[&"snapshot"]), "all saved typed fields equal Writer")
var restored: bool = _runtime.restore_snapshot(loaded[&"snapshot"])
_expect(restored, "public Runtime restore")
_expect(var_to_bytes(_runtime.create_snapshot()) == var_to_bytes(expected[&"snapshot"]), "all restored typed fields equal Writer")
if _case not in ["S5A_PURE", "S5B_DEPENDENCY"]:
_receipts = expected[&"receipts"].duplicate(true)
return restored
func _is_replayed_phase(row: Dictionary) -> bool:
return int(row[&"minute"]) > _boundary or (int(row[&"minute"]) == _boundary and row[&"phase"] == SimulationKernel.TickPhase.keys()[SimulationKernel.TickPhase.APPLY_COMMANDS])
func _assert_expected_phase_roster(references: Array) -> void:
var expected_pairs: Array = []
var end: int = int(_recovery[&"resume_minute"]) + 1
if _case == "S5E_MIDNIGHT": end = _boundary
if _case == "S5H_PAUSED_MIDNIGHT": end = int(_recovery[&"resume_minute"])
for minute: int in range(_boundary, end):
for phase: int in range(SimulationKernel.TickPhase.size()):
expected_pairs.append([minute if phase == SimulationKernel.TickPhase.APPLY_COMMANDS else minute + 1, SimulationKernel.TickPhase.keys()[phase]])
var actual_pairs: Array = []
for reference: Dictionary in references:
var row: Dictionary = _read(reference)
actual_pairs.append([int(row[&"minute"]), row[&"phase"]])
_expect(actual_pairs == expected_pairs, "complete dynamic replay phase roster with no omissions")
func _reader() -> void:
var file: FileAccess = FileAccess.open(_evidence_dir.path_join("writer.json"), FileAccess.READ)
_expect(file != null, "Writer receipt")
if file == null: return
var writer: Dictionary = JSON.parse_string(file.get_as_text())
file.close()
_expect(int(writer["pid"]) != OS.get_process_id() and writer["profile"] != OS.get_user_data_dir(), "independent Reader PID/profile")
for branch: String in CASE_TABLE:
_case = branch
var writer_case: Dictionary = _read(writer["branches"][branch])
var hashes: Dictionary = {}
var restored_refs: Dictionary = {}
for label: String in _labels():
var key: String = branch + "-" + label
var original: String = writer["slots"][key]
var target: String = ProjectSettings.globalize_path("user://saves/p04_s5/" + key)
_expect(DirAccess.make_dir_recursive_absolute(target) == OK, "private Reader formal slot")
var directory: DirAccess = DirAccess.open(original)
_expect(directory != null, "Writer formal slot readable")
if directory == null: return
var members: PackedStringArray = directory.get_files()
members.sort()
_expect(directory.get_directories().is_empty() and members == PackedStringArray(["journal.log", "manifest.json", "thumbnail.png", "world.bin"]), "all formal members enumerated")
var member_hashes: Dictionary = {}
for member: String in members:
var sha: String = FileAccess.get_sha256(original.path_join(member))
_expect(DirAccess.copy_absolute(original.path_join(member), target.path_join(member)) == OK, "copy every formal member")
var copied_sha: String = FileAccess.get_sha256(target.path_join(member))
_expect(not sha.is_empty() and sha == copied_sha, "original/copy member SHA equality")
member_hashes[member] = {&"original_before": sha, &"copy_before": copied_sha}
hashes[key] = {&"original": original, &"copy": target, &"members": member_hashes}
_slots[key] = target
var expected: Dictionary = _read(writer_case[&"points"][label])
if not _load_point(target, expected): return
restored_refs[label] = _write(label + "-restored", _capture())
var before: Dictionary = _read(writer_case[&"points"]["before"])
var boundary: Dictionary = _read(writer_case[&"points"]["boundary"])
if not _load_point(_slots[branch + "-boundary"], boundary): return
Callable(self, CASE_TABLE[_case]["stop"]).call(_capture())
_connect_observations()
var replay_refs: Dictionary = {}
for label: String in CASE_TABLE[_case]["labels"]:
if label == "boundary": continue
Callable(self, CASE_TABLE[_case]["advance"]).call(label)
var actual: Dictionary = _capture()
var expected: Dictionary = _read(writer_case[&"points"][label])
_expect(var_to_bytes(actual) == var_to_bytes(expected), "replay complete typed point including Runtime, inputs, receipts " + label)
Callable(self, CASE_TABLE[_case]["assert"]).call(before, actual)
replay_refs[label] = _write(label + "-replay", actual)
var expected_phases: Array = []
for reference: Dictionary in writer_case[&"phases"]:
if _is_replayed_phase(_read(reference)): expected_phases.append(reference)
_assert_expected_phase_roster(expected_phases)
_expect(_phases.size() == expected_phases.size(), "complete phase count")
if _phases.size() == expected_phases.size():
for index: int in range(_phases.size()):
_expect(var_to_bytes(_read(_phases[index])) == var_to_bytes(_read(expected_phases[index])), "same phase order and all typed phase state")
for key: String in hashes:
var row: Dictionary = hashes[key]
for member: String in row[&"members"]:
var item: Dictionary = row[&"members"][member]
item[&"original_after"] = FileAccess.get_sha256(String(row[&"original"]).path_join(member))
item[&"copy_after"] = FileAccess.get_sha256(String(row[&"copy"]).path_join(member))
_expect(item[&"original_before"] == item[&"original_after"] and item[&"copy_before"] == item[&"copy_after"], "original/copy unchanged after all loads and replay")
_branches[branch] = _write("case", {&"resource_replay": _replay_reference, &"restored": restored_refs, &"replay": replay_refs, &"phases": _phases,
&"member_hashes": hashes, &"recovery_commands": _commands, &"replay_completed_commands": _results})
@@ -0,0 +1,171 @@
#!/usr/bin/env python3
"""Engine-free REPAIR44 units. Synthetic typed inputs are never native evidence."""
import copy
import json
from pathlib import Path
import sys
sys.dont_write_bytecode = True
import s5_order_adapter as a
import run_s5_native as wrapper
def typed(value):
o = a.guard_oracle
def encode(v):
if isinstance(v, bool):
return o.atom(1, v)
if isinstance(v, int):
return o.atom(2, v)
if isinstance(v, str):
return o.atom(4, v)
if isinstance(v, list):
return o.array([encode(x) for x in v])
return o.strings_dict([(k, encode(v)) for k, v in v.items()])
return a.series.variant(encode(value))
def fixture():
"""Small source-shaped serializer unit for the deriver, not a game replay."""
n, price = 960, 25
primary = dict(service_id='primary', request_id=a.REQUEST, price_snapshot=price,
duration_minutes=45, started_at=n-45, elapsed_minutes=44,
state='ACTIVE', completed_at=-1, failure_reason='')
secondary = dict(service_id='secondary', request_id=a.SECOND_REQUEST, price_snapshot=price,
duration_minutes=45, started_at=n-1, elapsed_minutes=0,
state='ACTIVE', completed_at=-1, failure_reason='')
sale = dict(transaction_id='sale', category='SERVICE_SALE', amount=price,
absolute_minute=n, source_entity_id='facility', credit_account='GUEST_WALLET:'+a.GUEST)
reservation = dict(reservation_id='reservation.b', requester_id=a.SECOND_REQUEST, state='ACTIVE', terminal_at=-1)
def point(minute, completed=False, broken=False, failed=False):
s, second, r = copy.deepcopy((primary, secondary, reservation))
history = []
active = [s, second]
if completed:
s.update(state='COMPLETED', completed_at=n, elapsed_minutes=45)
history.append(s)
active.remove(s)
if failed:
second.update(state='FAILED', failure_reason='BROKEN', completed_at=n+1)
history.append(second)
active.remove(second)
r.update(state='RELEASED', terminal_at=n+1)
ledger = [copy.deepcopy(sale)] if completed else []
requests = [] if failed else [dict(request_id=a.SECOND_REQUEST)]
return dict(minute=minute, inputs=dict(boundary=n, price=price, duration=45, facility_id='facility'),
service=s, facility=dict(durability=0 if broken else 100, state='BROKEN' if broken else 'OPERATING',
suspension_reason='DESTROYED' if broken else ''),
ledger=ledger, wallets={a.GUEST: 50-price if completed else 50, a.SECOND: 50},
receipts=[dict(id='sale', minute=n, phase='FACILITY_COMPLETION', entries=copy.deepcopy(ledger))] if completed else [],
reservations=[r], requests={a.SECOND_REQUEST: {} if failed else dict(request_id=a.SECOND_REQUEST)},
active_services=len(active), snapshot=dict(systems=dict(runtime=dict(
facilities=dict(service_history=history, instances=[dict(active_services=active)], requests=requests,
known_service_ids=['primary', 'secondary'], known_request_ids=[a.REQUEST, a.SECOND_REQUEST],
next_service_sequence=3),
economy=dict(entries=copy.deepcopy(ledger), idempotency=[dict(key='service.payment.primary', transaction_id='sale')] if completed else []),
inventory=dict(idempotency_results=[dict(action='release', result=dict(reservation_id='reservation.b', ok=True))] if failed else [])))))
phases = []
for name, completed, broken in [('FACILITY_COMPLETION', False, False),
('VITALS_AND_ENVIRONMENT', True, False),
('INCIDENTS_AND_EVENTS', True, False), ('FACILITY_QUEUES', True, True)]:
p = point(n, completed, broken)
p['phase'] = name
phases.append(p)
return dict(before=point(n-1), boundary=point(n, True, True), held=point(n+1, True, True, True)), phases
def paid_controls():
original = fixture()
def derive(data):
points, phases = data
return a.paid_before_incident({k: typed(v) for k, v in points.items()}, [typed(v) for v in phases])
assert derive(original) == {'paid_before_incident': True, 'duplicate_generations': 0}
checks = []
def negative(name, change):
data = copy.deepcopy(original)
change(*data)
try:
derive(data)
except (ValueError, KeyError):
checks.append(name)
return
raise AssertionError('accepted mutation: ' + name)
runtime = lambda p: p['snapshot']['systems']['runtime']
second = lambda p: next(s for s in runtime(p)['facilities']['service_history'] if s['request_id'] == a.SECOND_REQUEST)
negative('sale-removed', lambda p, h: p['boundary']['ledger'].clear())
negative('sale-duplicated', lambda p, h: p['held']['ledger'].append(copy.deepcopy(p['held']['ledger'][0])))
negative('sale-after-incidents', lambda p, h: p['boundary']['receipts'][0].update(phase='FACILITY_QUEUES'))
negative('destruction-before-completion', lambda p, h: h[0]['facility'].update(durability=0))
negative('primary-not-completed', lambda p, h: p['boundary']['service'].update(state='ACTIVE'))
negative('secondary-charged', lambda p, h: p['held']['wallets'].update({a.SECOND: 25}))
negative('secondary-not-failed', lambda p, h: second(p['held']).update(state='ACTIVE'))
negative('secondary-failed-at-N', lambda p, h: second(p['held']).update(completed_at=960))
negative('reservation-not-released', lambda p, h: p['held']['reservations'][0].update(state='ACTIVE'))
negative('reservation-released-twice', lambda p, h: runtime(p['held'])['inventory']['idempotency_results'].append(copy.deepcopy(runtime(p['held'])['inventory']['idempotency_results'][0])))
negative('idempotency-missing', lambda p, h: runtime(p['held'])['economy']['idempotency'].clear())
negative('idempotency-duplicated', lambda p, h: runtime(p['held'])['economy']['idempotency'].append(copy.deepcopy(runtime(p['held'])['economy']['idempotency'][0])))
negative('wrong-financial-day', lambda p, h: p['held']['ledger'][0].update(absolute_minute=2400))
negative('AFTER-copy-tautology', lambda p, h: p.update(before=copy.deepcopy(p['held'])))
negative('phase-order-reversed', lambda p, h: h.reverse())
negative('duplicate-generation', lambda p, h: runtime(p['held'])['facilities']['service_history'].append(copy.deepcopy(second(p['held']))))
negative('hidden-generation-counter', lambda p, h: runtime(p['held'])['facilities'].update(next_service_sequence=4))
return checks
def roster_controls():
cases, slots = list(wrapper.CASE_TABLE), wrapper.SLOTS
old = [c for c in cases if c != 'S5D_PAID_BEFORE_INCIDENT']
assert sorted(old) != old, 'old R43 comparison must fail on actual insertion order'
assert wrapper.exact_roster(cases, slots)
assert wrapper.exact_roster(cases[::-1], slots[::-1])
assert not wrapper.exact_roster(cases[:-1], slots)
assert not wrapper.exact_roster(cases + [cases[0]], slots)
assert not wrapper.exact_roster(cases + ['UNKNOWN'], slots)
assert not wrapper.exact_roster(cases, slots[:-1])
assert not wrapper.exact_roster(cases, slots + ['UNKNOWN-slot'])
assert not wrapper.exact_roster(cases, slots + [slots[0]])
assert set(cases) == set(a.DERIVERS) | set(a.power.CASES)
import re
probe = wrapper.QA.read_text()
seeds = json.loads(re.search(r'^const SEEDS: Dictionary = (.*)$', probe, re.M)[1])
assert set(seeds) == set(cases)
for row in wrapper.CASE_TABLE.values():
for key in ('prepare', 'advance', 'stop', 'assert'):
assert 'func ' + row[key] + '(' in probe
# Reader obtains its own branches directly from CASE_TABLE (never Writer's list).
reader = probe.split('func _reader()', 1)[1]
assert 'for branch: String in CASE_TABLE:' in reader
expected_line = next(l for l in a.POWER_PATH.read_text().splitlines() if 'expected = set(CASES)' in l)
assert set(re.findall(r'"(S5[^"]+)"', expected_line)) | set(a.power.CASES) == set(cases)
root = Path(__file__).resolve().parents[1]
project = next(p for p in root.parents if (p / 'tools/check_p04_order_evidence.py').is_file())
checker = (project / 'tools/check_p04_order_evidence.py').read_text()
assert set(re.findall(r"['\"](S5[A-Z][A-Z0-9_]*)['\"]", checker)) == set(cases)
collector = (root / 'p04_native_series.py').read_text()
assert "set(order['cases']) == set(adapter.DERIVERS)" in collector
assert "set(power['cases']) == set(adapter.power.CASES)" in collector
assert 'order = adapter.derive(*arguments)' in collector
for name in ('S5_ROOT_RUN.md', 'PENDING.md'):
assert set(re.findall(r'`(S5[A-Z][A-Z0-9_]*)`', (root / 's5' / name).read_text())) == set(cases)
status = (root / 'REPAIR41_STATUS.md').read_text().split('## REPAIR44', 1)[1]
assert set(re.findall(r'`(S5[A-Z][A-Z0-9_]*)`', status.split('## ', 1)[0])) == set(cases)
wrapper.probe_guard(project)
patterns = [r'\bvar\s+\w+\s*=', r'\bfor\s+\w+\s+in\b',
r'\.(?:patience_remaining|elapsed_minutes|power_available|capacity|hold_until)\s*=(?!=)']
for regex, bad in zip(patterns, ['var x = 1', 'for x in values:', 'f.capacity = 2']):
assert not re.search(regex, probe) and re.search(regex, bad)
return ['R43-old-comparison-reproduced', 'insertion-order', 'reverse-order',
'missing-case', 'duplicate-case', 'unknown-case', 'missing-slot', 'extra-slot',
'duplicate-slot', 'probe-seeds-wrapper-reader-adapter-collector-checker-docs-name-sync',
'probe-guard-regex-self-check']
def main():
root = Path(__file__).resolve().parents[1]
assert not list(root.rglob('*.pyc')), 'no generated bytecode under allowed execution paths'
print(json.dumps(dict(synthetic_units_only=True, formal_acceptance=False,
paid_mutations=paid_controls(), roster=roster_controls(), no_pyc=True), indent=2))
if __name__ == '__main__':
main()
@@ -0,0 +1,646 @@
#!/usr/bin/env python3
"""S5-only native entry. --check-only never loads ownership helpers or starts Godot."""
from pathlib import Path
import argparse
import ast
import builtins
import inspect
import types
import copy
import hashlib
import importlib.util
import json
import os
import re
import shutil
import subprocess
import stat
import sys
sys.dont_write_bytecode = True
HERE = Path(__file__).resolve().parent
BUILD = Path("/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build")
PRODUCT = BUILD / "audit-support/p04-r17-full-inputs-r01/product"
CACHE_RUN = BUILD / "p04-final-product-full-r01"
TEST = "tests/s3/test_runtime_staff_assignment.gd"
QA = HERE / "p04_s5_power_probe.gd"
ENGINE = Path("/Applications/Godot.app/Contents/MacOS/Godot")
ENGINE_SHA256 = "c7cccbf8fb143e34e02fd6521e09be2c2b974f0d5db080b19071c9c570718ccf"
MANIFEST = BUILD / "audit-support/p04-r17-full-inputs-r01/MANIFEST.json"
MANIFEST_SHA = "a15f29fa12537f6d8aaf7cabea390922a9f16e3eb9c10981e5742aafc8c4c8a8"
CONTRACTS = BUILD / "audit-support/p04-r17-full-inputs-r01/fixed/6ce6b28c5985e8a4f13b78bfeb1f1e09f6216d874fb01e0656ec1633bfa01cd7/completion_marker_contracts.json"
def case_table(path):
matches = re.findall(r"^const CASE_TABLE: Dictionary = (\{.*?^\})", Path(path).read_text(), re.M | re.S)
if len(matches) != 1:
raise ValueError("exactly one literal CASE_TABLE required")
table = json.loads(matches[0])
for case, row in table.items():
if (set(row) != {"expected_reserved_ids", "labels", "prepare", "advance", "stop", "assert"}
or not row["labels"] or row["labels"][0] != "boundary"
or len(row["labels"]) != len(set(row["labels"]))):
raise ValueError("invalid case table: " + case)
return table
CASE_TABLE = case_table(QA)
CASES = sorted(CASE_TABLE)
LABELS = {case: [label for label in CASE_TABLE[case]["labels"] if label != "duplicate_guard"]
for case in CASES}
SLOTS = sorted(case + "-" + label for case in CASES for label in LABELS[case])
def exact_roster(branches, slots):
return (len(branches) == len(set(branches)) == len(CASES)
and sorted(branches) == CASES
and len(slots) == len(set(slots)) == len(SLOTS)
and sorted(slots) == SLOTS)
MATERIALS = [MANIFEST, BUILD / "audit-support/p04-review-repair22-r01/ACTUAL_CURRENT_PUBLIC_POWER_FUNCTIONS.json"]
def r17_relocation_guard(root):
if root != PRODUCT.resolve() or not HERE.is_relative_to(BUILD.resolve()):
raise ValueError("Root must stage this exact QA/wrapper/plan inside own B")
if pin(MANIFEST)["sha256"] != MANIFEST_SHA:
raise ValueError("immutable full R17 relocation manifest")
manifest = json.loads(MANIFEST.read_text())
for name, source in manifest["product_source"].items():
# Old absolute paths are lookup keys only. Never open them.
row = manifest["original_to_relocated"][source["path"]]
actual = pin(root / name)
if Path(row["relocated"]).resolve() != root / name or any(
actual[k] != source[k] or actual[k] != row[k] for k in ("bytes", "sha256")):
raise ValueError("relocated product differs: " + name)
def probe_guard(root):
probe = QA.read_text()
import re
seeds = re.findall(r"^const SEEDS: Dictionary = (.*)$", probe, re.M)
if len(seeds) != 1 or sorted(json.loads(seeds[0])) != CASES or sorted(case_table(QA)) != CASES:
raise ValueError("probe/seed canonical roster mismatch")
for case in CASES:
for key in ("prepare", "advance", "stop", "assert"):
if "func " + CASE_TABLE[case][key] + "(" not in probe:
raise ValueError("missing case dispatch function")
if ":=" in probe or re.search(r"\bvar\s+\w+\s*=", probe) or re.search(r"\bfor\s+\w+\s+in\b", probe):
raise ValueError("explicit typed declarations/loops required")
if re.search(r"\.(?:patience_remaining|elapsed_minutes|power_available|capacity|hold_until)\s*=(?!=)", probe):
raise ValueError("forbidden direct state mutation")
for forbidden in ["evaluate_now(", "configure_operations(", "._update_shift_states(", ".record_duty_minute("]:
if forbidden in probe:
raise ValueError("forbidden bypass: " + forbidden)
# Constants and public bodies are read from the actual selected source, not a memo.
mana = (root / "scripts/mana/mana_network_service.gd").read_text()
for key in ("EVALUATION_INTERVAL_MINUTES", "MINIMUM_OFF_HOLD_MINUTES"):
if not re.search(r"const " + key + r" := 10\b", mana):
raise ValueError("source timing changed: " + key)
def module(name, path):
spec = importlib.util.spec_from_file_location(name, path)
value = importlib.util.module_from_spec(spec)
spec.loader.exec_module(value)
return value
def pin(path):
path = Path(path)
if path.is_symlink() or not path.is_file():
raise ValueError("missing exact input: " + str(path))
data = path.read_bytes()
return dict(path=str(path), bytes=len(data), sha256=hashlib.sha256(data).hexdigest())
def load_uid_helper(root, r, refs):
hp = root / "tools/run_p13_reference_tests.py"
descriptor = pin(hp)
r.require(all(descriptor[k] == refs["tools/run_p13_reference_tests.py"][k]
for k in ("bytes", "sha256")), "actual Q UID helper pin")
src = hp.read_bytes()
r.require(len(src) == descriptor["bytes"] and
hashlib.sha256(src).hexdigest() == descriptor["sha256"], "stable helper read")
tree = ast.parse(src, filename=str(hp))
nodes = []
for name in ("uid_plan", "uid_snapshot"):
matches = [n for n in tree.body if isinstance(n, ast.FunctionDef) and n.name == name]
r.require(len(matches) == 1, "exactly one UID helper: " + name)
nodes.append(matches[0])
ns = {"__builtins__": builtins, "shared": r, "re": re, "stat": stat}
exec(compile(ast.Module(body=nodes, type_ignores=[]), str(hp), "exec"), ns)
binding = dict(helper_path="tools/run_p13_reference_tests.py",
helper_sha256=descriptor["sha256"], helper_bytes=descriptor["bytes"],
functions={n.name: hashlib.sha256(ast.get_source_segment(src.decode(), n).encode()).hexdigest()
for n in nodes}, shared_module="tools/run_all_tests.py",
shared_sha256=r.sha(root / "tools/run_all_tests.py"))
return ns["uid_plan"], ns["uid_snapshot"], binding
def make_uid_policy(r, uid_snapshot, source, plan, out):
state = dict(source=source, plan=plan, accepted=None, phase=None)
def reports(stage, exp, previous, requested):
r.require(not previous and not requested, "S5 has no generated reports")
snap = uid_snapshot(stage, source, plan)
if state["accepted"] is None:
r.require(state["phase"] == "import", "UID generation only during import")
state["accepted"] = snap
exp.update({n: {k: p[k] for k in ("bytes", "sha256")} for n, p in snap.items()})
r.write(out / "accepted-uids.json", snap)
r.require(snap == state["accepted"], "sealed UID bytes unchanged")
return r.declared_reports(stage, exp, previous, requested)
execute = types.FunctionType(r.execute_phase.__code__, dict(vars(r), declared_reports=reports),
"execute_phase", r.execute_phase.__defaults__, r.execute_phase.__closure__)
r.require(execute.__code__ is r.execute_phase.__code__, "unchanged execute_phase code object")
def phase_call(*args):
stage, phase_out, phase = args[1:4]
r.require(phase_out == out, "UID receipt output binding")
state["phase"] = phase
before, after = None, None
try:
if phase == "import":
r.require(state["accepted"] is None and not (out / "uid-plan.json").exists(), "single UID import")
r.require(r.inventory(stage, stage=True) == source, "original stage before import")
before = {}
r.write(out / "uid-plan.json", plan)
else:
before = uid_snapshot(stage, source, plan)
r.require(before == state["accepted"], "UID set before phase unchanged")
row = execute(*args)
if row["passed"]:
snap = uid_snapshot(stage, source, plan)
r.require(snap == state["accepted"], "UID set after phase unchanged")
after = snap
return row
finally:
r.write(out / (phase + "-uids.json"), dict(before=before, after=after))
return reports, phase_call, state
def engine_pin(path, expected=None):
path = Path(path)
if path != ENGINE or any(p.is_symlink() for p in (path, *path.parents)):
raise ValueError("exact installed engine required; no symlink or relocated input")
if path.resolve(strict=True) != ENGINE:
raise ValueError("installed engine resolved path changed")
before = path.stat()
if not stat.S_ISREG(before.st_mode):
raise ValueError("installed engine must be regular")
digest = hashlib.sha256(path.read_bytes()).hexdigest()
after = path.stat()
fields = ("st_dev", "st_ino", "st_size", "st_mtime_ns", "st_ctime_ns", "st_mode")
if any(getattr(before, k) != getattr(after, k) for k in fields):
raise ValueError("engine changed while hashing")
if any(p.is_symlink() for p in (path, *path.parents)) or path.resolve(strict=True) != ENGINE:
raise ValueError("engine path changed while hashing")
value = dict(path=str(path), resolved_path=str(path.resolve(strict=True)),
bytes=after.st_size, mtime_ns=after.st_mtime_ns, mode=after.st_mode,
device=after.st_dev, inode=after.st_ino, ctime_ns=after.st_ctime_ns, sha256=digest)
if digest != ENGINE_SHA256:
raise ValueError("engine differs from installed engine constant")
if expected is not None and value != expected:
raise ValueError("engine identity changed")
return value
def mirror_formal(r, out, before):
"""Mirror complete Writer and Reader packages, preserving original receipts."""
relocated = {}
for role in ("writer", "reader"):
receipt = r.read(out / ("raw/" + role + ".json"))
r.require(set(receipt["slots"]) == set(before), "formal slot roster")
relocated[role] = {}
for slot, original in receipt["slots"].items():
r.require(Path(slot).name == slot and slot not in (".", ".."), "formal slot name")
target = out / "formal" / role / slot
target.mkdir(parents=True)
members = r.inventory(Path(original))
r.require(set(members) == {"journal.log", "manifest.json", "thumbnail.png", "world.bin"}
and members == before[slot], "complete unchanged formal package")
for member in members:
shutil.copyfile(Path(original) / member, target / member)
r.require(r.inventory(target) == members, "all copied formal hashes")
relocated[role][slot] = dict(provenance=original, relative=str(target.relative_to(out)), members=members)
r.write(out / "formal-relocation.json", relocated)
C_REL = "docs/plans/original-completion-2026-10-02/execution/completion_marker_contracts.json"
def select_mode(args):
"""Pure CLI mode selection; no filesystem or Git access."""
triple = (args.main, args.submission, args.tested_tree)
if any(value is not None for value in triple):
if (not all(isinstance(value, str) and re.fullmatch(r"[0-9a-f]{40}", value)
for value in triple) or args.historical_r17):
raise ValueError("fresh-q requires a full HEX40 triple without --historical-r17")
return "fresh-q"
if args.historical_r17 and args.check_only:
return "historical-r17-readonly"
raise ValueError("historical R17 is read-only; require --historical-r17 --check-only")
def fresh_q_guard(root, M, S, Qt):
gate = module("s5_gate", root / "tools/check_p04_order_evidence.py")
gate.require(Path(gate.__file__).resolve() == root / gate.CHECKER_PATH
and not root.is_symlink(), "fresh-q checker/root location")
gate.require(M == gate.MAIN_ANCHOR, "fresh-q main anchor")
commit, tree, entries = gate.actual_checkout()
gate.require(tree == Qt and commit != S and commit != M, "fresh-q checkout carrier")
gate.require(Path(os.environ["BUILD_OUTPUT_DIR"]).resolve() == BUILD.resolve(),
"fresh-q own BUILD_OUTPUT_DIR")
with gate.isolated_objects():
for value in (M, S):
gate.require(gate.git_bytes("cat-file", "-t", value) == b"commit\n", "commit input")
gate.submission_role(S)
composed = gate.git_bytes("-c", "rerere.enabled=false", "merge-tree", "--write-tree", M, S).decode().strip()
gate.require(re.fullmatch(r"[0-9a-f]{40}", composed) is not None and composed == Qt,
"fresh-q recomputed tree")
gate.require(hashlib.sha256(gate.git_bytes("show", M + ":tools/run_all_tests.py")).hexdigest()
== gate.SELECTION_SHA, "selection authority")
gate.require(gate.product_manifest(gate.tree_entries(M)) == gate.product_manifest(entries),
"fresh-q product unchanged")
sel = gate.selected_manifest(entries, require_checker=True)
r = module("s5_guard_runner", root / "tools/run_all_tests.py")
source_before = r.source_refs(root)
gate.require(source_before.keys() == sel.keys() and TEST in sel,
"fresh-q selected source keys")
gate.require({name: {key: value[key] for key in ("bytes", "sha256")}
for name, value in source_before.items()} == sel, "fresh-q selected bytes")
gate.require(C_REL in entries, "fresh-q contracts entry")
blob = gate.git_bytes("cat-file", "blob", entries[C_REL][1])
contract_pin = pin(root / C_REL)
gate.require(contract_pin["bytes"] == len(blob)
and contract_pin["sha256"] == hashlib.sha256(blob).hexdigest(),
"fresh-q contracts pin")
build = BUILD.resolve()
gate.require(HERE.is_relative_to(build), "fresh-q staged HERE inside BUILD")
for staged in [HERE, *HERE.rglob("*")]:
current = build
for part in staged.relative_to(build).parts:
current = current / part
gate.require(not current.is_symlink(), "fresh-q staged symlink")
gate.require(staged.is_dir() or stat.S_ISREG(staged.stat().st_mode),
"fresh-q staged regular file")
return dict(M=M, S=S, Q_tree=Qt, recomputed_Q=composed, checkout_commit=commit,
checkout_role="nonproduction Root checkout carrier of tree Q; NOT normal Runner C",
selected_manifest_sha256=gate.manifest_digest(sel), selected_file_count=len(sel),
product_file_count=len(sel)-1, selection_authority_sha256=gate.SELECTION_SHA)
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--project-root", type=Path, default=None)
parser.add_argument("--output", type=Path, default=BUILD / "p04-s5-native-r32")
parser.add_argument("--plan", type=Path, default=BUILD / "p04-s5-plan-r32.json")
parser.add_argument("--cache-run", type=Path, default=None,
help="optional passed registered cache; default is fresh, without cache access")
parser.add_argument("--godot", type=Path, default=ENGINE)
parser.add_argument("--check-only", action="store_true")
parser.add_argument("--main")
parser.add_argument("--submission")
parser.add_argument("--tested-tree")
parser.add_argument("--historical-r17", action="store_true")
args = parser.parse_args()
mode = select_mode(args)
if mode == "fresh-q" and args.project_root is None:
raise ValueError("fresh-q requires explicit --project-root")
project_root = args.project_root if args.project_root is not None else PRODUCT
if project_root.is_symlink():
raise ValueError("project root symlink")
engine_descriptor = engine_pin(args.godot)
if args.cache_run is not None and args.cache_run.resolve() != CACHE_RUN.resolve():
raise ValueError("only registered own-B full-run cache")
root = project_root.resolve()
out = args.output.resolve()
if not out.is_relative_to(BUILD.resolve()) or not args.plan.resolve().is_relative_to(BUILD.resolve()):
raise ValueError("plan/output must stay in task build")
if out.exists() or out.is_symlink():
raise ValueError("fresh output required")
if args.check_only and (args.plan.exists() or args.plan.is_symlink()):
raise ValueError("fresh plan required")
r = module("s5_standard_runner", root / "tools/run_all_tests.py")
# Preserve the reviewed source_refs -> exactly one QA override order.
source_before = r.source_refs(root)
refs = dict(source_before)
refs[TEST] = pin(QA)
provenance = None
if mode == "fresh-q":
provenance = fresh_q_guard(root, args.main, args.submission, args.tested_tree)
else:
r17_relocation_guard(root)
probe_guard(root)
expected = {n: dict(bytes=p["bytes"], sha256=p["sha256"]) for n, p in refs.items()}
uid_source = copy.deepcopy(expected)
contracts_path = root / C_REL if mode == "fresh-q" else CONTRACTS
fixed = [pin(p) for p in ([] if mode == "fresh-q" else MATERIALS) + [
QA, Path(__file__), HERE / "S5_ROOT_RUN.md",
root / "tests/transport/test_runtime_transport.gd",
root / "tests/staff/test_rescue_elevator.gd",
contracts_path,
]]
selected = dict(root_before=source_before, map={n: p["sha256"] for n, p in refs.items()}, timeout=1200)
cache_note = None
cache_receipts = []
if args.cache_run is not None:
# Reject failed caches before reading their inputs or cache contents.
r.require(r.read(args.cache_run / "runner-ended.json")["passed"] is True,
"failed cache is ineligible")
for leaf in (["runner-ended.json", "runner-input.json"] if args.cache_run is not None else []):
path = args.cache_run / leaf
try:
cache_receipts.append(pin(path))
except OSError as caught:
cache_note = dict(path=str(path), error=type(caught).__name__ + ": " + str(caught),
required_before_native=True)
break
plan = dict(protocol=("p04-s5-fresh-q-v1" if mode == "fresh-q" else "p04-s5-historical-r17-readonly-v1"),
mode=mode, provenance=provenance, historical_r17=mode != "fresh-q",
native_admissible=False, fresh_q_evidence=False,
historical_not_inputs=[str(p) for p in MATERIALS] if mode == "fresh-q" else [],
project_root=str(root), output=str(out), engine_path=str(args.godot.resolve()),
source_before=source_before, selected_source_map=selected["map"],
QA_overrides=[TEST], fixed_input_pins=fixed,
cache_run=str(args.cache_run) if args.cache_run is not None else None,
import_mode="cache" if args.cache_run is not None else "fresh",
engine_sha256=ENGINE_SHA256, engine=engine_descriptor,
cache_receipts=cache_receipts, cache_access=cache_note,
phases=["import", "parse", "writer", "reader"],
native_engine_launches=0, whole_goal_accepted=False, unit_accepted=False)
if mode == "fresh-q":
uid_plan, uid_snapshot, binding = load_uid_helper(root, r, source_before)
uid_plan_map = uid_plan(refs)
r.require(len(uid_plan_map) > 0, "nonempty derived UID plan")
r.require(all(p["owner"] in refs and p["owner_sha256"] == refs[p["owner"]]["sha256"]
for p in uid_plan_map.values()), "UID plan owner bindings")
plan.update(protocol="p04-s5-fresh-q-uid-diagnostic-v1", diagnostic_composite=True,
standard_execute_phase_context=False, uid_plan=uid_plan_map,
uid_plan_count=len(uid_plan_map), instrumentation=dict(
wrapper_sha256=r.sha(__file__),
execute_phase_source_sha256=hashlib.sha256(inspect.getsource(r.execute_phase).encode()).hexdigest(),
declared_reports_source_sha256=hashlib.sha256(inspect.getsource(r.declared_reports).encode()).hexdigest(),
callback="private-globals declared_reports + phase wrapper", uid_helper=binding))
# Check-only only reads source/materials and writes the plan in task build.
# Reads engine identity; never launches Godot or inspects players/processes.
if args.check_only:
args.plan.parent.mkdir(parents=True, exist_ok=True)
r.write(args.plan, plan)
print(json.dumps(dict(check_only=True, engines=0, source_files=len(source_before),
QA_overrides=[TEST], fixed_pins=len(fixed), plan=str(args.plan),
plan_sha256=r.sha(args.plan), cache_access=cache_note), ensure_ascii=False))
return 0
if mode != "fresh-q":
raise ValueError("historical R17 is read-only")
r.require(len(source_before) == provenance["selected_file_count"], "fresh-q selected count")
r.require(args.plan.is_file() and r.read(args.plan) == plan, "run exact check-only plan first")
reports, phase_call, uid_state = make_uid_policy(r, uid_snapshot, uid_source, plan["uid_plan"], out)
engine_observations = []
engine_identity = dict(before=engine_descriptor, during=[], after=None)
def repin(label):
try:
value = engine_pin(args.godot, engine_descriptor)
engine_observations.append(dict(stage=label, descriptor=value))
if label == "after-cleanup":
engine_identity["after"] = value
else:
engine_identity["during"].append(value)
except BaseException as caught:
engine_observations.append(dict(stage=label, error=str(caught)))
raise
def fixed_guard():
repin("cleanup-fixed-guard")
r.require(fresh_q_guard(root, args.main, args.submission, args.tested_tree) == provenance,
"fresh-q provenance changed")
probe_guard(root)
hp = pin(root / binding["helper_path"])
r.require(hp["bytes"] == binding["helper_bytes"] and hp["sha256"] == binding["helper_sha256"],
"UID helper unchanged")
for value in fixed + cache_receipts:
r.require(pin(value["path"]) == value, "fixed input changed: " + value["path"])
fixed_guard()
old = args.cache_run
if old is not None:
# Native cache admission remains Root-only and fails closed.
r.require(cache_note is None, "Root must read exact cache receipts: " + str(cache_note))
r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed")
cache_input = r.read(old / "runner-input.json")
r.require(cache_input["engine_sha256"] == ENGINE_SHA256, "cache engine identity")
old_map = cache_input["selected_source_map"]
current_map = {n: p["sha256"] for n, p in source_before.items()}
excluded = {"tools/check_p04_order_evidence.py", TEST}
r.require({k: v for k, v in old_map.items() if k not in excluded}
== {k: v for k, v in current_map.items() if k not in excluded},
"immutable cache selected inputs except checker and QA override")
protected = r.default_player(root)
outer = module("s5_owned_outer", r.SUPPORT / "owned_outer.py")
r.require(not outer.native.helper["live_engines"](), "another Godot owns CPU")
engine = ENGINE
repin("native-admission")
r.require(shutil.disk_usage(out.parent).free >= 1024**3 + engine.stat().st_size + 136*1024**2,
"reviewed native disk admission")
r.require(not out.exists(), "fresh output required; preserve previous attempts")
out.mkdir()
stage = out / "stage"
stage.mkdir()
(out / "starters").mkdir()
(out / "bootstrap").mkdir()
phases = []
previous = {}
error = None
guards = []
cleanup = []
cleanup_errors = []
cache_before = None
formal_before = None
formal_after = None
original_phase = outer.run_phase
def run_phase(argv, folder, timeout, env, **kwargs):
env = dict(env)
if folder.name in ["writer", "reader"]:
env.update(THE_TREE_S5_EVIDENCE=str(out / "raw"), THE_TREE_S5_MODE=folder.name)
return original_phase(argv, folder, timeout, env, **kwargs)
outer.run_phase = run_phase
try:
r.write(out / "runner-started.json", dict(started=r.now(), owner_runner_pid=os.getpid(),
plan=pin(args.plan), engines_launched=0))
r.write(out / "source_before.json", source_before)
r.write(out / "selected-source-map.json", refs)
# Private source stage first, then literal reviewed bootstrap.
for name, value in refs.items():
target = stage / name
target.parent.mkdir(parents=True, exist_ok=True)
r.copy_source(Path(value["path"]), target)
r.require(r.inventory(stage, stage=True) == expected, "whole private source")
for name, value in r.read(r.SUPPORT / "bootstrap-scripts.json").items():
data = value["text"].encode()
r.require(hashlib.sha256(data).hexdigest() == value["sha256"], "bootstrap pin")
(out / "bootstrap" / name).write_bytes(data)
if old is not None:
cache = old / "stage/.godot"
cache_before = r.inventory(cache)
r.require(bool(cache_before), "nonempty ended cache")
for name in cache_before:
src = cache / name
dst = stage / ".godot" / name
dst.parent.mkdir(parents=True, exist_ok=True)
subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True)
r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino),
"cache clone is a separate inode")
r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes")
r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts,
whole_cache=cache_before, independent_inode=True,
ordinary_import_required=True, ordinary_parse_required=True))
paths = ["res://" + n for n in sorted(refs) if n.endswith(".gd")]
r.require(len(paths) == sum(name.endswith(".gd") for name in refs), "complete derived parse roster")
r.write(out / "parse-paths.json", paths)
markers = module("s5_markers", root / "tools/strict_test_markers.py")
contracts = markers.load_contracts(contracts_path)
contracts[TEST] = dict(test=TEST, template="S5 power: <checks> checks, <failures> failures", required=True)
policy = r.read(r.SUPPORT / "suite-policy.json")
r.require(TEST not in policy["suite_policies"], "no normal suite watchdog/policy override")
r.write(out / "contracts.json", contracts)
r.write(out / "runner-input.json", dict(plan, owner_runner_pid=os.getpid(),
wrapper_sha256=r.sha(__file__), QA=pin(QA), engine=engine_descriptor,
engine_identity_before=engine_descriptor, engine_identity_initial=copy.deepcopy(engine_identity),
runner_sha256=r.sha(root / "tools/run_all_tests.py"),
default_player_before=protected, fixed_input_pins=fixed,
uid_helper=binding, uid_plan=plan["uid_plan"], uid_source_count=len(uid_source),
functional_watchdog_seconds=1200, source_adoption=False))
diagnostics = module("s5_diagnostics", r.SUPPORT / "diagnostic_gate.py")
owners = module("s5_owners", r.SUPPORT / "ordinary_proof_gate.py")
audio = module("s5_audio", r.SUPPORT / "audio_evidence_gate.py")
public = (stage / "project.godot").read_bytes()
for phase, test in [("import", None), ("parse", None), ("writer", TEST), ("reader", TEST)]:
if phase == "reader":
writer = r.read(out / "raw/writer.json")
formal_before = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()}
r.require(sorted(formal_before) == SLOTS, "exact three formal points for isolated power case")
if phase == "import" and old is None:
r.require(not (stage / ".godot").exists() and not (stage / ".godot").is_symlink(),
"fresh private .godot absent at actual import")
repin("before-" + phase)
r.write(out / ("engine-identity-before-" + phase + ".json"),
dict(engine_observations[-1], observation_index=len(engine_observations)-1))
row = phase_call(str(engine), stage, out, phase, test, selected, expected,
previous, policy, contracts, paths, public, protected, root,
outer, markers, diagnostics, owners, audio)
phases.append(row)
# execute_phase writer/reader share out/<test>.log via write_text.
# Keep binary per-phase copies under these existing unique names.
# The shared runner log is not write-once; see S5_ROOT_RUN.md.
if test and row.get("log"):
(out / (phase + "-combined-raw.log")).write_bytes((out / row["log"]).read_bytes())
row["strict_runner_log_path"] = row["log"]
row["log"] = phase + "-combined-raw.log"
r.write(out / (phase + "-actual-phase.json"), row)
print(json.dumps(dict(phase=phase, passed=row["passed"], error=row.get("validation_error"))), flush=True)
r.require(row["passed"], "first strict phase failure: " + phase)
if phase in ["writer", "reader"]:
receipt = r.read(out / ("raw/" + phase + ".json"))
r.require(receipt["checks"] > 0 and receipt["failures"] == 0,
"S5 actual outcome receipt")
r.require(exact_roster(receipt["branches"], receipt["slots"]),
"exact one independent Writer/Reader case")
r.require(sorted(receipt["slots"]) == SLOTS, "all formal point slots")
r.require(receipt["pid"] == row["actual_pid"], "actual native PID/receipt")
repin("after-collection")
writer = r.read(out / "raw/writer.json")
reader = r.read(out / "raw/reader.json")
r.require(writer["pid"] != reader["pid"] and writer["profile"] != reader["profile"], "distinct formal processes")
formal_after = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()}
r.require(formal_before == formal_after, "Reader leaves Writer packages unchanged")
except BaseException as caught:
error = type(caught).__name__ + ": " + str(caught)
finally:
try:
cleanup, cleanup_errors = outer.finish_captured(outer.OWNED)
except BaseException as caught:
cleanup_errors.append(str(caught))
try:
r.write(out / "outer-owned-finally.json", dict(cleanup=cleanup, errors=cleanup_errors))
except BaseException as caught:
guards.append("finally receipt: " + type(caught).__name__ + ": " + str(caught))
# Explicit re-pin after cleanup is independent of other fixed-input guards.
try:
repin("after-cleanup")
except BaseException as caught:
guards.append(type(caught).__name__ + ": " + str(caught))
# Fixed guard always follows ownership cleanup, even if setup or an engine failed.
try:
fixed_guard()
if uid_state["accepted"] is not None:
r.require(uid_snapshot(stage, uid_source, plan["uid_plan"]) == uid_state["accepted"],
"UID seal after cleanup")
after = r.source_refs(root)
r.write(out / "source_after.json", after)
r.require(after == source_before, "whole product source unchanged")
r.require(r.default_player(root) == protected, "default player unchanged")
if (stage / "project.godot").exists():
r.require(r.inventory(stage, stage=True) == dict(expected, **previous), "whole private source unchanged")
if cache_before is not None:
r.require(r.inventory(old / "stage/.godot") == cache_before, "original cache unchanged")
if formal_before is not None:
writer = r.read(out / "raw/writer.json")
formal_after = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()}
r.require(formal_before == formal_after, "Writer formal packages unchanged after Reader, including failure")
except BaseException as caught:
guards.append(type(caught).__name__ + ": " + str(caught))
pids = [p.pid for p in outer.OWNED]
passed = (error is None and not guards and not cleanup_errors and len(phases) == 4
and all(p["passed"] for p in phases) and len(pids) == len(set(pids)) == 4
and all(p["engine_ended"] for p in cleanup)
and uid_state["accepted"] is not None
and set(uid_state["accepted"]) == set(plan["uid_plan"])
and all((out / (phase + "-uids.json")).is_file() for phase in plan["phases"]))
execution = dict(passed=passed, error=error, guard_errors=guards, phases=phases,
actual_captured_PIDs=pids, cleanup=cleanup, cleanup_errors=cleanup_errors,
formal_before=formal_before, formal_after=formal_after,
whole_goal_accepted=False, unit_accepted=False)
# IO1 has already copied all four members into a separate Reader profile.
# Mirror those exact complete directories to own B for read-only R verification.
# Original profile paths are provenance after this step, never verifier inputs.
try:
if passed:
relocated = {}
for role in ("writer", "reader"):
receipt = r.read(out / ("raw/" + role + ".json"))
relocated[role] = {}
for slot, original in receipt["slots"].items():
target = out / "formal" / role / slot
target.mkdir(parents=True)
members = r.inventory(Path(original))
r.require(set(members) == {"journal.log", "manifest.json", "thumbnail.png", "world.bin"}, "all formal members")
for member in members:
shutil.copyfile(Path(original) / member, target / member)
r.require(r.inventory(target) == members == formal_before[slot], "whole formal mirror")
relocated[role][slot] = dict(provenance=original, relative=str(target.relative_to(out)), members=members)
r.write(out / "formal-relocation.json", relocated)
r.write(out / "raw-inventory.json", r.inventory(out / "raw"))
r.write(out / "PID-set.json", dict(owner_runner_pid=os.getpid(), engine_PIDs=pids))
except BaseException as caught:
guards.append("output collection: " + type(caught).__name__ + ": " + str(caught))
passed = False
execution["passed"] = False
try:
repin("after-output-collection")
except BaseException as caught:
guards.append(str(caught))
passed = False
execution["passed"] = False
try:
r.write(out / "engine-identity.json",
dict(observations=engine_observations, identity=engine_identity))
except BaseException as caught:
guards.append("engine identity receipt: " + type(caught).__name__ + ": " + str(caught))
passed = False
execution["passed"] = False
execution["engine_observations"] = engine_observations
execution["engine_identity"] = engine_identity
r.write(out / "execution.json", execution)
r.write(out / "runner-ended.json", dict(execution, ended=r.now()))
print(json.dumps(dict(passed=passed, error=error, guard_errors=guards, output=str(out))))
return 0 if passed else 1
if __name__ == "__main__":
try:
raise SystemExit(main())
except Exception as caught:
print(type(caught).__name__ + ": " + str(caught), file=sys.stderr)
raise SystemExit(2)
@@ -0,0 +1,127 @@
"""Engine-free mirror of M journal serialization; EXPECTED never accepts AFTER.
The native probe uses detached public restores. This independent derivation
binds that recorded EXPECTED to BEFORE and the fixed guard command, so copying
AFTER into EXPECTED cannot turn a mutation into evidence.
"""
import struct
MESSAGES = {
'G1': 'A Facility assigned to a non-terminal Defense Raid cannot accept service requests.',
'G2': 'A busy Facility cannot become a Defense asset.',
}
def atom(kind, value):
if kind in (4, 21):
data = value.encode()
return struct.pack('<II', kind, len(data)) + data + b'\0' * (-len(data) % 4)
if kind == 2 and not -(2**31) <= value < 2**31:
return struct.pack('<Iq', kind | 65536, value)
return struct.pack('<Ii', kind, value)
def dictionary(pairs):
return struct.pack('<II', 27, len(pairs)) + b''.join(k + v for k, v in pairs)
def strings_dict(pairs):
return dictionary([(atom(4, k), v) for k, v in pairs])
def array(rows, element=None):
header = struct.pack('<II', 28, len(rows)) if element is None else struct.pack('<III', 65564, element, len(rows))
return header + b''.join(rows)
def update(node, changes):
"""Retain all untouched typed keys, values and order, with no field masks."""
if node.kind != 27 or set(changes) - {k.value for k, _ in node.value}:
raise ValueError('journal dictionary keys')
return dictionary([(k.raw, changes.get(k.value, v.raw)) for k, v in node.value])
def expected(before, command, guard, parse, require):
require(guard in MESSAGES, 'fixed guard')
rt = before.at('systems').at('runtime')
q = rt.at('command_queue')
require(q.at('version').kind == 2 and q.at('version').value == 2, 'M queue version')
require(rt.at('next_command_id').kind == 2, 'typed next_command_id')
for name in ('pending', 'in_flight', 'processed', 'accepted'):
require(q.at(name).raw[:8] == struct.pack('<II', 65564, 27), 'M typed queue array: ' + name)
prior_ids = {}
for name in ('accepted', 'processed'):
members = q.at(name).value
require(all(r.at('command_id').kind == 2 for r in members), 'typed prior command IDs')
numbers = [r.at('command_id').value for r in members]
require(numbers == sorted(set(numbers)) and all(i > 0 for i in numbers), 'sorted unique ' + name)
prior_ids[name] = numbers
require(prior_ids['accepted'] == prior_ids['processed'], 'complete isolated prior journal')
mapping = q.at('idempotency')
require(all(k.kind == 4 and v.kind == 2 for k, v in mapping.value), 'typed idempotency mapping')
require([k.value for k, _ in mapping.value] == sorted(k.value for k, _ in mapping.value), 'sorted idempotency')
require(not q.at('pending').value and not q.at('in_flight').value, 'isolated guard queue')
require(rt.at('operations').at('enabled').value is False, 'guard operations disabled')
ident = rt.at('next_command_id').value
minute = command.at('issued_tick').value
key = command.at('idempotency_key').value
kind = 'create_service_request' if guard == 'G1' else 'register_defense_asset'
require(command.at('command_id').kind == 2 and command.at('command_id').value == ident
and command.at('execute_tick').value == minute
and command.at('priority').value == 10 and command.at('command_type').value == kind
and command.at('actor_id').value == 'player' and command.at('target_id').value == ''
and key.startswith('p04.s5.') and key not in q.at('idempotency').plain(), 'fixed guard command binding')
payload = command.at('payload').plain()
if guard == 'G1':
require(set(payload) == {'facility_id', 'request_id', 'guest_ids'}
and payload['request_id'] == 'p04.s5.request.a'
and payload['guest_ids'] == ['p04.s5.guest.a'], 'G1 payload')
else:
require(set(payload) == {'raid_id', 'asset_id', 'kind', 'max_integrity'}
and payload['raid_id'] == 'p04.s5.guard.raid' and payload['kind'] == 'OBJECTIVE'
and payload['max_integrity'] == 10000, 'G2 payload')
details = dictionary([(atom(21, 'raid_id'), atom(21, 'p04.s5.raid'))]) if guard == 'G1' else dictionary([])
result = strings_dict([
('code', atom(4, 'VALIDATION_FAILED')), ('command_id', atom(2, ident)),
('target_id', atom(4, '')), ('message', atom(4, MESSAGES[guard])),
('resolution_hints', array([], 4)), ('details', details), ('is_replay', atom(1, 0))])
accepted = q.at('accepted').value
processed = q.at('processed').value
for row in accepted:
old_key = row.at('idempotency_key')
require(old_key.kind == 4, 'accepted String key')
if old_key.value:
require(mapping.at(old_key.value).value == row.at('command_id').value, 'prior accepted/idempotency join')
require(all(r.at('command_id').value < ident for r in accepted + processed), 'prior journal IDs')
metadata = strings_dict([('command_id', atom(2, ident)), ('idempotency_key', atom(4, key))])
idem = [(k.value, v.raw) for k, v in q.at('idempotency').value] + [(key, atom(2, ident))]
queue = update(q, {'accepted': array([r.raw for r in accepted] + [metadata], 27),
'processed': array([r.raw for r in processed] + [result], 27),
'idempotency': strings_dict(sorted(idem))})
generator = rt.at('id_generator')
counters = generator.at('counters').plain()
require(all(k.kind == 4 and v.kind == 2 for k, v in generator.at('counters').value), 'typed counters')
counters['domain_event'] = counters.get('domain_event', 0) + 1
eid = 'domain_event.%012d' % counters['domain_event']
ids = update(generator, {'counters': strings_dict([(k, atom(2, v)) for k, v in sorted(counters.items())])})
event = strings_dict([('event_id', atom(4, eid)), ('event_type', atom(4, 'COMMAND_FAILED')),
('absolute_minute', atom(2, minute)), ('source_service', atom(4, 'simulation_runtime')),
('entity_ids', array([], 4)), ('payload', result), ('causation_command_id', atom(2, ident))])
stream = rt.at('domain_events')
published = stream.at('published_ids').plain()
require(eid not in published, 'new event ID')
events = update(stream, {'published_ids': array([atom(4, k) for k in sorted(published + [eid])], 4),
'recent_events': array(([r.raw for r in stream.at('recent_events').value] + [event])[-256:], 27)})
runtime = update(rt, {'next_command_id': atom(2, ident + 1), 'command_queue': queue,
'id_generator': ids, 'domain_events': events})
envelope = update(before, {'systems': update(before.at('systems'), {'runtime': runtime})})
return parse(envelope), parse(result)
def verify(record, parse, require):
before, command = record.at('before'), record.at('command')
tree, result = expected(before, command, record.at('guard').value, parse, require)
require(record.at('expected').raw == tree.raw, 'EXPECTED must independently derive from BEFORE; AFTER-copy forbidden')
require(record.at('after').raw == tree.raw, 'whole typed guard Runtime; no business or journal masks')
require(record.at('result').raw == result.raw, 'independent exact failed result')
return True
@@ -0,0 +1,479 @@
#!/usr/bin/env python3
"""Typed S5 ordering derivations. Native provenance is verified separately."""
import hashlib
import importlib.util
import json
from pathlib import Path
def module(name, path):
spec = importlib.util.spec_from_file_location(name, path)
value = importlib.util.module_from_spec(spec)
spec.loader.exec_module(value)
return value
POWER_PATH = Path(__file__).with_name('s5_power_adapter.py')
power = module('s5_order_power', POWER_PATH)
Raw, staff_check, duplicate_check = power.Raw, power.staff_check, power.duplicate_check
series, require = power.series, power.require
DEPENDENCIES = {str(p): hashlib.sha256(p.read_bytes()).hexdigest()
for p in (POWER_PATH, power.SERIES_PATH)}
GUARD_PATH = Path(__file__).with_name('s5_guard_oracle.py')
guard_oracle = module('s5_guard_oracle', GUARD_PATH)
DEPENDENCIES[str(GUARD_PATH)] = hashlib.sha256(GUARD_PATH.read_bytes()).hexdigest()
GUEST, REQUEST = power.GUEST, power.REQUEST
SECOND, SECOND_REQUEST = 'p04.s5.guest.b', 'p04.s5.request.b'
def field(node, *keys):
for key in keys:
node = node.at(key)
return node
def scalar(node, *keys):
node = field(node, *keys)
require(node.kind in (1, 2, 4, 21), 'typed scalar required')
return node.value
def rows(node, *keys):
node = field(node, *keys)
require(node.kind == 28, 'typed array required')
return node.value
def phase(phases, name, minute):
found = [p for p in phases if scalar(p, 'phase') == name and scalar(p, 'minute') == minute]
require(len(found) == 1, 'one raw phase: ' + name)
return found[0]
def sales(point):
return [r for r in rows(point, 'ledger') if scalar(r, 'category') == 'SERVICE_SALE'
and scalar(r, 'credit_account') == 'GUEST_WALLET:' + GUEST]
def release(before, after, request, minute):
old = [r for r in rows(before, 'reservations') if scalar(r, 'requester_id') == request]
new = [r for r in rows(after, 'reservations') if scalar(r, 'requester_id') == request]
require(len(old) == len(new) == 1, 'one original reservation')
ident = scalar(old[0], 'reservation_id')
require(scalar(new[0], 'reservation_id') == ident and scalar(old[0], 'state') == 'ACTIVE'
and scalar(new[0], 'state') == 'RELEASED' and scalar(new[0], 'terminal_at') == minute,
'reservation release identity/state/time')
operations = rows(after, 'snapshot', 'systems', 'runtime', 'inventory', 'idempotency_results')
matches = [r for r in operations if scalar(r, 'action') == 'release'
and scalar(r, 'result', 'reservation_id') == ident]
require(len(matches) == 1 and scalar(matches[0], 'result', 'ok') is True,
'exactly one successful release')
require(field(after, 'requests', request).plain() == {}, 'no orphan request')
return ident
def payment(before, after, minute):
sale = sales(after)
require(not sales(before) and len(sale) == 1, 'exactly one new sale')
price = scalar(before, 'inputs', 'price')
require(price == scalar(before, 'service', 'price_snapshot')
and scalar(before, 'inputs', 'duration') == scalar(before, 'service', 'duration_minutes'),
'values derived from service snapshot')
require(price > 0 and scalar(sale[0], 'amount') == price
and scalar(sale[0], 'absolute_minute') == minute
and scalar(sale[0], 'source_entity_id') == scalar(after, 'inputs', 'facility_id'),
'sale amount/time/facility')
require(scalar(after, 'wallets', GUEST) == scalar(before, 'wallets', GUEST) - price,
'single wallet debit')
require(scalar(after, 'service', 'state') == 'COMPLETED'
and scalar(after, 'service', 'completed_at') == minute, 'completed before payment')
runtime = field(after, 'snapshot', 'systems', 'runtime')
history = [r for r in rows(runtime, 'facilities', 'service_history')
if scalar(r, 'service_id') == scalar(after, 'service', 'service_id')]
require(len(history) == 1 and history[0].raw == field(after, 'service').raw, 'completed service joins typed Runtime')
require(sum(r.raw == sale[0].raw for r in rows(runtime, 'economy', 'entries')) == 1,
'sale joins typed Runtime ledger once')
key = 'service.payment.' + scalar(after, 'service', 'service_id')
idem = [r for r in rows(runtime, 'economy', 'idempotency') if scalar(r, 'key') == key]
require(len(idem) == 1 and scalar(idem[0], 'transaction_id') == scalar(sale[0], 'transaction_id'),
'independent service/payment idempotency join')
receipt_entries = [r for receipt in rows(after, 'receipts') for r in rows(receipt, 'entries')]
require(sum(r.raw == sale[0].raw for r in receipt_entries) == 1, 'sale bound to one typed receipt')
return sale[0]
def destruction_command(points, phases):
before, end = points['before'], points['held']
n = scalar(before, 'inputs', 'boundary')
prior = phase(phases, 'FACILITY_COMPLETION', n)
require(scalar(prior, 'facility', 'durability') == 0
and scalar(prior, 'facility', 'state') == 'BROKEN', 'command destroys before completion')
for p in (points['boundary'], end):
require(scalar(p, 'service', 'state') == 'FAILED'
and scalar(p, 'service', 'failure_reason') == 'BROKEN', 'INTERRUPTION_BROKEN')
require(not sales(p) and scalar(p, 'wallets', GUEST) == scalar(before, 'wallets', GUEST),
'zero destroyed charge')
release(before, p, REQUEST, n)
return {'destruction_stop': {'charges': 0}, 'command_destruction_before_completion': True}
def destruction_raid_r40(points, phases):
before, end = points['before'], points['held']
n = scalar(before, 'inputs', 'boundary')
pre = phase(phases, 'INCIDENTS_AND_EVENTS', n)
post = phase(phases, 'FACILITY_QUEUES', n)
payment(before, phase(phases, 'VITALS_AND_ENVIRONMENT', n), n)
payment(before, pre, n)
require(scalar(pre, 'facility', 'durability') > 0 and scalar(post, 'facility', 'durability') == 0
and scalar(post, 'facility', 'state') == 'BROKEN'
and scalar(post, 'facility', 'suspension_reason') == 'DESTROYED', 'sale before automatic destruction')
require(scalar(end, 'minute') == n + 1, 'unfinished failure at N+1')
release(before, end, SECOND_REQUEST, n + 1)
failed = [r for r in rows(end, 'snapshot', 'systems', 'runtime', 'facilities', 'service_history')
if scalar(r, 'request_id') == SECOND_REQUEST]
require(len(failed) == 1 and scalar(failed[0], 'state') == 'FAILED'
and scalar(failed[0], 'failure_reason') == 'BROKEN', 'unfinished service failed by broken facility')
require(scalar(end, 'wallets', SECOND) == scalar(before, 'wallets', SECOND), 'no unfinished charge')
require([r.raw for r in sales(end)] == [r.raw for r in sales(pre)], 'no extra raid sale')
return {'raid_sale_before_destruction': True, 'raid_unfinished_release': True}
def paid_before_incident(points, phases):
"""Phase-start snapshots bracket completion and the public automatic event."""
before, boundary, end = (points[k] for k in ('before', 'boundary', 'held'))
n = scalar(before, 'inputs', 'boundary')
completion = phase(phases, 'FACILITY_COMPLETION', n)
completed = phase(phases, 'VITALS_AND_ENVIRONMENT', n)
incident = phase(phases, 'INCIDENTS_AND_EVENTS', n)
queues = phase(phases, 'FACILITY_QUEUES', n)
require([phases.index(p) for p in (completion, completed, incident, queues)] ==
sorted(phases.index(p) for p in (completion, completed, incident, queues)),
'completion/event/queue phase order')
require(scalar(before, 'minute') == n - 1 and scalar(boundary, 'minute') == n
and scalar(end, 'minute') == n + 1, 'exact boundary points')
for p in (before, completion):
require(scalar(p, 'service', 'state') == 'ACTIVE' and not sales(p)
and scalar(p, 'service', 'started_at') + scalar(p, 'service', 'duration_minutes') == n
and scalar(p, 'service', 'elapsed_minutes') == scalar(p, 'service', 'duration_minutes') - 1
and scalar(p, 'facility', 'durability') > 0, 'independent pre-completion state')
sale = payment(before, completed, n)
for p in (completed, incident, queues, boundary, end):
require(payment(before, p, n).raw == sale.raw, 'identical surviving sale')
require([r.raw for r in rows(p, 'ledger') if scalar(r, 'category') == 'SERVICE_SALE'] == [sale.raw],
'one total sale; secondary never charged')
require(scalar(p, 'wallets', SECOND) == scalar(before, 'wallets', SECOND), 'unchanged second wallet')
receipts = [r for r in rows(p, 'receipts') if scalar(r, 'id') == scalar(sale, 'transaction_id')]
require(len(receipts) == 1 and scalar(receipts[0], 'phase') == 'FACILITY_COMPLETION'
and scalar(receipts[0], 'minute') == n, 'payment emitted in completion phase')
require(scalar(sale, 'absolute_minute') // 1440 + 1 == n // 1440 + 1,
'financial day derived from ledger absolute_minute')
require(scalar(completed, 'facility', 'durability') > 0
and scalar(incident, 'facility', 'durability') > 0, 'destruction not before incidents')
for p in (queues, boundary, end):
require(scalar(p, 'facility', 'durability') == 0 and scalar(p, 'facility', 'state') == 'BROKEN'
and scalar(p, 'facility', 'suspension_reason') == 'DESTROYED', 'event destruction at N')
def services(p):
facilities = field(p, 'snapshot', 'systems', 'runtime', 'facilities')
return (rows(facilities, 'service_history') +
[s for f in rows(facilities, 'instances') for s in rows(f, 'active_services')])
baseline = services(before)
ids = [scalar(s, 'service_id') for s in baseline]
require(len(ids) == len(set(ids)) == 2, 'exactly two independent original service IDs')
second_id = None
for p in (before, completion, completed, incident, queues, boundary, end):
current = services(p)
require(sorted(scalar(s, 'service_id') for s in current) == sorted(ids), 'zero duplicate generations')
for key in ('known_service_ids', 'known_request_ids', 'next_service_sequence'):
require(field(p, 'snapshot', 'systems', 'runtime', 'facilities', key).raw ==
field(before, 'snapshot', 'systems', 'runtime', 'facilities', key).raw,
'stable service/request generation bookkeeping: ' + key)
secondary = [s for s in current if scalar(s, 'request_id') == SECOND_REQUEST]
require(len(secondary) == 1, 'one secondary request/service join')
s = secondary[0]
if second_id is None:
second_id = scalar(s, 'service_id')
require(scalar(s, 'service_id') == second_id, 'secondary identity unchanged')
if p is end:
require(scalar(s, 'state') == 'FAILED' and scalar(s, 'failure_reason') == 'BROKEN'
and scalar(s, 'completed_at') == n + 1, 'secondary failed once at N+1')
else:
require(scalar(s, 'state') == 'ACTIVE' and scalar(s, 'elapsed_minutes') < scalar(s, 'duration_minutes')
and scalar(s, 'started_at') == n - 1, 'secondary unfinished through N')
reservation = [r for r in rows(p, 'reservations') if scalar(r, 'requester_id') == SECOND_REQUEST]
require(len(reservation) == 1 and scalar(reservation[0], 'state') == 'ACTIVE', 'secondary reservation held through N')
require(not [r for r in rows(p, 'snapshot', 'systems', 'runtime', 'inventory', 'idempotency_results')
if scalar(r, 'action') == 'release'
and scalar(r, 'result', 'reservation_id') == scalar(reservation[0], 'reservation_id')],
'no early secondary release')
release(before, end, SECOND_REQUEST, n + 1)
require(not rows(end, 'snapshot', 'systems', 'runtime', 'facilities', 'requests')
and all(scalar(r, 'state') != 'ACTIVE' for r in rows(end, 'reservations'))
and scalar(end, 'active_services') == 0, 'no reservation or orphan request remains')
return {'paid_before_incident': True, 'duplicate_generations': 0}
def destruction_raid(points, phases):
before = points['before']
n = scalar(before, 'inputs', 'boundary')
due = rows(before, 'inputs', 'recovery', 'due_rounds')
require(len(due) == 1 and scalar(due[0], 'earliest_minute') == n
and scalar(due[0], 'raid_id') == 'p04.s5.raid', 'idle OBJECTIVE due exactly N')
pre = phase(phases, 'INCIDENTS_AND_EVENTS', n)
require(scalar(pre, 'facility', 'durability') > 0, 'idle breach not before incidents')
for point in (phase(phases, 'FACILITY_QUEUES', n), points['boundary'], points['held']):
require(scalar(point, 'facility', 'durability') == 0 and scalar(point, 'facility', 'state') == 'BROKEN'
and scalar(point, 'facility', 'suspension_reason') == 'DESTROYED', 'automatic idle destruction in INCIDENTS_AND_EVENTS')
require(not rows(point, 'reservations') and field(point, 'service').plain() == {}
and scalar(point, 'active_services') == 0
and not rows(point, 'snapshot', 'systems', 'runtime', 'facilities', 'requests')
and all(v.plain() == {} for _, v in field(point, 'requests').value), 'idle no requests/reservations/orphans')
require(not any(scalar(r, 'category') == 'SERVICE_SALE' for r in rows(point, 'ledger')),
'idle raid zero SERVICE_SALE')
return {'idle_objective_breach': True, 'destruction_stop': {'charges': 0}}
def destruction_in_flight(points, phases):
before, boundary, end = points['before'], points['boundary'], points['held']
n = scalar(before, 'inputs', 'boundary')
pre = phase(phases, 'INCIDENTS_AND_EVENTS', n)
post = phase(phases, 'FACILITY_QUEUES', n)
require(scalar(pre, 'facility', 'durability') > 0 and scalar(pre, 'service', 'state') == 'ACTIVE'
and scalar(pre, 'service', 'elapsed_minutes') < scalar(pre, 'service', 'duration_minutes'),
'in-flight completion phase precedes destruction')
require(scalar(post, 'facility', 'durability') == 0 and scalar(post, 'facility', 'state') == 'BROKEN'
and scalar(boundary, 'service', 'state') == 'ACTIVE', 'event breaks active service at N')
require(scalar(end, 'minute') == n + 1 and scalar(end, 'service', 'state') == 'FAILED'
and scalar(end, 'service', 'failure_reason') == 'BROKEN', 'N+1 in-flight failure')
for p in (boundary, end):
require(not sales(p) and field(p, 'wallets').raw == field(before, 'wallets').raw, 'in-flight zero charge')
release(before, end, REQUEST, n + 1)
return {'in_flight_destruction': True, 'destruction_stop': {'charges': 0}}
def shift_completion(points, phases):
before, end, held = points['before'], points['boundary'], points['held']
require(scalar(before, 'inputs', 'boundary') == 1080, 'DAY end exactly 1080')
require(scalar(before, 'minute') == 1079 and scalar(before, 'service', 'state') == 'ACTIVE'
and scalar(before, 'service', 'started_at') + scalar(before, 'service', 'duration_minutes') == 1080
and scalar(before, 'service', 'elapsed_minutes') == scalar(before, 'service', 'duration_minutes') - 1,
'natural snapshot duration aligns completion to 1080')
for point, label in [(before, 'first-before-17-59'), (end, 'first-18-00-tick-complete'),
(held, 'first-18-01-tick-complete'),
(phase(phases, 'FACILITY_COMPLETION', 1080), 'first-18-00-before-facility'),
(phase(phases, 'VITALS_AND_ENVIRONMENT', 1080), 'first-18-00-after-facility'),
(phase(phases, 'PUBLISH_SNAPSHOT', 1080), 'first-18-00-after-staff')]:
require(scalar(point, 'order_label') == label, 'historical shift observation label: ' + label)
require(not sales(phase(phases, 'FACILITY_COMPLETION', 1080)), 'not charged before FACILITY_COMPLETION')
sale = payment(before, phase(phases, 'VITALS_AND_ENVIRONMENT', 1080), 1080)
payment(before, end, 1080)
payment(before, held, 1080)
require(scalar(held, 'minute') == 1081 and field(end, 'service').raw == field(held, 'service').raw,
'1081 no second completion')
receipts = [r for r in rows(end, 'receipts') if scalar(r, 'id') == scalar(sale, 'transaction_id')]
require(len(receipts) == 1 and scalar(receipts[0], 'phase') == 'FACILITY_COMPLETION', 'sale before handover')
staff = rows(receipts[0], 'staff_at_receipt')
ids = field(before, 'service', 'staff_ids').plain()
require(ids and [scalar(r, 'staff_id') for r in staff] == ids, 'DAY staff captured at receipt')
shifts = rows(before, 'snapshot', 'systems', 'runtime', 'staff', 'shifts')
final_shifts = rows(end, 'snapshot', 'systems', 'runtime', 'staff', 'shifts')
final_staff = rows(end, 'snapshot', 'systems', 'runtime', 'staff', 'staff')
for worker in staff:
ident = scalar(worker, 'staff_id')
shift = [s for s in shifts if scalar(s, 'shift_instance_id') == scalar(worker, 'shift_id')]
require(len(shift) == 1 and scalar(shift[0], 'end_at') == 1080 and scalar(shift[0], 'template_id') == 'DAY'
and scalar(worker, 'state') != 'OFF_DUTY', 'DAY not NIGHT staff before handover')
after = [s for s in final_shifts if scalar(s, 'shift_instance_id') == scalar(worker, 'shift_id')]
require(len(after) == 1 and scalar(after[0], 'actual_ended_at') == scalar(after[0], 'end_at') == 1080,
'DAY shift ended after receipt')
workers = [s for s in final_staff if scalar(s, 'staff_id') == ident]
require(len(workers) == 1 and scalar(workers[0], 'state') == 'OFF_DUTY', 'DAY now OFF_DUTY')
return {'shift_completion': {'minute': 1080, 'completions': 1, 'charges': 1, 'completion_before_shift': True}}
def paused_midnight(points, phases):
before, end = points['before'], points['recovered']
n = scalar(before, 'inputs', 'boundary')
require(n > 0 and n % 1440 == 0, 'paused midnight multiple')
for p in (before, phase(phases, 'TIME_BOUNDARIES', n), phase(phases, 'MANA', n), points['boundary'], points['held']):
require(scalar(p, 'service', 'state') == 'PAUSED'
and scalar(p, 'service', 'interruption_reason') == 'RELATED_FACILITY_INACTIVE'
and scalar(p, 'service', 'elapsed_minutes') == scalar(before, 'service', 'elapsed_minutes'),
'legitimate pause unchanged through DAILY_CLOSE')
require(field(p, 'reservations').raw == field(before, 'reservations').raw
and field(p, 'requests', REQUEST).raw == field(before, 'requests', REQUEST).raw,
'identical active reservations and preserved request')
require(not sales(p) and field(p, 'wallets').raw == field(before, 'wallets').raw, 'no paused sale')
active = rows(before, 'reservations')
require(len(active) == 1 and scalar(active[0], 'state') == 'ACTIVE', 'one active meal reservation')
post = phase(phases, 'MANA', n)
summaries = rows(post, 'snapshot', 'systems', 'runtime', 'operations', 'coordinator', 'day_summaries')
summaries = [s for s in summaries if scalar(s, 'closed_at') == n]
require(len(summaries) == 1, 'one DAILY_CLOSE during TIME_BOUNDARIES')
settlement_rows = [r for r in rows(post, 'ledger') if scalar(r, 'absolute_minute') == n]
upkeep = [r for r in settlement_rows if scalar(r, 'category') == 'MAINTENANCE_PAYMENT']
require(upkeep and len({scalar(r, 'transaction_id') for r in upkeep}) == 1, 'one paused upkeep settlement')
require(len({scalar(r, 'source_entity_id') for r in upkeep}) == len(upkeep), 'one upkeep row per owned facility')
for row in upkeep:
accrual = [r for r in rows(post, 'ledger') if scalar(r, 'category') == 'MAINTENANCE_ACCRUAL'
and scalar(r, 'transaction_id') == scalar(row, 'transaction_id')
and scalar(r, 'source_entity_id') == scalar(row, 'source_entity_id')
and scalar(r, 'amount') == scalar(row, 'amount') and scalar(r, 'absolute_minute') == n - 1]
require(len(accrual) == 1, 'paused upkeep accrual joined once')
wages = [r for r in settlement_rows if scalar(r, 'category') == 'WAGE']
require(len(wages) == 1, 'one paused payroll transaction')
payroll = [r for r in rows(post, 'snapshot', 'systems', 'runtime', 'staff', 'payroll_settlements')
if scalar(r, 'settlement_id') == scalar(wages[0], 'source_entity_id')]
require(len(payroll) == 1 and scalar(payroll[0], 'day') == n // 1440, 'paused payroll day/ledger join')
paid = [r for r in rows(payroll[0], 'rows') if scalar(r, 'payment') > 0]
require(paid and len({scalar(r, 'staff_id') for r in paid}) == len(paid)
and sum(scalar(r, 'payment') for r in paid) == scalar(wages[0], 'amount'), 'paused payroll paid once')
for p in (points['boundary'], points['held'], end):
require([r.raw for r in rows(p, 'ledger') if scalar(r, 'absolute_minute') == n] == [r.raw for r in settlement_rows],
'no double settlement or midnight sale')
current = [s for s in rows(p, 'snapshot', 'systems', 'runtime', 'operations', 'coordinator', 'day_summaries')
if scalar(s, 'closed_at') == n]
require([s.raw for s in current] == [s.raw for s in summaries], 'settlement summary posted once')
completion = scalar(end, 'service', 'completed_at')
require(n < completion < n + 1440, 'recovery in new day')
payment(before, end, completion)
consumed = rows(end, 'reservations')
require(len(consumed) == 1 and scalar(consumed[0], 'reservation_id') == scalar(active[0], 'reservation_id')
and scalar(consumed[0], 'state') == 'CONSUMED' and field(end, 'requests', REQUEST).plain() == {},
'consumed original reservation no orphan')
return {'paused_midnight': {'orphan_reservations': 0, 'crossed_midnight_while_paused': True,
'stopped_charges': 0, 'completions': 1, 'charges': 1}}
def midnight_day(points, phases):
before, end, replay = points['before'], points['boundary'], points['recalled']
n = scalar(before, 'inputs', 'boundary')
require(n > 0 and n % 1440 == 0, 'midnight multiple')
pre = phase(phases, 'FACILITY_COMPLETION', n)
require(not sales(pre), 'settlement before sale')
coordinator = field(pre, 'snapshot', 'systems', 'runtime', 'operations', 'coordinator')
days = [r for r in rows(coordinator, 'day_summaries') if scalar(r, 'closed_at') == n]
require(len(days) == 1 and scalar(days[0], 'period_end_minute_exclusive') == n,
'one half-open DAILY_CLOSE at N')
upkeep = [r for r in rows(pre, 'ledger') if scalar(r, 'category') == 'MAINTENANCE_PAYMENT'
and scalar(r, 'absolute_minute') == n]
require(upkeep and len({scalar(r, 'transaction_id') for r in upkeep}) == 1, 'a_upkeep before sale')
mana = phase(phases, 'MANA', n)
require(all(any(r.raw == u.raw for r in rows(mana, 'ledger')) for u in upkeep),
'upkeep posted during TIME_BOUNDARIES')
sale = payment(before, end, n)
payment(before, phase(phases, 'VITALS_AND_ENVIRONMENT', n), n)
require(n <= scalar(sale, 'absolute_minute') < n + 1440, 'new day sale')
require(field(end, 'snapshot').raw == field(replay, 'snapshot').raw,
'same-minute replay preserves every typed Runtime field')
require(scalar(replay, 'inputs', 'recovery', 'midnight_replay', 'is_replay') is True,
'same minute is_replay')
def paid_view(point):
value = point.plain()
runtime = value['snapshot']['systems']['runtime']
value.update(staff=runtime['staff'], payroll=runtime['staff']['payroll_settlements'],
shifts=runtime['staff']['shifts'], operations=runtime['operations']['coordinator'],
idempotency={'economy': runtime['economy']['idempotency']})
return value
# Reuse the unchanged paid-midnight ledger/duty joins after the typed order gates.
series.settlement(paid_view(before), paid_view(end))
return {'midnight_settlement': {'settlements': 1, 'sales_payments': 1, 'payroll_payments': 1,
'upkeep_payments': 1, 'duty_payments': 1, 'nonzero_payroll': True},
'midnight_replay': {'settlements': 1, 'same_minute_replayed': True, 'duplicate_payments': 0},
'midnight_close_upkeep_before_sale': True, 'midnight_new_day_sale': True}
def exit_order(points, phases):
before = points['before']
n = scalar(before, 'inputs', 'boundary')
pre = phase(phases, 'FACILITY_COMPLETION', n)
release(before, pre, SECOND_REQUEST, n)
for p in [pre, points['boundary'], points['held']]:
services = rows(p, 'snapshot', 'systems', 'runtime', 'facilities', 'service_history')
services = services + [s for facility in rows(p, 'snapshot', 'systems', 'runtime', 'facilities', 'instances')
for s in rows(facility, 'active_services')]
require(not any(scalar(s, 'request_id') == SECOND_REQUEST for s in services), 'command exit before start')
require(scalar(p, 'wallets', SECOND) == scalar(before, 'wallets', SECOND), 'command exit no charge')
ai = phase(phases, 'AI_DECISIONS', n)
published = phase(phases, 'PUBLISH_SNAPSHOT', n)
payment(before, ai, n)
payment(before, phase(phases, 'VITALS_AND_ENVIRONMENT', n), n)
require(scalar(ai, 'guests', GUEST, 'state') == 'DECIDING'
and scalar(ai, 'guests', GUEST, 'planned_exit_at') <= n
and scalar(published, 'guests', GUEST, 'state') == 'LEAVING'
and scalar(published, 'guests', GUEST, 'exit_reason') == 'PLANNED_EXIT',
'AI exit only after DECIDING and paid completion')
return {'exit_release': {'orphan_reservations': 0, 'released_once': True}, 'command_exit_before_start': True,
'planned_exit_after_completion': True}
DERIVERS = {'S5C_DESTRUCTION_COMMAND': destruction_command, 'S5D_DESTRUCTION_RAID': destruction_raid,
'S5D_IN_FLIGHT': destruction_in_flight, 'S5D_PAID_BEFORE_INCIDENT': paid_before_incident,
'S5G_SHIFT_1080': shift_completion,
'S5H_PAUSED_MIDNIGHT': paused_midnight, 'S5E_MIDNIGHT': midnight_day, 'S5F_EXIT': exit_order}
def derive(root, writer_sha, reader_sha):
root = Path(root)
raw = Raw(root)
writer = json.loads(raw.pin(root / 'writer.json', writer_sha), object_pairs_hook=power.unique)
reader = json.loads(raw.pin(root / 'reader.json', reader_sha), object_pairs_hook=power.unique)
require(writer['pid'] != reader['pid'] and writer['profile'] != reader['profile'], 'independent Reader')
expected = set(DERIVERS) | set(power.CASES)
require(set(writer['branches']) == set(reader['branches']) == expected, 'complete S5 roster')
result = {}
for case, function in DERIVERS.items():
branch = raw.reference(writer['branches'][case])
replay = raw.reference(reader['branches'][case])
points = {k: raw.typed(v) for k, v in branch['points'].items()}
phases = [raw.typed(r) for r in branch['phases']]
raw.typed(branch['commands'])
for p in points.values():
if case not in ('S5D_DESTRUCTION_RAID', 'S5G_SHIFT_1080'):
staff_check(p, field(p, 'inputs', 'recovery'))
if case == 'S5G_SHIFT_1080':
staff_check(points['before'], field(points['before'], 'inputs', 'recovery'))
result[case] = function(points, phases)
expected_guards = {'G1'} if case == 'S5D_DESTRUCTION_RAID' else {'G2'} if case == 'S5D_IN_FLIGHT' else set()
require(set(branch['guards']) == expected_guards, 'complete fixed guard roster')
for label, ref in branch['guards'].items():
guard = raw.typed(ref)
require(scalar(guard, 'guard') == label, 'guard label binding')
facility_id = scalar(points['before'], 'inputs', 'facility_id')
payload_field = 'facility_id' if label == 'G1' else 'asset_id'
require(scalar(guard, 'command', 'payload', payload_field) == facility_id, 'guard binds case facility')
facilities = rows(guard, 'before', 'systems', 'runtime', 'facilities', 'instances')
facility = [f for f in facilities if scalar(f, 'instance_id') == facility_id]
require(len(facility) == 1, 'guard facility exists in BEFORE')
if label == 'G2':
require(rows(facility[0], 'active_services'), 'G2 independently busy BEFORE')
else:
raids = rows(guard, 'before', 'systems', 'runtime', 'defense', 'raids')
raid = [r for r in raids if scalar(r, 'raid_id') == 'p04.s5.raid']
require(len(raid) == 1 and scalar(raid[0], 'state') in ('PREPARING', 'ACTIVE', 'BETWEEN_WAVES')
and any(scalar(asset, 'asset_id') == facility_id for asset in rows(raid[0], 'assets')),
'G1 independently non-terminal Defense ownership')
result[case][label] = guard_oracle.verify(guard, series.variant, require)
for label, ref in replay['restored'].items():
require(field(raw.typed(ref), 'snapshot').raw == field(points[label], 'snapshot').raw,
'whole typed formal restore')
require(set(replay['restored']) == set(points) - {'before'}, 'complete restore roster')
require(set(replay['replay']) == set(points) - {'before', 'boundary'}, 'complete replay roster')
for label, ref in replay['replay'].items():
require(raw.typed(ref).raw == points[label].raw, 'whole typed independent replay')
n = scalar(points['before'], 'inputs', 'boundary')
expected_phases = [p.raw for p in phases if scalar(p, 'minute') > n or
(scalar(p, 'minute') == n and scalar(p, 'phase') == 'APPLY_COMMANDS')]
require([raw.typed(r).raw for r in replay['phases']] == expected_phases, 'complete phase replay')
result[case]['formal_restore_verified'] = True
if case == 'S5E_MIDNIGHT':
for reference in (branch['resource_replay'], replay['resource_replay']):
record = raw.typed(reference)
require(field(record, 'before').raw == field(record, 'after').raw == field(points['boundary'], 'snapshot').raw
and scalar(record, 'result', 'is_replay') is True and scalar(record, 'result', 'code') == 'OK'
and scalar(record, 'minute') == n, 'public advance_to after formal boundary restore')
result[case]['same_minute_replay'] = {'completions': 1, 'charges': 1, 'duplicate_generations': 0, 'same_minute_replayed': True}
result[case]['save_restore'] = {'settlements': 1, 'duplicate_payments': 0, 'formal_save_restored': True}
return {'cases': result, 'dependency_sha256': DEPENDENCIES, 'raw_sha256': raw.hashes,
'pending': ['patience_release'], 'formal_acceptance': False}
@@ -0,0 +1,258 @@
#!/usr/bin/env python3
"""Root-only typed mutations against fresh native S5 raw; never synthetic positives."""
import argparse
import json
from pathlib import Path
import struct
import sys
sys.dont_write_bytecode = True
import s5_order_adapter as a
mutation = a.module('order_typed_mutation', Path(__file__).with_name('s5_power_adapter_controls.py'))
BUILD = Path('/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build')
def guard_mutations(record):
"""All typed AFTER nodes are tested, including every changed journal field.
Also copy each corrupted AFTER into EXPECTED: the independent derivation
must still reject it. No native evidence is produced by these controls.
"""
oracle = a.guard_oracle
a.require(oracle.verify(record, a.series.variant, a.require), 'guard control prerequisite')
checks = []
after = record.at('after')
def visit(node, path):
replacements = []
if node.kind in (4, 21):
replacements = [('value', oracle.atom(node.kind, node.value + '.mutated')),
('string-type', oracle.atom(21 if node.kind == 4 else 4, node.value))]
elif node.kind == 2:
replacements = [('value', oracle.atom(2, node.value + 1)),
('int-float', struct.pack('<If', 3, float(node.value)))]
elif node.kind == 1:
replacements = [('bool', oracle.atom(1, not node.value))]
elif node.kind == 28:
start = 12 if node.raw[:4] == struct.pack('<I', 65564) else 8
if node.value:
replacements.append(('extra-row', node.raw[:start-4] + struct.pack('<I', len(node.value)+1)
+ node.raw[start:] + node.value[-1].raw))
if len(node.value) > 1:
replacements.append(('unsorted', node.raw[:start] + b''.join(r.raw for r in reversed(node.value))))
for i, child in enumerate(node.value):
visit(child, path + '/' + str(i))
elif node.kind == 27:
if len(node.value) > 1:
replacements.append(('unsorted', oracle.dictionary([(k.raw, v.raw) for k, v in reversed(node.value)])))
for key, child in node.value:
visit(key, path + '/key:' + str(key.value))
visit(child, path + '/' + str(key.value))
for label, encoded in replacements:
changed_after = mutation.replace(after, node, encoded)
for copied in (False, True):
changed_record = mutation.replace(record, after, changed_after)
try:
changed = a.series.variant(changed_record)
if copied:
changed_record = mutation.replace(changed, changed.at('expected'), changed_after)
oracle.verify(a.series.variant(changed_record), a.series.variant, a.require)
except ValueError:
checks.append(path + ':' + label + (':AFTER-copy' if copied else ''))
continue
raise ValueError('guard mutation accepted: ' + path + ':' + label)
visit(after, 'after')
return checks
def pure_controls():
"""Source-shaped synthetic serializer units, never Writer/Reader positives."""
o = a.guard_oracle
atom, d, arr = o.atom, o.strings_dict, o.array
prior = lambda ident: d([('code', atom(4, 'OK')), ('command_id', atom(2, ident)),
('target_id', atom(4, '')), ('message', atom(4, '')),
('resolution_hints', arr([], 4)), ('details', d([])), ('is_replay', atom(1, 0))])
q = d([('version', atom(2, 2)), ('pending', arr([], 27)), ('in_flight', arr([], 27)),
('processed', arr([prior(1), prior(2)], 27)),
('idempotency', d([('a', atom(2, 1)), ('b', atom(2, 2))])),
('accepted', arr([d([('command_id', atom(2, i)), ('idempotency_key', atom(4, k))])
for i, k in [(1, 'a'), (2, 'b')]], 27))])
runtime = d([('next_command_id', atom(2, 3)), ('command_queue', q),
('id_generator', d([('version', atom(2, 1)), ('counters', d([('domain_event', atom(2, 2))]))])),
('domain_events', d([('version', atom(2, 1)), ('published_ids', arr([atom(4, 'domain_event.000000000001'), atom(4, 'domain_event.000000000002')], 4)), ('recent_events', arr([], 27))])),
('operations', d([('enabled', atom(1, 0))])),
('business', d([('wallet', atom(2, 100)), ('reservations', arr([], 27))]))])
before = a.series.variant(d([('systems', d([('runtime', runtime)]))]))
results = {}
for guard in ('G1', 'G2'):
payload = (o.dictionary([(atom(21, 'facility_id'), atom(21, 'facility.1')),
(atom(21, 'request_id'), atom(21, a.REQUEST)),
(atom(21, 'guest_ids'), arr([atom(21, a.GUEST)]))]) if guard == 'G1' else
o.dictionary([(atom(21, 'raid_id'), atom(21, 'p04.s5.guard.raid')),
(atom(21, 'asset_id'), atom(21, 'facility.1')),
(atom(21, 'kind'), atom(21, 'OBJECTIVE')),
(atom(21, 'max_integrity'), atom(2, 10000))]))
command = a.series.variant(d([('command_id', atom(2, 3)), ('issued_tick', atom(2, 959)),
('execute_tick', atom(2, 959)), ('priority', atom(2, 10)),
('command_type', atom(4, 'create_service_request' if guard == 'G1' else 'register_defense_asset')),
('actor_id', atom(4, 'player')), ('target_id', atom(4, '')),
('payload', payload), ('idempotency_key', atom(4, 'p04.s5.unit.3'))]))
expected, result = o.expected(before, command, guard, a.series.variant, a.require)
record = a.series.variant(d([('before', before.raw), ('command', command.raw), ('guard', atom(4, guard)),
('expected', expected.raw), ('after', expected.raw), ('result', result.raw)]))
results[guard] = guard_mutations(record)
return {'synthetic_serializer_controls_only': True, 'negative_controls': results, 'formal_acceptance': False}
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--pure-only', action='store_true')
parser.add_argument('--raw-root', type=Path)
parser.add_argument('--writer-sha256')
parser.add_argument('--reader-sha256')
parser.add_argument('--scratch', type=Path)
args = parser.parse_args()
if args.pure_only:
print(json.dumps(pure_controls(), sort_keys=True))
return
a.require(all((args.raw_root, args.writer_sha256, args.reader_sha256, args.scratch)), 'explicit fresh raw arguments')
scratch = args.scratch
a.require(scratch.is_absolute() and not scratch.exists() and not scratch.is_symlink(), 'explicit absent scratch')
a.require(scratch.parent.resolve(strict=True).is_relative_to(BUILD.resolve(strict=True)), 'scratch inside BUILD')
a.require(not scratch.resolve().is_relative_to(args.raw_root.resolve()), 'scratch outside native raw')
for parent in scratch.parents:
a.require(not parent.is_symlink(), 'scratch ancestor symlink')
positive = a.derive(args.raw_root, args.writer_sha256, args.reader_sha256)
scratch.mkdir()
raw = a.Raw(args.raw_root)
writer = json.loads(raw.pin(args.raw_root / 'writer.json', args.writer_sha256))
cases = {}
for case in a.DERIVERS:
branch = raw.reference(writer['branches'][case])
cases[case] = ({k: raw.typed(v) for k, v in branch['points'].items()},
[raw.typed(r) for r in branch['phases']])
checks = []
def negative(label, case, owner, target, replacement):
points, phases = cases[case]
encoded = mutation.replace(owner, target, replacement)
(scratch / (label + '.var')).write_bytes(encoded)
changed = a.series.variant(encoded)
changed_points = {k: changed if v is owner else v for k, v in points.items()}
changed_phases = [changed if v is owner else v for v in phases]
try:
a.DERIVERS[case](changed_points, changed_phases)
except ValueError:
checks.append(label)
return
raise ValueError('mutation accepted: ' + label)
paid = 'S5D_PAID_BEFORE_INCIDENT'
points, phases = cases[paid]
end, boundary = points['held'], points['boundary']
n = a.scalar(points['before'], 'inputs', 'boundary')
def changed_array(node, members):
start = 12 if node.raw[:4] == struct.pack('<I', 65564) else 8
return node.raw[:start-4] + struct.pack('<I', len(members)) + b''.join(r.raw for r in members)
sale = a.sales(end)[0]
ledger = a.field(end, 'ledger')
negative('paid-sale-removed', paid, end, ledger, changed_array(ledger, [r for r in ledger.value if r is not sale]))
negative('paid-sale-duplicated', paid, end, ledger, changed_array(ledger, ledger.value + [sale]))
receipt = next(r for r in a.rows(end, 'receipts') if a.scalar(r, 'id') == a.scalar(sale, 'transaction_id'))
negative('paid-sale-after-incidents', paid, end, a.field(receipt, 'phase'), mutation.scalar(4, 'FACILITY_QUEUES'))
pre = a.phase(phases, 'FACILITY_COMPLETION', n)
negative('paid-destruction-before-completion', paid, pre, a.field(pre, 'facility', 'durability'), mutation.scalar(2, 0))
negative('paid-primary-not-completed', paid, end, a.field(end, 'service', 'state'), mutation.scalar(4, 'ACTIVE'))
negative('paid-secondary-charged', paid, end, a.field(end, 'wallets', a.SECOND), mutation.scalar(2, a.scalar(end, 'wallets', a.SECOND)-1))
secondary = next(r for r in a.rows(end, 'snapshot', 'systems', 'runtime', 'facilities', 'service_history')
if a.scalar(r, 'request_id') == a.SECOND_REQUEST)
negative('paid-secondary-not-failed', paid, end, a.field(secondary, 'state'), mutation.scalar(4, 'ACTIVE'))
negative('paid-secondary-failed-at-N', paid, end, a.field(secondary, 'completed_at'), mutation.scalar(2, n))
reservation = next(r for r in a.rows(end, 'reservations') if a.scalar(r, 'requester_id') == a.SECOND_REQUEST)
negative('paid-reservation-held', paid, end, a.field(reservation, 'state'), mutation.scalar(4, 'ACTIVE'))
operations = a.field(end, 'snapshot', 'systems', 'runtime', 'inventory', 'idempotency_results')
released = next(r for r in operations.value if a.scalar(r, 'action') == 'release'
and a.scalar(r, 'result', 'reservation_id') == a.scalar(reservation, 'reservation_id'))
negative('paid-double-release', paid, end, operations, changed_array(operations, operations.value + [released]))
idem = a.field(end, 'snapshot', 'systems', 'runtime', 'economy', 'idempotency')
key = 'service.payment.' + a.scalar(end, 'service', 'service_id')
payment = next(r for r in idem.value if a.scalar(r, 'key') == key)
negative('paid-idempotency-missing', paid, end, idem, changed_array(idem, [r for r in idem.value if r is not payment]))
negative('paid-idempotency-duplicate', paid, end, idem, changed_array(idem, idem.value + [payment]))
negative('paid-wrong-day', paid, end, a.field(sale, 'absolute_minute'), mutation.scalar(2, n+1440))
negative('paid-AFTER-copy', paid, points['before'], points['before'], end.raw)
midnight = 'S5E_MIDNIGHT'
points, phases = cases[midnight]
n = a.scalar(points['before'], 'inputs', 'boundary')
end = points['boundary']
negative('sale-old-day', midnight, end, a.field(a.sales(end)[0], 'absolute_minute'), mutation.scalar(2, n - 1))
pre = a.phase(phases, 'FACILITY_COMPLETION', n)
days = a.field(pre, 'snapshot', 'systems', 'runtime', 'operations', 'coordinator', 'day_summaries')
empty = days.raw[:-sum(len(r.raw) for r in days.value)] if days.value else days.raw
# Preserve the original typed-array header and replace its element count.
start = 12 if days.raw[:4] == struct.pack('<I', 28 | (1 << 16)) else 8
empty = days.raw[:start-4] + struct.pack('<I', 0)
negative('settlement-after-sale', midnight, pre, days, empty)
raid = 'S5D_DESTRUCTION_RAID'
points, phases = cases[raid]
pre = a.phase(phases, 'INCIDENTS_AND_EVENTS', a.scalar(points['before'], 'inputs', 'boundary'))
negative('idle-breach-too-early', raid, pre, a.field(pre, 'facility', 'durability'), mutation.scalar(2, 0))
for case in ('S5D_DESTRUCTION_RAID', 'S5D_IN_FLIGHT'):
branch = raw.reference(writer['branches'][case])
for label, reference in branch['guards'].items():
checks.extend(label + ':' + name for name in guard_mutations(raw.typed(reference)))
command = 'S5C_DESTRUCTION_COMMAND'
points, phases = cases[command]
end = points['held']
ops = a.field(end, 'snapshot', 'systems', 'runtime', 'inventory', 'idempotency_results')
release = next(r for r in ops.value if a.scalar(r, 'action') == 'release')
start = 12 if ops.raw[:4] == struct.pack('<I', 28 | (1 << 16)) else 8
doubled = ops.raw[:start-4] + struct.pack('<I', len(ops.value) + 1) + ops.raw[start:] + release.raw
negative('double-release', command, end, ops, doubled)
exit_case = 'S5F_EXIT'
points, phases = cases[exit_case]
n = a.scalar(points['before'], 'inputs', 'boundary')
ai = a.phase(phases, 'AI_DECISIONS', n)
negative('ai-exit-during-service', exit_case, ai, a.field(ai, 'guests', a.GUEST, 'state'), mutation.scalar(4, 'RECEIVING_SERVICE'))
pre = a.phase(phases, 'FACILITY_COMPLETION', n)
reservation = next(r for r in a.rows(pre, 'reservations') if a.scalar(r, 'requester_id') == a.SECOND_REQUEST)
negative('command-exit-after-start', exit_case, pre, a.field(reservation, 'terminal_at'), mutation.scalar(2, n + 1))
shift = 'S5G_SHIFT_1080'
points, phases = cases[shift]
end = points['boundary']
receipt = next(r for r in a.rows(end, 'receipts') if a.scalar(r, 'id') == a.scalar(a.sales(end)[0], 'transaction_id'))
negative('sale-after-handover', shift, end, a.field(receipt, 'phase'), mutation.scalar(4, 'AI_DECISIONS'))
staff = a.field(receipt, 'staff_at_receipt')
negative('empty-staff-at-receipt', shift, end, staff, a.guard_oracle.array([]))
negative('night-staff-at-receipt', shift, end, a.field(staff.value[0], 'shift_id'), mutation.scalar(4, 'NIGHT'))
paused = 'S5H_PAUSED_MIDNIGHT'
points, phases = cases[paused]
end = points['boundary']
reservation = a.rows(end, 'reservations')[0]
negative('reservation-released-at-midnight', paused, end, a.field(reservation, 'state'), mutation.scalar(4, 'RELEASED'))
negative('reservation-changed-at-midnight', paused, end, a.field(reservation, 'quantity'), mutation.scalar(2, a.scalar(reservation, 'quantity') + 1))
negative('paused-elapsed-typed-different', paused, end, a.field(end, 'service', 'elapsed_minutes'), struct.pack('<If', 3, float(a.scalar(end, 'service', 'elapsed_minutes'))))
ledger = a.field(end, 'ledger')
sale = a.sales(points['recovered'])[0]
start = 12 if ledger.raw[:4] == struct.pack('<I', 65564) else 8
def appended(row):
return ledger.raw[:start-4] + struct.pack('<I', len(ledger.value)+1) + ledger.raw[start:] + row.raw
negative('sale-while-paused', paused, end, ledger, appended(sale))
settlement = next(r for r in ledger.value if a.scalar(r, 'absolute_minute') == a.scalar(end, 'inputs', 'boundary'))
negative('double-paused-settlement', paused, end, ledger, appended(settlement))
points, phases = cases[midnight]
replay = points['recalled']
counter = a.field(replay, 'snapshot', 'systems', 'runtime', 'next_command_id')
negative('replay-extra-id', midnight, replay, counter, mutation.scalar(2, counter.value + 1))
negative('replay-json-equal-type-difference', midnight, replay, counter, struct.pack('<If', 3, float(counter.value)))
ledger = a.field(replay, 'snapshot', 'systems', 'runtime', 'economy', 'entries')
start = 12 if ledger.raw[:4] == struct.pack('<I', 65564) else 8
negative('replay-extra-row', midnight, replay, ledger, ledger.raw[:start-4] + struct.pack('<I', len(ledger.value)+1) + ledger.raw[start:] + ledger.value[-1].raw)
print(json.dumps({'positive_cases': list(positive['cases']), 'negative_controls': checks,
'formal_acceptance': False}, sort_keys=True))
if __name__ == '__main__':
main()
@@ -0,0 +1,206 @@
#!/usr/bin/env python3
"""Derive S5 power measurements from hashed writer/reader raw, not test counts.
This semantic adapter does not verify engine provenance, Q or full-suite joins.
Its output is preparation only and cannot replace the registered evidence gate.
"""
import argparse
import hashlib
import importlib.util
import struct
import json
from pathlib import Path
SERIES_PATH = Path(__file__).resolve().parents[1] / 'p04_native_series.py'
SERIES_SHA256 = hashlib.sha256(SERIES_PATH.read_bytes()).hexdigest()
_spec = importlib.util.spec_from_file_location('s5_power_series', SERIES_PATH)
series = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(series)
CASES = ("S5A_PURE", "S5B_DEPENDENCY")
GUEST = "p04.s5.guest.a"
REQUEST = "p04.s5.request.a"
def require(value, message):
if not value:
raise ValueError(message)
def unique(pairs):
result = {}
for key, value in pairs:
require(key not in result, "duplicate raw key")
result[key] = value
return result
class Raw:
def __init__(self, root):
self.root = root.resolve(strict=True)
self.hashes = {}
def pin(self, path, expected):
path = Path(path)
require(path.is_file() and not path.is_symlink() and path.resolve().is_relative_to(self.root), "raw reference outside root/missing")
data = path.read_bytes()
digest = hashlib.sha256(data).hexdigest()
require(digest == expected, "raw reference SHA mismatch")
self.hashes[str(path)] = digest
return data
def reference(self, reference):
require(set(reference) == {"var", "json"}, "typed and JSON raw references required")
self.pin(reference["var"]["path"], reference["var"]["sha256"])
return json.loads(self.pin(reference["json"]["path"], reference["json"]["sha256"]), object_pairs_hook=unique)
def typed(self, reference):
require(set(reference) == {"var", "json"}, "typed and JSON raw references required")
data = self.pin(reference["var"]["path"], reference["var"]["sha256"])
self.pin(reference["json"]["path"], reference["json"]["sha256"])
return series.variant(data)
def staff_check(point_node, recovery_node):
ids = point_node.at("facility").at("active_staff_ids")
expected = recovery_node.at("staff_ids")
for node, element in ((ids, 4), (expected, 21)):
require(node.kind == 28 and node.raw[:8] == struct.pack("<II", 28 | (1 << 16), element)
and all(member.kind == element for member in node.value), "typed staff representation")
require(len(ids.value) > 0 and ids.plain() == expected.plain(), "staff values/order/count")
def command_queue(snapshot):
return snapshot.at("systems").at("runtime").at("command_queue")
def duplicate_check(replay_node, recorded):
before, after = replay_node.at("before"), replay_node.at("after")
require(before.raw == after.raw, "resource replay changes no typed Runtime field")
result = replay_node.at("result")
require(result.at("code").value == "DUPLICATE_IDEMPOTENCY_KEY", "duplicate rejection code")
flag = result.at("is_replay")
require(flag.kind == 1 and flag.value is False, "duplicate is not replay")
details = result.at("details")
processed = details.at("processed")
require(processed.kind == 1 and processed.value is True, "original processed")
key, ident, original = recorded.at("key"), recorded.at("command_id"), recorded.at("original")
require(key.kind in (4, 21) and ident.kind == 2, "recorded command types")
require(details.at("idempotency_key").value == key.value
and details.at("original_command_id").value == ident.value
and details.at("original_result").raw == original.raw, "duplicate original binding")
queue = command_queue(before)
require(queue.at("idempotency").at(key.value).value == ident.value, "typed idempotency binding")
rows = [row for row in queue.at("processed").value if row.at("command_id").value == ident.value]
require(len(rows) == 1 and rows[0].raw == original.raw, "typed processed original")
def derive(root, writer_sha, reader_sha):
raw = Raw(root)
writer = json.loads(raw.pin(root / "writer.json", writer_sha), object_pairs_hook=unique)
reader = json.loads(raw.pin(root / "reader.json", reader_sha), object_pairs_hook=unique)
require(writer["pid"] != reader["pid"] and writer["profile"] != reader["profile"], "independent reader required")
expected = set(CASES) | {"S5C_DESTRUCTION_COMMAND", "S5D_DESTRUCTION_RAID", "S5D_IN_FLIGHT", "S5D_PAID_BEFORE_INCIDENT", "S5E_MIDNIGHT", "S5F_EXIT", "S5G_SHIFT_1080", "S5H_PAUSED_MIDNIGHT"}
historical_roster = set(CASES) | {"S5C_DESTRUCTION_COMMAND", "S5D_DESTRUCTION_RAID", "S5E_MIDNIGHT", "S5F_EXIT"}
require(set(writer["branches"]) == set(reader["branches"]) and
set(writer["branches"]) in (set(CASES), historical_roster, expected), "exact pair or full case table roster")
output = {}
for case in CASES:
branch = raw.reference(writer["branches"][case])
replay = raw.reference(reader["branches"][case])
raw.reference(branch["commands"])
for role, reference in ((branch, writer["branches"][case]), (replay, reader["branches"][case])):
typed_role = raw.typed(reference)
guard = raw.typed(role["resource_replay"])
recorded = guard.at("recorded_command")
commands = (raw.typed(branch["commands"]).at("completed_including_fixture")
if role is branch else typed_role.at("replay_completed_commands"))
rows = [row.at("result") for row in commands.value
if row.at("result").at("command_id").value == recorded.at("command_id").value]
require(len(rows) == 1 and rows[0].raw == recorded.at("original").raw,
"recorded original cross-check against typed commands")
duplicate_check(guard, recorded)
points = {name: raw.reference(ref) for name, ref in branch["points"].items()}
require(set(points) == {"before", "boundary", "held", "recovered", "duplicate_guard"}, "full point roster")
for reference in branch["points"].values():
point = raw.typed(reference)
staff_check(point, point.at("inputs").at("recovery"))
before = points["before"]
price, duration = before["inputs"]["price"], before["inputs"]["duration"]
require(price > 0 and duration > 1 and before["mana"] > 0, "paid natural service")
service_id = before["service"]["service_id"]
require(before["service"]["state"] == "ACTIVE" and before["service"]["elapsed_minutes"] == duration - 1, "pre-boundary progress")
reservations = before["requests"][REQUEST]["reserved_inventory_ids"]
require(len(reservations) == (1 if case == "S5B_DEPENDENCY" else 0), "item premise")
for label in ("boundary", "held"):
point = points[label]
service = point["service"]
require(point["minute"] == before["inputs"]["boundary"] + (label == "held"), "boundary minute")
require(point["mana"] == 0 and point["facility"]["power_available"] is False, "real depletion projection")
reason = "RELATED_FACILITY_INACTIVE" if case == "S5B_DEPENDENCY" else "NO_POWER"
require(service["state"] == "PAUSED" and service["interruption_reason"] == reason
and service["elapsed_minutes"] == duration - 1 and service["service_id"] == service_id, "stopped reason/progress/service")
require(point["receipts"] == [] and point["ledger"] == before["ledger"]
and point["wallets"][GUEST] == price * 2 and point["player_cash"] == before["player_cash"], "zero stopped charge")
require(point["requests"][REQUEST] == before["requests"][REQUEST]
and point["guests"][GUEST]["state"] == "RECEIVING_SERVICE", "live request/guest ownership")
require(point["reservations"] == before["reservations"], "entire reservation retained")
if case == "S5B_DEPENDENCY":
require(point["kitchen"]["state"] == "NO_POWER" and point["related_facility_operating"] is False, "RELATED-before-NO_POWER")
require(all(r["state"] == "ACTIVE" and r["requester_id"] == REQUEST for r in point["reservations"]), "active item owner")
else:
require(point["related_facility_operating"] is True, "pure power premise")
recovered = points["recovered"]
resume = recovered["inputs"]["recovery"]["resume_minute"]
require(recovered["minute"] == resume and resume <= before["inputs"]["boundary"] + duration, "bounded observed resume")
for label in ("recovered", "duplicate_guard"):
point = points[label]
service = point["service"]
require(service["service_id"] == service_id and service["state"] == "COMPLETED"
and service["elapsed_minutes"] == duration and point["active_services"] == 0, "one completed service")
require(len(point["receipts"]) == 1 and point["ledger"] == before["ledger"] + point["receipts"][0]["entries"], "whole ledger single receipt")
require(point["wallets"][GUEST] == price and point["player_cash"] == before["player_cash"] + price, "single price")
require(point["receipts"] == recovered["receipts"] and point["ledger"] == recovered["ledger"], "no duplicate sale")
if reservations:
require(len(point["reservations"]) == 1, "same item count")
r = point["reservations"][0]
require(r["reservation_id"] == reservations[0] and r["state"] == "CONSUMED"
and r["terminal_at"] == service["completed_at"] and point["requests"][REQUEST] == {}, "consumed without orphan")
for label in ("held", "recovered", "duplicate_guard"):
require(raw.reference(replay["replay"][label]) == points[label], "reader full raw replay mismatch")
for label in ("boundary", "held", "recovered"):
require(raw.reference(replay["restored"][label])["snapshot"] == points[label]["snapshot"], "formal restore snapshot mismatch")
phases = [raw.reference(ref) for ref in branch["phases"]]
expected_replay = [p for p in phases if p["minute"] > before["inputs"]["boundary"] or
(p["minute"] == before["inputs"]["boundary"] and p["phase"] == "APPLY_COMMANDS")]
require([raw.reference(ref) for ref in replay["phases"]] == expected_replay, "all reader phase raw mismatch")
reasons = []
for p in phases:
reason = p["service"].get("interruption_reason", "")
if not reasons or reasons[-1] != reason:
reasons.append(reason)
output[case] = dict(measurements={
**({"power_stop": {"charges": 0}} if case == "S5A_PURE" else
{"dependency_stop": {"charges": 0, "progress_delta": 0, "reservation_ids_preserved": True, "service_id_preserved": True}}),
"recovery_completion": {"completions": 1, "charges": 1}},
reason_sequence=reasons, resume_minute=resume)
return dict(cases=output, series_sha256=SERIES_SHA256, raw_sha256=raw.hashes, native_provenance_verified=False,
whole_goal_accepted=False, unit_accepted=False)
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--raw-root", type=Path, required=True)
parser.add_argument("--writer-sha256", required=True)
parser.add_argument("--reader-sha256", required=True)
args = parser.parse_args()
try:
print(json.dumps(derive(args.raw_root, args.writer_sha256, args.reader_sha256), sort_keys=True))
except (OSError, ValueError, KeyError, TypeError) as error:
print(json.dumps({"error": str(error), "whole_goal_accepted": False}))
return 1
return 0
if __name__ == "__main__":
raise SystemExit(main())
@@ -0,0 +1,137 @@
#!/usr/bin/env python3
"""Pure actual-fixture controls. Root runs this with a fresh BUILD scratch."""
import argparse
import hashlib
import importlib.util
import json
from pathlib import Path
import struct
import sys
sys.dont_write_bytecode = True
spec = importlib.util.spec_from_file_location("s5_power_adapter", Path(__file__).with_name("s5_power_adapter.py"))
a = importlib.util.module_from_spec(spec)
spec.loader.exec_module(a)
def scalar(kind, value):
if kind in (4, 21):
data = value.encode()
return struct.pack("<II", kind, len(data)) + data + b"\0" * (-len(data) % 4)
return struct.pack("<Ii", kind, value)
def replace(node, target, replacement):
"""Re-encode only ancestors of the targeted typed node, preserving other bytes."""
if node is target:
return replacement
if node.kind == 27:
return node.raw[:8] + b"".join(replace(k, target, replacement) + replace(v, target, replacement)
for k, v in node.value)
if node.kind == 28:
start = 12 if node.raw[:4] == struct.pack("<I", 28 | (1 << 16)) else 8
return node.raw[:start] + b"".join(replace(v, target, replacement) for v in node.value)
return node.raw
def array(element, members):
return struct.pack("<III", 28 | (1 << 16), element, len(members)) + b"".join(members)
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--fixture-dir", required=True, type=Path)
parser.add_argument("--scratch", required=True, type=Path)
args = parser.parse_args()
fixture = args.fixture_dir.resolve(strict=True)
projects = {parent for origin in (Path(__file__).resolve(), fixture)
for parent in origin.parents if (parent / "project.godot").is_file()}
a.require(bool(projects), "project ancestry required for scratch exclusion")
index = json.loads((fixture / "INDEX.json").read_text(), object_pairs_hook=a.unique)
for name, row in index["files"].items():
path = fixture / name
a.require(path.is_file() and not path.is_symlink() and path.resolve().is_relative_to(fixture), "fixture path")
data = path.read_bytes()
a.require(len(data) == row["bytes"] and hashlib.sha256(data).hexdigest() == row["sha256"], "INDEX sha/bytes")
scratch = args.scratch
a.require(scratch.is_absolute() and not scratch.exists() and not scratch.is_symlink(), "explicit absolute fresh scratch")
parent = scratch.parent.resolve(strict=True)
# BUILD is the registered allocation, never inferred from fixture provenance.
build = Path("/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build").resolve(strict=True)
scratch = parent / scratch.name
a.require(parent.is_dir() and parent.is_relative_to(build)
and all(not scratch.is_relative_to(project) for project in projects) and not scratch.is_relative_to(fixture), "scratch inside BUILD outside project/fixture")
scratch.mkdir()
audit = json.loads((fixture / "TYPED_AUDIT.json").read_text())
results = []
def negative(label, data, check):
path = scratch / (label + ".var")
path.write_bytes(data)
try:
check(a.series.variant(path.read_bytes()))
except ValueError:
results.append(label)
return
raise ValueError("negative accepted: " + label)
for case in a.CASES:
point = a.series.variant((fixture / ("writer-" + case + "-before.var")).read_bytes())
replay = a.series.variant((fixture / ("writer-" + case + "-resource-replay.var")).read_bytes())
recovery = point.at("inputs").at("recovery")
a.staff_check(point, recovery)
queue = a.command_queue(replay.at("before"))
key = audit["cases"][case]["replay_result"]["details"]["idempotency_key"]
ident = queue.at("idempotency").at(key)
rows = [row for row in queue.at("processed").value if row.at("command_id").value == ident.value]
a.require(len(rows) == 1, "actual processed binding")
original = rows[0]
# Derived exclusively from actual typed queue, not duplicate result details.
recorded_bytes = struct.pack("<II", 27, 3) + scalar(4, "key") + scalar(4, key) + scalar(4, "command_id") + ident.raw + scalar(4, "original") + original.raw
recorded = a.series.variant(recorded_bytes)
a.duplicate_check(replay, recorded)
results.append(case + "-positive")
ids = point.at("facility").at("active_staff_ids")
members = [v.raw for v in ids.value]
staff_bad = {
"wrong-id": array(4, [scalar(4, "wrong")] + members[1:]),
"stringname": array(21, [scalar(21, v.value) for v in ids.value]),
"missing": array(4, members[:-1]),
"extra": array(4, members + [scalar(4, "extra")]),
}
if case == "S5B_DEPENDENCY":
staff_bad["swapped"] = array(4, members[::-1])
for label, data in staff_bad.items():
negative(case + "-staff-" + label, replace(point, ids, data),
lambda n: a.staff_check(n, recovery))
result = replay.at("result")
details = result.at("details")
mutations = [
("key", details.at("idempotency_key"), scalar(4, "wrong")),
("id", details.at("original_command_id"), scalar(2, -1)),
("original", details.at("original_result"), struct.pack("<II", 27, 0)),
("processed-false", details.at("processed"), scalar(1, 0)),
("code", result.at("code"), scalar(4, "OK")),
("replay", result.at("is_replay"), scalar(1, 1)),
]
for label, target, data in mutations:
negative(case + "-duplicate-" + label, replace(replay, target, data),
lambda n: a.duplicate_check(n, recorded))
pairs = [(k, v) for k, v in details.value if k.value != "processed"]
missing = struct.pack("<II", 27, len(pairs)) + b"".join(k.raw + v.raw for k, v in pairs)
negative(case + "-processed-missing", replace(replay, details, missing),
lambda n: a.duplicate_check(n, recorded))
after = replay.at("after")
target = a.command_queue(after).at("idempotency")
value = target.at(key)
changed = replace(replay, value, struct.pack("<If", 3, float(value.value)))
changed_node = a.series.variant(changed)
a.require(changed_node.plain() == replay.plain() and changed_node.at("after").raw != after.raw,
"typed-only mutation retains JSON plain value")
negative(case + "-typed-after", changed, lambda n: a.duplicate_check(n, recorded))
print(json.dumps(dict(accepted=False, root_only=True, checks=results,
series_sha256=a.SERIES_SHA256), sort_keys=True))
if __name__ == "__main__":
main()
@@ -0,0 +1,119 @@
#!/usr/bin/env python3
"""Pure Root-only UID controls; no engine or environment access."""
import argparse
import copy
import importlib.util
import json
import os
from pathlib import Path
import sys
sys.dont_write_bytecode = True
def module(name, path):
spec = importlib.util.spec_from_file_location(name, path)
value = importlib.util.module_from_spec(spec)
spec.loader.exec_module(value)
return value
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--project-root', required=True, type=Path)
parser.add_argument('--scratch', required=True, type=Path)
args = parser.parse_args()
root = args.project_root.resolve(strict=True)
r = module('s5_uid_q_runner', root / 'tools/run_all_tests.py')
w = module('s5_uid_wrapper', Path(__file__).with_name('run_s5_native.py'))
# Actual Q pins precede all synthetic data. No synthetic refs enter the loader.
uid_plan, uid_snapshot, binding = w.load_uid_helper(root, r, r.source_refs(root))
scratch = args.scratch
r.require(scratch.is_absolute() and not scratch.exists() and not scratch.is_symlink(),
'absolute fresh scratch')
parent = scratch.parent.resolve(strict=True)
r.require(parent.is_dir() and parent.is_relative_to(w.BUILD.resolve())
and not (parent / scratch.name).is_relative_to(root), 'scratch parent inside BUILD outside Q')
scratch = parent / scratch.name
scratch.mkdir()
results = []
def fixture(label):
stage = scratch / label
stage.mkdir()
files = {'project.godot': b'config_version=5\n',
'scripts/special/peeping_room_service.gd': b'extends Node\n',
'tests/special/test_a.gd': b'extends SceneTree\n',
'scripts/other.gd': b'extends RefCounted\n',
'scripts/other.gd.uid': b'uid://existing\n'}
for name, data in files.items():
path = stage / name
path.parent.mkdir(parents=True, exist_ok=True)
path.write_bytes(data)
source = r.inventory(stage, stage=True)
refs = {n: dict(p, path=str(stage / n)) for n, p in source.items()}
plan = uid_plan(refs)
r.require(bool(plan) and all(p['owner_sha256'] == refs[p['owner']]['sha256']
for p in plan.values()), 'derived synthetic plan')
for i, name in enumerate(plan):
(stage / name).write_bytes(('uid://generated' + str(i) + '\n').encode())
return stage, source, plan
stage, source, plan = fixture('positive')
snap = uid_snapshot(stage, source, plan)
r.require(set(snap) == set(plan), 'exact positive planned UID set')
results.append('positive')
def negative(label, mutate):
stage, source, plan = fixture(label)
names = list(plan)
mutate(stage, source, plan, names)
try:
uid_snapshot(stage, source, plan)
except AssertionError:
results.append(label)
else:
raise AssertionError('control did not reject: ' + label)
negative('extra', lambda s, a, p, n: (s / 'extra.uid').write_bytes(b'uid://extra\n'))
negative('original', lambda s, a, p, n: (s / 'project.godot').write_bytes(b'changed\n'))
negative('owner', lambda s, a, p, n: (s / p[n[0]]['owner']).write_bytes(b'changed\n'))
negative('existing-collision', lambda s, a, p, n: (s / n[0]).write_bytes(b'uid://existing\n'))
negative('generated-collision', lambda s, a, p, n: (s / n[0]).write_bytes((s / n[1]).read_bytes()))
for label, raw in [('no-newline', b'uid://abc'), ('crlf', b'uid://abc\r\n'),
('uppercase', b'uid://ABC\n'), ('too-long', b'uid://abcdefghijklmn\n')]:
negative(label, lambda s, a, p, n, raw=raw: (s / n[0]).write_bytes(raw))
def hardlink(stage, source, plan, names):
os.link(stage / names[0], scratch / 'hardlink-peer')
def symlink(stage, source, plan, names):
path = stage / names[0]
path.unlink()
path.symlink_to(stage / names[1])
negative('hardlink', hardlink)
negative('symlink', symlink)
negative('missing', lambda s, a, p, n: (s / n[0]).unlink())
stage, source, plan = fixture('post-seal')
out = scratch / 'policy-receipts'
out.mkdir()
reports, phase_call, state = w.make_uid_policy(r, uid_snapshot, source, plan, out)
expected = copy.deepcopy(source)
state['phase'] = 'import'
reports(stage, expected, {}, [])
r.require(state['accepted'] == uid_snapshot(stage, source, plan), 'import sealed')
state['phase'] = 'parse'
(stage / next(iter(plan))).write_bytes(b'uid://mutated\n')
try:
reports(stage, expected, {}, [])
except AssertionError:
results.append('post-seal-reports')
else:
raise AssertionError('post-seal mutation accepted')
print(json.dumps({'accepted': False, 'Root-only': True, 'controls': results,
'uid_helper': binding, 'scratch': str(scratch)}))
if __name__ == '__main__':
main()
@@ -0,0 +1,50 @@
#!/usr/bin/env python3
"""Pure select_mode fixtures; no Git, engine, temporary files or environment access."""
import argparse
import importlib.util
import json
from pathlib import Path
import sys
sys.dont_write_bytecode = True
def main():
path = Path(__file__).parent / "run_s5_native.py"
spec = importlib.util.spec_from_file_location("s5_wrapper_fixture_target", path)
wrapper = importlib.util.module_from_spec(spec)
spec.loader.exec_module(wrapper)
cases = [
("partial-triple", argparse.Namespace(main="a" * 40, submission=None, tested_tree=None,
historical_r17=False, check_only=True), None),
("non-hex", argparse.Namespace(main="z" * 40, submission="b" * 40, tested_tree="c" * 40,
historical_r17=False, check_only=True), None),
("short", argparse.Namespace(main="a" * 39, submission="b" * 40, tested_tree="c" * 40,
historical_r17=False, check_only=True), None),
("mixed-modes", argparse.Namespace(main="a" * 40, submission="b" * 40, tested_tree="c" * 40,
historical_r17=True, check_only=True), None),
("historical-native", argparse.Namespace(main=None, submission=None, tested_tree=None,
historical_r17=True, check_only=False), None),
("no-flags", argparse.Namespace(main=None, submission=None, tested_tree=None,
historical_r17=False, check_only=False), None),
("fresh-q", argparse.Namespace(main="a" * 40, submission="b" * 40, tested_tree="c" * 40,
historical_r17=False, check_only=True), "fresh-q"),
("historical-check-only", argparse.Namespace(main=None, submission=None, tested_tree=None,
historical_r17=True, check_only=True),
"historical-r17-readonly"),
]
results = []
for name, args, expected in cases:
try:
actual = wrapper.select_mode(args)
passed = expected is not None and actual == expected
except ValueError:
actual = "ValueError"
passed = expected is None
results.append(dict(name=name, result=actual, passed=passed))
print(json.dumps(dict(accepted=False, fixtures=results, passed=all(r["passed"] for r in results))))
return 0 if all(r["passed"] for r in results) else 1
if __name__ == "__main__":
raise SystemExit(main())
@@ -0,0 +1,54 @@
#!/usr/bin/env python3
"""Root-only scratch routing for preserved partial31 fixture sources.
Only TemporaryDirectory allocation is redirected. Fixture assertions and checker
semantics remain unchanged. No fixture is run by importing this adapter.
"""
import argparse
import os
from pathlib import Path
import runpy
import sys
import tempfile
sys.dont_write_bytecode = True
HERE = Path(__file__).resolve().parent
FIXTURES = {"bulk_reader_equivalence", "checker_role_fixtures", "checker_candidate_fixtures",
"checker_approval_fixtures", "checker_negative_fixtures", "checker_applicability_fixtures"}
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--scratch", type=Path, required=True)
parser.add_argument("--fixture", choices=sorted(FIXTURES), required=True)
parser.add_argument("arguments", nargs=argparse.REMAINDER)
args = parser.parse_args()
scratch = args.scratch.resolve()
repository = HERE.parents[4]
if scratch.exists() or scratch.is_relative_to(repository) or scratch == Path("/tmp").resolve() or Path("/tmp").resolve() in scratch.parents:
raise ValueError("fresh external scratch required; no repository or /tmp writes")
scratch.mkdir(parents=True)
old_env, old_argv = dict(os.environ), sys.argv[:]
original = tempfile.TemporaryDirectory
def directory(suffix=None, prefix=None, dir=None, **kwargs):
# Explicit dir in old source is intentionally superseded only here.
return original(suffix=suffix, prefix=prefix, dir=scratch, **kwargs)
try:
for name in list(os.environ):
if name.startswith("GIT_"):
del os.environ[name]
os.environ["TMPDIR"] = str(scratch)
tempfile.TemporaryDirectory = directory
forwarded = args.arguments[1:] if args.arguments[:1] == ["--"] else args.arguments
source = HERE / (args.fixture + ".py")
sys.argv = [str(source), *forwarded]
runpy.run_path(str(source), run_name="__main__")
finally:
tempfile.TemporaryDirectory = original
sys.argv = old_argv
os.environ.clear()
os.environ.update(old_env)
if __name__ == "__main__":
main()
+192 -119
View File
@@ -20,13 +20,29 @@ ROOT = Path(__file__).resolve().parents[1]
SPEC = ROOT / 'docs/spec/acceptance/P04-01.json'
SPEC_HASH = '9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881'
DOMAINS = {'閉店', '停電', '破壊', '退出', '課金', 'シフト交代', '00:00決算'}
OWNER_HASH = '4583ee9aad45c4db183d72df4420df48aa8e0897e3b5efda13016f0b5cdbd68e'
REGISTERED_COMMIT = 'deb1bcb2374eb378b840ca345db952bd8572cb6e'
EXECUTION_ORIGIN = '9767b0a28ca8d252520307dbbac60a1d8cfb87ab'
CHECKER_PATH = 'tools/check_p04_order_evidence.py'
DOC_SCOPE = 'docs/plans/original-completion-2026-10-02/execution/p04-01/'
MAIN_ANCHOR = '9b1a18c1eb25ca1300dcd59da78423c0dda2f498'
TESTED_PRODUCT = '5f6bc11d6bb6e92d22d787989b219fef3a435bc1'
OWNER_BINDINGS = {
ref: (DOC_SCOPE + leaf, digest)
for refs, leaf, digest in (
(('D05-P04-DEPENDENCY', 'D05-P04-SHIFT-1800'), 'D05_OWNER_APPROVAL.json',
'4583ee9aad45c4db183d72df4420df48aa8e0897e3b5efda13016f0b5cdbd68e'),
(('D05-P04-DESTRUCTION', 'D05-P04-MIDNIGHT-DAY', 'D05-P04-PAUSE-REASON',
'D05-P04-EXIT'), 'D05_REMAINING_APPROVAL.json',
'09b5092124574c3ccbf3b55169729a7529d9dde9b9a115d5e944fce4b960f5e4'),
) for ref in refs
}
MAIN_ANCHOR = 'c0ea009b28a7649aca6a433a1a24dc0be5e7ab81'
# Documentation only: external Runner prepare_integration/integrate and Root
# normal_c_join joins after final. The checker never consumes this roster.
NORMAL_C_PROVENANCE_JOIN = frozenset({
'candidate_commit', 'candidate_tree', 'first_parent', 'second_parent',
'tested_tree', 'prepare_integration_receipt', 'independent_review_receipt',
'validation_receipt', 'source_manifest_sha256', 'settings_sha256',
'markers_sha256', 'policy_sha256', 'engine_sha256', 'inputs_sha256',
})
SELECTION_SHA = '320ca668732b4ff72fc4449998af2327d4e5c527b06896740806aaf0487282b4'
_GIT_ENV = None
# Fixed membership, never supplied by the evidence index.
@@ -43,19 +59,20 @@ ORDER_FUNCTIONS = {
'scripts/operations/operations_coordinator.gd': ('_process_minute_boundaries',),
}
# Condition -> (domain, authority refs, required engine measurements).
# Measurements describe safety/counts, not the still-pending attribution policy.
# Existing safety/count thresholds are retained. Repair30's additional approved
# order measurements still need the S5 raw adapter (see REPAIR30_STATUS.md).
REQUIRED = {
'power_stop': ('停電', ('BASELINE:183',), {'charges': 0}),
'destruction_stop': ('破壊', ('BASELINE:183',), {'charges': 0}),
'power_stop': ('停電', ('BASELINE:183', 'D05-P04-PAUSE-REASON'), {'charges': 0}),
'destruction_stop': ('破壊', ('D05-P04-DESTRUCTION',), {'charges': 0}),
'dependency_stop': ('閉店', ('D05-P04-DEPENDENCY',), {'charges': 0, 'progress_delta': 0, 'reservation_ids_preserved': True, 'service_id_preserved': True}),
'shift_completion': ('シフト交代', ('BASELINE:64', 'BASELINE:67', 'D05-P04-SHIFT-1800'), {'minute': 1080, 'completions': 1, 'charges': 1, 'completion_before_shift': True}),
'recovery_completion': ('課金', ('D05-P04-DEPENDENCY',), {'completions': 1, 'charges': 1}),
'same_minute_replay': ('課金', ('D05-P04-DEPENDENCY', 'D05-P04-SHIFT-1800'), {'completions': 1, 'charges': 1, 'duplicate_generations': 0, 'same_minute_replayed': True}),
'closure_release': ('閉店', ('D-034',), {'orphan_reservations': 0, 'released_once': True, 'started_service_continues': True}),
'exit_release': ('退出', ('D-034',), {'orphan_reservations': 0, 'released_once': True}),
'patience_release': ('退出', ('D-034',), {'orphan_reservations': 0, 'released_once': True}),
'paused_midnight': ('00:00決算', ('D05-P04-DEPENDENCY', 'BASELINE:71', 'BASELINE:72'), {'orphan_reservations': 0, 'crossed_midnight_while_paused': True, 'stopped_charges': 0, 'completions': 1, 'charges': 1}),
'midnight_settlement': ('00:00決算', ('BASELINE:71', 'BASELINE:72', 'A01'), {'settlements': 1, 'sales_payments': 1, 'payroll_payments': 1, 'upkeep_payments': 1, 'duty_payments': 1, 'nonzero_payroll': True}),
'exit_release': ('退出', ('D-034', 'D05-P04-EXIT'), {'orphan_reservations': 0, 'released_once': True}),
'patience_release': ('退出', ('D-034', 'D05-P04-EXIT'), {'orphan_reservations': 0, 'released_once': True}),
'paused_midnight': ('00:00決算', ('D05-P04-DEPENDENCY', 'BASELINE:71', 'BASELINE:72', 'D05-P04-MIDNIGHT-DAY'), {'orphan_reservations': 0, 'crossed_midnight_while_paused': True, 'stopped_charges': 0, 'completions': 1, 'charges': 1}),
'midnight_settlement': ('00:00決算', ('BASELINE:71', 'BASELINE:72', 'A01', 'D05-P04-MIDNIGHT-DAY'), {'settlements': 1, 'sales_payments': 1, 'payroll_payments': 1, 'upkeep_payments': 1, 'duty_payments': 1, 'nonzero_payroll': True}),
'midnight_replay': ('00:00決算', ('BASELINE:71', 'BASELINE:72', 'A01'), {'settlements': 1, 'same_minute_replayed': True, 'duplicate_payments': 0}),
'save_restore': ('00:00決算', ('BASELINE:71', 'BASELINE:72', 'A01'), {'settlements': 1, 'duplicate_payments': 0, 'formal_save_restored': True}),
'night_staff_absent': ('シフト交代', ('BASELINE:67', 'D05-P04-SHIFT-1800'), {'minute': 1081, 'state': 'WAITING_FOR_STAFF', 'night_staff_count': 0}),
@@ -244,6 +261,16 @@ def product_manifest(entries):
return result
def selected_manifest(entries, require_checker=True):
result = product_manifest(entries)
if require_checker:
require(CHECKER_PATH in entries, 'selected source missing checker')
if CHECKER_PATH in entries:
data = git_bytes('cat-file', 'blob', entries[CHECKER_PATH][1])
result[CHECKER_PATH] = {'bytes': len(data), 'sha256': hashlib.sha256(data).hexdigest()}
return result
def manifest_digest(manifest):
return hashlib.sha256(json.dumps(manifest, sort_keys=True, separators=(',', ':')).encode()).hexdigest()
@@ -256,6 +283,15 @@ def supplied_file(directory, descriptor):
support = directory / 'audit-support'
roots = [support / n for n in ('p04-whole-closure-r01', 'native-first-current',
'p04-current-native-series-r01', 'p04-r17-full-inputs-r01')]
fresh_path = support / 'p04-fresh-runs.json'
if fresh_path.is_file():
fresh = load(fresh_path)
require(fresh['protocol'] == 'p04-fresh-runs-v1', 'fresh material registry')
roots.append(support / 'p04-fresh-context')
for row in fresh['series'].values():
relative = Path(row['run'])
require(not relative.is_absolute() and '..' not in relative.parts, 'fresh material run path')
roots.append(directory / relative)
matches = [root for root in roots if path.is_relative_to(root)]
require(len(matches) == 1, 'unsupplied external material: ' + name)
path = safe(matches[0], path.relative_to(matches[0]).as_posix())
@@ -266,91 +302,6 @@ def supplied_file(directory, descriptor):
return path
def verify_product_target(index, directory, checker_commit):
"""Four actual roles, complete source selection, and candidate equality.
This does not establish any native boundary condition. Runner input files
are checked against Git blobs, never against a Root-reported digest alone.
"""
binding = index['product_binding']
target = binding['product_target']
require(set(target) == {'main_anchor', 'submitted', 'composed_tree'}, 'product target shape')
require(target['main_anchor'] == MAIN_ANCHOR, 'main anchor changed')
for key in target:
require(re.fullmatch('[0-9a-f]{40}', target[key]) is not None, 'full product target OID')
for commit in (REGISTERED_COMMIT, EXECUTION_ORIGIN, target['main_anchor'], target['submitted'], checker_commit):
require(git_bytes('cat-file', '-t', commit).strip() == b'commit', 'role is not a commit')
require(_GIT_ENV is not None, 'merge-tree needs isolated object store')
composed = git_bytes('-c', 'rerere.enabled=false', 'merge-tree', '--write-tree',
target['main_anchor'], target['submitted']).decode().strip()
require(composed == target['composed_tree'], 'recomputed composed tree mismatch')
anchor, submission, tree = [tree_entries(t) for t in (MAIN_ANCHOR, target['submitted'], composed)]
selection = git_bytes('show', MAIN_ANCHOR + ':tools/run_all_tests.py')
require(hashlib.sha256(selection).hexdigest() == SELECTION_SHA, 'source selection authority')
changed = git_bytes('diff', '--no-ext-diff', '--no-renames', '--name-only', '-z',
REGISTERED_COMMIT, target['submitted']).split(b'\0')
require(all(allowed_path(p.decode()) for p in changed if p), 'submission outside registered scope')
for path in anchor.keys() | tree.keys():
if anchor.get(path) != tree.get(path):
require(allowed_path(path), 'new/changed path outside scope: ' + path)
baseline = product_manifest(anchor)
product = product_manifest(tree)
require(len(baseline) == 1338 and product == baseline, 'complete selected product mismatch')
metadata = sorted(p for p in anchor if not selected_path(p) and anchor[p] == tree.get(p))
require(len(metadata) == 3139, 'unchanged existing metadata membership changed')
require(set(p for p in tree if selected_path(p)) == set(product) | {CHECKER_PATH},
'unknown selected source cannot be metadata')
own = Path(__file__).read_bytes()
for role, entries in (('submitted', submission), ('composed', tree),
('checker', tree_entries(checker_commit))):
require(CHECKER_PATH in entries and git_bytes('cat-file', 'blob', entries[CHECKER_PATH][1]) == own,
'checker self blob not verified: ' + role)
tested = binding['tested_product']
require(git_bytes('cat-file', '-t', tested).strip() == b'commit'
and product_manifest(tree_entries(tested)) == product, 'tested product manifest mismatch')
candidate = tree_entries(index['candidate_tree'])
require(candidate == tree, 'candidate product/QA/collector/tree bytes differ from target')
runners = binding['runner_inputs']
require(isinstance(runners, list) and runners, 'actual runner inputs missing')
runner_paths = set()
for descriptor in runners:
runner_path = supplied_file(directory, descriptor)
require(runner_path not in runner_paths, 'duplicate runner input')
runner_paths.add(runner_path)
native = load(runner_path)
before = native['source_before']
require(set(before) == set(product) and all(
{'bytes': v['bytes'], 'sha256': v['sha256']} == product[p] for p, v in before.items()),
'runner source_before differs from complete product')
require(native['runner_sha256'] == product['tools/run_all_tests.py']['sha256'], 'runner source pin')
overrides = native['QA_overrides']
require(isinstance(overrides, list) and len(overrides) == 1
and overrides[0].startswith('tests/') and overrides[0] in product, 'one declared QA override')
selected = {p: v['sha256'] for p, v in product.items()}
selected[overrides[0]] = native['QA']['sha256']
require(native['selected_source_map'] == selected, 'selected source/QA override mismatch')
# A relocation is explicit and hash-bound; never open the original path.
materials = descriptor['materials']
fixed = native.get('fixed_input_pins', [])
require(isinstance(fixed, list), 'native fixed input pin list')
needed = fixed + [native['QA']]
require(set(materials) == {p['path'] for p in needed}, 'runner input/config material membership')
for pin in needed:
real = supplied_file(directory, materials[pin['path']])
require(real.stat().st_size == pin['bytes'] and sha(real) == pin['sha256'], 'native input/QA bytes')
wrapper = supplied_file(directory, descriptor['wrapper'])
require(sha(wrapper) == native['wrapper_sha256'], 'native wrapper bytes')
digest = manifest_digest(product)
require(index['versions'] == {
'registered': REGISTERED_COMMIT, 'execution_origin': EXECUTION_ORIGIN,
'checker': {'commit': checker_commit, 'sha256': hashlib.sha256(own).hexdigest()},
'tested': {'product_target': target, 'manifest_sha256': digest}}, 'four version roles')
require(index['source_map'] == {p: v['sha256'] for p, v in product.items()}, 'product source map')
return composed, {'manifest_sha256': digest, 'existing_metadata': metadata,
'runner_paths': runner_paths,
'tested_product': tested, 'product_target': target}
def ancestor(older, newer):
# merge-base's nonzero status is data only for the ordinary non-ancestor case.
try:
@@ -398,6 +349,7 @@ def verify_roles(index, directory):
"""Infer roles from Git, never from an index or a caller's stage label."""
require(not ({'candidate_commit', 'candidate_tree', 'code_only', 'candidate', 'phase'} & index.keys()),
'candidate/code-only/phase declarations are not evidence')
candidate = None
commit, actual_tree, actual = actual_checkout()
require(_GIT_ENV is not None, 'isolated object store required')
if not ancestor(MAIN_ANCHOR, commit):
@@ -407,12 +359,16 @@ def verify_roles(index, directory):
parents = git_bytes('show', '-s', '--format=%P', commit).decode().split()
require(len(parents) == 2, 'integration/final requires a two-parent no-ff merge')
main, submitted = parents
require(ancestor(MAIN_ANCHOR, main), 'merge main ancestry')
require(main == MAIN_ANCHOR, 'integration main is not frozen M')
submission_role(submitted)
role = 'integration/final'
composed = git_bytes('-c', 'rerere.enabled=false', 'merge-tree', '--write-tree',
main, submitted).decode().strip()
require(re.fullmatch('[0-9a-f]{40}', composed) is not None, 'conflicted composition')
if 'fresh_run_bindings' in index:
fresh = index['fresh_run_bindings']
require((fresh['M'], fresh['S'], fresh['Q_tree']) == (main, submitted, composed),
'fresh evidence does not bind recomputed Q')
main_entries, patch, target = [tree_entries(t) for t in (main, submitted, composed)]
anchor_entries = tree_entries(MAIN_ANCHOR)
for path in main_entries.keys() | target.keys():
@@ -425,6 +381,7 @@ def verify_roles(index, directory):
'unknown source hidden as metadata: ' + path)
if role == 'integration/final':
require(actual_tree == composed and actual == target, 'actual merge differs from composition')
candidate = qualify_normal_candidate(commit, actual_tree, main, submitted, composed)
require(target[CHECKER_PATH] == patch[CHECKER_PATH] == actual[CHECKER_PATH],
'checker blob differs from submission')
for path in patch:
@@ -432,16 +389,22 @@ def verify_roles(index, directory):
require(target.get(path) == patch[path], 'reviewed patch differs in merge: ' + path)
binding = index['product_binding']
require(set(binding) == {'tested_product', 'runner_inputs'}, 'unknown product role/metadata declaration')
require(binding['tested_product'] == TESTED_PRODUCT, 'wrong tested revision')
tested = binding['tested_product']
require(tested == composed and git_bytes('cat-file', '-t', tested).strip() == b'tree',
'tested Q is not the genuine recomputed merge-tree')
selection = git_bytes('show', MAIN_ANCHOR + ':tools/run_all_tests.py')
require(hashlib.sha256(selection).hexdigest() == SELECTION_SHA, 'source selection authority')
product = product_manifest(target)
tested_entries = tree_entries(TESTED_PRODUCT)
tested_entries = tree_entries(tested)
expected = product_manifest(tested_entries)
require(len(product) == 1338 and product == expected and
require(product == expected and
product_manifest(main_entries) == expected and product_manifest(anchor_entries) == expected,
'complete 1338-file native product mismatch')
'complete selected native product mismatch')
require(all(target[p][0] == main_entries[p][0] == tested_entries[p][0] for p in product),
'native product mode mismatch')
require(index['source_map'] == {p: v['sha256'] for p, v in product.items()}, 'stale pin: source map')
selected_product = selected_manifest(target)
require(set(selected_product) == set(product) | {CHECKER_PATH}, 'checker must be explicitly selected')
require(index['source_map'] == {p: v['sha256'] for p, v in selected_product.items()}, 'stale pin: source map')
runner_paths = set()
for descriptor in binding['runner_inputs']:
path = supplied_file(directory, descriptor)
@@ -449,14 +412,14 @@ def verify_roles(index, directory):
runner_paths.add(path)
native = load(path)
before = native['source_before']
require(set(before) == set(product) and all(
{'bytes': v['bytes'], 'sha256': v['sha256']} == product[p] for p, v in before.items()),
require(set(before) == set(selected_product) and all(
{'bytes': v['bytes'], 'sha256': v['sha256']} == selected_product[p] for p, v in before.items()),
'runner complete source map mismatch')
require(native['runner_sha256'] == product['tools/run_all_tests.py']['sha256'], 'runner source pin')
overrides = native['QA_overrides']
require(len(overrides) == 1 and overrides[0].startswith('tests/') and overrides[0] in product,
'QA override membership')
selected = {p: v['sha256'] for p, v in product.items()}
selected = {p: v['sha256'] for p, v in selected_product.items()}
selected[overrides[0]] = native['QA']['sha256']
require(native['selected_source_map'] == selected, 'selected QA source map')
needed = native.get('fixed_input_pins', []) + [native['QA']]
@@ -467,11 +430,24 @@ def verify_roles(index, directory):
require(sha(supplied_file(directory, descriptor['wrapper'])) == native['wrapper_sha256'], 'wrapper bytes')
require(runner_paths, 'runner inputs missing')
require(index['versions'] == {'registered': REGISTERED_COMMIT, 'execution_origin': EXECUTION_ORIGIN,
'tested': TESTED_PRODUCT}, 'evidence version roles')
return composed, {'role': role, 'actual_head': commit, 'actual_tree': actual_tree,
'tested': tested}, 'evidence version roles')
return composed, {'candidate_structure': candidate, 'role': role, 'actual_head': commit, 'actual_tree': actual_tree,
'submission': submitted, 'main': main, 'existing_metadata': metadata,
'manifest_sha256': manifest_digest(product), 'runner_paths': runner_paths,
'tested_product': TESTED_PRODUCT}
'tested_product': tested, 'product_file_count': len(product), 'selected_file_count': len(selected_product)}
def qualify_normal_candidate(commit, tree, main, submitted, composed):
"""Qualify structure only; Runner and Root verify provenance externally.
The documentation roster is never consumed. Structure grants no provenance
verification or original credit.
"""
require(tree == composed and main == MAIN_ANCHOR and commit != submitted,
'normal candidate identity mismatch')
return {'structure_qualified': True, 'provenance_verified_by_checker': False,
'provenance_owner': 'actual Runner.prepare_integration/integrate and Root normal_c_join AFTER final before original credit',
'join': {'C': commit, 'S': submitted, 'M': main, 'C_tree': tree, 'Q': composed}}
def function_bytes(data):
@@ -535,7 +511,18 @@ def boundary_conditions(path, function):
return set(REQUIRED) | {'EV'}
def mandatory_conditions(index):
conditions = index.get('conditions')
require(isinstance(conditions, dict), 'mandatory conditions must be a dictionary')
missing = sorted(set(REQUIRED) - set(conditions))
unknown = sorted(set(conditions) - set(REQUIRED))
require(not missing and not unknown,
'mandatory conditions missing: ' + ', '.join(missing) + '; unknown: ' + ', '.join(unknown))
return conditions
def applicability(index, spec, source, head):
mandatory_conditions(index)
tested = index.get('versions', {}).get('tested')
require(isinstance(tested, str) and tree_entries(tested) and
product_manifest(tree_entries(tested)) == product_manifest(tree_entries(head)),
@@ -572,6 +559,19 @@ def applicability(index, spec, source, head):
require(case_id == declaration.get('case_id'), 'boundary delta engine case: ' + key)
def owner_authority(ref, entry, path):
"""Each decision is bound to its own immutable, path-qualified record."""
require(ref in OWNER_BINDINGS, 'unknown owner authority: ' + ref)
relative, digest = OWNER_BINDINGS[ref]
require(entry.get('status') == 'approved', 'pending/missing authority: ' + ref)
require(entry.get('source') == relative, 'owner approval path mismatch: ' + ref)
require(sha(path) == digest, 'owner approval hash mismatch: ' + ref)
owner = load(path)
require(owner.get('origin') == 'direct_user_reply' and owner.get('formal_acceptance') is False,
'owner approval scope')
require(ref in {v['id'] for v in owner['approved_choices']}, 'owner approval condition')
def coverage(index, raw, source, product_tree):
authority = index['authority']
for ref in {r for _, refs, _ in REQUIRED.values() for r in refs}:
@@ -580,18 +580,13 @@ def coverage(index, raw, source, product_tree):
aid = entry.get('artifact_id')
require(aid in raw and index['artifacts'][aid]['type'] == 'authority', 'raw authority: ' + ref)
if ref.startswith('D05-P04-'):
require(sha(raw[aid]) == OWNER_HASH, 'owner approval hash mismatch')
owner = load(raw[aid])
require(owner.get('origin') == 'direct_user_reply' and owner.get('formal_acceptance') is False,
'owner approval scope')
require(ref in {v['id'] for v in owner['approved_choices']}, 'owner approval condition')
owner_authority(ref, entry, raw[aid])
else:
path = ('docs/traceability/original/BASELINE.txt' if ref.startswith('BASELINE:') else
'docs/DESIGN_DECISIONS.md' if ref == 'D-034' else
'docs/plans/original-completion-2026-10-02/execution/p04-01-input-r01/ORDER_CONTRACT_DRAFT.md')
require(sha(raw[aid]) == sha(safe(ROOT, path)), 'authority document mismatch: ' + ref)
conditions = index.get('conditions')
require(isinstance(conditions, dict) and set(conditions) == set(REQUIRED), 'mandatory conditions missing/unknown')
conditions = mandatory_conditions(index)
for cid, (domain_name, refs, expected) in REQUIRED.items():
condition = conditions[cid]
require(condition.get('authority_refs') == list(refs), 'condition authority: ' + cid)
@@ -983,14 +978,13 @@ def verify_shift_completion(base):
"""C's first 18:00 transaction, never the paid-midnight 1442 sale."""
for row in load(safe(base, 'SOURCE_MANIFEST.json'))['files']:
native_file(base, row['copy'], row)
require(native_applicability(base) == TESTED_PRODUCT, 'shift tested revision')
tested = native_applicability(base)
pids = native_ownership(base)
shift_pids = [pids['actual-native/' + phase] for phase in NATIVE_RUNS['actual-native']]
require(len(shift_pids) == len(set(shift_pids)) == 3, 'shift ended PID identity')
inputs = load(safe(base, 'actual-native/runner-input.json'))
expected = product_manifest(tree_entries(TESTED_PRODUCT))
require(len(inputs['source_before']) == 1338 and
{p: {'bytes': v['bytes'], 'sha256': v['sha256']} for p, v in inputs['source_before'].items()}
expected = selected_manifest(tree_entries(tested), require_checker=False)
require({p: {'bytes': v['bytes'], 'sha256': v['sha256']} for p, v in inputs['source_before'].items()}
== expected, 'shift complete native source')
prefix = 'actual-native/order-evidence/'
observations = load(safe(base, prefix + 'observations.json'))
@@ -1079,7 +1073,7 @@ def verify_shift_completion(base):
return {'verified_conditions': ['shift_completion'], 'phases': points, 'transaction_id': transaction_id}
def combine_native_series(directory, native):
def combine_historical_native_series(directory, native):
"""Independent R composition; rerun raw checks, never trust condition scalars.
The C verifier and its fixtures remain unchanged. This function does not
@@ -1124,6 +1118,85 @@ def combine_native_series(directory, native):
'stage_A': 'candidate binding stage A pending', 'formal_acceptance': False}
def combine_native_series(directory, native):
"""Fresh raw supplies conditions; historical collection is separate provenance."""
import importlib.util
def module(name, path):
spec = importlib.util.spec_from_file_location(name, path)
value = importlib.util.module_from_spec(spec)
spec.loader.exec_module(value)
return value
module_path = ROOT / DOC_SCOPE / 'p04_native_series.py'
series = module('p04_fresh_series', module_path)
root_bindings = series.fresh_bindings(directory)
collection = root_bindings['collection']
require(re.fullmatch(r'audit-support/p04-raw-collect-q[0-9]+', collection) is not None,
'exclusive fresh collection name')
base = directory / collection
manifest_path = safe(base, 'MANIFEST.json')
manifest = load(manifest_path)
require(manifest['protocol'] == 'p04-fresh-native-series-collection-v1'
and manifest['historical_merged'] is False
and set(manifest['series']) == set(series.FRESH_RUNS), 'fresh series roster')
verified, bindings, results, pids = set(), {}, {}, []
for name in series.FRESH_RUNS:
binding = manifest['series'][name]
path = safe(base, binding['path'])
require(path.name == name + '.json' and sha(path) == binding['sha256']
and path.stat().st_size == binding['bytes'], 'fresh series collection pin')
recorded = load(path)
require(recorded['verifier_sha256'] == sha(module_path), 'fresh verifier drift')
actual = getattr(series, 'verify_fresh_' + name)(directory)
require({k: v for k, v in recorded.items() if k != 'verifier_sha256'} == actual, 'fresh raw recomputation drift')
verified.update(actual['verified_conditions'])
pids.extend(actual['owned_pids'])
bindings[name], results[name] = binding['sha256'], actual
require(len(pids) == len(set(pids)), 'fresh series PID reuse')
order = results['s5']['facts']['order']['cases']
gates = {
'D05-P04-DESTRUCTION': [('S5C_DESTRUCTION_COMMAND', 'command_destruction_before_completion'),
('S5D_DESTRUCTION_RAID', 'G1'), ('S5D_IN_FLIGHT', 'G2'),
('S5D_DESTRUCTION_RAID', 'idle_objective_breach'),
('S5D_IN_FLIGHT', 'in_flight_destruction'),
('S5D_PAID_BEFORE_INCIDENT', 'paid_before_incident')],
'D05-P04-MIDNIGHT-DAY': [('S5E_MIDNIGHT', 'midnight_close_upkeep_before_sale'),
('S5E_MIDNIGHT', 'midnight_new_day_sale')],
'D05-P04-EXIT': [('S5F_EXIT', 'command_exit_before_start'), ('S5F_EXIT', 'planned_exit_after_completion')],
}
for ref, pairs in gates.items():
require(all(order[case][key] is True for case, key in pairs), 'S5 order gate: ' + ref)
for case, key in [('S5G_SHIFT_1080', 'shift_completion'), ('S5H_PAUSED_MIDNIGHT', 'paused_midnight'),
('S5E_MIDNIGHT', 'same_minute_replay')]:
require(order[case][key] == REQUIRED[key][2], 'fresh S5 threshold: ' + key)
power = results['s5']['facts']['power']['cases']
require(power['S5A_PURE']['measurements']['power_stop'] == REQUIRED['power_stop'][2]
and power['S5B_DEPENDENCY']['measurements']['dependency_stop'] == REQUIRED['dependency_stop'][2],
'S5 D05-P04-PAUSE-REASON gate')
full_verifier = module('p04_full_verifier', ROOT / DOC_SCOPE / 'full_suite_verifier.py')
full_binding = root_bindings['full_suite']
full_run = directory / full_binding['run']
require(not Path(full_binding['run']).is_absolute() and '..' not in Path(full_binding['run']).parts,
'full run path')
for leaf, key in [('runner-input.json', 'runner_input'), ('runner-ended.json', 'runner_ended')]:
series.checked(safe(full_run, leaf).read_bytes(), full_binding[key], 'Root full receipt')
full_inputs = load(safe(full_run, 'runner-input.json'))
full = full_verifier.verify(Path(full_inputs['project_root']), full_run, REQUIRED)
require(full['verified'] is True and set(full['conditions']) == set(REQUIRED) | {'EV'}, 'full condition membership')
expected_source = {n: p['sha256'] for n, p in load(directory / root_bindings['series']['s5']['run'] / 'source_before.json').items()}
require(full['source_sha256'] == expected_source, 'full and boundary exact same Q')
history = safe(directory / 'audit-support/p04-raw-collect-r22', 'MANIFEST.json')
c_base = directory / 'audit-support/native-first-current'
require(native == verify_native(c_base), 'historical C provenance recomputation')
return {'verified_conditions': sorted(verified), 'series_manifest_sha256': sha(manifest_path),
'series_bindings': bindings, 'fresh_collection': collection, 'full_suite': full,
'historical_collection': {'manifest_sha256': sha(history), 'merged': False},
'C_source_manifest_sha256': sha(safe(c_base, 'SOURCE_MANIFEST.json')),
'C_provenance_sha256': sha(safe(c_base, 'OWNERSHIP_RAW_PROVENANCE.json')),
'missing_conditions': sorted((set(REQUIRED) | {'EV'}) - verified),
'nativeWindows': {name: 'pending' for name in sorted(set(REQUIRED) | {'EV'})},
'stage_A': 'candidate binding stage A pending', 'formal_acceptance': False}
def verify(directory):
# Contract hashes the supplied spec string, while the checked-in JSON has
# one final LF. Accept only that exact representation difference.