Compare commits

...
38 changed files with 6929 additions and 140 deletions
@@ -1,4 +1,54 @@
# P04-01 current status — repair31
# P04-01 REPAIR51 canonical handoff
ACTUAL S50 historical evidence complete; S51 docs-only resubmission; S51 native admission pending at worker handoff (fresh native on Q51 required by S-binding, checker:368-371); post-submit admission determined only by Root version-pinned receipts; formal_acceptance false; P04=0.
ACTUAL S50: native6 / 24 phases PASS (historical; bound to S50/Q50).
ACTUAL S50: collector 15+EV, missing 0 (historical; bound to S50/Q50).
ACTUAL S50 receipts: build/audit-support/p04-root-acceptance-a9ef681f/.
ACTUAL S47: full184 retains its original label; conditional reuse only under the existing checker and applicability map. r22 remains historical.
S51 native admission is pending AT HANDOFF. After submission, only Root version-pinned receipts under build/audit-support/p04-root-acceptance-<S>/ and build/p04-evidence/index.json determine admission. Worker-time NOT RUN / UNDETERMINED / unexecuted text below is historical and never a reason to rebuild. Fresh native6 on Q51 is required by S/Q binding, not by that text. No future S51 SHA, Q51 or receipt is claimed.
All six D05 IDs remain approved; pending D05 is empty. PAUSE-REASON: S5B proves same-tick onset from ACTIVE gives RELATED. Power-first then dependency closure shows NO_POWER statically at M facility_service.gd:860-864; that sequential case is EXPLICITLY UNRESOLVED/UNPROVEN under the unchanged approval. It is not a defect, cured, proven, or silently narrowed. The :569 gate preserves P04 safety regardless of label. Any later product change needs a separate owner-authorised task; do not amend the contract or re-ask the owner.
Remaining Root gates:
- Root fixes Q51; compare actual hashes with REPAIR51_APPLICABILITY_MAP.json; stop reuse on executable differences
- clean exact-Q check-only; capacity and PID check; one heavy lease for fresh native6 on Q51
- reader/adapters then collector; full184 conditional reuse check; order CLI/complete_B conditional reuse or rerun once
- index regeneration; one p04-acceptance validate; separate Opus whole-unit independent review
- prepare / exactC / integration / final / RootDB join / ledger / main push
- nativeWindows individually pending
Scope: documentation-only repair within the original P04-01/W unit. Original total 30/88, formal 16, P04 credit 0; formal_acceptance false; unit incomplete. No partial credit. See REPAIR51_APPLICABILITY_MAP.json for hashes and reuse conditions.
# Historical, superseded
All older text below, including its current/status headings and worker-time execution statements, is superseded historical material.
## REPAIR49 current correction
Source-ready only; original 30/88, formal 16, P04=0, no partial credit.
REPAIR48's specification-mismatch blocker below is historical and corrected:
the immutable 7000-byte original has SHA256
d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f;
removing its single EOF LF gives
9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881.
This is the existing Git/Runner strip/checker one-EOF-LF pin contract.
No specification, approval or normalization change. Older contradictory wording
below is superseded history, including blanket full-reuse prohibitions and
all-controls-unexecuted wording. Q47 admission/index failures remain failures.
See REPAIR49_STATUS.md for closure audit and verbatim complete_B FileNotFoundError.
Root handoff reports payload(B), all53, series/join/power PASS; order-typed remains
UNDETERMINED. Worker did not rerun them. Corrected complete_B remains unexecuted.
Old native/full successes confer no new-S acceptance or credit.
REPAIR48 current source status: see [REPAIR48_STATUS.md](REPAIR48_STATUS.md). Earlier run directions and successes below are historical; they grant no P04 credit.
RUN47 current harness status: see REPAIR47_STATUS.md, REPAIR47_PLAN.json and REPAIR47_VALIDATION.json. Original unit remains unaccepted; earlier status below is historical.
# Historical P04-01 status — repair31
**BLOCKED: partial implementation; do not start the once-only native/full run.**
Formal completed status is **16/88**, with **zero P04 credit**.
@@ -1,3 +1,16 @@
## RUN47 harness repair; original unit remains unaccepted
Q46 S4 failed before engine startup: `AssertionError: complete 316-script parse roster`.
Secondary guard: `AssertionError: exact source and planned UID set`. Captured S4
PIDs: `[]`; phases: `[]`; passed: `false`. No game verification ran. This failure
is historical reference only, never adopted as a pass. Current S4 admission derives
exact roster/sets from real selection; check-only and native share it. Import-not-
attempted cleanup requires the original inventory without generated UIDs.
REPAIR47_PLAN.json and REPAIR47_STATUS.md supersede earlier current-run count and
reuse instructions. Immutable spec, REQUIRED/REACH_REFS, product, caps, denominator,
permissions and historical raw are unchanged. Option B: Root freezes new final Q,
then fresh all-series runs once; no receipt rewriting or reuse adopter.
# Evidence collection — historical repair29 description
Repair30 supersedes current-use claims below: existing S1–S4/r22/full178 records
@@ -1,4 +1,114 @@
# P04-01 order audit — repair31
# P04-01 REPAIR51 canonical handoff
ACTUAL S50 historical evidence complete; S51 docs-only resubmission; S51 native admission pending at worker handoff (fresh native on Q51 required by S-binding, checker:368-371); post-submit admission determined only by Root version-pinned receipts; formal_acceptance false; P04=0.
ACTUAL S50: native6 / 24 phases PASS (historical; bound to S50/Q50).
ACTUAL S50: collector 15+EV, missing 0 (historical; bound to S50/Q50).
ACTUAL S50 receipts: build/audit-support/p04-root-acceptance-a9ef681f/.
ACTUAL S47: full184 retains its original label; conditional reuse only under the existing checker and applicability map. r22 remains historical.
S51 native admission is pending AT HANDOFF. After submission, only Root version-pinned receipts under build/audit-support/p04-root-acceptance-<S>/ and build/p04-evidence/index.json determine admission. Worker-time NOT RUN / UNDETERMINED / unexecuted text below is historical and never a reason to rebuild. Fresh native6 on Q51 is required by S/Q binding, not by that text. No future S51 SHA, Q51 or receipt is claimed.
All six D05 IDs remain approved; pending D05 is empty. PAUSE-REASON: S5B proves same-tick onset from ACTIVE gives RELATED. Power-first then dependency closure shows NO_POWER statically at M facility_service.gd:860-864; that sequential case is EXPLICITLY UNRESOLVED/UNPROVEN under the unchanged approval. It is not a defect, cured, proven, or silently narrowed. The :569 gate preserves P04 safety regardless of label. Any later product change needs a separate owner-authorised task; do not amend the contract or re-ask the owner.
Remaining Root gates:
- Root fixes Q51; compare actual hashes with REPAIR51_APPLICABILITY_MAP.json; stop reuse on executable differences
- clean exact-Q check-only; capacity and PID check; one heavy lease for fresh native6 on Q51
- reader/adapters then collector; full184 conditional reuse check; order CLI/complete_B conditional reuse or rerun once
- index regeneration; one p04-acceptance validate; separate Opus whole-unit independent review
- prepare / exactC / integration / final / RootDB join / ledger / main push
- nativeWindows individually pending
Scope: documentation-only repair within the original P04-01/W unit. Original total 30/88, formal 16, P04 credit 0; formal_acceptance false; unit incomplete. No partial credit. See REPAIR51_APPLICABILITY_MAP.json for hashes and reuse conditions.
# Historical, superseded
All older text below, including its current/status headings and worker-time execution statements, is superseded historical material.
## REPAIR49 normal-gate handoff
Required materials: exact B/native-first-current and fresh-run registry; each
runner-input/ended/source/UID/formal/raw/lifecycle receipt; original recorded Q
and engine context; B/p04-evidence/runner-materials and RELOCATION.json; matching
collection/MANIFEST and separate dependency invocation; original full run and
full_suite binding/raw receipts; final index and invocation receipt; immutable
authorities in frozen checkout. No raw or historical receipt is rewritten.
Two-placement identity requires the explicit closure in repair48_identity_controls.py,
missing-file rejection, and original/A/B complete path/bytes/SHA tables and tree
hash equality before and after positive execution. See REPAIR49_STATUS.md.
Submission is followed by new Q freeze, affected pure controls (complete_B included),
clean exact-Q check-only, capacity/PID checks, one fresh native lease for
S1/S2a/S2b/S3/S4 and all ten S5 cases, readers/adapters, 15EV collector, full
verification/binding under the conditions below (or one final full184 if any
condition fails), index generation, p04-acceptance once, separate Opus whole-unit
review, normal prepare/C/integration/final/Root DB join/ledger/main push.
If order-typed fails, preserve its result and stop before heavy execution.
Only whole-unit acceptance grants credit.
## REPAIR49 full184 conditional reuse candidate — all conditions UNVERIFIED
Native reuse is forbidden: all six series require fresh M/S/Q_tree provenance
(p04_native_series.py:1287; checker:370). Full uses the existing separate binding
(checker:1175-1186); no adopter or checker change is authorized.
The following are requirements, not results or approval:
1. New S5 source_before must equal old full selected_source_map: all 1369 keys
and SHA values, not counts alone.
2. Old project_root must remain unchanged: source-start == current source_refs
== post-verification source_refs (full_suite_verifier.py:115).
3. selected_source_map, roster184, parse329, settings, runner/marker module,
marker contract, suite-policy and UID plan/stage must all match (116-152,225).
4. inputs.engine must match current engine_pin (124-125).
5. Revalidate every phase PID, cleanup, marker and diagnostics (154-228).
6. Current s5/run_s5_native.py and full_suite_verifier.py SHA must equal the
Root rehearsal versions.
7. Never relabel old S/oldQ/project_root/PIDs/time. Describe reuse only as
revalidating the exact-source-identical old full through the existing
full_suite route; never claim full ran on new S.
8. A separate Opus whole-unit review must independently confirm applicability.
Conditions 1–6 require actual checks after final freeze. If any predicate is
unproved or differs, reject reuse and execute full184 once on the final version.
SourceRefs (tools/run_all_tests.py:40-45) excludes docs/private package, but that
fact is no substitute for complete source equality. No reuse is approved here.
## REPAIR49 current correction
Source-ready only; original 30/88, formal 16, P04=0, no partial credit.
REPAIR48's specification-mismatch blocker below is historical and corrected:
the immutable 7000-byte original has SHA256
d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f;
removing its single EOF LF gives
9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881.
This is the existing Git/Runner strip/checker one-EOF-LF pin contract.
No specification, approval or normalization change. Older contradictory wording
below is superseded history, including blanket full-reuse prohibitions and
all-controls-unexecuted wording. Q47 admission/index failures remain failures.
See REPAIR49_STATUS.md for closure audit and verbatim complete_B FileNotFoundError.
Root handoff reports payload(B), all53, series/join/power PASS; order-typed remains
UNDETERMINED. Worker did not rerun them. Corrected complete_B remains unexecuted.
Old native/full successes confer no new-S acceptance or credit.
REPAIR48 current source status: see [REPAIR48_STATUS.md](REPAIR48_STATUS.md). Earlier run directions and successes below are historical; they grant no P04 credit.
## RUN47 harness repair; original unit remains unaccepted
Q46 S4 failed before engine startup: `AssertionError: complete 316-script parse roster`.
Secondary guard: `AssertionError: exact source and planned UID set`. Captured S4
PIDs: `[]`; phases: `[]`; passed: `false`. No game verification ran. This failure
is historical reference only, never adopted as a pass. Current S4 admission derives
exact roster/sets from real selection; check-only and native share it. Import-not-
attempted cleanup requires the original inventory without generated UIDs.
REPAIR47_PLAN.json and REPAIR47_STATUS.md supersede earlier current-run count and
reuse instructions. Immutable spec, REQUIRED/REACH_REFS, product, caps, denominator,
permissions and historical raw are unchanged. Option B: Root freezes new final Q,
then fresh all-series runs once; no receipt rewriting or reuse adopter.
# Historical P04-01 order audit — repair31
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.
@@ -26,3 +136,36 @@ The preserved S1–S4, r22 index, old registered validation and f5 full178 run r
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.
See [CURRENT_STATUS.md](CURRENT_STATUS.md) and [REPAIR31_STATUS.md](REPAIR31_STATUS.md) before any Root execution.
## REPAIR50 source preparation (2026-10-18; no acceptance claim)
The commander handoff reports an identity order mutation on an all-equal array
(`recent_events/17/payload/current_cell = [0,0,0]`), raw SHA prefix
`bb0ccb1d…`, and 761.085 seconds elapsed. These are supplied observations,
not measurements repeated by this worker; the full raw SHA/log remains Root
material. The old control reversed every multi-element array and classified
the resulting identical bytes as a negative. The oracle correctly accepted
that identity. Existing failure records remain unchanged.
REPAIR50 separates byte-identical identity positives from negatives, swaps the
first unequal typed byte pair, and lists collections with no genuine order
variant. All AFTER keys/values, journal/body fields and both copied modes
remain traversed. Type-invalid mutations still require ValueError rejection
and are also listed as parser rejections; copied records contain the changed
bytes in both AFTER and EXPECTED even when an intermediate parse is invalid.
The oracle, adapters, public checker, native-series implementation and R49
closure roster are unchanged. No Node patch optimization is used.
The temporary expected memo keys full BEFORE/command/guard bytes by SHA256
and length plus oracle/parser source SHA256. Its cache contains only genuine
derivation output bytes. It reconstructs fresh Nodes on each return, restores
the wrapper with finally, and retains verify for each parseable mutation.
Self-controls compare hit/nonmemo bytes for first/last and each mutated kind,
require a one-byte BEFORE miss and reject, and check normal/exception cleanup.
The SHA fixture now streams 1 MiB implementation chunks without changing
file selection, traversal, relative keys or digest semantics.
Worker validation: AST parsing only; pure, stream, native and formal checks
are unexecuted. See [REPAIR50_STATUS.md](REPAIR50_STATUS.md) for Root commands,
static estimation and reuse prerequisites. Original 30/88, formal 16 and P04
credit 0 remain unchanged; the whole unit is incomplete.
@@ -0,0 +1,354 @@
{
"task_id": "P04-01",
"status": "submitted-preparation-only",
"accepted": false,
"option": "B-no-reuse-adopter",
"worker_scope": "engine-free bounded harness repair",
"retained_M": "build/owner-handoff/p04-after-p26-closure-r01/verified-m-engine-free-r45",
"affected_pure": [
{
"name": "pure:series",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_series_fixtures.py",
"sha256": "5779b05505d6c7118f40cff3b8c309211142603d04c69183c3e68e88efaee4a9",
"baseline_sha256": "5ec725ad77313287f4f86ab30332012e2092caccafde2d91594ddd2013d8f418",
"unchanged": false,
"prior_result": {
"name": "pure:series",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/checker_series_fixtures.py",
"--build",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build"
],
"returncode": 0,
"passed": true,
"wall_seconds": 9.860904957633466,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_series.log"
}
},
{
"name": "pure:join",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_join_fixtures.py",
"sha256": "c80cb694fe3b7498f294fb10d7cd08aff9c93623bee442018e120d6b475cc4dd",
"baseline_sha256": "c80cb694fe3b7498f294fb10d7cd08aff9c93623bee442018e120d6b475cc4dd",
"unchanged": true,
"prior_result": {
"name": "pure:join",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/checker_join_fixtures.py",
"--build",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build"
],
"returncode": 0,
"passed": true,
"wall_seconds": 19.733827583957464,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_join.log"
}
}
],
"reused_pure": [
{
"name": "pure:encoder",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_encoder_fixtures.py",
"sha256": "aa286736657c025cc0c759102969a5fc1fcbae277c06ce4e418a8d4325dec6ac",
"baseline_sha256": "aa286736657c025cc0c759102969a5fc1fcbae277c06ce4e418a8d4325dec6ac",
"unchanged": true,
"prior_result": {
"name": "pure:encoder",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/checker_encoder_fixtures.py"
],
"returncode": 0,
"passed": true,
"wall_seconds": 0.08287249971181154,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_encoder.log"
}
},
{
"name": "pure:candidate",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_candidate_fixtures.py",
"sha256": "957a01f3c4ec8d167a10e276d9eb76a56352281aafb4d0a678c6e7c843c71903",
"baseline_sha256": "957a01f3c4ec8d167a10e276d9eb76a56352281aafb4d0a678c6e7c843c71903",
"unchanged": true,
"prior_result": {
"name": "pure:candidate",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/checker_candidate_fixtures.py",
"--pure-only"
],
"returncode": 0,
"passed": true,
"wall_seconds": 0.06956258416175842,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_candidate.log"
}
},
{
"name": "pure:negative",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_negative_fixtures.py",
"sha256": "1fbef5f248ca435c4983c4085023c74d9bf7811c3482dad3805e3bb8ba1846a9",
"baseline_sha256": "1fbef5f248ca435c4983c4085023c74d9bf7811c3482dad3805e3bb8ba1846a9",
"unchanged": true,
"prior_result": {
"name": "pure:negative",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/checker_negative_fixtures.py"
],
"returncode": 0,
"passed": true,
"wall_seconds": 34.31273220805451,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_negative-with-build-environment.log",
"controlled_environment": {
"BUILD_OUTPUT_DIR": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build",
"PYTHONDONTWRITEBYTECODE": "1"
}
}
},
{
"name": "pure:approval",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_approval_fixtures.py",
"sha256": "b218ad8fb8aaa9c58ec91c3e917b97307829cb1a3c2f09a2e3e2c856e7fff634",
"baseline_sha256": "b218ad8fb8aaa9c58ec91c3e917b97307829cb1a3c2f09a2e3e2c856e7fff634",
"unchanged": true,
"prior_result": {
"name": "pure:approval",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/checker_approval_fixtures.py"
],
"returncode": 0,
"passed": true,
"wall_seconds": 0.2860210002399981,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_approval.log"
}
},
{
"name": "pure:applicability",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/checker_applicability_fixtures.py",
"sha256": "f993e0d8f5085f11799f7053de87cda7fc32225473a80a82c0d4d36663fc2235",
"baseline_sha256": "f993e0d8f5085f11799f7053de87cda7fc32225473a80a82c0d4d36663fc2235",
"unchanged": true,
"prior_result": {
"name": "pure:applicability",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/checker_applicability_fixtures.py"
],
"returncode": 0,
"passed": true,
"wall_seconds": 21.79465250018984,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_applicability.log"
}
},
{
"name": "pure:UID",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_uid_controls.py",
"sha256": "17069b87b98c385e1298152c9c5c2f23c8710b79eb19aef073c64ce215f6c902",
"baseline_sha256": "17069b87b98c385e1298152c9c5c2f23c8710b79eb19aef073c64ce215f6c902",
"unchanged": true,
"prior_result": {
"name": "pure:UID",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/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-root-q-r46-e7f22711",
"--scratch",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/s5-uid-root-controls-r46"
],
"returncode": 0,
"passed": true,
"wall_seconds": 0.7516515422612429,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_UID.log"
}
},
{
"name": "pure:power-adapter",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_power_adapter_controls.py",
"sha256": "32d71db80994052b905829e6a2da38448ae789825c44570a901e67fe2d07fd33",
"baseline_sha256": "32d71db80994052b905829e6a2da38448ae789825c44570a901e67fe2d07fd33",
"unchanged": true,
"prior_result": {
"name": "pure:power-adapter",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_power_adapter_controls.py",
"--fixture-dir",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/owner-handoff/p04-after-p26-closure-r01/q36-writer-contract",
"--scratch",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/s5-power-controls-r46"
],
"returncode": 0,
"passed": true,
"wall_seconds": 0.8173460410907865,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_power-adapter.log"
}
},
{
"name": "pure:full-suite-negatives",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/full_suite_verifier.py",
"sha256": "df3768b7755d603fc079e899da8f06ae4ebb529ae531824a30add0f4d6773a6e",
"baseline_sha256": "df3768b7755d603fc079e899da8f06ae4ebb529ae531824a30add0f4d6773a6e",
"unchanged": true,
"prior_result": {
"name": "pure:full-suite-negatives",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/full_suite_verifier.py",
"--controls"
],
"returncode": 0,
"passed": true,
"wall_seconds": 0.03479995811358094,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_full-suite-negatives.log"
}
},
{
"name": "pure:wrapper",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_wrapper_fixtures.py",
"sha256": "1a4daebf46051e975a9cc740660c4672371ea6a9e6cb04cbc1d458ece5f0151d",
"baseline_sha256": "1a4daebf46051e975a9cc740660c4672371ea6a9e6cb04cbc1d458ece5f0151d",
"unchanged": true,
"prior_result": {
"name": "pure:wrapper",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_wrapper_fixtures.py"
],
"returncode": 0,
"passed": true,
"wall_seconds": 0.045466875191777945,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_wrapper.log"
}
},
{
"name": "pure:guard-mutations",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_order_adapter_controls.py",
"sha256": "f1f90b9847830c6505a176bf78442e619b1d297c818ec561c92c498a4db74b53",
"baseline_sha256": "f1f90b9847830c6505a176bf78442e619b1d297c818ec561c92c498a4db74b53",
"unchanged": true,
"prior_result": {
"name": "pure:guard-mutations",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/s5_order_adapter_controls.py",
"--pure-only"
],
"returncode": 0,
"passed": true,
"wall_seconds": 1.5057093752548099,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_guard-mutations.log"
}
},
{
"name": "pure:repair44-new-roster-paid-mutations",
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s5/repair44_controls.py",
"sha256": "3eeaa1e17b7e27ba00c42be5fba3bbf907a8e82a75e834d7aec6bf62586c3781",
"baseline_sha256": "3eeaa1e17b7e27ba00c42be5fba3bbf907a8e82a75e834d7aec6bf62586c3781",
"unchanged": true,
"prior_result": {
"name": "pure:repair44-new-roster-paid-mutations",
"argv": [
"/Users/korizatou114/Antigravity/環境構築/agent-control/.venv/bin/python",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r46-e7f22711/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/repair44_controls.py"
],
"returncode": 0,
"passed": true,
"wall_seconds": 0.11979149980470538,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/coordinator-p04-repair30-current-main-r01/q46-pure-plans-logs/pure_repair44-new-roster-paid-mutations.log"
}
}
],
"unchanged_series_top_level_functions": {
"require": "9775a8b3969599d5d1f620d9717824195d7ab69490eafb5e7b8d1bacbf14df85",
"digest": "b46c442db8153d4caa4e3d7ebb3560f6dc261f2c614ac20722d41b32fb1785fd",
"unique": "72abe6f619eb97c8d540b8f74ddf0939c11d0c1c786d540a3e23a36a4beded9b",
"function_bodies": "7b69fa546fdc7a22f1acc531be141ec9627fd0212509f328e910c2401b0e6128",
"source_body_pins": "c83b75bb2ba1f3728cbc7aa8cb89455cdb7921d6cc02220c15d687f825b52be3",
"loads": "e35a9b9819e7efaf7e83b0a0b694cb220624888b765856ceb3054c37ee66c612",
"ordinary": "8b39c612330ac0844e593cb6f806e3fa38adfa53c829641f72082a1aad97295f",
"checked": "9cf3869795a79d420fda3c15ff21fa6d322d3090135e3687704eb6b33a8652df",
"variant": "60d89a476b547aaa511bc74525d881f3b35f060d98341165700e37b6b51d7cd6",
"normalized": "e63426c2f2de5ef8b97c4e12b96273c1ef73ae2961361a75293c09f5654c28d7",
"persistence_pins": "7fd541bfa754547aed89a0dcb019ac418fd44c7fbbecb65211c2cbcf2072704d",
"getter_array_headers": "c6f9c21b685fa96ca2d092af294acb7a125a107817c62cd17cd1a0d5fa65a79b",
"persisted_day_projection": "7c4e84529b2a262a66e12a3833b6c1dec328518e330ebc1cdb96a1ec8378305d",
"runtime": "d249848c71d3b0cab1d37e4b6b8631f76dab0f4a8f4ae8c7dcf6b9c9bc25d1a0",
"service_reservations": "79a8d64dddb277fd965c1965b92524df4616843f04900b3f8ba413bce4515f09",
"sales": "bec5cc78ac364aaa1ac78fd3d5fe099cf22afed188d8ddbd7047a299eb850b9e",
"s1_pretravel": "f02ee9c5071ceef71aa3ab530f9d3e9b0628b4003782ac28c86721c28b971f01",
"s1_semantics": "7cc52a4fd173bddf1f0e3f47c1c5266de06202f526195ad2e97b520ff34bc755",
"settlement": "c2b1a2d54446bb583977ea8fecb9a6577f5de736882a0990deae62cc70e20d38",
"recall": "31961e7c264046b805be3c0473f9ec2412841fc17e5cce2729ca8b5f32078528",
"s2a_semantics": "f87f4312d7e4643415e6268a2683cbd4d5967d2c94dd5ff45381fed0db4e6ac5",
"s2b_semantics": "ccb4cffd5bdbc31e5f0ecfa28e1b98dd527f348a1c341805aa68664fe35bf65f",
"s3_semantics": "a93e0acd0b67844992ae9dee285230c928d2ca365a628171d1a99e4856832fd7",
"dependency_closure_diagnostic": "9e352050aa9f23daaaa8cac0d02ff380d5dfb2e4076398906eaa0c5c1fcc5d0f",
"power_stop": "07d9bcef32320e33c92f1afe7e5be35e1e37a4debe751ebceb1d6279b67868c5",
"verify_s4_engine": "8f0761a68c3adbbd69a47a3358952bc458d0a885a72ca9e64694ff5c5bc3dbd8",
"verify_s4_wrapper": "ed7b19fb2f50c9aa30ef34ad355ef7eea884688aaf61aee77583698fffe2b042",
"verify_s4": "efc8d32132db9e498d20eec6bc36e4cdf56a415439349339cbb20c592276d849",
"verify_s1": "13cccc10c8758fec02e9b655fd0d97a5139dfe92d65a40ba73f7a514886163ac",
"verify_s2a": "0a1e24648ccb1432156fd946fc2c797a519cc461af798a7d7395f4a6363b8f6c",
"paid_series": "47dcd6b17e7e5e80caff6517234ed529d5bc6221efb140ec1c9b78652c81c018",
"verify_s2b": "5234b429ac310818d2e9163dcb977770670305fa6b4b90b6f07fb282f8de2764",
"verify_s3": "22800abeda3292013f95241121657e1a5129e71c4731e45c592a642db2ad5794",
"fresh_bindings": "8021bd1d2d8ac820a574a86c7148bc699514f63dc88f79abca47fcb043641434",
"verify_fresh_s1": "b6841f48bae307744e434df5bcdd58827acc8d3346f4b81822d07e8ef5ffc4df",
"verify_fresh_s2a": "b7b7d96b2db9faf45cad377cfb2228247714885bd08d0afe24646e914e1565d4",
"verify_fresh_s2b": "b693e93f6f3a17223e6f4fde890ad20abb525a25a97bc3d45b80c328ac2d3851",
"verify_fresh_s3": "e7ab78bce70ba47a0506fda1cb4791a3d7d282c8a57dc674ce1d5b6c63c565bd",
"verify_fresh_s4": "1be49dd54ed4885e15c577c159f5a0565ef78966774dca9edc71f9f7054e80db",
"verify_fresh_s5": "f6f58e84346f5e8b674dd60f94712684825a1404832e70704ab9bac23fac7f6d",
"main": "5f67e808cb4fd765f6809fe8ad06b2518dfd6c13db0c96fa5813330a85891d74"
},
"additional_controls": "s4/admission_controls.py",
"historical_controls": "s4/receipt_lifecycle_fixtures.py (explicit pinned r28 path)",
"six_check_only": [
"s1",
"s2a",
"s2b",
"s3",
"s4",
"s5"
],
"s4_check_only_admission": "same admission as native, before writing plan",
"root_sequence": [
"Freeze final Q/Qt",
"Affected pure controls",
"Clean exact-Q S1-S5 six check-only plans",
"Capacity and PID-end checks",
"One heavy lease: fresh S1,S2a,S2b,S3,S4 and all ten S5",
"Reader/adapters on actual raw",
"Fresh all 15 EV/approved subclauses",
"Full 184 once",
"Index",
"verify-only",
"Registered p04-acceptance before independent whole-unit Opus review",
"prepare/exact C/integration/final/Root DB join/ledger/main push"
],
"worker_prohibited": [
"Git writes",
"engine/native/full runs",
"Runner actions",
"other agents"
],
"old_artifacts": "Q46 historical only; no rewriting or adoption",
"native_pending": true
}
@@ -0,0 +1,18 @@
{
"provenance": "build/owner-handoff/p04-after-p26-closure-r01/q46-s4-admission-gap/actual-native/s4/execution.json",
"sha256": "c44550114d47a5332cefead105a039d437802e3e5eae709b9e62d03631dab2d6",
"verbatim_failure_fields": {
"passed": false,
"error": "AssertionError: complete 316-script parse roster",
"guard_errors": [
"AssertionError: exact source and planned UID set"
],
"phases": [],
"actual_captured_PIDs": [],
"cleanup": [],
"cleanup_errors": [],
"whole_goal_accepted": false,
"unit_accepted": false
},
"classification": "Q46 actual failure; not adopted; zero S4 native PIDs and no game verification"
}
@@ -0,0 +1,44 @@
{
"task_id": "P04-01",
"scope_ok": true,
"changed_paths": [
"docs/plans/original-completion-2026-10-02/execution/p04-01/CURRENT_STATUS.md",
"docs/plans/original-completion-2026-10-02/execution/p04-01/EVIDENCE_COLLECTION.md",
"docs/plans/original-completion-2026-10-02/execution/p04-01/ORDER_AUDIT.md",
"docs/plans/original-completion-2026-10-02/execution/p04-01/checker_series_fixtures.py",
"docs/plans/original-completion-2026-10-02/execution/p04-01/p04_native_series.py",
"docs/plans/original-completion-2026-10-02/execution/p04-01/s2b/S2B_ROOT_RUN.md",
"docs/plans/original-completion-2026-10-02/execution/p04-01/s3/S3_ROOT_RUN.md",
"docs/plans/original-completion-2026-10-02/execution/p04-01/s4/S4_ROOT_RUN.md",
"docs/plans/original-completion-2026-10-02/execution/p04-01/s4/receipt_lifecycle_fixtures.py",
"docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py",
"docs/plans/original-completion-2026-10-02/execution/p04-01/REPAIR47_PLAN.json",
"docs/plans/original-completion-2026-10-02/execution/p04-01/REPAIR47_Q46_FAILURE_REFERENCE.json",
"docs/plans/original-completion-2026-10-02/execution/p04-01/REPAIR47_STATUS.md",
"docs/plans/original-completion-2026-10-02/execution/p04-01/REPAIR47_VALIDATION.json",
"docs/plans/original-completion-2026-10-02/execution/p04-01/s4/admission_controls.py"
],
"immutable": [
{
"path": "tools/check_p04_order_evidence.py",
"unchanged": true,
"sha256": "3bb0cde776bc295f6f18e74f1e23bf3d832d8e4f71aed260601c82d287c655fd"
},
{
"path": "docs/spec/acceptance/P04-01.json",
"unchanged": true,
"sha256": "d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f"
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s4/historical/run_s4_native_r28.py.reference",
"unchanged": true,
"sha256": "2d3be39d2b310abac058e27336ac816c234043a0a1dd7b2c52d84994907dd31b"
}
],
"compiled_sources_match_final_bytes": true,
"git_diff_check": true,
"engine_launches": 0,
"git_writes": 0,
"runner_actions": 0,
"whole_unit_accepted": false
}
@@ -0,0 +1,105 @@
# RUN47 submission — bounded S4 admission repair
P04-01 remains **unaccepted**. This is the same original 30/88 unit, formal credit
16, P04 credit 0. No completion, integration or native-success claim is made.
All edits are under the contracted execution directory. Product code, registered
spec, checker (including REQUIRED/REACH_REFS), denominator, caps and permissions
are unchanged. No Git writes, other agents, Runner actions or engine launches.
## Changes and count/roster audit
- `s4/run_s4_native.py`, former line 301: removed current 316-script admission.
`admission` compares the whole sorted source-derived `.gd` res:// list. It runs
before check-only writes its plan and again before native writes parse-paths.
Plans carry the exact list; missing/extra/duplicate/non-.gd/same-count changes fail.
- Former line 240: removed selected/product 1339/1338 assumptions. Cache admission
requires the exact current product map, with precisely the checker as its extra;
the real product/selection difference allows no other input. Existing hashes,
failed-cache rejection and no-adoption guards remain. Option B uses no cache.
- `p04_native_series.py`, former lines 73/187/1030: removed literal source counts;
retained whole source/manifest/input/source_after equalities and pin checks.
Result count comes from the actual manifest. FreshSeries S4 also calls the
admission function and compares plan and actual parse-paths.
- `s4/receipt_lifecycle_fixtures.py`, former lines 81/92: split historical-pinned
lifecycle from current-derived admission. It now explicitly loads the unchanged,
hash-pinned r28 wrapper, retaining historical 1338/316 synthetic fixtures. The
standard runner comes from the supplied retained M copy. Current cases live in
`s4/admission_controls.py`; another valid derived roster is accepted as well.
- Remaining 316 in current controls is only the deliberately stale negative and
the historical AST/receipt fixture. The current wrapper has none. The 329 pin
diagnoses this supplied M fixture only; production has no fixed roster size.
- Resolver's 1721 members/71488772 bytes are the immutable historical relocation
identity, already bound to the fixed manifest hash; retained. S4 phase-cut
121/132, eleven kernel phases, three slots, four engine phases and case roster
are scenario/receipt invariants rather than source counts; retained unchanged.
- `S4_ROOT_RUN.md` now distinguishes the current derived rules from historical
relocation/count descriptions. Its parse-path receipt row describes the new
admission. Earlier 1338/316 observations remain historical. S2b/S3 normative
fixed-product instructions are explicitly superseded. S1/S2 source-count
observations describe earlier runs, not current admission. ORDER_AUDIT,
EVIDENCE_COLLECTION, CURRENT_STATUS and REPAIR47_PLAN are synchronized.
- `checker_series_fixtures.py` uses BUILD for disposable fixtures. No test was
removed or disabled.
Before import is attempted (`phase is None`), cleanup requires the complete
original source inventory with no generated UID. After import is attempted, the
existing exact planned UID snapshot/seal still applies. Partial/unknown UID sets
and changed source fail in both branches. The original exception stays in `error`;
cleanup errors remain separate guards, and the pass predicate still requires a
sealed import, all four successful phases and owned PID cleanup. Engine identity,
fixed inputs, default-player protection, source checks and first-failure behavior
are preserved.
## Q46 failure, preserved verbatim
```json
{
"passed": false,
"error": "AssertionError: complete 316-script parse roster",
"guard_errors": ["AssertionError: exact source and planned UID set"],
"phases": [],
"actual_captured_PIDs": []
}
```
No S4 game verification ran. REPAIR47_Q46_FAILURE_REFERENCE.json records the raw
file hash and verbatim failure fields. The original raw and historical wrapper
were not modified. Q46 successes elsewhere are reference only, never adopted.
## Engine-free verification
REPAIR47_VALIDATION.json includes commands, exit codes, raw-log hashes and full
finite outputs. The final current admission program passed 34 controls: actual
329 scripts, another derived roster, checker-only selection extra, every required
roster rejection, actual check-only main admission and its six rejected mutations,
the real FreshSeries roster block, the real cache set guard, historical 316 via
pinned r28 AST, and pre-import/attempted-import UID/source rejection cases.
Its check-only unit explicitly stubs historical template and engine identity;
this is a synthetic control, not a fresh-Q provenance plan or native proof.
Affected series (62 controls), join (29 controls), and historical lifecycle (six
cases) passed. Historical lifecycle was finally confirmed against retained M.
Five changed Python files passed AST and compile checks; bytecode and scratch are
in allocated BUILD. Initial control-development failures (two absent contract
paths in the product-only M copy and one synthetic UID owner outside the existing
plan's allowed selection) are recorded, not treated as passes. Their fixture
references/owners were corrected; the final finite runs passed.
REPAIR47_PLAN.json records unchanged hashes against S46 for the eleven unaffected
pure programs, their prior Q46 results, and unchanged top-level series function
hashes. Those eleven programs were not rerun. This is reuse of unchanged pure
checks only, not adoption of native receipts. The affected series/join checks were
rerun. The checker file is byte-for-byte unchanged (SHA256
`3bb0cde776bc295f6f18e74f1e23bf3d832d8e4f71aed260601c82d287c655fd`).
The historical wrapper remains
`2d3be39d2b310abac058e27336ac816c234043a0a1dd7b2c52d84994907dd31b`.
Spec raw bytes remain unchanged; the existing one-final-LF dispatch identity
protocol yields the contracted `9ec722e7…` hash (REPAIR43_PRECHECK records it).
Formal six-series check-only plans were not run by this worker: they require
Root's clean final Q/provenance. No claim that W check-only passed, or failed only
because of dirtiness, is made. No native/full/registered acceptance test ran.
Root must follow the complete option-B sequence in REPAIR47_PLAN.json: freeze Q,
affected pure, six clean plans, capacity/PID checks, one fresh native batch,
readers/adapters, fresh all-15/EV/subclauses, full 184 once, index, verify-only,
registered p04-acceptance before independent Opus review, then normal integration.
@@ -0,0 +1,984 @@
{
"results": [
{
"name": "admission",
"argv": [
"/Applications/Xcode.app/Contents/Developer/usr/bin/python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/admission_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/repair47-finite-validation-r01/admission"
],
"exit_code": 0,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair47-finite-validation-r01/admission.log",
"sha256": "93b3976b5a79fd3c046f07e0f8f0a336e046e77a5bc914e54a255a7461cba182",
"output": {
"passed": true,
"controls": [
{
"case": "real-329",
"result": "pass"
},
{
"case": "another-derived-roster",
"result": "pass"
},
{
"case": "missing",
"result": "rejected"
},
{
"case": "extra",
"result": "rejected"
},
{
"case": "same-count-substitution",
"result": "rejected"
},
{
"case": "duplicate",
"result": "rejected"
},
{
"case": "non-gd",
"result": "rejected"
},
{
"case": "stale-literal-count",
"result": "rejected"
},
{
"case": "checker-as-product",
"result": "rejected"
},
{
"case": "missing-product",
"result": "rejected"
},
{
"case": "extra-selected-input",
"result": "rejected"
},
{
"case": "real-check-only-shared-admission",
"result": "pass"
},
{
"case": "check-only-missing",
"result": "rejected"
},
{
"case": "check-only-extra",
"result": "rejected"
},
{
"case": "check-only-same-count-substitution",
"result": "rejected"
},
{
"case": "check-only-duplicate",
"result": "rejected"
},
{
"case": "check-only-non-gd",
"result": "rejected"
},
{
"case": "check-only-stale-literal-count",
"result": "rejected"
},
{
"case": "historical-316-receipt",
"result": "pass"
},
{
"case": "historical-rejects-current-roster",
"result": "rejected"
},
{
"case": "pre-import-original-no-uid",
"result": "pass"
},
{
"case": "pre-import-partial-import",
"result": "rejected"
},
{
"case": "attempted-import-partial-import",
"result": "rejected"
},
{
"case": "pre-import-unknown-uid",
"result": "rejected"
},
{
"case": "attempted-import-unknown-uid",
"result": "rejected"
},
{
"case": "pre-import-changed-source",
"result": "rejected"
},
{
"case": "attempted-import-changed-source",
"result": "rejected"
}
],
"source_files": 1368,
"product_files": 1368,
"scripts": 329,
"engine_launches": 0,
"formal_acceptance": false
}
},
{
"name": "series",
"argv": [
"/Applications/Xcode.app/Contents/Developer/usr/bin/python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/checker_series_fixtures.py",
"--build",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build"
],
"exit_code": 0,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair47-finite-validation-r01/series.log",
"sha256": "33d8711aa6481841088938f4c4b8fc492c71ead6e1419e9558419a329adcf73b",
"output": {
"formal_acceptance": false,
"results": [
{
"class": "fresh_roster_and_entrypoints",
"result": "pass",
"series": "fresh"
},
{
"class": "small_synthetic_positive",
"result": "pass",
"series": "shared"
},
{
"class": "full_body_positive",
"result": "pass",
"series": "s1"
},
{
"class": "wrong_source_pin",
"error": "SHA drift: native /native/body.gd",
"result": "rejected",
"series": "s1"
},
{
"class": "signature_only_pin",
"error": "full-function-body pin mismatch",
"result": "rejected",
"series": "s1"
},
{
"class": "symlink",
"error": "symlink: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/.series-fixtures-u1xfy7kc/symlink.gd",
"result": "rejected",
"series": "s1"
},
{
"class": "traversal",
"error": "raw traversal",
"result": "rejected",
"series": "s1"
},
{
"class": "unmapped_original_path",
"error": "unmapped original path: /native/unknown.gd",
"result": "rejected",
"series": "s1"
},
{
"class": "relocated_manifest_native_mismatch",
"error": "byte length drift: native /native/body.gd",
"result": "rejected",
"series": "s1"
},
{
"class": "relocated_byte_manifest_mismatch",
"error": "SHA drift: relocation /native/body.gd",
"result": "rejected",
"series": "s1"
},
{
"class": "JSON_only_getter_substitute",
"error": "unsupported Variant flags 8827:25959 at 0",
"result": "rejected",
"series": "s1"
},
{
"class": "forged_scalar",
"error": "SHA drift: p04-s1-native-r02/raw/writer.json",
"result": "rejected",
"series": "s1"
},
{
"class": "changed_raw_byte",
"error": "SHA drift: p04-s1-native-r02/raw/writer.json",
"result": "rejected",
"series": "s1"
},
{
"class": "formal_member_SHA_drift",
"error": "SHA drift: p04-s1-native-r02/execution.json",
"result": "rejected",
"series": "s1"
},
{
"class": "unowned_missing_PID_end",
"error": "missing PID end",
"result": "rejected",
"series": "s1"
},
{
"class": "altered_phase_pair",
"error": "SHA drift: p04-s1-native-r02/raw/reader-landing-held.var",
"result": "rejected",
"series": "s1"
},
{
"class": "relabeled_interruption_reason",
"error": "SHA drift: p04-s1-native-r02/raw/writer-landing-depleted.json",
"result": "rejected",
"series": "s1"
},
{
"class": "full_body_positive",
"result": "pass",
"series": "s2a"
},
{
"class": "wrong_source_pin",
"error": "SHA drift: native /native/body.gd",
"result": "rejected",
"series": "s2a"
},
{
"class": "signature_only_pin",
"error": "full-function-body pin mismatch",
"result": "rejected",
"series": "s2a"
},
{
"class": "symlink",
"error": "symlink: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/.series-fixtures-u1xfy7kc/symlink.gd",
"result": "rejected",
"series": "s2a"
},
{
"class": "traversal",
"error": "raw traversal",
"result": "rejected",
"series": "s2a"
},
{
"class": "unmapped_original_path",
"error": "unmapped original path: /native/unknown.gd",
"result": "rejected",
"series": "s2a"
},
{
"class": "relocated_manifest_native_mismatch",
"error": "byte length drift: native /native/body.gd",
"result": "rejected",
"series": "s2a"
},
{
"class": "relocated_byte_manifest_mismatch",
"error": "SHA drift: relocation /native/body.gd",
"result": "rejected",
"series": "s2a"
},
{
"class": "JSON_only_getter_substitute",
"error": "unsupported Variant flags 8827:25959 at 0",
"result": "rejected",
"series": "s2a"
},
{
"class": "forged_scalar",
"error": "SHA drift: p04-s2a-native-r03/raw/writer.json",
"result": "rejected",
"series": "s2a"
},
{
"class": "changed_raw_byte",
"error": "SHA drift: p04-s2a-native-r03/raw/writer.json",
"result": "rejected",
"series": "s2a"
},
{
"class": "formal_member_SHA_drift",
"error": "SHA drift: p04-s2a-native-r03/execution.json",
"result": "rejected",
"series": "s2a"
},
{
"class": "unowned_missing_PID_end",
"error": "missing PID end",
"result": "rejected",
"series": "s2a"
},
{
"class": "altered_phase_pair",
"error": "SHA drift: p04-s2a-native-r03/raw/reader-C3-recall.var",
"result": "rejected",
"series": "s2a"
},
{
"class": "relabeled_interruption_reason",
"error": "SHA drift: p04-s2a-native-r03/raw/writer-C1-midnight.json",
"result": "rejected",
"series": "s2a"
},
{
"class": "full_body_positive",
"result": "pass",
"series": "s2b"
},
{
"class": "wrong_source_pin",
"error": "SHA drift: native /native/body.gd",
"result": "rejected",
"series": "s2b"
},
{
"class": "signature_only_pin",
"error": "full-function-body pin mismatch",
"result": "rejected",
"series": "s2b"
},
{
"class": "symlink",
"error": "symlink: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/.series-fixtures-u1xfy7kc/symlink.gd",
"result": "rejected",
"series": "s2b"
},
{
"class": "traversal",
"error": "raw traversal",
"result": "rejected",
"series": "s2b"
},
{
"class": "unmapped_original_path",
"error": "unmapped original path: /native/unknown.gd",
"result": "rejected",
"series": "s2b"
},
{
"class": "relocated_manifest_native_mismatch",
"error": "byte length drift: native /native/body.gd",
"result": "rejected",
"series": "s2b"
},
{
"class": "relocated_byte_manifest_mismatch",
"error": "SHA drift: relocation /native/body.gd",
"result": "rejected",
"series": "s2b"
},
{
"class": "JSON_only_getter_substitute",
"error": "unsupported Variant flags 8827:25959 at 0",
"result": "rejected",
"series": "s2b"
},
{
"class": "forged_scalar",
"error": "SHA drift: p04-s2b-native-r02/raw/writer.json",
"result": "rejected",
"series": "s2b"
},
{
"class": "changed_raw_byte",
"error": "SHA drift: p04-s2b-native-r02/raw/writer.json",
"result": "rejected",
"series": "s2b"
},
{
"class": "formal_member_SHA_drift",
"error": "SHA drift: p04-s2b-native-r02/execution.json",
"result": "rejected",
"series": "s2b"
},
{
"class": "unowned_missing_PID_end",
"error": "missing PID end",
"result": "rejected",
"series": "s2b"
},
{
"class": "altered_phase_pair",
"error": "SHA drift: p04-s2b-native-r02/raw/reader-night_absent-1080-before-facility.var",
"result": "rejected",
"series": "s2b"
},
{
"class": "relabeled_interruption_reason",
"error": "SHA drift: p04-s2b-native-r02/raw/writer-night_absent-1081.json",
"result": "rejected",
"series": "s2b"
},
{
"class": "full_body_positive",
"result": "pass",
"series": "s3"
},
{
"class": "wrong_source_pin",
"error": "SHA drift: native /native/body.gd",
"result": "rejected",
"series": "s3"
},
{
"class": "signature_only_pin",
"error": "full-function-body pin mismatch",
"result": "rejected",
"series": "s3"
},
{
"class": "symlink",
"error": "symlink: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/.series-fixtures-u1xfy7kc/symlink.gd",
"result": "rejected",
"series": "s3"
},
{
"class": "traversal",
"error": "raw traversal",
"result": "rejected",
"series": "s3"
},
{
"class": "unmapped_original_path",
"error": "unmapped original path: /native/unknown.gd",
"result": "rejected",
"series": "s3"
},
{
"class": "relocated_manifest_native_mismatch",
"error": "byte length drift: native /native/body.gd",
"result": "rejected",
"series": "s3"
},
{
"class": "relocated_byte_manifest_mismatch",
"error": "SHA drift: relocation /native/body.gd",
"result": "rejected",
"series": "s3"
},
{
"class": "JSON_only_getter_substitute",
"error": "unsupported Variant flags 8827:25959 at 0",
"result": "rejected",
"series": "s3"
},
{
"class": "forged_scalar",
"error": "SHA drift: p04-s3-native-r01/raw/writer.json",
"result": "rejected",
"series": "s3"
},
{
"class": "changed_raw_byte",
"error": "SHA drift: p04-s3-native-r01/raw/writer.json",
"result": "rejected",
"series": "s3"
},
{
"class": "formal_member_SHA_drift",
"error": "SHA drift: p04-s3-native-r01/execution.json",
"result": "rejected",
"series": "s3"
},
{
"class": "unowned_missing_PID_end",
"error": "missing PID end",
"result": "rejected",
"series": "s3"
},
{
"class": "altered_phase_pair",
"error": "SHA drift: p04-s3-native-r01/raw/reader-B1-phase-960-TIME_BOUNDARIES.var",
"result": "rejected",
"series": "s3"
},
{
"class": "relabeled_interruption_reason",
"error": "SHA drift: p04-s3-native-r01/raw/writer-B1-after.json",
"result": "rejected",
"series": "s3"
}
],
"scope": "file-only Stage R controls; immutable descriptor and primitive negatives"
}
},
{
"name": "join",
"argv": [
"/Applications/Xcode.app/Contents/Developer/usr/bin/python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/checker_join_fixtures.py",
"--build",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build"
],
"exit_code": 0,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair47-finite-validation-r01/join.log",
"sha256": "6cc0a89527b5e8192f11c0d3d503536aab1ea03db08d2af4f440dd0da9525dc8",
"output": {
"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"
}
]
}
},
{
"name": "historical-lifecycle",
"argv": [
"/Applications/Xcode.app/Contents/Developer/usr/bin/python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/receipt_lifecycle_fixtures.py"
],
"exit_code": 0,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair47-finite-validation-r01/historical-lifecycle.log",
"sha256": "e2bc93824d2152de4aac320d5fbf0fd7497c09cb07d61c630abc299d15d785cb",
"output": {
"results": [
{
"case": "success",
"passed": true,
"native_engine_launches": 0
},
{
"case": "parse",
"passed": true,
"native_engine_launches": 0
},
{
"case": "cleanup",
"passed": true,
"native_engine_launches": 0
},
{
"case": "setup",
"passed": true,
"native_engine_launches": 0
},
{
"case": "output",
"passed": true,
"native_engine_launches": 0
},
{
"case": "identity-write",
"passed": true,
"native_engine_launches": 0
}
],
"formal_acceptance": false
}
},
{
"name": "final-admission",
"argv": [
"/Applications/Xcode.app/Contents/Developer/usr/bin/python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/admission_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/repair47-finite-validation-r02/admission"
],
"exit_code": 0,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair47-finite-validation-r02/admission.log",
"sha256": "1644a127dd89fc318e348dddc43e347b10e88e36b202328a6292b8d76ea66865",
"output": {
"passed": true,
"controls": [
{
"case": "real-329",
"result": "pass"
},
{
"case": "selected-checker-only-extra",
"result": "pass"
},
{
"case": "another-derived-roster",
"result": "pass"
},
{
"case": "missing",
"result": "rejected"
},
{
"case": "extra",
"result": "rejected"
},
{
"case": "same-count-substitution",
"result": "rejected"
},
{
"case": "duplicate",
"result": "rejected"
},
{
"case": "non-gd",
"result": "rejected"
},
{
"case": "stale-literal-count",
"result": "rejected"
},
{
"case": "checker-as-product",
"result": "rejected"
},
{
"case": "missing-product",
"result": "rejected"
},
{
"case": "extra-selected-input",
"result": "rejected"
},
{
"case": "real-check-only-shared-admission",
"result": "pass"
},
{
"case": "check-only-missing",
"result": "rejected"
},
{
"case": "check-only-extra",
"result": "rejected"
},
{
"case": "check-only-same-count-substitution",
"result": "rejected"
},
{
"case": "check-only-duplicate",
"result": "rejected"
},
{
"case": "check-only-non-gd",
"result": "rejected"
},
{
"case": "check-only-stale-literal-count",
"result": "rejected"
},
{
"case": "FreshSeries-exact-roster",
"result": "pass"
},
{
"case": "FreshSeries-actual-substitution",
"result": "rejected"
},
{
"case": "FreshSeries-plan-substitution",
"result": "rejected"
},
{
"case": "cache-exact-product-plus-checker",
"result": "pass"
},
{
"case": "cache-missing-checker",
"result": "rejected"
},
{
"case": "cache-same-count-substitution",
"result": "rejected"
},
{
"case": "historical-316-receipt",
"result": "pass"
},
{
"case": "historical-rejects-current-roster",
"result": "rejected"
},
{
"case": "pre-import-original-no-uid",
"result": "pass"
},
{
"case": "pre-import-partial-import",
"result": "rejected"
},
{
"case": "attempted-import-partial-import",
"result": "rejected"
},
{
"case": "pre-import-unknown-uid",
"result": "rejected"
},
{
"case": "attempted-import-unknown-uid",
"result": "rejected"
},
{
"case": "pre-import-changed-source",
"result": "rejected"
},
{
"case": "attempted-import-changed-source",
"result": "rejected"
}
],
"source_files": 1368,
"product_files": 1368,
"scripts": 329,
"engine_launches": 0,
"formal_acceptance": false
}
},
{
"name": "final-historical-lifecycle-retained-M",
"argv": [
"/Applications/Xcode.app/Contents/Developer/usr/bin/python3",
"-B",
"/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/receipt_lifecycle_fixtures.py"
],
"exit_code": 0,
"log": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/repair47-finite-validation-r03/historical-lifecycle.log",
"sha256": "e2bc93824d2152de4aac320d5fbf0fd7497c09cb07d61c630abc299d15d785cb",
"output": {
"results": [
{
"case": "success",
"passed": true,
"native_engine_launches": 0
},
{
"case": "parse",
"passed": true,
"native_engine_launches": 0
},
{
"case": "cleanup",
"passed": true,
"native_engine_launches": 0
},
{
"case": "setup",
"passed": true,
"native_engine_launches": 0
},
{
"case": "output",
"passed": true,
"native_engine_launches": 0
},
{
"case": "identity-write",
"passed": true,
"native_engine_launches": 0
}
],
"formal_acceptance": false
}
}
],
"compile": [
{
"path": "p04_native_series.py",
"sha256": "4d8fd60f209a6827eadfa2bf036deee8bf88aa0dbaa89f366e71b8ae46adf594",
"ast": true,
"compile": true
},
{
"path": "checker_series_fixtures.py",
"sha256": "5779b05505d6c7118f40cff3b8c309211142603d04c69183c3e68e88efaee4a9",
"ast": true,
"compile": true
},
{
"path": "s4/run_s4_native.py",
"sha256": "628a7aa8108a6b41a2ddc9139cbca21bec8723f0ce9829df67b8bb52f6a38203",
"ast": true,
"compile": true
},
{
"path": "s4/receipt_lifecycle_fixtures.py",
"sha256": "3c0331c190874ed602ef845eff62c2bf52a8178542067e5d104d3a7d8aa61b88",
"ast": true,
"compile": true
},
{
"path": "s4/admission_controls.py",
"sha256": "96b3545d741c0495eb20b2a4786c9ce67ce5721229535dc2dae3214bf27b6b76",
"ast": true,
"compile": true
}
],
"native_launches": 0,
"formal_acceptance": false,
"development_control_failures": [
{
"scratch": "repair47-admission-controls-r01",
"error": "ValueError: missing exact input: retained M tools/completion_marker_contracts.json"
},
{
"scratch": "repair47-admission-controls-r02",
"error": "ValueError: missing exact input: retained M docs/plans/original-completion-2026-10-02/execution/completion_marker_contracts.json"
},
{
"scratch": "repair47-admission-controls-r03",
"error": "AssertionError: len(plan) >= 2; synthetic owner paths outside existing UID-plan selection"
}
],
"formal_six_check_only": "not run by worker: exact clean final Q and provenance are Root responsibility; synthetic S4 main control is explicitly stubbed, not a fresh-Q plan",
"retained_M": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/build/owner-handoff/p04-after-p26-closure-r01/verified-m-engine-free-r45",
"unchanged_proof_reuse": "REPAIR47_PLAN.json: 11 program hashes and unchanged top-level series function hashes; no native evidence adoption"
}
@@ -0,0 +1,14 @@
Traceback (most recent call last):
File "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/build_p04_index.py", line 159, in <module>
main()
File "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/build_p04_index.py", line 141, in main
index = payload(args.build, gate)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/build_p04_index.py", line 37, in payload
raw = gate.combine_native_series(build, c)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/tools/check_p04_order_evidence.py", line 1150, in combine_native_series
require({k: v for k, v in recorded.items() if k != 'verifier_sha256'} == actual, 'fresh raw recomputation drift')
File "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/tools/check_p04_order_evidence.py", line 97, in require
raise ValueError(message)
ValueError: fresh raw recomputation drift
@@ -0,0 +1,53 @@
{
"S": "2cd734062a2226b5006bbecf96e6024a26982665",
"checker_sha256": "3bb0cde776bc295f6f18e74f1e23bf3d832d8e4f71aed260601c82d287c655fd",
"actual_function": "supplied_file",
"source_call_site": "build_p04_index.payload lines 50-55 calls descriptor of actual runner fixed paths then supplied_file on all those paths",
"scope": "narrow pure actual material admission only; NOT complete checker/index or engine execution",
"rows": [
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/audit-support/p04-fresh-context-r47/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/p04_s4_power_probe.gd",
"admitted": false,
"error": "unsupplied external material: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/audit-support/p04-fresh-context-r47/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/p04_s4_power_probe.gd"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/audit-support/p04-fresh-context-r47/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py",
"admitted": false,
"error": "unsupplied external material: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/audit-support/p04-fresh-context-r47/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/audit-support/p04-fresh-context-r47/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/S4_ROOT_RUN.md",
"admitted": false,
"error": "unsupplied external material: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/audit-support/p04-fresh-context-r47/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/S4_ROOT_RUN.md"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r47-2cd73406/tests/transport/test_runtime_transport.gd",
"admitted": false,
"error": "unsupplied external material: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r47-2cd73406/tests/transport/test_runtime_transport.gd"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r47-2cd73406/tests/staff/test_rescue_elevator.gd",
"admitted": false,
"error": "unsupplied external material: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r47-2cd73406/tests/staff/test_rescue_elevator.gd"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r47-2cd73406/docs/plans/original-completion-2026-10-02/execution/completion_marker_contracts.json",
"admitted": false,
"error": "unsupplied external material: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-root-q-r47-2cd73406/docs/plans/original-completion-2026-10-02/execution/completion_marker_contracts.json"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/audit-support/p04-fresh-context-r47/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py",
"admitted": false,
"error": "unsupplied external material: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/audit-support/p04-fresh-context-r47/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py"
},
{
"path": "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/audit-support/p04-fresh-context-r47/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/p04_s4_power_probe.gd",
"admitted": false,
"error": "unsupplied external material: /Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build/audit-support/p04-fresh-context-r47/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/p04_s4_power_probe.gd"
}
],
"rejected": 8,
"full184_status": "still running; retain without restarting",
"formal_acceptance": false,
"at_unix_ns": 1792318056557763000
}
@@ -0,0 +1,88 @@
{
"task_id": "P04-01",
"kind": "static inspection only; no tests executed",
"syntax": [
"build_p04_index.py",
"p04_native_series.py",
"full_suite_verifier.py",
"collect_p04_native.py",
"s5/s5_order_adapter.py",
"s5/s5_power_adapter.py",
"repair48_transport_controls.py",
"repair48_identity_controls.py"
],
"source_sha256": {
"build_p04_index.py": "35b1b35f94e64f0f8c93ad5de17b35a16c2a81ca802691ba77251ad4256ca515",
"p04_native_series.py": "c33f8abb7f4ad143f75a1b761447a84afddb2dd0ac67b782e4cf9a8a67b67e4a",
"full_suite_verifier.py": "779ab0c0b5be31dcee462f04cbd6b765d44f9bef95fb52b03d3b676ec9f80c9c",
"collect_p04_native.py": "70a12149c770ef4dca97d3d5aa0b59270cf1547efde79ee7346ba340e1bebca6",
"s5/s5_order_adapter.py": "91344410b3441049fbce316cef9c227c9355747ae56890b45fcf348dac401d7e",
"s5/s5_power_adapter.py": "41d33e8d6b4e986611bdf7a0eedbde3f0b92f724ea37d3b2502ba4965a298462",
"repair48_transport_controls.py": "b2df097bc20bde89a7a738d4c1fe855bfa0bd1ac82a12936aa2b106980685628",
"repair48_identity_controls.py": "1c4f81e13715a2ab4b73b633265d3279772a3a8a90115e78098f0ecbd895d9ef"
},
"engine_runs": 0,
"git_writes": 0,
"runner_actions": 0,
"immutable": [
{
"path": "tools/check_p04_order_evidence.py",
"sha256": "3bb0cde776bc295f6f18e74f1e23bf3d832d8e4f71aed260601c82d287c655fd",
"matches_repair47_record": true
},
{
"path": "docs/spec/acceptance/P04-01.json",
"sha256": "d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f",
"matches_repair47_record": true
},
{
"path": "docs/plans/original-completion-2026-10-02/execution/p04-01/s4/historical/run_s4_native_r28.py.reference",
"sha256": "2d3be39d2b310abac058e27336ac816c234043a0a1dd7b2c52d84994907dd31b",
"matches_repair47_record": true
}
],
"historical_failure_copies": [
{
"name": "ROOT_Q47_ACTUAL_INDEX_GENERATION.log",
"byte_identical": true,
"sha256": "0250e523aeeecde5d81d298e30cd7e4e18a5415ac4e762401697256be6d514f9"
},
{
"name": "ROOT_Q47_ACTUAL_MATERIAL_ADMISSION_FAILURE.json",
"byte_identical": true,
"sha256": "a86b93150c33620854938c040f57db49e5627171f8f0633b399c527b7c08ec55"
}
],
"status": "blocked",
"specification_version_gap": {
"contract_sha256": "9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881",
"actual_sha256": "d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f",
"specification_modified": false
},
"tests_executed": [],
"historical_test_results_reused": [],
"changed_source_files": [
"build_p04_index.py",
"p04_native_series.py",
"full_suite_verifier.py",
"collect_p04_native.py",
"s5/s5_order_adapter.py",
"s5/s5_power_adapter.py",
"repair48_transport_controls.py",
"repair48_identity_controls.py"
],
"changed_documentation": [
"REPAIR48_STATUS.md",
"REPAIR48_STATIC_INSPECTION.json",
"REPAIR48_HISTORICAL_ROOT_Q47_ACTUAL_INDEX_GENERATION.log",
"REPAIR48_HISTORICAL_ROOT_Q47_ACTUAL_MATERIAL_ADMISSION_FAILURE.json",
"ORDER_AUDIT.md",
"CURRENT_STATUS.md",
"s1/S1_ROOT_RUN.md",
"s2/S2_ROOT_RUN.md",
"s2b/S2B_ROOT_RUN.md",
"s3/S3_ROOT_RUN.md",
"s4/S4_ROOT_RUN.md",
"s5/S5_ROOT_RUN.md"
]
}
@@ -0,0 +1,160 @@
## REPAIR49 current correction
Source-ready only; original 30/88, formal 16, P04=0, no partial credit.
REPAIR48's specification-mismatch blocker below is historical and corrected:
the immutable 7000-byte original has SHA256
d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f;
removing its single EOF LF gives
9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881.
This is the existing Git/Runner strip/checker one-EOF-LF pin contract.
No specification, approval or normalization change. Older contradictory wording
below is superseded history, including blanket full-reuse prohibitions and
all-controls-unexecuted wording. Q47 admission/index failures remain failures.
See REPAIR49_STATUS.md for closure audit and verbatim complete_B FileNotFoundError.
Root handoff reports payload(B), all53, series/join/power PASS; order-typed remains
UNDETERMINED. Worker did not rerun them. Corrected complete_B remains unexecuted.
Old native/full successes confer no new-S acceptance or credit.
# REPAIR48 implementation status
BLOCKED on exact specification-version context; source changes are retained for
review. No acceptance or new credit is claimed.
Original scope remains 30/88; formal credit is 16; P04 credit is 0.
Engine runs, Git writes, Runner actions and delegation are prohibited.
The supplied task contract declares spec_sha256
`9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881`.
The actual immutable docs/spec/acceptance/P04-01.json hashes to
`d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f`.
That local hash agrees with REPAIR47_STATIC_CHECKS.json. This worker has not
changed the specification or selected a replacement authority. Root must resolve
which exact specification bytes govern the retained repair before gate use.
This is an exact-version context gap, not a proposed acceptance change.
## Current changes
`build_p04_index.py` separates exclusive generation (`relocate_materials`) from
read-only `payload`. The exact output is resolved B/p04-evidence, with no existing
output, traversal or parent symlinks. Fixed pins plus QA are checked for exact
duplicates and conflicting identities, including across series. Copies are
content-addressed under the first referencing series, created exclusively, and
rehashed. Exact (original path, bytes, SHA) identities share one copy across all
series; different original paths are never silently merged. RELOCATION.json
keeps original pin paths as keys. Raw inputs are never rewritten. Every payload
call checks map membership, declared relative form, hashes, unmapped files and
exactly one wrapper candidate. Materials and wrapper descriptors are relative;
the relocation-map SHA is included in the index. The obsolete absolute material
admission pre-check is removed. Main relocates, derives, checks refs and roles,
then writes index and the separate invocation receipt. Failure leaves a failed
output attempt without a usable index; an existing output cannot be resumed.
S5 dependency identity uses the package-relative power, series and guard module
paths. Each module is read once and those same bytes are compiled and executed,
without cached bytecode. Symlinks, outside dependencies and mismatched mappings
are rejected. The roster is checked against the modules loaded. Dependency maps
are checked against the executed roster before deriving facts. Absolute observed
paths and checkout are retained in collection/dependency-invocation.json, outside
the compared s5.json and the collection manifest's series mapping. The adapter's
own observed path and executed-byte SHA are also retained there.
## Static path audit
| Value | Result and required context |
| --- | --- |
| fixed pins and QA | Source placement is free-form. Generation reads original pinned paths; verification admits relocated relative copies under B/p04-evidence. |
| wrapper | Exactly one distinct original pin path must match wrapper_sha256; descriptor uses that relocated copy. |
| runner-input row | Absolute path is constructed from the current B and the registered series run. supplied_file admits each registered run root. No earlier Root B is embedded by the builder. |
| C references | Constructed under current B/audit-support/native-first-current, one of supplied_file's fixed roots. |
| native_bundle | Same fixed native-first-current root under the supplied B. |
| authorities | ROOT-relative source paths, resolved against the invocation's gate.ROOT. |
| native and full raw references | Relative to each retained run/B, with original provenance retained. No analysis checkout is used as a payload identity. |
| S1–S4 / verify_fresh_* | Shared implementations in p04_native_series.py; no separate checkout-keyed dependency maps. Current metadata modules are found via __file__; that path is not returned as a fresh fact. Fresh wrapper loading now executes source bytes directly. |
| S5 adapters | Checkout-keyed dependency map corrected. Raw hash keys refer to the immutable raw input, not the analysis checkout. Explicit raw root is resolved before writer/reader references are formed. |
| readers | Independent Reader data is validated from raw run-relative references and recorded original provenance. bulk_reader_equivalence.py is a fixture using explicit scratch checkouts, not a production payload producer. |
| full_suite_verifier | Explicit Q root and retained run are inputs. Its reference map uses run-relative names. Metadata module loading now executes source bytes directly. |
| scratch_fixture_adapter | Explicit scratch routing only; no production compared payload. |
Transport does not make the entire B portable by itself. FreshSeries still
requires original Q source paths/project_root, the retained stage/formal copies,
and the exact engine file for identity reads (no engine launch). full-suite
verification also reads its recorded actual Q. If a later invocation changes B,
the registry/run hierarchy and these original-source contexts must still be
supplied. Missing context is a blocker; do not rewrite raw pins or the checker
to conceal it. Static supplied_file inspection found no additional absolute
descriptor admission gap in the builder's rows above. Runtime admission has
not been claimed.
## Historical failures and successes
The Q47 material admission failure is preserved verbatim in
REPAIR48_HISTORICAL_ROOT_Q47_ACTUAL_MATERIAL_ADMISSION_FAILURE.json.
All eight recorded attempts failed with their original `unsupplied external
material: ...` messages. The index generation traceback is preserved verbatim
in REPAIR48_HISTORICAL_ROOT_Q47_ACTUAL_INDEX_GENERATION.log, ending:
```text
ValueError: fresh raw recomputation drift
```
These are failures, not passing receipts. Original raw and historical receipts
remain unchanged. Their retained source is
build/owner-handoff/p04-after-p26-closure-r01/repair48-final-index-transport.
Root actually staged the S47 context under p04-fresh-context-r47, deviating from
the fixed p04-fresh-context name in the pre-REPAIR48 S5_ROOT_RUN.md line 167.
The old direction is retained as history. Material placement is now free-form
for builder relocation; no historical receipt is renamed or adopted.
Q47 native successes and the historical full 184 result (21903 checks, zero
reported failures, 329 parse paths, 186 ended PIDs, no guard/cleanup failures)
remain historical only. They are not C and cannot be reused under the new S.
The immutable checker still binds M/S/Q_tree; no adopter is introduced.
## Verification handoff
The worker performed syntax parsing and static source/path inspection only.
Per the final worker instruction that tests are formally executed by Runner,
no pure control, check-only plan, registered checker or engine was executed.
No result is inferred from a historical test count. No unaffected pure result
is reused without a complete code/dependency SHA proof; none is claimed here.
Runner controls added:
- repair48_transport_controls.py --retained <retained repair48-final-index-transport>
checks the real immutable S47 inputs/copies, r47 context and out-of-B Q pins,
relocation repeatability, duplicate/conflict rules, material adversaries,
wrapper failures, and the actual checker's old-S/new-S binding rejection
using simulated Git observations without Git writes.
- repair48_identity_controls.py --raw <retained S5 raw> --writer-sha <pin>
--reader-sha <pin> --build <complete retained relocated B> checks independent
same-byte complete analysis directories (S5 results and builder payload),
dependency mutations and mappings, symlinks,
outside paths, two read-only payload calls and unchanged B tree, index drift,
and external absolute descriptor rejection. The optional B section must be
supplied for the complete control, not omitted as an implicit pass.
All these controls remain UNEXECUTED. Required affected existing controls and
fresh check-only S1/S2a/S2b/S3/S4/S5 plans also remain Runner work. A dirty-only
failure has not been observed and is not invented. Source-ready is not a gate
pass. Runner must verify full negative coverage, including exclusive output,
pin-SHA mismatch and ambiguous wrapper bindings, before the native lease.
## Normal-gate material roster and Root order
Supply the exact B with native-first-current, historical relocation inputs,
fresh-run registry, every fresh run's runner-input/ended/source/UID/formal/raw
and lifecycle receipts, the exact recorded Q source and engine identity context;
B/p04-evidence/runner-materials with all pin copies and RELOCATION.json;
the matching fresh collection including MANIFEST and separate dependency
invocation record; and the matching full 184 run and its binding/raw receipts.
The final index and generation-invocation receipt belong to this same attempt.
Required original authorities and sources must exist in the frozen checkout.
Root's next order is unchanged: freeze new Q; affected pure controls; clean
exact-Q check-only; capacity/PID-end checks; one heavy native lease for
S1/S2a/S2b/S3/S4 and all ten S5 cases; readers/adapters; collect 15 EV and all
subclauses; full 184 once; index generation with relocation; registered
p04-acceptance once (no duplicate Root --verify-only); separate Opus whole-unit
review; normal prepare/C/integration/final/Root DB join/ledger/main push.
Only whole-unit acceptance can grant credit.
@@ -0,0 +1,41 @@
{
"before": {
"build_p04_index.py": "35b1b35f94e64f0f8c93ad5de17b35a16c2a81ca802691ba77251ad4256ca515",
"p04_native_series.py": "c33f8abb7f4ad143f75a1b761447a84afddb2dd0ac67b782e4cf9a8a67b67e4a",
"full_suite_verifier.py": "779ab0c0b5be31dcee462f04cbd6b765d44f9bef95fb52b03d3b676ec9f80c9c",
"collect_p04_native.py": "70a12149c770ef4dca97d3d5aa0b59270cf1547efde79ee7346ba340e1bebca6",
"s5/s5_order_adapter.py": "91344410b3441049fbce316cef9c227c9355747ae56890b45fcf348dac401d7e",
"s5/s5_power_adapter.py": "41d33e8d6b4e986611bdf7a0eedbde3f0b92f724ea37d3b2502ba4965a298462",
"s5/s5_guard_oracle.py": "b58ee46f5c8a82de796bffd88ff8cab89f1f9e7e5c9417414310a1b649dc6c1c",
"s5/s5_order_adapter_controls.py": "f1f90b9847830c6505a176bf78442e619b1d297c818ec561c92c498a4db74b53",
"s5/s5_power_adapter_controls.py": "32d71db80994052b905829e6a2da38448ae789825c44570a901e67fe2d07fd33"
},
"root_expected": {
"build_p04_index.py": "35b1b35f94e64f0f8c93ad5de17b35a16c2a81ca802691ba77251ad4256ca515",
"p04_native_series.py": "c33f8abb7f4ad143f75a1b761447a84afddb2dd0ac67b782e4cf9a8a67b67e4a",
"full_suite_verifier.py": "779ab0c0b5be31dcee462f04cbd6b765d44f9bef95fb52b03d3b676ec9f80c9c",
"collect_p04_native.py": "70a12149c770ef4dca97d3d5aa0b59270cf1547efde79ee7346ba340e1bebca6",
"s5/s5_order_adapter.py": "91344410b3441049fbce316cef9c227c9355747ae56890b45fcf348dac401d7e",
"s5/s5_power_adapter.py": "41d33e8d6b4e986611bdf7a0eedbde3f0b92f724ea37d3b2502ba4965a298462",
"s5/s5_guard_oracle.py": "b58ee46f5c8a82de796bffd88ff8cab89f1f9e7e5c9417414310a1b649dc6c1c",
"s5/s5_order_adapter_controls.py": "f1f90b9847830c6505a176bf78442e619b1d297c818ec561c92c498a4db74b53",
"s5/s5_power_adapter_controls.py": "32d71db80994052b905829e6a2da38448ae789825c44570a901e67fe2d07fd33"
},
"after": {
"build_p04_index.py": "35b1b35f94e64f0f8c93ad5de17b35a16c2a81ca802691ba77251ad4256ca515",
"p04_native_series.py": "c33f8abb7f4ad143f75a1b761447a84afddb2dd0ac67b782e4cf9a8a67b67e4a",
"full_suite_verifier.py": "779ab0c0b5be31dcee462f04cbd6b765d44f9bef95fb52b03d3b676ec9f80c9c",
"collect_p04_native.py": "70a12149c770ef4dca97d3d5aa0b59270cf1547efde79ee7346ba340e1bebca6",
"s5/s5_order_adapter.py": "91344410b3441049fbce316cef9c227c9355747ae56890b45fcf348dac401d7e",
"s5/s5_power_adapter.py": "41d33e8d6b4e986611bdf7a0eedbde3f0b92f724ea37d3b2502ba4965a298462",
"s5/s5_guard_oracle.py": "b58ee46f5c8a82de796bffd88ff8cab89f1f9e7e5c9417414310a1b649dc6c1c",
"s5/s5_order_adapter_controls.py": "f1f90b9847830c6505a176bf78442e619b1d297c818ec561c92c498a4db74b53",
"s5/s5_power_adapter_controls.py": "32d71db80994052b905829e6a2da38448ae789825c44570a901e67fe2d07fd33"
},
"unchanged": true,
"parse": "pass",
"tests_run": false,
"additional_protected": {
"s5/run_s5_native.py": "28d54f061a9a07ee7ab12e043170ae43760bb686354b1c682166e82d04ec35b3"
}
}
@@ -0,0 +1,225 @@
## REPAIR49 current correction
Source-ready only; original 30/88, formal 16, P04=0, no partial credit.
REPAIR48's specification-mismatch blocker below is historical and corrected:
the immutable 7000-byte original has SHA256
d28aadb044633f7d804de5a92c8d4c4a7438dfbf44c3243dca978951f4def25f;
removing its single EOF LF gives
9ec722e7dfb0bee178d291624a026420c08412574e238bba1fde012c7a6f7881.
This is the existing Git/Runner strip/checker one-EOF-LF pin contract.
No specification, approval or normalization change. Older contradictory wording
below is superseded history, including blanket full-reuse prohibitions and
all-controls-unexecuted wording. Q47 admission/index failures remain failures.
See REPAIR49_STATUS.md for closure audit and verbatim complete_B FileNotFoundError.
Root handoff reports payload(B), all53, series/join/power PASS; order-typed remains
UNDETERMINED. Worker did not rerun them. Corrected complete_B remains unexecuted.
Old native/full successes confer no new-S acceptance or credit.
## REPAIR49 full184 conditional reuse candidate — all conditions UNVERIFIED
Native reuse is forbidden: all six series require fresh M/S/Q_tree provenance
(p04_native_series.py:1287; checker:370). Full uses the existing separate binding
(checker:1175-1186); no adopter or checker change is authorized.
The following are requirements, not results or approval:
1. New S5 source_before must equal old full selected_source_map: all 1369 keys
and SHA values, not counts alone.
2. Old project_root must remain unchanged: source-start == current source_refs
== post-verification source_refs (full_suite_verifier.py:115).
3. selected_source_map, roster184, parse329, settings, runner/marker module,
marker contract, suite-policy and UID plan/stage must all match (116-152,225).
4. inputs.engine must match current engine_pin (124-125).
5. Revalidate every phase PID, cleanup, marker and diagnostics (154-228).
6. Current s5/run_s5_native.py and full_suite_verifier.py SHA must equal the
Root rehearsal versions.
7. Never relabel old S/oldQ/project_root/PIDs/time. Describe reuse only as
revalidating the exact-source-identical old full through the existing
full_suite route; never claim full ran on new S.
8. A separate Opus whole-unit review must independently confirm applicability.
Conditions 1–6 require actual checks after final freeze. If any predicate is
unproved or differs, reject reuse and execute full184 once on the final version.
SourceRefs (tools/run_all_tests.py:40-45) excludes docs/private package, but that
fact is no substitute for complete source equality. No reuse is approved here.
# REPAIR49 source-ready status
Original 30/88, formal 16, P04=0; no partial credit or whole-unit acceptance.
Worker static audit/parse only; all new controls remain Runner work.
## Explicit closure audit
All .py files are explicitly enumerated in CLOSURE, plus the six probe .gd files
and six ROOT_RUN documents used by package-local runner material references.
The list is fixed in source; a missing member cannot vanish through globbing.
No package-local JSON is read by the identity execution path: JSON inputs are
supplied B/raw/recorded Q. These external contexts remain required, not rewritten.
The original checker is loaded from the original checkout and supplied to both builders.
- `build_p04_index.py:46`: `path = Path(__file__).with_name('p04_native_series.py')`
- `build_p04_index.py:184`: `series_spec = importlib.util.spec_from_file_location('p04_index_series', Path(__file__).with_name('p04_native_series.py'))`
- `checker_join_fixtures.py:111`: `current_wrapper = series.digest((series.HERE / 's4/run_s4_native.py').read_bytes())`
- `full_suite_verifier.py:111`: `wrapper = module('p04_full_uid', Path(__file__).parent / 's5/run_s5_native.py')`
- `normal_c_join_fixtures.py:12`: `spec = importlib.util.spec_from_file_location("normal_c_join", HERE / "normal_c_join.py")`
- `p04_native_series.py:1001`: `S4_HISTORICAL_WRAPPER = HERE / 's4/historical/run_s4_native_r28.py.reference'`
- `p04_native_series.py:1013`: `require(receipt_sha256 == digest((HERE / 's4/run_s4_native.py').read_bytes()),`
- `p04_native_series.py:1035`: `qa = HERE / 's4/p04_s4_power_probe.gd'`
- `p04_native_series.py:1332`: `wrapper_path = Path(__file__).parent / 's5/run_s5_native.py'`
- `p04_native_series.py:1340`: `admission = wrapper.module('fresh_s4_admission', HERE / 's4/run_s4_native.py')`
- `p04_native_series.py:1432`: `path = Path(__file__).parent / 's5/s5_order_adapter.py'`
- `repair48_identity_controls.py:38`: `CLOSURE = ('build_p04_index.py', 'bulk_reader_equivalence.py', 'checker_applicability_fixtures.py', 'checker_approval_fixtures.py', 'checker_candidate_fixtures.py', 'checker_encoder_fixtures.py', 'checker_join_fixtures.py', 'checker_native_fixtures.py', 'checker_negative_fixtures.py', 'checker_role_fixtures.py', 'checker_series_fixtures.py', 'collect_p04_native.py', 'full_suite_verifier.py', 'normal_c_join.py', 'normal_c_join_fixtures.py', 'p04_native_series.py', 'repair48_identity_controls.py', 'repair48_transport_controls.py', 's1/S1_ROOT_RUN.md', 's1/p04_s1_ev_power_probe.gd', 's1/run_s1_native.py', 's2/S2_ROOT_RUN.md', 's2/p04_s2a_midnight_probe.gd', 's2/run_s2a_native.py', 's2b/S2B_ROOT_RUN.md', 's2b/p04_s2b_shift_probe.gd', 's2b/run_s2b_native.py', 's3/S3_ROOT_RUN.md', 's3/p04_s3_closure_probe.gd', 's3/run_s3_native.py', 's4/S4_ROOT_RUN.md', 's4/admission_controls.py', 's4/engine_identity_negative_fixtures.py', 's4/p04_s4_power_probe.gd', 's4/phase_cut_regression.py', 's4/receipt_lifecycle_fixtures.py', 's4/run_s4_native.py', 's5/S5_ROOT_RUN.md', 's5/p04_s5_power_probe.gd', 's5/repair44_controls.py', 's5/run_s5_native.py', 's5/s5_guard_oracle.py', 's5/s5_order_adapter.py', 's5/s5_order_adapter_controls.py', 's5/s5_power_adapter.py', 's5/s5_power_adapter_controls.py', 's5/s5_uid_controls.py', 's5/s5_wrapper_fixtures.py', 'scratch_fixture_adapter.py')`
- `repair48_identity_controls.py:71`: `shutil.copyfile(HERE / relative, target)`
- `repair48_identity_controls.py:86`: `original_builder = load(HERE / 'build_p04_index.py', 'original_builder')`
- `repair48_identity_controls.py:125`: `rejects(lambda: a.module('outside_identity', HERE / 's5/s5_guard_oracle.py'))`
- `repair48_identity_controls.py:128`: `builder = load(HERE / 'build_p04_index.py', 'identity_builder')`
- `repair48_transport_controls.py:14`: `spec = importlib.util.spec_from_file_location('transport', Path(__file__).with_name('build_p04_index.py'))`
- `s1/run_s1_native.py:20`: `QA = HERE / "p04_s1_ev_power_probe.gd"`
- `s1/run_s1_native.py:61`: `shared = module("fresh_q_shared", HERE.parent / "s5/run_s5_native.py")`
- `s1/run_s1_native.py:89`: `QA, Path(__file__), HERE / "S1_ROOT_RUN.md",`
- `s1/run_s1_native.py:119`: `fixed.append(pin(HERE.parent / "s5/run_s5_native.py"))`
- `s2/run_s2a_native.py:20`: `QA = HERE / "p04_s2a_midnight_probe.gd"`
- `s2/run_s2a_native.py:33`: `]] + [HERE.parent / "s1" / n for n in ["run_s1_native.py", "p04_s1_ev_power_probe.gd", "S1_ROOT_RUN.md"]]`
- `s2/run_s2a_native.py:82`: `shared = module("fresh_q_shared", HERE.parent / "s5/run_s5_native.py")`
- `s2/run_s2a_native.py:111`: `QA, Path(__file__), HERE / "S2_ROOT_RUN.md",`
- `s2/run_s2a_native.py:141`: `fixed.append(pin(HERE.parent / "s5/run_s5_native.py"))`
- `s2b/run_s2b_native.py:20`: `QA = HERE / "p04_s2b_shift_probe.gd"`
- `s2b/run_s2b_native.py:25`: `HERE.parent / folder / name for folder, name in [`
- `s2b/run_s2b_native.py:26`: `("s1", "run_s1_native.py"), ("s1", "S1_ROOT_RUN.md"),`
- `s2b/run_s2b_native.py:28`: `("s2", "S2_ROOT_RUN.md"),`
- `s2b/run_s2b_native.py:71`: `shared = module("fresh_q_shared", HERE.parent / "s5/run_s5_native.py")`
- `s2b/run_s2b_native.py:102`: `QA, Path(__file__), HERE / "S2B_ROOT_RUN.md",`
- `s2b/run_s2b_native.py:132`: `fixed.append(pin(HERE.parent / "s5/run_s5_native.py"))`
- `s3/run_s3_native.py:20`: `QA = HERE / "p04_s3_closure_probe.gd"`
- `s3/run_s3_native.py:31`: `MATERIALS = [MANIFEST, AUDIT, HERE.parent / "s2b/run_s2b_native.py",`
- `s3/run_s3_native.py:32`: `HERE.parent / "s2b/p04_s2b_shift_probe.gd", HERE.parent / "s2b/S2B_ROOT_RUN.md"]`
- `s3/run_s3_native.py:90`: `shared = module("fresh_q_shared", HERE.parent / "s5/run_s5_native.py")`
- `s3/run_s3_native.py:121`: `QA, Path(__file__), HERE / "S3_ROOT_RUN.md",`
- `s3/run_s3_native.py:151`: `fixed.append(pin(HERE.parent / "s5/run_s5_native.py"))`
- `s4/admission_controls.py:99`: `series = s4.module('admission_series', s4.HERE.parent / 'p04_native_series.py')`
- `s4/admission_controls.py:100`: `series_tree = ast.parse((s4.HERE.parent / 'p04_native_series.py').read_text())`
- `s4/admission_controls.py:105`: `wrapper = s4.module('admission_fresh_wrapper', s4.HERE.parent / 's5/run_s5_native.py')`
- `s4/admission_controls.py:124`: `historical = s4.HERE / 'historical/run_s4_native_r28.py.reference'`
- `s4/admission_controls.py:134`: `uid_plan, snapshot, _ = s4.module('admission_uid', s4.HERE.parent / 's5/run_s5_native.py').load_uid_helper(root, r, selected)`
- `s4/engine_identity_negative_fixtures.py:12`: `spec = importlib.util.spec_from_file_location("series", HERE.parent / "p04_native_series.py")`
- `s4/engine_identity_negative_fixtures.py:15`: `spec = importlib.util.spec_from_file_location("s4", HERE / "run_s4_native.py")`
- `s4/receipt_lifecycle_fixtures.py:36`: `s4 = load('receipt_s4_historical', HERE / 'historical/run_s4_native_r28.py.reference')`
- `s4/receipt_lifecycle_fixtures.py:38`: `series = load('receipt_series', HERE.parent / 'p04_native_series.py')`
- `s4/receipt_lifecycle_fixtures.py:42`: `tree = ast.parse((HERE.parent / 'p04_native_series.py').read_text())`
- `s4/receipt_lifecycle_fixtures.py:97`: `put(staged / 'run_s4_native.py', (HERE / 'historical/run_s4_native_r28.py.reference').read_bytes())`
- `s4/receipt_lifecycle_fixtures.py:98`: `put(staged / 'S4_ROOT_RUN.md', b'synthetic fixture material\n')`
- `s4/run_s4_native.py:21`: `QA = HERE / "p04_s4_power_probe.gd"`
- `s4/run_s4_native.py:136`: `shared = module("fresh_q_shared", HERE.parent / "s5/run_s5_native.py")`
- `s4/run_s4_native.py:177`: `QA, Path(__file__), HERE / "S4_ROOT_RUN.md",`
- `s4/run_s4_native.py:214`: `fixed.append(pin(HERE.parent / "s5/run_s5_native.py"))`
- `s4/run_s4_native.py:365`: `# The shared runner log is not write-once; see S4_ROOT_RUN.md.`
- `s5/repair44_controls.py:148`: `for name in ('S5_ROOT_RUN.md', 'PENDING.md'):`
- `s5/run_s5_native.py:26`: `QA = HERE / "p04_s5_power_probe.gd"`
- `s5/run_s5_native.py:33`: `matches = re.findall(r"^const CASE_TABLE: Dictionary = (\{.*?^\})", Path(path).read_text(), re.M | re.S)`
- `s5/run_s5_native.py:45`: `CASE_TABLE = case_table(QA)`
- `s5/run_s5_native.py:77`: `if len(seeds) != 1 or sorted(json.loads(seeds[0])) != CASES or sorted(case_table(QA)) != CASES:`
- `s5/run_s5_native.py:334`: `QA, Path(__file__), HERE / "S5_ROOT_RUN.md",`
- `s5/run_s5_native.py:527`: `# The shared runner log is not write-once; see S5_ROOT_RUN.md.`
- `s5/s5_order_adapter.py:46`: `POWER_PATH = Path(__file__).with_name('s5_power_adapter.py')`
- `s5/s5_order_adapter.py:50`: `GUARD_PATH = Path(__file__).with_name('s5_guard_oracle.py')`
- `s5/s5_order_adapter_controls.py:12`: `mutation = a.module('order_typed_mutation', Path(__file__).with_name('s5_power_adapter_controls.py'))`
- `s5/s5_power_adapter_controls.py:12`: `spec = importlib.util.spec_from_file_location("s5_power_adapter", Path(__file__).with_name("s5_power_adapter.py"))`
- `s5/s5_uid_controls.py:28`: `w = module('s5_uid_wrapper', Path(__file__).with_name('run_s5_native.py'))`
- `s5/s5_wrapper_fixtures.py:13`: `path = Path(__file__).parent / "run_s5_native.py"`
- `scratch_fixture_adapter.py:43`: `source = HERE / (args.fixture + ".py")`
Explicit closure membership:
- `build_p04_index.py`
- `bulk_reader_equivalence.py`
- `checker_applicability_fixtures.py`
- `checker_approval_fixtures.py`
- `checker_candidate_fixtures.py`
- `checker_encoder_fixtures.py`
- `checker_join_fixtures.py`
- `checker_native_fixtures.py`
- `checker_negative_fixtures.py`
- `checker_role_fixtures.py`
- `checker_series_fixtures.py`
- `collect_p04_native.py`
- `full_suite_verifier.py`
- `normal_c_join.py`
- `normal_c_join_fixtures.py`
- `p04_native_series.py`
- `repair48_identity_controls.py`
- `repair48_transport_controls.py`
- `s1/S1_ROOT_RUN.md`
- `s1/p04_s1_ev_power_probe.gd`
- `s1/run_s1_native.py`
- `s2/S2_ROOT_RUN.md`
- `s2/p04_s2a_midnight_probe.gd`
- `s2/run_s2a_native.py`
- `s2b/S2B_ROOT_RUN.md`
- `s2b/p04_s2b_shift_probe.gd`
- `s2b/run_s2b_native.py`
- `s3/S3_ROOT_RUN.md`
- `s3/p04_s3_closure_probe.gd`
- `s3/run_s3_native.py`
- `s4/S4_ROOT_RUN.md`
- `s4/admission_controls.py`
- `s4/engine_identity_negative_fixtures.py`
- `s4/p04_s4_power_probe.gd`
- `s4/phase_cut_regression.py`
- `s4/receipt_lifecycle_fixtures.py`
- `s4/run_s4_native.py`
- `s5/S5_ROOT_RUN.md`
- `s5/p04_s5_power_probe.gd`
- `s5/repair44_controls.py`
- `s5/run_s5_native.py`
- `s5/s5_guard_oracle.py`
- `s5/s5_order_adapter.py`
- `s5/s5_order_adapter_controls.py`
- `s5/s5_power_adapter.py`
- `s5/s5_power_adapter_controls.py`
- `s5/s5_uid_controls.py`
- `s5/s5_wrapper_fixtures.py`
- `scratch_fixture_adapter.py`
The fixture compares complete relative-path/bytes/SHA tables and canonical table
tree hashes for original/A/B before execution and after positive identity work.
Missing, traversal, outside paths and symlinks reject. Negative mutation phase is
separate; existing byte/missing/extra/mapping/symlink/outside cases remain.
A missing S5 .gd negative is added. complete_B_controls=true requires both
placements' S5 facts and entire payload equality. No raw or compared fields are
excluded or normalized. Actual three-placement proof is UNEXECUTED by worker;
Runner must retain the emitted before/after tables.
## Root handoff
Read ROOT_REPAIR49_CURRENT_EVIDENCE_AND_INDEPENDENT_SCOPE.json directly:
payload(B), all53, series/join/power PASS per Root report, engine0, no acceptance.
order-typed is UNDETERMINED and is not pass. Transport/raw-only/synthetic and
q4801 six-series collection are historical S47 successes, not new-S evidence.
Only the observed complete_B closure failure is repaired.
## Historical complete_B failure (verbatim)
```text
Traceback (most recent call last):
File "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/repair48_identity_controls.py", line 115, in <module>
run(parser.parse_args())
File "/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement/docs/plans/original-completion-2026-10-02/execution/p04-01/repair48_identity_controls.py", line 60, in run
assert native[0].verify_fresh_s5(build) == native[1].verify_fresh_s5(build)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/41/j8fq6vqj2993cmyprl6p76pw0000gn/T/p04-r48-identity-8veppaza/first/docs/plans/original-completion-2026-10-02/execution/p04-01/p04_native_series.py", line 1430, in verify_fresh_s5
s = FreshSeries(build, 's5')
^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/41/j8fq6vqj2993cmyprl6p76pw0000gn/T/p04-r48-identity-8veppaza/first/docs/plans/original-completion-2026-10-02/execution/p04-01/p04_native_series.py", line 1338, in __init__
exec(compile(wrapper_path.read_bytes(), str(wrapper_path), 'exec'), wrapper.__dict__)
File "/private/var/folders/41/j8fq6vqj2993cmyprl6p76pw0000gn/T/p04-r48-identity-8veppaza/first/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py", line 45, in <module>
File "/private/var/folders/41/j8fq6vqj2993cmyprl6p76pw0000gn/T/p04-r48-identity-8veppaza/first/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/run_s5_native.py", line 33, in case_table
File "/opt/homebrew/Cellar/python@3.12/3.12.13_2/Frameworks/Python.framework/Versions/3.12/lib/python3.12/pathlib.py", line 1027, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.13_2/Frameworks/Python.framework/Versions/3.12/lib/python3.12/pathlib.py", line 1013, in open
return io.open(self, mode, buffering, encoding, errors, newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/41/j8fq6vqj2993cmyprl6p76pw0000gn/T/p04-r48-identity-8veppaza/first/docs/plans/original-completion-2026-10-02/execution/p04-01/s5/p04_s5_power_probe.gd'
```
@@ -0,0 +1,68 @@
# REPAIR50 source-ready handoff
Scope: control classification/memo, tree() read method only, stream equivalence
control and documentation. No Git write, engine, Runner, integration or formal
test was performed. Three changed/new Python sources passed AST parsing.
## Root-only execution and estimation
From this package directory, run the following pure controls once and retain
their separate JSON output and external elapsed/RSS measurements:
```
python3 s5/s5_order_adapter_controls.py --pure-only
python3 repair50_stream_controls.py
```
The first emits separate negative counts/lists, identity positive counts/lists,
no-genuine-order lists, memo hit/miss, parser-rejection list and elapsed per
guard. The second compares the complete whole-read and streamed SHA maps and
key insertion order for empty, Unicode name/content, binary, sparse, chunk
boundary -1/exact/+1, multiple chunks and nested files. It uses temporary
synthetic files only and creates no native acceptance evidence.
Before heavy typed controls, parse each actual retained guard record with:
```
python3 s5/s5_order_adapter_controls.py --estimate-record /absolute/path/to/guard.var
```
This performs no derivation or verify: output includes record byte size,
AFTER node count, kind histogram, replacement count and replacement count x2
(including identities, never reported as negatives). Guard mutation disk
estimate is zero; stream control logical fixture size is about 10 MiB, with
the sparse part filesystem-dependent. Memory scales with retained parsed
representatives (at most one per mutated kind, plus first/last), record bytes,
parser overhead and output labels. Memo holds one pair of expected/result raw
bytes for unchanged inputs; it never caches AFTER or recorded EXPECTED.
Time scales with mutation count x record bytes: parse/verify still examine
whole records. Use the synthetic run's external peak RSS and elapsed, together
with its emitted counts/bytes, as an initial calibration; real record shape
and source-derivation costs make this an estimate, not an ETA or resource cap.
Actual guard bytes/counts and calibrated measurements are Root-pending.
## complete_B scope reuse remains conditional
The supplied commander handoff reports R49 session56645 exit 0, 49-file map,
S5 facts/payload equality, no B changes, log SHA prefix bdef6715 and closure
tree prefix b54a35ed. This worker has not independently verified that run.
Root must mechanically compare its saved full raw map with the new tree and
record only the authorized control/tree-read/new-control/document changes.
Inspect import/exec and input closure for builder, collector, native-series,
reader, oracle, wrapper, probe and helper; preserve S47 raw, 21pin, legacy5,
full184 originals, oldQ source/engine SHA and public run_all_tests.py SHA.
Important: repair48_identity_controls.CLOSURE explicitly lists the changed
order control, identity control and S5_ROOT_RUN.md as snapshot material.
The roster is unchanged. Direct searches in builder/native-series/order
adapter did not reference these names, but this is not a complete graph proof
and does not establish reuse. Root must distinguish the actual two-directory
analysis/payload execution/input closure from this snapshot roster and apply
all commander conditions. If any condition fails, rerun complete_B once.
No R49 closure bytes or raw evidence were rewritten to obtain reuse.
Then preserve the recorded Root order: pure controls → clean exact-Q check-only
→ capacity/PID confirmation → fresh native6 → reader/collector → all eight
full exact-source reuse conditions (failure means one full run) → index → one
registered p04-acceptance validation → independent whole-unit review → normal
gates/RootDB join/ledger/main push. Only whole-unit acceptance awards credit.
@@ -0,0 +1,19 @@
# REPAIR51 pre-submit worker handoff
code_ready: documentation-only batch prepared for submission. This file records worker-time static results only; it does not establish post-submit admission.
Changed: order-audit.json, CURRENT_STATUS.md, ORDER_AUDIT.md, this handoff and REPAIR51_APPLICABILITY_MAP.json. Checker, all executables, product/config/spec/values/engine/oracle, fixtures, approvals and historical REPAIR*_STATUS bodies remain byte-identical. Git writes 0; Runner 0; engine 0; delegation 0.
ACTUAL S50 native6/24 phases PASS and collector 15+EV missing 0 remain historical, bound to S50/Q50. ACTUAL S47 full184 retains its original label. No run is relabelled S51. S51 native admission pending AT HANDOFF; Root must freeze Q51 and run fresh native6 because checker:368-371 binds S/Q. Full184, order CLI and complete_B reuse require the map predicates; Root checks actual hashes.
Post-submit state is decided only by Root version-pinned receipts under build/audit-support/p04-root-acceptance-<S>/ and build/p04-evidence/index.json. S50 receipt location: build/audit-support/p04-root-acceptance-a9ef681f/. A worker NOT RUN statement is never a reason to rebuild. No future submitted SHA, Q51 or new receipt is claimed.
All six D05 approvals remain valid; pending D05 empty. Same-tick ACTIVE onset gives RELATED (S5B native proof). Power-first then dependency closure gives NO_POWER by static source observation only; sequential interpretation remains EXPLICITLY UNRESOLVED/UNPROVEN, neither defect nor cure nor proof. Original approval remains unchanged. P04 safety holds through :569 regardless of label. A later product change needs a separate owner-authorised task.
Static checks: JSON parsing, current-table stale-anchor search, empty pending D05, five-path scope check and immutable SHA comparisons. These are worker static checks, not Runner acceptance tests. See applicability map for unchanged SHA256 and source-consumer grep evidence.
Root order: fix Q51; compare map/stop reuse on executable difference; clean exact-Q check-only; capacity/PID check; one native6 heavy lease; readers/adapters then collector; full184 reuse check; order CLI/complete_B conditional reuse or one rerun; index; one p04-acceptance validate; separate Opus whole-unit review; prepare/exactC/integration/final/RootDB join/ledger/main push. NativeWindows individually pending.
Original 30/88, formal 16 and P04 credit 0 unchanged; unit incomplete; formal_acceptance false.
Worker static verification results: 594 JSON files parsed with zero errors; all 3,096 immutable-file SHA256 values matched; exactly the five declared doc-scope non-executables changed; six D05 IDs approved and pending D05 empty; no listed stale anchors in current phase_order/safety_cases. No formal tests were run. code_ready handoff.
@@ -29,9 +29,155 @@ def descriptor(path):
return {'path': str(path.absolute()), 'bytes': len(data), 'sha256': hashlib.sha256(data).hexdigest()}
def require(value, message):
if not value:
raise ValueError(message)
def ordinary(path):
path = Path(path)
require('..' not in path.parts, 'parent traversal')
require(not any(p.is_symlink() for p in (path, *path.parents)), 'symlink path')
return path
def series_inputs(build):
registry = json.loads(ordinary(build / 'audit-support/p04-fresh-runs.json').read_bytes())
path = Path(__file__).with_name('p04_native_series.py')
spec = importlib.util.spec_from_file_location('transport_series', path)
module = importlib.util.module_from_spec(spec)
exec(compile(path.read_bytes(), str(path), 'exec'), module.__dict__)
require(set(registry['series']) == set(module.FRESH_RUNS), 'fresh series roster')
result = {}
for name in module.FRESH_RUNS:
run = Path(registry['series'][name]['run'])
require(not run.is_absolute() and '..' not in run.parts, 'fresh run path')
result[name] = json.loads(ordinary(build / run / 'runner-input.json').read_bytes())
return result
def pin_roster(inputs):
result = {}
for pin in inputs['fixed_input_pins'] + [inputs['QA']]:
path = pin['path']
ordinary(path)
require(Path(path).is_absolute(), 'pin source must be absolute')
require(type(pin['bytes']) is int and pin['bytes'] >= 0, 'pin bytes')
digest = pin['sha256']
require(isinstance(digest, str) and len(digest) == 64
and all(c in '0123456789abcdef' for c in digest), 'pin SHA')
identity = {'bytes': pin['bytes'], 'sha256': digest}
require(path not in result or result[path] == identity, 'conflicting duplicate pin')
result[path] = identity
return result
def relative_material(series, original, pin):
return f"runner-materials/{series}/{pin['sha256']}/{Path(original).name}"
def all_rosters(inputs):
rosters, seen = {}, {}
for name, raw in inputs.items():
rosters[name] = pin_roster(raw)
for original, pin in rosters[name].items():
require(original not in seen or seen[original] == pin, 'conflicting duplicate pin across series')
seen[original] = pin
return rosters
def material_layout(inputs):
rosters = all_rosters(inputs)
layout, seen, destinations = {}, {}, {}
for name, roster in rosters.items():
layout[name] = {}
for original, pin in roster.items():
identity = (original, pin['bytes'], pin['sha256'])
relative = seen.setdefault(identity, relative_material(name, original, pin))
require(relative not in destinations or destinations[relative] == identity,
'distinct pins collide at material destination')
destinations[relative] = identity
layout[name][original] = relative
return rosters, layout
def checked_material(path, pin):
data = ordinary(path).read_bytes()
require(len(data) == pin['bytes'] and hashlib.sha256(data).hexdigest() == pin['sha256'],
'material pin mismatch')
return data
def relocate_materials(build, output):
build = ordinary(Path(build).absolute()).resolve(strict=True)
output = ordinary(Path(output).absolute())
require(output == build / 'p04-evidence', 'output must be B/p04-evidence')
output.mkdir()
mapping = {}
inputs = series_inputs(build)
rosters, layout = material_layout(inputs)
written = set()
for name, roster in rosters.items():
mapping[name] = {}
for original, pin in roster.items():
relative = layout[name][original]
target = output / relative
if relative not in written:
data = checked_material(original, pin)
target.parent.mkdir(parents=True, exist_ok=True)
with target.open('xb') as stream:
stream.write(data)
written.add(relative)
checked_material(target, pin)
mapping[name][original] = {'relative': relative, **pin}
with (output / 'runner-materials/RELOCATION.json').open('x') as stream:
json.dump(mapping, stream, sort_keys=True, indent=2)
stream.write('\n')
return mapping
def relocated_materials(build):
output = ordinary(build / 'p04-evidence')
map_path = ordinary(output / 'runner-materials/RELOCATION.json')
def unique(pairs):
result = {}
for key, value in pairs:
require(key not in result, 'duplicate relocation key')
result[key] = value
return result
mapping = json.loads(map_path.read_bytes(), object_pairs_hook=unique)
inputs = series_inputs(build)
rosters, layout = material_layout(inputs)
require(set(mapping) == set(inputs), 'relocation series roster')
descriptors = {}
expected_files = {'runner-materials/RELOCATION.json'}
for name, raw in inputs.items():
roster = rosters[name]
require(set(mapping[name]) == set(roster), 'relocation material roster')
descriptors[name] = {}
for original, pin in roster.items():
relative = layout[name][original]
require(mapping[name][original] == {'relative': relative, **pin}, 'relocation mapping mismatch')
checked_material(output / relative, pin)
expected_files.add(relative)
descriptors[name][original] = {'path': relative, **pin}
wrappers = [path for path, pin in roster.items() if pin['sha256'] == raw['wrapper_sha256']]
require(len(wrappers) == 1, 'exactly one wrapper pin required')
actual_files = set()
for path in (output / 'runner-materials').rglob('*'):
ordinary(path)
if path.is_file():
actual_files.add(path.relative_to(output).as_posix())
require(actual_files == expected_files, 'unmapped material')
return inputs, descriptors, {'path': 'runner-materials/RELOCATION.json',
'bytes': map_path.stat().st_size,
'sha256': hashlib.sha256(map_path.read_bytes()).hexdigest()}
def payload(build, gate=None):
gate = gate or checker()
build = Path(build).resolve(strict=True)
build = ordinary(Path(build).absolute()).resolve(strict=True)
inputs_by_series, materials_by_series, relocation_descriptor = relocated_materials(build)
native = build / 'audit-support/native-first-current'
c = gate.verify_native(native)
raw = gate.combine_native_series(build, c)
@@ -48,16 +194,12 @@ def payload(build, gate=None):
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']]:
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']))
require(inputs == inputs_by_series[name], 'runner input changed during payload')
row['materials'] = materials_by_series[name]
wrappers = [p for p in row['materials']
if row['materials'][p]['sha256'] == inputs['wrapper_sha256']]
require(len(wrappers) == 1, 'exactly one wrapper pin required')
row['wrapper'] = row['materials'][wrappers[0]]
runners.append(row)
# C references retain every lifecycle, raw phase, source, environment and
# formal member mapping; Stage R retains its complete original->relocated map.
@@ -102,7 +244,8 @@ def payload(build, gate=None):
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, tested)
index = {'schema_version': 2, 'task_id': 'P04-01', 'formal_acceptance': False,
index = {'runner_material_relocation': relocation_descriptor,
'schema_version': 2, 'task_id': 'P04-01', 'formal_acceptance': False,
'versions': {'registered': gate.REGISTERED_COMMIT, 'execution_origin': gate.EXECUTION_ORIGIN,
'tested': tested},
'product_binding': {'tested_product': tested, 'runner_inputs': runners},
@@ -127,17 +270,16 @@ def payload(build, gate=None):
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--build', required=True, type=Path)
parser.add_argument('--output', required=True, type=Path, help='fresh directory; exclusive creation')
parser.add_argument('--output', type=Path, help='exact B/p04-evidence; exclusive creation')
parser.add_argument('--invocation', required=True, choices=('validate', 'prepare-integration', 'final'))
parser.add_argument('--registered-ref', required=True)
parser.add_argument('--tested-ref', required=True)
args = parser.parse_args()
gate = checker()
os.environ['BUILD_OUTPUT_DIR'] = str(args.build.resolve(strict=True))
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')
output = args.output or Path(os.environ.get('P04_EVIDENCE_DIR', str(args.build.resolve() / 'p04-evidence')))
output = output.absolute()
relocate_materials(args.build, output)
index = payload(args.build, gate)
gate.require(args.registered_ref == gate.REGISTERED_COMMIT and
args.tested_ref == index['versions']['tested'],
@@ -147,11 +289,15 @@ def main():
# The historical invocation is separate from the reusable evidence index.
receipt = {'invocation': args.invocation, 'actual_head': role['actual_head'],
'actual_tree': role['actual_tree'], 'role': role['role'], 'formal_acceptance': False}
output.mkdir(parents=False)
for name, value in (('index.json', index), ('generation-invocation.json', receipt)):
with (output / name).open('x', encoding='utf-8') as stream:
json.dump(value, stream, ensure_ascii=False, sort_keys=True, indent=2)
stream.write('\n')
try:
for name, value in (('index.json', index), ('generation-invocation.json', receipt)):
with (output / name).open('x', encoding='utf-8') as stream:
json.dump(value, stream, ensure_ascii=False, sort_keys=True, indent=2)
stream.write('\n')
except BaseException:
# The exclusively created directory is a failed attempt, never evidence.
(output / 'index.json').unlink(missing_ok=True)
raise
print(json.dumps({'evidence_directory': str(output), **receipt}))
@@ -31,14 +31,14 @@ def run(build):
else:
raise AssertionError('negative accepted: ' + series + '/' + name)
with tempfile.TemporaryDirectory(prefix='.series-fixtures-', dir=s.HERE) as tmp:
with tempfile.TemporaryDirectory(prefix='.series-fixtures-', dir=build) as tmp:
base = Path(tmp)
data = b'func boundary():\n\treturn 42\n# included trailing comment\n'
path = base / 'body.gd'
path.write_bytes(data)
pin = {'sha256': s.digest(data), 'bytes': len(data)}
# A deliberately small resolver fixture bypasses the production-only
# fixed 1721-file constructor, but exercises its exact read path.
# historical pinned relocation constructor, but exercises its exact read path.
resolver = s.Resolver.__new__(s.Resolver)
resolver.base, resolver.used = base, {}
resolver.mapping = {'/native/body.gd': dict(pin, relocated=str(path))}
@@ -45,6 +45,9 @@ def collect(build, fresh=None):
'collector_sha256': series.digest(Path(__file__).read_bytes()),
'historical_merged': False, 'large_payloads_copied': 0}
payloads['MANIFEST.json'] = encoded(manifest)
if fresh:
# This is an invocation/transport record, never compared as S5 facts.
payloads['dependency-invocation.json'] = encoded(series.S5_DEPENDENCY_INVOCATION)
estimate = sum(len(v) for v in payloads.values())
# The estimate precedes all writes. Reserve extra directory/allocation space.
print(json.dumps({'estimated_payload_bytes': estimate, 'files': len(payloads),
@@ -12,9 +12,13 @@ def require(value, message):
def module(name, path):
path = Path(path).absolute()
require('..' not in path.parts and all(not p.is_symlink() for p in (path, *path.parents)),
'module ordinary path')
data = path.read_bytes()
spec = importlib.util.spec_from_file_location(name, path)
result = importlib.util.module_from_spec(spec)
spec.loader.exec_module(result)
exec(compile(data, str(path), 'exec'), result.__dict__)
return result
@@ -1,8 +1,8 @@
{
"revision": "repair30",
"status": "BLOCKED: partial implementation; no native admission",
"revision": "REPAIR51 pre-submit documentation handoff",
"status": "ACTUAL S50 historical evidence complete; S51 docs-only resubmission; S51 native admission pending at worker handoff (fresh native on Q51 required by S-binding, checker:368-371); post-submit admission determined only by Root version-pinned receipts; formal_acceptance false; P04=0",
"task_id": "P04-01",
"current_table": true,
"current_table": "M c0ea009; current source facts, policy approvals and ACTUAL S50 historical evidence; S51 admission pending AT HANDOFF",
"scope": {
"conditions": 15,
"additional_EV_obligation": true,
@@ -16,12 +16,13 @@
"deliveries": 88,
"original_credit": "16/88 formal; P04 receives zero credit",
"CurrentAlphaScope": "unchanged",
"frozen_main": "c0ea009b28a7649aca6a433a1a24dc0be5e7ab81"
"frozen_main": "c0ea009b28a7649aca6a433a1a24dc0be5e7ab81",
"summary": "Documentation-only REPAIR51 within existing P04-01/W; original 30/88, formal 16, P04=0; unit incomplete."
},
"domains": [
{
"domain": "閉店",
"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.",
"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. PAUSE-REASON scope: same-tick onset from ACTIVE only is natively proven; sequential power-first scope explicitly unresolved/unproven.",
"current_source": [
{
"path": "autoload/simulation_runtime.gd",
@@ -53,10 +54,10 @@
"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 policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"status": "approved policy",
"observation_status": "M source observations; ACTUAL S50 historical evidence; S51 admission pending AT HANDOFF",
"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",
"evidence": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"nativeWindows": "pending"
},
{
@@ -86,11 +87,11 @@
"pending_D05": [],
"phase": "MANA → FACILITY_COMPLETION",
"relative_priority": "Projection before completion; RELATED chosen before NO_POWER.",
"status": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"status": "approved policy",
"observation_status": "M source observations; ACTUAL S50 historical evidence; S51 admission pending AT HANDOFF",
"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",
"evidence": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"nativeWindows": "pending"
},
{
@@ -132,10 +133,10 @@
"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": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"status": "approved policy",
"observation_status": "M source observations; ACTUAL S50 historical evidence; S51 admission pending AT HANDOFF",
"historical_evidence": "R/s3.json B4a/B4b",
"evidence": "Fresh exact-Q native proof pending; no old raw reused as Q",
"evidence": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"nativeWindows": "pending"
},
{
@@ -165,10 +166,10 @@
"pending_D05": [],
"phase": "APPLY_COMMANDS vs AI_DECISIONS",
"relative_priority": "Command exit before completion/charging; AI PLANNED_EXIT after them; despawn later.",
"status": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"status": "approved policy",
"observation_status": "M source observations; ACTUAL S50 historical evidence; S51 admission pending AT HANDOFF",
"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",
"evidence": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"nativeWindows": "pending"
},
{
@@ -213,10 +214,10 @@
"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": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"status": "approved policy",
"observation_status": "M source observations; ACTUAL S50 historical evidence; S51 admission pending AT HANDOFF",
"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",
"evidence": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"nativeWindows": "pending"
},
{
@@ -246,10 +247,10 @@
"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 policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"status": "approved policy",
"observation_status": "M source observations; ACTUAL S50 historical evidence; S51 admission pending AT HANDOFF",
"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",
"evidence": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"nativeWindows": "pending"
},
{
@@ -295,10 +296,10 @@
"pending_D05": [],
"phase": "pre-TIME_BOUNDARIES signals → TIME_BOUNDARIES → FACILITY_COMPLETION",
"relative_priority": "Midnight signals, then upkeep/close, then completion.",
"status": "approved policy; fresh Q evidence pending",
"observation_status": "historical observations; current M source inspected",
"status": "approved policy",
"observation_status": "M source observations; ACTUAL S50 historical evidence; S51 admission pending AT HANDOFF",
"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",
"evidence": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"nativeWindows": "pending"
}
],
@@ -314,16 +315,22 @@
"REPAIR21_STATUS.md",
"REPAIR22–28 creation-time status and runbooks"
],
"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.",
"history_policy": "Raw and historical material retain original S50/S47/r22 labels. Canonical top sections describe handoff only; Root version-pinned receipts decide post-submit state.",
"evidence_policy": {
"S50_actual": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"S47_full184": "ACTUAL S47 full184 historical; reusable only if checker:1185-1186 full source_sha256 equals new S5 source_before and product, checker and every doc-scope executable are byte-identical; all full verifier input/environment predicates must hold.",
"r22_historical": "r22 and earlier raw retain historical labels and bindings; no new-S native admission."
},
"pending": [
"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"
"Root fixes Q51; compare actual hashes with REPAIR51_APPLICABILITY_MAP.json; stop reuse on executable differences",
"clean exact-Q check-only; capacity and PID check; one heavy lease for fresh native6 on Q51",
"reader/adapters then collector; full184 conditional reuse check; order CLI/complete_B conditional reuse or rerun once",
"index regeneration; one p04-acceptance validate; separate Opus whole-unit independent review",
"prepare / exactC / integration / final / RootDB join / ledger / main push",
"nativeWindows individually pending"
],
"priority_candidates_if_required": "D05_REMAINING_ORDER_CANDIDATE.json (superseded history)",
"collection_plan": "REPAIR30_STATUS.md",
"collection_plan": "REPAIR51_STATUS.md; Root-only post-submit order",
"formal_acceptance": false,
"original_unit_complete": false,
"phase_order": [
@@ -336,10 +343,11 @@
"phase": "APPLY_COMMANDS",
"handler_id": "simulation_runtime.commands",
"function": "_process_tick_commands",
"registration_line": 369
"registration_line": 375
}
],
"behavior": "Previous minute: commands → _process_tick_commands:5743. Operations gate requests current tick abort and returns before Clock changes; otherwise commands apply for minute+1."
"behavior": "Previous minute: commands → _process_tick_commands:5765. Operations gate requests current tick abort and returns before Clock changes; otherwise commands apply for minute+1.",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
},
{
"priority": 2,
@@ -350,22 +358,23 @@
"phase": "TIME_BOUNDARIES",
"handler_id": "simulation_runtime.0_weather",
"function": "_advance_weather",
"registration_line": 366
"registration_line": 372
},
{
"phase": "TIME_BOUNDARIES",
"handler_id": "simulation_runtime.a_upkeep",
"function": "_advance_facility_upkeep",
"registration_line": 368
"registration_line": 374
},
{
"phase": "TIME_BOUNDARIES",
"handler_id": "simulation_runtime.operations",
"function": "_advance_operations_time",
"registration_line": 1766
"registration_line": 1787
}
],
"behavior": "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)."
"behavior": "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:1876; operations:1919 → coordinator _process_minute_boundaries:882: 00:00 upkeep, daily close, 06:00 morning, demand, arrivals (conditional boundaries and early returns).",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
},
{
"priority": 3,
@@ -376,10 +385,11 @@
"phase": "MANA",
"handler_id": "simulation_runtime.mana",
"function": "_advance_mana",
"registration_line": 379
"registration_line": 385
}
],
"behavior": "Runtime _advance_mana:10694: proxy preflight → mana_network advance → mana_power_projection.apply → MANA_STATE_CHANGED events."
"behavior": "Runtime _advance_mana:10716: proxy preflight → mana_network advance → mana_power_projection.apply → MANA_STATE_CHANGED events.",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
},
{
"priority": 4,
@@ -390,10 +400,11 @@
"phase": "CONSTRUCTION",
"handler_id": "simulation_runtime.construction",
"function": "_advance_construction",
"registration_line": 384
"registration_line": 390
}
],
"behavior": "Construction:8064 follows power and precedes logistics."
"behavior": "Construction:8086 follows power and precedes logistics.",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
},
{
"priority": 5,
@@ -404,10 +415,11 @@
"phase": "LOGISTICS",
"handler_id": "simulation_runtime.logistics",
"function": "_advance_inventory_and_logistics",
"registration_line": 389
"registration_line": 395
}
],
"behavior": "Logistics:8472 precedes completion."
"behavior": "Logistics:8494 precedes completion.",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
},
{
"priority": 6,
@@ -418,10 +430,11 @@
"phase": "FACILITY_COMPLETION",
"handler_id": "simulation_runtime.facilities",
"function": "_advance_facilities",
"registration_line": 394
"registration_line": 400
}
],
"behavior": "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)."
"behavior": "Runtime _advance_facilities:8504: 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:11817 → _apply_service_transaction:11833 posts SERVICE_SALE / SERVICE_CASH_SWEEP at the post-increment minute (:11826–11838 [unverified-M-line]).",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
},
{
"priority": 7,
@@ -432,10 +445,11 @@
"phase": "VITALS_AND_ENVIRONMENT",
"handler_id": "simulation_runtime.guest_vitals",
"function": "_advance_guest_vitals",
"registration_line": 399
"registration_line": 405
}
],
"behavior": "Guest vitals:8488 follows completion."
"behavior": "Guest vitals:8510 follows completion.",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
},
{
"priority": 8,
@@ -446,22 +460,23 @@
"phase": "INCIDENTS_AND_EVENTS",
"handler_id": "simulation_runtime.authority_incidents",
"function": "_advance_authority_incidents",
"registration_line": 409
"registration_line": 415
},
{
"phase": "INCIDENTS_AND_EVENTS",
"handler_id": "simulation_runtime.defense",
"function": "_advance_defense",
"registration_line": 414
"registration_line": 420
},
{
"phase": "INCIDENTS_AND_EVENTS",
"handler_id": "simulation_runtime.relationship_events",
"function": "_advance_relationship_events",
"registration_line": 419
"registration_line": 425
}
],
"behavior": "String-sorted authority_incidents:8551 → defense:8577 → relationship_events:8615; after completion/charging."
"behavior": "String-sorted authority_incidents:8573 → defense:8599 → relationship_events:8637; after completion/charging.",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
},
{
"priority": 9,
@@ -472,10 +487,11 @@
"phase": "FACILITY_QUEUES",
"handler_id": "simulation_runtime.guest_queues",
"function": "_advance_guest_queues",
"registration_line": 404
"registration_line": 410
}
],
"behavior": "_advance_guest_queues:8502 releases closed queues first (_release_closed_business_queues:12624); closed queues spend no patience (:8516–8517)."
"behavior": "_advance_guest_queues:8524 releases closed queues first (_release_closed_business_queues:12672); closed queues spend no patience (:8516–8517 [unverified-M-line]).",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
},
{
"priority": 10,
@@ -486,10 +502,11 @@
"phase": "AI_DECISIONS",
"handler_id": "simulation_runtime.staff_ai",
"function": "_advance_staff_ai",
"registration_line": 424
"registration_line": 430
}
],
"behavior": "_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)."
"behavior": "_advance_staff_ai:8680: 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:8760. DECIDING PLANNED_EXIT → LEAVING; despawn occurs only on later minute (:8760–8762 [unverified-M-line]).",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
},
{
"priority": 11,
@@ -500,16 +517,17 @@
"phase": "PUBLISH_SNAPSHOT",
"handler_id": "simulation_runtime.snapshot",
"function": "_publish_snapshot",
"registration_line": 374
"registration_line": 380
},
{
"phase": "PUBLISH_SNAPSHOT",
"handler_id": "simulation_runtime.zz_save_checkpoints",
"function": "_process_save_checkpoints",
"registration_line": 431
"registration_line": 437
}
],
"behavior": "snapshot:12476 then zz_save_checkpoints:4514; persistence follows publication."
"behavior": "snapshot:12524 then zz_save_checkpoints:4535; persistence follows publication.",
"line_authority": "M c0ea009 actual Git source; main handler registration 371-438; operations registration 1787-1791. Explicitly marked ranges remain unverified-M-line."
}
],
"safety_cases": [
@@ -519,8 +537,9 @@
"phase": "FACILITY_COMPLETION",
"source": "FacilityService _prepare_service_for_tick:853, ACTIVE-only gate:569, _complete_service:895",
"priority": "Preparation before advance/completion/payment",
"proof": "R/s4.json isolated power; I C and R/s2a.json dependency hold",
"approval": "Dependency hold approved; both D05(a) options preserve safety"
"proof": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"approval": "All six D05 policies approved; pause_reason_scope preserves unresolved sequential interpretation.",
"approval_scope": "See authority_statuses.pause_reason_scope; no sequential display-rule interpretation is claimed."
},
{
"item": "Double-settlement idempotency",
@@ -528,15 +547,17 @@
"phase": "TIME_BOUNDARIES",
"source": "coordinator _process_daily_close:1125; _day_summaries replay:1127–1130; daily-close:N:1137",
"priority": "Before facility completion",
"proof": "I C; R/s2a.json same-boundary replay and separate-PID restore, unchanged accounting"
"proof": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"approval_scope": "See authority_statuses.pause_reason_scope; no sequential display-rule interpretation is claimed."
},
{
"item": "Orphan reservation release",
"status": "original",
"phase": "APPLY_COMMANDS / FACILITY_QUEUES",
"source": "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",
"source": "Runtime _execute_leave_facility_queue:7575 (release keys:7565–7569 [unverified-M-line]); _leave_guest_queue_boundary:9200; _release_closed_business_queues:12672; _release_closed_business_request:12690",
"priority": "Command release before completion; closed-queue release afterward; closed patience not spent",
"proof": "R/s3.json B2a/B2b/B3/B4b; I C; R/s2a.json reservation/service identity and restore"
"proof": "ACTUAL S50 native6/24 phases PASS, collector 15+EV missing 0 (historical, bound to S50/Q50); S51 requires fresh native6 (checker:368-371); nativeWindows pending",
"approval_scope": "See authority_statuses.pause_reason_scope; no sequential display-rule interpretation is claimed."
}
],
"proof_legend": {
@@ -554,15 +575,22 @@
"A01 midnight ownership upkeep",
"D05-P04-DEPENDENCY",
"D05-P04-SHIFT-1800",
"D-034 direct business closure"
"D-034 direct business closure",
"D05-P04-DESTRUCTION",
"D05-P04-MIDNIGHT-DAY",
"D05-P04-PAUSE-REASON",
"D05-P04-EXIT"
],
"pending D05": [
"a power vs closure/dependency",
"b destruction",
"c exit",
"d cost time/day beyond A01 and18:00"
],
"observed-current": "All phase and source behavior observations; not approval"
"pending D05": [],
"observed-current": "All phase and source behavior observations; not approval",
"pause_reason_scope": {
"authority": "D05_REMAINING_APPROVAL.json:30-33 unchanged; all six approvals remain valid",
"proven": "Same-tick onset from ACTIVE gives RELATED; natively proven only by S5B.",
"sequential": "Power loss first, then dependency closure: M facility_service.gd:860-864 shows NO_POWER. Static observation only; never executed natively. EXPLICITLY UNRESOLVED/UNPROVEN under the original approval text. Not a defect, not cured, not proven, and not silently narrowed into an approved meaning.",
"dependency_first": "Dependency closure first returns at :864 and retains RELATED.",
"safety": "M facility_service.gd:569 ACTIVE gate stops progress and charging and holds reservations in every order; no stopped charging, no double settlement and no orphan reservations do not depend on the label.",
"next_action": "No product change needed for P04 acceptance. Any later change at :860-864 is outside allowed_paths and needs a separate owner-authorised task. Do not amend the contract or ask the owner."
}
},
"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",
@@ -70,7 +70,7 @@ class Series:
('runner-input.json', 'raw-inventory.json', 'execution.json'), NATIVE_PINS[name])]
self.inputs, self.inventory, self.execution = inputs, inventory, execution
source = loads(self.read('source_before.json', {'sha256': self.resolver.manifest['source_before_sha'][self.run]}))
require(source == inputs['source_before'] == self.resolver.manifest['product_source'] and len(source) == 1338,
require(source == inputs['source_before'] == self.resolver.manifest['product_source'],
'source_before product set mismatch')
selected = {k: v['sha256'] for k, v in source.items()}
require(inputs['QA_overrides'] == ['tests/s3/test_runtime_staff_assignment.gd'], 'QA override membership')
@@ -184,7 +184,7 @@ class Series:
def result(self, conditions, facts=None):
return {'series': self.name, 'verified_conditions': sorted(conditions), 'facts': facts or {},
'product_content': PRODUCT, 'relocation_manifest_sha256': MANIFEST_SHA256,
'source_files': 1338, 'owned_pids': self.pids, 'phase_pairs': self.phase_pairs,
'source_files': len(self.resolver.manifest['product_source']), 'owned_pids': self.pids, 'phase_pairs': self.phase_pairs,
'references': self.references,
'relocated_references': self.resolver.used, 'formal_acceptance': False}
@@ -1027,7 +1027,7 @@ class S4Series(Series):
inputs, execution = self.inputs, self.execution
source = loads(self.read('source_before.json'))
product = self.resolver.manifest['product_source']
require(set(source) == set(product) and len(source) == 1338 and
require(set(source) == set(product) and
source == inputs['source_before'] == loads(self.read('source_after.json')), 'S4 complete unchanged product set')
for name, pin in source.items():
require(all(pin[k] == product[name][k] for k in ('bytes', 'sha256')), 'S4 product pin')
@@ -1333,7 +1333,15 @@ class FreshSeries(Series):
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)
require(all(not p.is_symlink() for p in (wrapper_path, *wrapper_path.parents)),
'fresh wrapper ordinary path')
exec(compile(wrapper_path.read_bytes(), str(wrapper_path), 'exec'), wrapper.__dict__)
if self.name == 's4':
admission = wrapper.module('fresh_s4_admission', HERE / 's4/run_s4_native.py')
product = {n: p for n, p in selected.items() if n != admission.CHECKER}
paths = loads(self.read('parse-paths.json'))
admission.admission(selected, product, paths)
require(paths == self.inputs['parse_paths'], 'S4 plan/actual parse roster')
root = Path(self.inputs['project_root'])
runner = wrapper.module('fresh_series_runner', root / 'tools/run_all_tests.py')
refs = dict(self.source)
@@ -1424,7 +1432,18 @@ def verify_fresh_s5(build):
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)
require('..' not in path.parts and all(not p.is_symlink() for p in (path, *path.parents)),
'S5 adapter ordinary package path')
adapter_bytes = path.read_bytes()
exec(compile(adapter_bytes, str(path), 'exec'), adapter.__dict__)
# Transport-only observations are retained by collect(), outside s5.json.
global S5_DEPENDENCY_INVOCATION
S5_DEPENDENCY_INVOCATION = {
'checkout': str(HERE.parents[4]),
'adapter': {'path': str(path.absolute()), 'sha256': digest(adapter_bytes)},
'dependencies': dict(adapter.DEPENDENCY_OBSERVATIONS),
'dependency_sha256': dict(adapter.DEPENDENCIES),
}
arguments = (s.base / 'raw', s.inventory['writer.json']['sha256'], s.inventory['reader.json']['sha256'])
power = adapter.power.derive(*arguments)
order = adapter.derive(*arguments)
@@ -0,0 +1,160 @@
#!/usr/bin/env python3
"""Runner-only retained-raw identity controls; no engine or acceptance run."""
import argparse
import copy
import hashlib
import importlib.util
import json
from pathlib import Path
import shutil
import sys
import tempfile
sys.dont_write_bytecode = True
HERE = Path(__file__).resolve().parent
def load(path, name):
spec = importlib.util.spec_from_file_location(name, path)
value = importlib.util.module_from_spec(spec)
exec(compile(path.read_bytes(), str(path), 'exec'), value.__dict__)
return value
def rejects(call):
try:
call()
except (ValueError, OSError, KeyError, TypeError):
return
raise AssertionError('negative admitted')
def tree(root):
rows = {}
for p in root.rglob('*'):
if p.is_file():
digest = hashlib.sha256()
with p.open('rb') as source:
for chunk in iter(lambda: source.read(1024 * 1024), b''):
digest.update(chunk)
rows[p.relative_to(root).as_posix()] = digest.hexdigest()
return rows
# Explicit audited package-local closure; see REPAIR49_STATUS.md.
CLOSURE = ('build_p04_index.py', 'bulk_reader_equivalence.py', 'checker_applicability_fixtures.py', 'checker_approval_fixtures.py', 'checker_candidate_fixtures.py', 'checker_encoder_fixtures.py', 'checker_join_fixtures.py', 'checker_native_fixtures.py', 'checker_negative_fixtures.py', 'checker_role_fixtures.py', 'checker_series_fixtures.py', 'collect_p04_native.py', 'full_suite_verifier.py', 'normal_c_join.py', 'normal_c_join_fixtures.py', 'p04_native_series.py', 'repair48_identity_controls.py', 'repair48_transport_controls.py', 's1/S1_ROOT_RUN.md', 's1/p04_s1_ev_power_probe.gd', 's1/run_s1_native.py', 's2/S2_ROOT_RUN.md', 's2/p04_s2a_midnight_probe.gd', 's2/run_s2a_native.py', 's2b/S2B_ROOT_RUN.md', 's2b/p04_s2b_shift_probe.gd', 's2b/run_s2b_native.py', 's3/S3_ROOT_RUN.md', 's3/p04_s3_closure_probe.gd', 's3/run_s3_native.py', 's4/S4_ROOT_RUN.md', 's4/admission_controls.py', 's4/engine_identity_negative_fixtures.py', 's4/p04_s4_power_probe.gd', 's4/phase_cut_regression.py', 's4/receipt_lifecycle_fixtures.py', 's4/run_s4_native.py', 's5/S5_ROOT_RUN.md', 's5/p04_s5_power_probe.gd', 's5/repair44_controls.py', 's5/run_s5_native.py', 's5/s5_guard_oracle.py', 's5/s5_order_adapter.py', 's5/s5_order_adapter_controls.py', 's5/s5_power_adapter.py', 's5/s5_power_adapter_controls.py', 's5/s5_uid_controls.py', 's5/s5_wrapper_fixtures.py', 'scratch_fixture_adapter.py')
def package_snapshot(root):
root = Path(root).absolute()
rows = {}
for name in CLOSURE:
relative = Path(name)
if relative.is_absolute() or '..' in relative.parts:
raise ValueError('closure traversal/outside')
path = root / relative
if (any(p.is_symlink() for p in (path, *path.parents))
or not path.resolve(strict=True).is_relative_to(root.resolve(strict=True))
or not path.is_file()):
raise ValueError('closure missing/symlink/outside: ' + name)
data = path.read_bytes()
rows[name] = {'bytes': len(data), 'sha256': hashlib.sha256(data).hexdigest()}
encoded = json.dumps(rows, sort_keys=True, separators=(',', ':')).encode()
return {'files': rows, 'tree_sha256': hashlib.sha256(encoded).hexdigest()}
def run(args):
raw = args.raw.resolve(strict=True)
with tempfile.TemporaryDirectory(prefix='p04-r48-identity-') as directory:
base = Path(directory).resolve()
suffix = Path('docs/plans/original-completion-2026-10-02/execution/p04-01')
packages = [base / name / suffix for name in ('first', 'second')]
original_package = package_snapshot(HERE)
names = [Path(name) for name in CLOSURE]
for package in packages:
for relative in names:
target = package / relative
target.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(HERE / relative, target)
snapshots_before = [package_snapshot(root) for root in (HERE, *packages)]
assert all(row == original_package for row in snapshots_before)
a, b = [load(p / 's5/s5_order_adapter.py', 'identity_' + str(i))
for i, p in enumerate(packages)]
first = a.derive(raw, args.writer_sha, args.reader_sha)
assert b.derive(raw, args.writer_sha, args.reader_sha) == first
assert a.DEPENDENCY_OBSERVATIONS != b.DEPENDENCY_OBSERVATIONS
if args.build:
build = args.build.resolve(strict=True)
before = tree(build)
# These independent packages execute the same complete analysis bytes.
native = [load(p / 'p04_native_series.py', 'native_' + str(i))
for i, p in enumerate(packages)]
assert native[0].verify_fresh_s5(build) == native[1].verify_fresh_s5(build)
original_builder = load(HERE / 'build_p04_index.py', 'original_builder')
gate = original_builder.checker()
builders = [load(p / 'build_p04_index.py', 'builder_' + str(i))
for i, p in enumerate(packages)]
assert builders[0].payload(build, gate) == builders[1].payload(build, gate)
assert tree(build) == before
snapshots_after = [package_snapshot(root) for root in (HERE, *packages)]
assert snapshots_after == snapshots_before
missing = packages[1] / 's5/p04_s5_power_probe.gd'
saved = missing.read_bytes()
missing.unlink()
rejects(lambda: package_snapshot(packages[1]))
missing.write_bytes(saved)
assert package_snapshot(packages[1]) == original_package
for kind in ('byte', 'missing', 'extra', 'mapping'):
original = copy.deepcopy(a.DEPENDENCIES)
key = next(iter(original))
if kind == 'byte':
a.DEPENDENCIES[key] = '0' * 64
elif kind == 'missing':
del a.DEPENDENCIES[key]
elif kind == 'extra':
a.DEPENDENCIES['extra.py'] = '0' * 64
else:
a.DEPENDENCY_OBSERVATIONS[key] = '/outside-package.py'
rejects(lambda: a.derive(raw, args.writer_sha, args.reader_sha))
a.DEPENDENCIES.clear()
a.DEPENDENCIES.update(original)
a.DEPENDENCY_OBSERVATIONS.update(a._EXECUTED_OBSERVATIONS)
target = packages[1] / 's5/s5_guard_oracle.py'
target.write_bytes(target.read_bytes() + b'\n')
changed = load(packages[1] / 's5/s5_order_adapter.py', 'changed_identity')
assert changed.DEPENDENCIES != a.DEPENDENCIES
# Reject the changed payload at the same equality boundary used for recomputation.
rejects(lambda: a.require(changed.derive(raw, args.writer_sha, args.reader_sha) == first,
'fresh raw recomputation drift'))
target.unlink()
target.symlink_to(packages[0] / 's5/s5_guard_oracle.py')
rejects(lambda: load(packages[1] / 's5/s5_order_adapter.py', 'symlink_identity'))
rejects(lambda: a.module('outside_identity', HERE / 's5/s5_guard_oracle.py'))
target.unlink()
target.write_bytes((HERE / 's5/s5_guard_oracle.py').read_bytes())
assert [package_snapshot(root) for root in (HERE, *packages)] == snapshots_before
if args.build:
# A retained complete B is required. Never call the registered checker main().
builder = load(HERE / 'build_p04_index.py', 'identity_builder')
build = args.build.resolve(strict=True)
before = tree(build)
first = builder.payload(build)
assert builder.payload(build) == first and tree(build) == before
changed = copy.deepcopy(first)
changed['runner_material_relocation']['sha256'] = '0' * 64
rejects(lambda: builder.require(changed == builder.payload(build), 'index recomputation mismatch'))
rejects(lambda: builder.checker().supplied_file(build, {
'path': '/outside-B/material', 'bytes': 0, 'sha256': '0' * 64}))
assert package_snapshot(HERE) == original_package
print(json.dumps({'identity_controls': 'pass', 'complete_B_controls': bool(args.build),
'formal_acceptance': False,
'closure_before': snapshots_before, 'closure_after': snapshots_after}))
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--raw', type=Path, required=True)
parser.add_argument('--writer-sha', required=True)
parser.add_argument('--reader-sha', required=True)
parser.add_argument('--build', type=Path)
run(parser.parse_args())
@@ -0,0 +1,159 @@
#!/usr/bin/env python3
"""Runner-only, engine-free retained-copy transport controls. No acceptance."""
import argparse
import copy
import hashlib
import importlib.util
import json
from pathlib import Path
import tempfile
from unittest.mock import patch
import sys
sys.dont_write_bytecode = True
spec = importlib.util.spec_from_file_location('transport', Path(__file__).with_name('build_p04_index.py'))
builder = importlib.util.module_from_spec(spec)
spec.loader.exec_module(builder)
def sha(data):
return hashlib.sha256(data).hexdigest()
def tree(root):
return {p.relative_to(root).as_posix(): sha(p.read_bytes())
for p in root.rglob('*') if p.is_file()}
def rejects(call):
try:
call()
except (ValueError, OSError, KeyError, TypeError):
return
raise AssertionError('negative admitted')
def run(retained):
manifest = json.loads((retained / 'REAL_S47_PINNED_MATERIAL_COPIES.json').read_bytes())
inputs, sources = {}, {}
for name, row in manifest['series'].items():
data = (retained / row['raw_input']).read_bytes()
assert len(data) == row['bytes'] and sha(data) == row['sha256']
inputs[name] = json.loads(data)
for original, row in manifest['materials'].items():
data = (retained / row['retained_copy']).read_bytes()
assert len(data) == row['bytes'] and sha(data) == row['sha256']
sources[original] = data
assert any('p04-fresh-context-r47' in p for p in sources)
assert any('P04-01-root-q-r47' in p for p in sources)
original_checked = builder.checked_material
def retained_checked(path, pin):
if str(path) in sources:
data = sources[str(path)]
builder.require(len(data) == pin['bytes'] and sha(data) == pin['sha256'], 'retained pin')
return data
return original_checked(path, pin)
with tempfile.TemporaryDirectory(prefix='p04-repair48-') as directory:
build = Path(directory).resolve()
with patch.object(builder, 'series_inputs', return_value=inputs), \
patch.object(builder, 'checked_material', side_effect=retained_checked):
output = build / 'p04-evidence'
rejects(lambda: builder.relocate_materials(build, build / 'wrong'))
assert not output.exists()
builder.relocate_materials(build, output)
rejects(lambda: builder.relocate_materials(build, output))
before = tree(build)
first = builder.relocated_materials(build)
assert builder.relocated_materials(build) == first and tree(build) == before
map_path = output / 'runner-materials/RELOCATION.json'
map_bytes = map_path.read_bytes()
mapping = json.loads(map_bytes)
identities = {(pin['path'], pin['bytes'], pin['sha256'])
for raw in inputs.values() for pin in raw['fixed_input_pins'] + [raw['QA']]}
assert len({row['relative'] for rows in mapping.values() for row in rows.values()}) == len(identities)
series = next(iter(inputs))
original = next(iter(mapping[series]))
target = output / mapping[series][original]['relative']
data = target.read_bytes()
target.write_bytes(data + b'x')
rejects(lambda: builder.relocated_materials(build))
target.write_bytes(data)
target.unlink()
target.symlink_to(map_path)
rejects(lambda: builder.relocated_materials(build))
target.unlink()
target.write_bytes(data)
for kind in ('missing', 'extra', 'mapping', 'traversal', 'external'):
changed = copy.deepcopy(mapping)
if kind == 'missing':
del changed[series][original]
elif kind == 'extra':
changed[series]['/extra'] = changed[series][original]
else:
changed[series][original]['relative'] = {
'mapping': 'runner-materials/wrong', 'traversal': '../outside',
'external': '/outside-B'}[kind]
map_path.write_text(json.dumps(changed))
rejects(lambda: builder.relocated_materials(build))
map_path.write_bytes(map_bytes)
extra = output / 'runner-materials/unmapped'
extra.write_bytes(b'extra')
rejects(lambda: builder.relocated_materials(build))
extra.unlink()
for digest in ('0' * 64, None):
altered = copy.deepcopy(inputs)
altered[series]['wrapper_sha256'] = digest
with patch.object(builder, 'series_inputs', return_value=altered):
rejects(lambda: builder.relocated_materials(build))
# A second distinct pin carrying wrapper bytes is ambiguous.
altered = copy.deepcopy(inputs)
wrapper = next(p for p in altered[series]['fixed_input_pins']
if p['sha256'] == altered[series]['wrapper_sha256'])
altered[series]['fixed_input_pins'].append(dict(wrapper, path='/different-wrapper'))
with patch.object(builder, 'series_inputs', return_value=altered):
rejects(lambda: builder.relocated_materials(build))
assert tree(build) == before
raw = copy.deepcopy(next(iter(inputs.values())))
pin = copy.deepcopy(raw['QA'])
raw['fixed_input_pins'].append(pin)
assert len(builder.pin_roster(raw)) == len({p['path'] for p in raw['fixed_input_pins'] + [raw['QA']]})
with tempfile.TemporaryDirectory(prefix='p04-r48-dedup-') as directory:
build = Path(directory).resolve()
with patch.object(builder, 'series_inputs', return_value={'s1': raw}), \
patch.object(builder, 'checked_material', side_effect=retained_checked):
mapping = builder.relocate_materials(build, build / 'p04-evidence')
assert len(mapping['s1']) == len(builder.pin_roster(raw))
builder.relocated_materials(build)
raw['fixed_input_pins'].append(dict(pin, bytes=pin['bytes'] + 1))
rejects(lambda: builder.pin_roster(raw))
rejects(lambda: builder.ordinary('/a/../b'))
changed = copy.deepcopy(inputs)
series = next(iter(changed))
changed[series]['QA']['sha256'] = '0' * 64
rejects(lambda: builder.all_rosters(changed))
# Exercise the actual immutable checker's role binding predicate, with
# simulated Git observations only. No objects, refs or checkouts are written.
gate = builder.checker()
old = next(iter(inputs.values()))['provenance']
new_submission, composed = 'f' * 40, 'e' * 40
assert old['S'] != new_submission
with patch.object(gate, 'actual_checkout', return_value=(new_submission, composed, {})), \
patch.object(gate, '_GIT_ENV', {}), \
patch.object(gate, 'ancestor', return_value=False), \
patch.object(gate, 'submission_role'), \
patch.object(gate, 'git_bytes', return_value=composed.encode()):
try:
gate.verify_roles({'fresh_run_bindings': old}, Path('/retained-B'))
except ValueError as error:
assert str(error) == 'fresh evidence does not bind recomputed Q'
else:
raise AssertionError('old S47 bindings admitted under new S')
print(json.dumps({'retained_S47_transport_controls': 'pass', 'formal_acceptance': False}))
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--retained', type=Path, required=True)
run(parser.parse_args().retained.resolve(strict=True))
@@ -0,0 +1,44 @@
#!/usr/bin/env python3
"""Root-only engine-free whole-read/stream SHA equivalence controls."""
import hashlib
import importlib.util
import json
from pathlib import Path
import sys
import tempfile
import time
sys.dont_write_bytecode = True
def main():
started = time.monotonic()
path = Path(__file__).with_name('repair48_identity_controls.py')
spec = importlib.util.spec_from_file_location('r50_identity', path)
module = importlib.util.module_from_spec(spec)
exec(compile(path.read_bytes(), str(path), 'exec'), module.__dict__)
chunk = 1024 * 1024 # Implementation boundary, never an acceptance limit.
with tempfile.TemporaryDirectory(prefix='p04-r50-stream-') as directory:
root = Path(directory)
(root / 'empty').write_bytes(b'')
(root / '日本語🌳').write_bytes('木と水\n🌳'.encode())
(root / 'binary').write_bytes(bytes(range(256)) * 5)
for size in (chunk - 1, chunk, chunk + 1, chunk * 3 + 17):
(root / str(size)).write_bytes((bytes(range(256)) * (size // 256 + 1))[:size])
with (root / 'sparse').open('wb') as stream:
stream.seek(chunk * 4 + 3)
stream.write(b'\xff')
nested = root / 'nested'
nested.mkdir()
(nested / '全bytes').write_bytes(b'\x00\xff\x80\n')
whole = {p.relative_to(root).as_posix(): hashlib.sha256(p.read_bytes()).hexdigest()
for p in root.rglob('*') if p.is_file()}
streamed = module.tree(root)
assert list(streamed) == list(whole), 'same traversal/key insertion order'
assert streamed == whole, 'complete SHA map equality'
print(json.dumps({'stream_equivalence': 'pass', 'files': whole,
'elapsed': time.monotonic() - started, 'formal_acceptance': False}, sort_keys=True))
if __name__ == '__main__':
main()
@@ -1,3 +1,26 @@
## REPAIR49 normal-gate handoff
Required materials: exact B/native-first-current and fresh-run registry; each
runner-input/ended/source/UID/formal/raw/lifecycle receipt; original recorded Q
and engine context; B/p04-evidence/runner-materials and RELOCATION.json; matching
collection/MANIFEST and separate dependency invocation; original full run and
full_suite binding/raw receipts; final index and invocation receipt; immutable
authorities in frozen checkout. No raw or historical receipt is rewritten.
Two-placement identity requires the explicit closure in repair48_identity_controls.py,
missing-file rejection, and original/A/B complete path/bytes/SHA tables and tree
hash equality before and after positive execution. See REPAIR49_STATUS.md.
Submission is followed by new Q freeze, affected pure controls (complete_B included),
clean exact-Q check-only, capacity/PID checks, one fresh native lease for
S1/S2a/S2b/S3/S4 and all ten S5 cases, readers/adapters, 15EV collector, full
verification/binding under the conditions below (or one final full184 if any
condition fails), index generation, p04-acceptance once, separate Opus whole-unit
review, normal prepare/C/integration/final/Root DB join/ledger/main push.
If order-typed fails, preserve its result and stop before heavy execution.
Only whole-unit acceptance grants credit.
REPAIR48 current source status: see [REPAIR48_STATUS.md](../REPAIR48_STATUS.md). Earlier run directions and successes below are historical; they grant no P04 credit.
# S1 Root run(コード準備のみ)
S1コード準備完了・未実測・原P04 whole未達。D05 pending、A未検証。
@@ -1,3 +1,26 @@
## REPAIR49 normal-gate handoff
Required materials: exact B/native-first-current and fresh-run registry; each
runner-input/ended/source/UID/formal/raw/lifecycle receipt; original recorded Q
and engine context; B/p04-evidence/runner-materials and RELOCATION.json; matching
collection/MANIFEST and separate dependency invocation; original full run and
full_suite binding/raw receipts; final index and invocation receipt; immutable
authorities in frozen checkout. No raw or historical receipt is rewritten.
Two-placement identity requires the explicit closure in repair48_identity_controls.py,
missing-file rejection, and original/A/B complete path/bytes/SHA tables and tree
hash equality before and after positive execution. See REPAIR49_STATUS.md.
Submission is followed by new Q freeze, affected pure controls (complete_B included),
clean exact-Q check-only, capacity/PID checks, one fresh native lease for
S1/S2a/S2b/S3/S4 and all ten S5 cases, readers/adapters, 15EV collector, full
verification/binding under the conditions below (or one final full184 if any
condition fails), index generation, p04-acceptance once, separate Opus whole-unit
review, normal prepare/C/integration/final/Root DB join/ledger/main push.
If order-typed fails, preserve its result and stop before heavy execution.
Only whole-unit acceptance grants credit.
REPAIR48 current source status: see [REPAIR48_STATUS.md](../REPAIR48_STATUS.md). Earlier run directions and successes below are historical; they grant no P04 credit.
# P04-01 S2a Root run(code-ready提出用・実測未実施)
repair12確認: worktreeのoperations_coordinator.gd SHA256は
@@ -1,3 +1,28 @@
## REPAIR49 normal-gate handoff
Required materials: exact B/native-first-current and fresh-run registry; each
runner-input/ended/source/UID/formal/raw/lifecycle receipt; original recorded Q
and engine context; B/p04-evidence/runner-materials and RELOCATION.json; matching
collection/MANIFEST and separate dependency invocation; original full run and
full_suite binding/raw receipts; final index and invocation receipt; immutable
authorities in frozen checkout. No raw or historical receipt is rewritten.
Two-placement identity requires the explicit closure in repair48_identity_controls.py,
missing-file rejection, and original/A/B complete path/bytes/SHA tables and tree
hash equality before and after positive execution. See REPAIR49_STATUS.md.
Submission is followed by new Q freeze, affected pure controls (complete_B included),
clean exact-Q check-only, capacity/PID checks, one fresh native lease for
S1/S2a/S2b/S3/S4 and all ten S5 cases, readers/adapters, 15EV collector, full
verification/binding under the conditions below (or one final full184 if any
condition fails), index generation, p04-acceptance once, separate Opus whole-unit
review, normal prepare/C/integration/final/Root DB join/ledger/main push.
If order-typed fails, preserve its result and stop before heavy execution.
Only whole-unit acceptance grants credit.
REPAIR48 current source status: see [REPAIR48_STATUS.md](../REPAIR48_STATUS.md). Earlier run directions and successes below are historical; they grant no P04 credit.
RUN47 note: Earlier 1338-source native instructions below describe the historical relocation. Current fresh-Q selection uses exact source/manifest equality, never a literal file count. See ../REPAIR47_PLAN.json.
# P04-01 S2b code preparation
変更は本ディレクトリの `p04_s2b_shift_probe.gd`、`run_s2b_native.py`、本書の3ファイルのみ。
@@ -1,3 +1,28 @@
## REPAIR49 normal-gate handoff
Required materials: exact B/native-first-current and fresh-run registry; each
runner-input/ended/source/UID/formal/raw/lifecycle receipt; original recorded Q
and engine context; B/p04-evidence/runner-materials and RELOCATION.json; matching
collection/MANIFEST and separate dependency invocation; original full run and
full_suite binding/raw receipts; final index and invocation receipt; immutable
authorities in frozen checkout. No raw or historical receipt is rewritten.
Two-placement identity requires the explicit closure in repair48_identity_controls.py,
missing-file rejection, and original/A/B complete path/bytes/SHA tables and tree
hash equality before and after positive execution. See REPAIR49_STATUS.md.
Submission is followed by new Q freeze, affected pure controls (complete_B included),
clean exact-Q check-only, capacity/PID checks, one fresh native lease for
S1/S2a/S2b/S3/S4 and all ten S5 cases, readers/adapters, 15EV collector, full
verification/binding under the conditions below (or one final full184 if any
condition fails), index generation, p04-acceptance once, separate Opus whole-unit
review, normal prepare/C/integration/final/Root DB join/ledger/main push.
If order-typed fails, preserve its result and stop before heavy execution.
Only whole-unit acceptance grants credit.
REPAIR48 current source status: see [REPAIR48_STATUS.md](../REPAIR48_STATUS.md). Earlier run directions and successes below are historical; they grant no P04 credit.
RUN47 note: Earlier 1338-source native instructions below describe the historical relocation. Current fresh-Q selection uses exact source/manifest equality, never a literal file count. See ../REPAIR47_PLAN.json.
# P04-01 S3 code-ready preparation
変更は本ディレクトリのGD、Python wrapper、本書の3本のみ。製品修正0。
@@ -1,3 +1,47 @@
## REPAIR49 normal-gate handoff
Required materials: exact B/native-first-current and fresh-run registry; each
runner-input/ended/source/UID/formal/raw/lifecycle receipt; original recorded Q
and engine context; B/p04-evidence/runner-materials and RELOCATION.json; matching
collection/MANIFEST and separate dependency invocation; original full run and
full_suite binding/raw receipts; final index and invocation receipt; immutable
authorities in frozen checkout. No raw or historical receipt is rewritten.
Two-placement identity requires the explicit closure in repair48_identity_controls.py,
missing-file rejection, and original/A/B complete path/bytes/SHA tables and tree
hash equality before and after positive execution. See REPAIR49_STATUS.md.
Submission is followed by new Q freeze, affected pure controls (complete_B included),
clean exact-Q check-only, capacity/PID checks, one fresh native lease for
S1/S2a/S2b/S3/S4 and all ten S5 cases, readers/adapters, 15EV collector, full
verification/binding under the conditions below (or one final full184 if any
condition fails), index generation, p04-acceptance once, separate Opus whole-unit
review, normal prepare/C/integration/final/Root DB join/ledger/main push.
If order-typed fails, preserve its result and stop before heavy execution.
Only whole-unit acceptance grants credit.
REPAIR48 current source status: see [REPAIR48_STATUS.md](../REPAIR48_STATUS.md). Earlier run directions and successes below are historical; they grant no P04 credit.
## RUN47 current admission (supersedes earlier execution instructions)
Current S4 check-only and native call the same engine-free `admission` function.
The real selected source map determines the sorted unique res:// `.gd` roster;
the whole list must match, including membership and order. Product is exactly
selected minus `tools/check_p04_order_evidence.py`; no other extra is allowed.
There is no current fixed product/script count. The supplied M copy happens to
select 1368 product files and 329 scripts; fresh Q additionally selects the checker.
Plans now carry `parse_paths`, and FreshSeries checks plan/actual/source equality.
Before import is attempted, cleanup requires the complete original inventory and
no generated UID. After import starts, the existing exact planned UID seal applies.
Failure stays failure; no previous native receipt is adopted.
The older relocation, counts, runs and receipts below are historical context only.
The historical r28 wrapper and data retain 1338/316. `receipt_lifecycle_fixtures.py`
now explicitly loads that pinned historical wrapper. Current-derived finite cases
are in `admission_controls.py`, using the retained verified-M copy and BUILD scratch.
Root must freeze final Q and run six clean check-only plans, then all fresh native
boundaries and ten S5 cases once in one heavy lease. See REPAIR47_PLAN.json and
REPAIR47_STATUS.md; worker does not execute that native sequence.
# S4 finite Root collection r28 — NOT RUN
This adds only the existing `power_stop` evidence obligation. It adds no counted
@@ -141,7 +185,7 @@ the descriptor it just appended and the index of that exact observation.
| `write_bytes` to `bootstrap/<name>` | 1 per pinned bootstrap key | The reviewed map names `profile_guard.gd` and `parse_full_dependencies.gd`; setup only |
| `/bin/cp -c` to `stage/.godot/<name>` | 1 per cache inventory key | Optional eligible-cache branch only; fresh mode never accesses cache |
| `cache-reuse.json` | 0 or 1 | Only after all optional cache clones and guards |
| `parse-paths.json` | 1 | Setup after 316-script guard |
| `parse-paths.json` | 1 | Setup after source-derived roster admission (historical r28 used 316) |
| `contracts.json` | 1 | Setup after unchanged suite-policy guard |
| `runner-input.json` | 1 | Setup; no final read/rewrite; absent if earlier setup fails |
| `engine-identity-before-<phase>.json` | 1 each for import, parse, writer, reader | Immediately after that phase's repin; failure stops loop, never resumes it |
@@ -0,0 +1,164 @@
#!/usr/bin/env python3
"""Finite engine-free admission controls. Synthetic plans are never evidence."""
import argparse
import ast
from contextlib import redirect_stdout
import hashlib
import io
import json
from pathlib import Path
import sys
from types import SimpleNamespace
from unittest.mock import patch
sys.dont_write_bytecode = True
import run_s4_native as s4
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)
expected_root = Path(__file__).resolve().parents[6] / 'build/owner-handoff/p04-after-p26-closure-r01/verified-m-engine-free-r45'
assert root == expected_root.resolve(strict=True), 'retained M only; never Root Q'
scratch = args.scratch.resolve()
assert scratch.is_relative_to(s4.BUILD.resolve()) and not scratch.exists()
scratch.mkdir(parents=True)
r = s4.module('admission_real_selection', root / 'tools/run_all_tests.py')
selected = r.source_refs(root)
product = {n: p for n, p in selected.items() if n != s4.CHECKER}
paths = ['res://' + n for n in sorted(product) if n.endswith('.gd')]
results = []
def check(label, action, reject=False):
try:
action()
except (ValueError, AssertionError):
assert reject, label
results.append(dict(case=label, result='rejected'))
else:
assert not reject, label
results.append(dict(case=label, result='pass'))
assert len(paths) == 329, 'diagnostic pin for supplied M, not production admission'
check('real-329', lambda: s4.admission(selected, product, paths))
check('selected-checker-only-extra', lambda: s4.admission(
dict(product, **{s4.CHECKER: {'sha256': 'synthetic-checker'}}), product, paths))
other = dict(product, **{'scripts/another_valid.gd': {'sha256': 'synthetic'}})
other_paths = sorted(paths + ['res://scripts/another_valid.gd'])
check('another-derived-roster', lambda: s4.admission(other, other, other_paths))
mutations = {
'missing': paths[:-1],
'extra': sorted(paths + ['res://scripts/extra.gd']),
'same-count-substitution': sorted(paths[:-1] + ['res://scripts/substitute.gd']),
'duplicate': sorted(paths + [paths[0]]),
'non-gd': sorted(paths + ['res://project.godot']),
'stale-literal-count': paths[:316],
}
for label, roster in mutations.items():
check(label, lambda roster=roster: s4.admission(selected, product, roster), True)
check('checker-as-product', lambda: s4.admission(
dict(selected, **{s4.CHECKER: {}}), dict(product, **{s4.CHECKER: {}}), paths), True)
check('missing-product', lambda: s4.admission(selected, dict(list(product.items())[1:]), paths), True)
check('extra-selected-input', lambda: s4.admission(dict(selected, unexpected={}), product, paths), True)
# Execute the real check-only main with explicit historical template/engine
# stubs. Source selection and admission are real; no fresh-Q claim is made.
real_admission = s4.admission
calls = []
def observed(a, b, c):
calls.append((a, b, c))
return real_admission(a, b, c)
argv = ['run_s4_native.py', '--historical-r17', '--project-root', str(root),
'--output', str(scratch / 'never-native'), '--plan', str(scratch / 'synthetic-plan.json'), '--check-only']
with patch.object(s4, 'engine_pin', return_value={'synthetic': True}), \
patch.object(s4, 'template_guard'), patch.object(s4, 'MATERIALS', []), \
patch.object(s4, 'CONTRACTS', s4.HERE.parent.parent / 'completion_marker_contracts.json'), \
patch.object(s4, 'admission', side_effect=observed), \
patch.object(sys, 'argv', argv), redirect_stdout(io.StringIO()):
assert s4.main() == 0
assert len(calls) == 1 and calls[0][2] == paths
assert not (scratch / 'never-native').exists()
assert r.read(scratch / 'synthetic-plan.json')['parse_paths'] == paths
results.append(dict(case='real-check-only-shared-admission', result='pass'))
for label, roster in mutations.items():
def mutated(a, b, c):
return real_admission(a, b, roster)
bad_plan = scratch / ('rejected-plan-' + label + '.json')
bad_argv = list(argv)
bad_argv[bad_argv.index('--plan') + 1] = str(bad_plan)
with patch.object(s4, 'engine_pin', return_value={'synthetic': True}), \
patch.object(s4, 'template_guard'), patch.object(s4, 'admission', side_effect=mutated), \
patch.object(sys, 'argv', bad_argv):
check('check-only-' + label, s4.main, True)
assert not bad_plan.exists(), 'admission must precede plan write'
# Historical admission executes the original pinned r28 AST unchanged.
series = s4.module('admission_series', s4.HERE.parent / 'p04_native_series.py')
series_tree = ast.parse((s4.HERE.parent / 'p04_native_series.py').read_text())
fresh = next(n for n in series_tree.body if isinstance(n, ast.ClassDef) and n.name == 'FreshSeries')
roster_block = next(n for n in ast.walk(fresh) if isinstance(n, ast.If)
and "'S4 plan/actual parse roster'" in ast.unparse(n))
roster_code = compile(ast.Module(body=[roster_block], type_ignores=[]), '<actual FreshSeries roster block>', 'exec')
wrapper = s4.module('admission_fresh_wrapper', s4.HERE.parent / 's5/run_s5_native.py')
def series_roster(actual, planned):
obj = SimpleNamespace(name='s4', read=lambda _: json.dumps(actual).encode(), inputs={'parse_paths': planned})
exec(roster_code, dict(wrapper=wrapper, HERE=s4.HERE.parent, selected=selected,
self=obj, loads=series.loads, require=series.require))
check('FreshSeries-exact-roster', lambda: series_roster(paths, paths))
check('FreshSeries-actual-substitution', lambda: series_roster(mutations['same-count-substitution'], paths), True)
check('FreshSeries-plan-substitution', lambda: series_roster(paths, mutations['same-count-substitution']), True)
main_tree = ast.parse(Path(s4.__file__).read_text())
cache_guard = next(n for n in ast.walk(main_tree) if isinstance(n, ast.Expr)
and 'cache selection is exact product plus checker' in ast.unparse(n))
cache_code = compile(ast.Module(body=[cache_guard], type_ignores=[]), '<actual cache set guard>', 'exec')
def cache_keys(old):
exec(cache_code, dict(r=r, old_map=old, current_map=product, CHECKER=s4.CHECKER))
s4.admission(old, product, paths)
cache = dict(product, **{s4.CHECKER: {}})
check('cache-exact-product-plus-checker', lambda: cache_keys(cache))
check('cache-missing-checker', lambda: cache_keys(product), True)
check('cache-same-count-substitution', lambda: cache_keys(dict(list(cache.items())[1:], unexpected={})), True)
historical = s4.HERE / 'historical/run_s4_native_r28.py.reference'
series.verify_s4_wrapper(hashlib.sha256(historical.read_bytes()).hexdigest(), historical=True)
tree = ast.parse(historical.read_text())
guard = next(n for n in ast.walk(tree) if isinstance(n, ast.Expr)
and 'complete 316-script parse roster' in ast.unparse(n))
code = compile(ast.Module(body=[guard], type_ignores=[]), str(historical), 'exec')
# A finite synthetic historical receipt; not a replacement for native raw.
check('historical-316-receipt', lambda: exec(code, {'r': r, 'paths': paths[:316]}))
check('historical-rejects-current-roster', lambda: exec(code, {'r': r, 'paths': paths}), True)
uid_plan, snapshot, _ = s4.module('admission_uid', s4.HERE.parent / 's5/run_s5_native.py').load_uid_helper(root, r, selected)
for label in ('original-no-uid', 'partial-import', 'unknown-uid', 'changed-source'):
stage = scratch / label
(stage / 'tests/special').mkdir(parents=True)
(stage / 'tests/special/a.gd').write_text('extends Node\n')
(stage / 'tests/special/b.gd').write_text('extends Node\n')
source = r.inventory(stage, stage=True)
refs = {n: dict(p, path=str(stage / n)) for n, p in source.items()}
plan = uid_plan(refs)
assert len(plan) >= 2
if label == 'partial-import':
(stage / next(iter(plan))).write_text('uid://partial\n')
elif label == 'unknown-uid':
(stage / 'unknown.uid').write_text('uid://unknown\n')
elif label == 'changed-source':
(stage / 'tests/special/a.gd').write_text('changed\n')
state = dict(phase=None, accepted=None)
check('pre-import-' + label, lambda: s4.cleanup_uid_guard(r, snapshot, stage, source, plan, state), label != 'original-no-uid')
if label != 'original-no-uid':
state['phase'] = 'import'
check('attempted-import-' + label, lambda: s4.cleanup_uid_guard(r, snapshot, stage, source, plan, state), True)
result = dict(passed=True, controls=results, source_files=len(selected),
product_files=len(product), scripts=len(paths), engine_launches=0,
formal_acceptance=False)
(scratch / 'results.json').write_text(json.dumps(result, indent=2) + '\n')
print(json.dumps(result, indent=2))
if __name__ == '__main__':
main()
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Root-only synthetic receipt lifecycle fixtures. No engine/process is started.
"""Historical-pinned r28 synthetic lifecycle fixtures. No engine/process starts.
Uses the real main, exclusive JSON writer, source_refs and inventories. The
identity section is compiled directly from S4Series.__init__, not reimplemented.
@@ -10,6 +10,7 @@ from collections import Counter
from contextlib import ExitStack, redirect_stdout
import copy
import importlib.util
from importlib.machinery import SourceFileLoader
import io
import json
from pathlib import Path
@@ -21,17 +22,18 @@ from unittest.mock import patch
sys.dont_write_bytecode = True
HERE = Path(__file__).resolve().parent
ROOT = next(p for p in HERE.parents if (p / 'tools/run_all_tests.py').is_file())
WORKTREE = next(p for p in HERE.parents if (p / 'tools/run_all_tests.py').is_file())
ROOT = WORKTREE / 'build/owner-handoff/p04-after-p26-closure-r01/verified-m-engine-free-r45'
def load(name, path):
spec = importlib.util.spec_from_file_location(name, path)
spec = importlib.util.spec_from_file_location(name, path, loader=SourceFileLoader(name, str(path)))
value = importlib.util.module_from_spec(spec)
spec.loader.exec_module(value)
return value
s4 = load('receipt_s4', HERE / 'run_s4_native.py')
s4 = load('receipt_s4_historical', HERE / 'historical/run_s4_native_r28.py.reference')
r = load('receipt_standard', ROOT / 'tools/run_all_tests.py')
series = load('receipt_series', HERE.parent / 'p04_native_series.py')
@@ -78,7 +80,7 @@ def case(base, failure=None):
path.parent.mkdir(parents=True, exist_ok=True)
path.write_bytes(data)
# Real 1338-entry source_refs and 316-entry script roster, synthetic bytes.
# Historical-pinned r28 fixture only. Current-derived cases: admission_controls.py.
scripts = [s4.TEST, 'tests/transport/test_runtime_transport.gd',
'tests/staff/test_rescue_elevator.gd']
scripts += ['scripts/fixture_%03d.gd' % i for i in range(313)]
@@ -92,7 +94,7 @@ def case(base, failure=None):
assert len(r.source_refs(product)) == 1338
qa = staged / 'p04_s4_power_probe.gd'
put(qa, b'extends Node\n# synthetic override\n')
put(staged / 'run_s4_native.py', (HERE / 'run_s4_native.py').read_bytes())
put(staged / 'run_s4_native.py', (HERE / 'historical/run_s4_native_r28.py.reference').read_bytes())
put(staged / 'S4_ROOT_RUN.md', b'synthetic fixture material\n')
contracts = base / 'contracts.json'
r.write(contracts, {})
@@ -97,6 +97,28 @@ def engine_pin(path, expected=None):
raise ValueError("engine identity changed")
return value
CHECKER = "tools/check_p04_order_evidence.py"
def admission(selected, product, paths):
"""Engine-free exact selection and parse admission; no historical counts."""
if CHECKER in product:
raise ValueError("checker is not a product input")
if set(selected) - set(product) not in (set(), {CHECKER}):
raise ValueError("only checker may be a selected extra")
if {n: p for n, p in selected.items() if n != CHECKER} != product:
raise ValueError("exact selected/product source map")
expected = ["res://" + n for n in sorted(product) if n.endswith(".gd")]
if paths != expected:
raise ValueError("exact source-derived parse roster")
return paths
def cleanup_uid_guard(r, snapshot, stage, source, plan, state):
if state["phase"] is None:
r.require(state["accepted"] is None and r.inventory(stage, stage=True) == source,
"exact original source and no generated UID before import")
else:
r.require(snapshot(stage, source, plan) == state["accepted"], "UID seal after cleanup")
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--project-root", type=Path, default=PRODUCT)
@@ -147,6 +169,9 @@ def main():
refs = dict(source_before)
refs[TEST] = pin(QA)
template_guard(root, historical=not fresh)
product_refs = {n: p for n, p in refs.items() if n != CHECKER}
paths = ["res://" + n for n in sorted(product_refs) if n.endswith(".gd")]
admission(refs, product_refs, paths)
expected = {n: dict(bytes=p["bytes"], sha256=p["sha256"]) for n, p in refs.items()}
fixed = [pin(p) for p in ([] if fresh else MATERIALS) + [
QA, Path(__file__), HERE / "S4_ROOT_RUN.md",
@@ -171,7 +196,7 @@ def main():
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,
QA_overrides=[TEST], parse_paths=paths, 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,
@@ -237,7 +262,9 @@ def main():
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")
r.require(set(old_map) == (set(current_map) - {CHECKER}) | {CHECKER},
"cache selection is exact product plus checker")
admission(old_map, {k: v for k, v in current_map.items() if k != CHECKER}, paths)
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")
@@ -297,8 +324,7 @@ def main():
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")
admission(refs, product_refs, paths)
r.write(out / "parse-paths.json", paths)
markers = module("s4_markers", root / "tools/strict_test_markers.py")
contracts = markers.load_contracts(root / shared.C_REL if fresh else CONTRACTS)
@@ -377,7 +403,7 @@ 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")
cleanup_uid_guard(r, uid_snapshot, stage, uid_source, uid_plan_map, uid_state)
r.write(out / "fresh-engine-checks.json", engine_checks)
after = r.source_refs(root)
r.write(out / "source_after.json", after)
@@ -1,3 +1,54 @@
## REPAIR49 normal-gate handoff
Required materials: exact B/native-first-current and fresh-run registry; each
runner-input/ended/source/UID/formal/raw/lifecycle receipt; original recorded Q
and engine context; B/p04-evidence/runner-materials and RELOCATION.json; matching
collection/MANIFEST and separate dependency invocation; original full run and
full_suite binding/raw receipts; final index and invocation receipt; immutable
authorities in frozen checkout. No raw or historical receipt is rewritten.
Two-placement identity requires the explicit closure in repair48_identity_controls.py,
missing-file rejection, and original/A/B complete path/bytes/SHA tables and tree
hash equality before and after positive execution. See REPAIR49_STATUS.md.
Submission is followed by new Q freeze, affected pure controls (complete_B included),
clean exact-Q check-only, capacity/PID checks, one fresh native lease for
S1/S2a/S2b/S3/S4 and all ten S5 cases, readers/adapters, 15EV collector, full
verification/binding under the conditions below (or one final full184 if any
condition fails), index generation, p04-acceptance once, separate Opus whole-unit
review, normal prepare/C/integration/final/Root DB join/ledger/main push.
If order-typed fails, preserve its result and stop before heavy execution.
Only whole-unit acceptance grants credit.
## REPAIR49 full184 conditional reuse candidate — all conditions UNVERIFIED
Native reuse is forbidden: all six series require fresh M/S/Q_tree provenance
(p04_native_series.py:1287; checker:370). Full uses the existing separate binding
(checker:1175-1186); no adopter or checker change is authorized.
The following are requirements, not results or approval:
1. New S5 source_before must equal old full selected_source_map: all 1369 keys
and SHA values, not counts alone.
2. Old project_root must remain unchanged: source-start == current source_refs
== post-verification source_refs (full_suite_verifier.py:115).
3. selected_source_map, roster184, parse329, settings, runner/marker module,
marker contract, suite-policy and UID plan/stage must all match (116-152,225).
4. inputs.engine must match current engine_pin (124-125).
5. Revalidate every phase PID, cleanup, marker and diagnostics (154-228).
6. Current s5/run_s5_native.py and full_suite_verifier.py SHA must equal the
Root rehearsal versions.
7. Never relabel old S/oldQ/project_root/PIDs/time. Describe reuse only as
revalidating the exact-source-identical old full through the existing
full_suite route; never claim full ran on new S.
8. A separate Opus whole-unit review must independently confirm applicability.
Conditions 1–6 require actual checks after final freeze. If any predicate is
unproved or differs, reject reuse and execute full184 once on the final version.
SourceRefs (tools/run_all_tests.py:40-45) excludes docs/private package, but that
fact is no substitute for complete source equality. No reuse is approved here.
REPAIR48 current source status: see [REPAIR48_STATUS.md](../REPAIR48_STATUS.md). Earlier run directions and successes below are historical; they grant no P04 credit.
# REPAIR45 handoff
## REPAIR45 — implementation ready for submission
@@ -308,3 +359,25 @@ 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.
## REPAIR50 preparation (2026-10-18)
Commander-reported prior observation: all-equal array reversal produced
identical bytes (raw SHA prefix `bb0ccb1d…`), correctly accepted by the oracle;
the old control incorrectly required reject. Reported elapsed: 761.085 seconds.
This worker has not rerun that observation and does not supply a full SHA
from the abbreviated handoff. Earlier failure records are preserved.
The order control now records identity accept separately, swaps unequal typed
bytes, lists no-genuine-order cases, avoids duplicate parsing of the uncopied
record and memoizes only genuine BEFORE/command/guard derivations under strict
source-bound keys with finally restoration. Both copied modes and all
AFTER/journal/body traversal remain. Negative rejection is still ValueError;
parser rejection is separately visible. Synthetic equal-array, swap, type,
value, AFTER-copy and memo controls are prepared in --pure-only.
repair48_identity_controls.tree now hashes fixed-size chunks; its roster and
all other fixture logic remain unchanged. Root must run the new
repair50_stream_controls.py equivalence control. Only AST parse was performed
by this worker. No pure/native/formal pass, reuse approval or credit is claimed.
See ../REPAIR50_STATUS.md before running the existing Root sequence.
@@ -5,11 +5,41 @@ import importlib.util
import json
from pathlib import Path
PACKAGE_ROOT = Path(__file__).absolute().parents[1]
DEPENDENCIES = {}
DEPENDENCY_OBSERVATIONS = {}
_EXECUTED_DEPENDENCIES = {}
_EXECUTED_OBSERVATIONS = {}
def module(name, path):
path = Path(path).absolute()
if '..' in path.parts or any(p.is_symlink() for p in (path, *path.parents)):
raise ValueError('dependency traversal/symlink')
if not path.resolve(strict=True).is_relative_to(PACKAGE_ROOT.resolve(strict=True)):
raise ValueError('dependency outside package')
relative = path.relative_to(PACKAGE_ROOT).as_posix()
data = path.read_bytes()
spec = importlib.util.spec_from_file_location(name, path)
value = importlib.util.module_from_spec(spec)
spec.loader.exec_module(value)
exec(compile(data, str(path), 'exec'), value.__dict__)
DEPENDENCIES[relative] = hashlib.sha256(data).hexdigest()
DEPENDENCY_OBSERVATIONS[relative] = str(path)
for key, digest in getattr(value, 'DEPENDENCIES', {}).items():
dependency = Path(key)
if dependency.is_absolute() or '..' in dependency.parts:
raise ValueError('dependency key must be package relative')
observed = Path(value.DEPENDENCY_OBSERVATIONS[key])
if (observed != PACKAGE_ROOT / dependency
or any(p.is_symlink() for p in (observed, *observed.parents))
or not observed.resolve(strict=True).is_relative_to(PACKAGE_ROOT.resolve(strict=True))):
raise ValueError('dependency mapping outside package/symlink')
if key in DEPENDENCIES and DEPENDENCIES[key] != digest:
raise ValueError('dependency mapping conflict')
DEPENDENCIES[key] = digest
DEPENDENCY_OBSERVATIONS[key] = value.DEPENDENCY_OBSERVATIONS[key]
_EXECUTED_DEPENDENCIES.update(DEPENDENCIES)
_EXECUTED_OBSERVATIONS.update(DEPENDENCY_OBSERVATIONS)
return value
@@ -17,11 +47,11 @@ 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()
if (set(DEPENDENCIES) != {'s5/s5_power_adapter.py', 'p04_native_series.py', 's5/s5_guard_oracle.py'}
or power.DEPENDENCIES != {'p04_native_series.py': power.SERIES_SHA256}):
raise ValueError('loaded dependency roster mismatch')
GUEST, REQUEST = power.GUEST, power.REQUEST
SECOND, SECOND_REQUEST = 'p04.s5.guest.b', 'p04.s5.request.b'
@@ -415,7 +445,10 @@ DERIVERS = {'S5C_DESTRUCTION_COMMAND': destruction_command, 'S5D_DESTRUCTION_RAI
def derive(root, writer_sha, reader_sha):
root = Path(root)
require(DEPENDENCIES == _EXECUTED_DEPENDENCIES
and DEPENDENCY_OBSERVATIONS == _EXECUTED_OBSERVATIONS,
'dependency identity differs from executed module roster')
root = Path(root).resolve(strict=True)
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)
@@ -1,10 +1,13 @@
#!/usr/bin/env python3
"""Root-only typed mutations against fresh native S5 raw; never synthetic positives."""
import argparse
from contextlib import contextmanager
import hashlib
import json
from pathlib import Path
import struct
import sys
import time
sys.dont_write_bytecode = True
import s5_order_adapter as a
@@ -13,6 +16,70 @@ mutation = a.module('order_typed_mutation', Path(__file__).with_name('s5_power_a
BUILD = Path('/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build')
def order_variant(node):
"""Swap the first unequal typed byte pair, preserving the header."""
rows = [r.raw if node.kind == 28 else r[0].raw + r[1].raw for r in node.value]
for i in range(len(rows)):
for j in range(i + 1, len(rows)):
if rows[i] != rows[j]:
header = len(node.raw) - sum(map(len, rows))
rows[i], rows[j] = rows[j], rows[i]
return node.raw[:header] + b''.join(rows)
return None
def static_estimate(record):
kinds, nodes, candidates = {}, 0, 0
def visit(node):
nonlocal nodes, candidates
nodes += 1
kinds[str(node.kind)] = kinds.get(str(node.kind), 0) + 1
candidates += (2 if node.kind in (4, 21, 2) else 1 if node.kind == 1 else
int(bool(node.value)) + int(len(node.value) > 1) if node.kind == 28 else
int(len(node.value) > 1) if node.kind == 27 else 0)
if node.kind == 28:
for child in node.value:
visit(child)
elif node.kind == 27:
for key, child in node.value:
visit(key)
visit(child)
visit(record.at('after'))
return {'record_bytes': len(record.raw), 'after_nodes': nodes, 'kind_counts': kinds,
'candidate_count': candidates, 'verify_mutations': candidates * 2,
'disk_mutation_bytes': 0,
'memory_model': 'O(record_bytes * (mutated_kinds + 2) + after_nodes + output_labels); parser overhead unmeasured',
'time_model': 'O(verify_mutations * record_bytes); calibrate with --pure-only; not a measured ETA'}
@contextmanager
def expected_memo(stats, guard_raw):
oracle = a.guard_oracle
original = oracle.expected
sources = tuple(hashlib.sha256(Path(m.__file__).read_bytes()).digest()
for m in (oracle, a.series))
cache = {}
def wrapped(before, command, guard, parse, require):
require(parse(guard_raw).value == guard, 'memo exact guard binding')
blobs = (before.raw, command.raw, guard_raw)
key = (tuple((len(b), hashlib.sha256(b).digest()) for b in blobs), sources)
if key not in cache:
stats['miss'] += 1
tree, result = original(before, command, guard, parse, require)
cache[key] = (tree.raw, result.raw)
else:
stats['hit'] += 1
return tuple(parse(b) for b in cache[key])
oracle.expected = wrapped
try:
yield original
finally:
oracle.expected = original
def guard_mutations(record):
"""All typed AFTER nodes are tested, including every changed journal field.
@@ -20,11 +87,20 @@ def guard_mutations(record):
must still reject it. No native evidence is produced by these controls.
"""
oracle = a.guard_oracle
estimate = static_estimate(record)
a.require(oracle.verify(record, a.series.variant, a.require), 'guard control prerequisite')
checks = []
started = time.monotonic()
checks, identities, no_order = [], [], []
stats = {'hit': 0, 'miss': 0}
kinds, nodes, candidates = {}, 0, 0
representatives, first_last = {}, []
parser_rejections = []
after = record.at('after')
def visit(node, path):
nonlocal nodes, candidates
nodes += 1
kinds[str(node.kind)] = kinds.get(str(node.kind), 0) + 1
replacements = []
if node.kind in (4, 21):
replacements = [('value', oracle.atom(node.kind, node.value + '.mutated')),
@@ -40,30 +116,101 @@ def guard_mutations(record):
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))))
encoded = order_variant(node)
if encoded is None:
no_order.append(path + ':order-no-genuine-variant')
replacements.append(('identity-order' if encoded is None else 'unsorted',
node.raw if encoded is None else encoded))
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)])))
encoded = order_variant(node)
if encoded is None:
no_order.append(path + ':order-no-genuine-variant')
replacements.append(('identity-order' if encoded is None else 'unsorted',
node.raw if encoded is None else encoded))
for key, child in node.value:
visit(key, path + '/key:' + str(key.value))
visit(child, path + '/' + str(key.value))
for label, encoded in replacements:
candidates += 1
identity = encoded == node.raw
changed_after = mutation.replace(after, node, encoded)
changed_bytes = mutation.replace(record, after, changed_after)
try:
changed = a.series.variant(changed_bytes)
except ValueError:
if identity:
raise
changed = None
for copied in (False, True):
changed_record = mutation.replace(record, after, changed_after)
name = path + ':' + label + (':AFTER-copy' if copied else '')
# Copy even malformed typed AFTER bytes into EXPECTED, without
# parsing the invalid intermediate record a second time.
copied_bytes = (record.raw[:8] + b''.join(
k.raw + (changed_after if v is after or v is record.at('expected') else v.raw)
for k, v in record.value)) if copied else None
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)
tested = a.series.variant(copied_bytes) if copied else changed
except ValueError:
checks.append(path + ':' + label + (':AFTER-copy' if copied else ''))
continue
raise ValueError('guard mutation accepted: ' + path + ':' + label)
visit(after, 'after')
return checks
if identity:
raise
tested = None
if tested is None:
checks.append(name)
parser_rejections.append(name)
# Derivation inputs remain the original record's inputs.
tested = record
elif identity:
a.require(oracle.verify(tested, a.series.variant, a.require), 'identity accepted')
identities.append(name)
else:
try:
oracle.verify(tested, a.series.variant, a.require)
except ValueError:
checks.append(name)
else:
raise ValueError('guard mutation accepted: ' + name)
representatives.setdefault(node.kind, tested)
first_last[:] = [first_last[0] if first_last else tested, tested]
original = oracle.expected
with expected_memo(stats, record.at('guard').raw) as derive:
visit(after, 'after')
for tested in first_last + list(representatives.values()):
args = (tested.at('before'), tested.at('command'), tested.at('guard').value,
a.series.variant, a.require)
hit, plain = oracle.expected(*args), derive(*args)
a.require(tuple(n.raw for n in hit) == tuple(n.raw for n in plain), 'memo bytes')
before = record.at('before')
target = before.at('systems').at('runtime').at('next_command_id')
bad = bytearray(target.raw)
bad[4] ^= 1
changed_before = a.series.variant(mutation.replace(before, target, bytes(bad)))
changed_record = a.series.variant(mutation.replace(record, before, changed_before.raw))
misses = stats['miss']
try:
oracle.verify(changed_record, a.series.variant, a.require)
except ValueError:
pass
else:
raise ValueError('one-byte BEFORE mutation accepted')
a.require(stats['miss'] == misses + 1, 'one-byte BEFORE cache miss')
a.require(oracle.expected is original, 'memo wrapper restored')
try:
with expected_memo({'hit': 0, 'miss': 0}, record.at('guard').raw):
raise ValueError('cleanup sentinel')
except ValueError:
pass
a.require(oracle.expected is original, 'exceptional memo wrapper restored')
a.require(estimate['verify_mutations'] == candidates * 2 and estimate['after_nodes'] == nodes
and estimate['kind_counts'] == kinds, 'static enumeration agrees')
return {'negative_controls': checks, 'negative_count': len(checks),
'identity_positive_count': len(identities), 'identity_positive_list': identities,
'no_genuine_order_variant': no_order, 'memo': stats,
'parser_rejections': parser_rejections,
'elapsed': time.monotonic() - started,
'static_estimate': estimate}
def pure_controls():
@@ -82,7 +229,9 @@ def pure_controls():
('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))]))])
('business', d([('wallet', atom(2, 100)), ('reservations', arr([], 27)),
('equal_array', arr([atom(2, 0)] * 3, 2)),
('swap_array', arr([atom(2, 1), atom(2, 2)], 2))]))])
before = a.series.variant(d([('systems', d([('runtime', runtime)]))]))
results = {}
for guard in ('G1', 'G2'):
@@ -102,17 +251,25 @@ def pure_controls():
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)
report = results[guard]
a.require(any('equal_array:identity-order' in x for x in report['identity_positive_list']), 'equal array positive')
for label in ('swap_array:unsorted', 'wallet:value', 'wallet:int-float', 'wallet:value:AFTER-copy'):
a.require(any(label in x for x in report['negative_controls']), 'synthetic coverage: ' + label)
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('--estimate-record', type=Path, help='parse one guard record and print static estimate only')
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.estimate_record:
print(json.dumps(static_estimate(a.series.variant(args.estimate_record.read_bytes())), sort_keys=True))
return
if args.pure_only:
print(json.dumps(pure_controls(), sort_keys=True))
return
@@ -133,6 +290,7 @@ def main():
cases[case] = ({k: raw.typed(v) for k, v in branch['points'].items()},
[raw.typed(r) for r in branch['phases']])
checks = []
guard_reports = {}
def negative(label, case, owner, target, replacement):
points, phases = cases[case]
@@ -202,7 +360,9 @@ def main():
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)))
report = guard_mutations(raw.typed(reference))
guard_reports[case + ':' + label] = report
checks.extend(label + ':' + name for name in report['negative_controls'])
command = 'S5C_DESTRUCTION_COMMAND'
points, phases = cases[command]
end = points['held']
@@ -251,6 +411,7 @@ def main():
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,
'negative_count': len(checks), 'guard_reports': guard_reports,
'formal_acceptance': False}, sort_keys=True))
@@ -11,11 +11,20 @@ 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()
PACKAGE_ROOT = Path(__file__).absolute().parents[1]
SERIES_PATH = PACKAGE_ROOT / 'p04_native_series.py'
for _path in (SERIES_PATH, *SERIES_PATH.parents):
if _path.is_symlink():
raise ValueError('dependency symlink')
if not SERIES_PATH.resolve(strict=True).is_relative_to(PACKAGE_ROOT.resolve(strict=True)):
raise ValueError('dependency outside package')
_series_bytes = SERIES_PATH.read_bytes()
SERIES_SHA256 = hashlib.sha256(_series_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)
exec(compile(_series_bytes, str(SERIES_PATH), 'exec'), series.__dict__)
DEPENDENCIES = {'p04_native_series.py': SERIES_SHA256}
DEPENDENCY_OBSERVATIONS = {'p04_native_series.py': str(SERIES_PATH)}
CASES = ("S5A_PURE", "S5B_DEPENDENCY")
GUEST = "p04.s5.guest.a"
@@ -96,6 +105,7 @@ def duplicate_check(replay_node, recorded):
def derive(root, writer_sha, reader_sha):
root = Path(root).resolve(strict=True)
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)