diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01/REPAIR23_STATUS.md b/docs/plans/original-completion-2026-10-02/execution/p04-01/REPAIR23_STATUS.md new file mode 100644 index 0000000..0182a1b --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01/REPAIR23_STATUS.md @@ -0,0 +1,34 @@ +# Repair 23 — submitted, NOT RUN + +S4 source preparation only. The wrapper now defaults to fresh import without +accessing cache receipts or cache directories. It checks that private `.godot` +is absent immediately before import and requires the complete 316-script parse +roster. The complete 1338-file source check and sole QA override remain intact. +Optional cache mode retains the original registered-path, passed-run, source +identity, engine identity and original-cache preservation guards. + +Engine identity is independently pinned to +`c7cccbf8fb143e34e02fd6521e09be2c2b974f0d5db080b19071c9c570718ccf`. +Read-only SHA256 inspection found identical bytes in the installed executable +and the preserved r22 staged executable; neither was launched. + +Current wrapper SHA256: +`6d5f4e05e87607413bfb5498dc9c9e17c2bfd96bf751c9e645050ca6f8e69d5c`. +The current runbook binds this SHA. The series verifier already binds the wrapper +to current checkout bytes dynamically, so no series metadata change is needed. +Historical REPAIR22_STATIC_VALIDATION.json is preserved as historical evidence, +not rewritten to claim validation of the new wrapper. + +Root must use fresh staging `audit-support/p04-s4-source-r23` and fresh plan +`p04-s4-plan-r23.json`. Output remains `p04-s4-native-r22`. Old staging and plan +are preserved. All R22 fixes and other suite wrappers/checks are retained. + +Checker SHA256 remains +`a61c5b496e656f60c66898e42500bc9a2d45f947690ce8f5f19a03984ebbc850`; +S4 probe SHA256 remains +`ceb592d853fd50063f20496c7b6df05257528dbe1c0d0d80bc6a8ccb1f9dd6d7`. +No game input file was edited. Review was limited to source reading and hashes. +No Git, tests, fixtures, check-only execution, engine, Runner, agents or manual +commit were run. Native S4 evidence, root native/data/index work, independent +review and formal acceptance remain pending. The expected validate MANIFEST +failure is unchanged. Original P04-01 completion is not claimed. diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/S4_ROOT_RUN.md b/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/S4_ROOT_RUN.md index d4b0022..93ea845 100644 --- a/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/S4_ROOT_RUN.md +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/S4_ROOT_RUN.md @@ -15,19 +15,17 @@ provenance only. Never open their original production locations. export B=/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/.runtime/P04-01/build export E=docs/plans/original-completion-2026-10-02/execution/p04-01 export PYTHONDONTWRITEBYTECODE=1 -mkdir "$B/audit-support/p04-s4-source-r22" -cp "$E/s4/run_s4_native.py" "$E/s4/p04_s4_power_probe.gd" "$E/s4/S4_ROOT_RUN.md" "$B/audit-support/p04-s4-source-r22/" -cp /Applications/Godot.app/Contents/MacOS/Godot "$B/audit-support/p04-s4-source-r22/Godot" -python3 "$B/audit-support/p04-s4-source-r22/run_s4_native.py" \ +mkdir "$B/audit-support/p04-s4-source-r23" +cp "$E/s4/run_s4_native.py" "$E/s4/p04_s4_power_probe.gd" "$E/s4/S4_ROOT_RUN.md" "$B/audit-support/p04-s4-source-r23/" +cp /Applications/Godot.app/Contents/MacOS/Godot "$B/audit-support/p04-s4-source-r23/Godot" +python3 "$B/audit-support/p04-s4-source-r23/run_s4_native.py" \ --project-root "$B/audit-support/p04-r17-full-inputs-r01/product" \ - --output "$B/p04-s4-native-r22" --plan "$B/p04-s4-plan-r22.json" \ - --cache-run "$B/p04-final-product-full-r01" \ - --godot "$B/audit-support/p04-s4-source-r22/Godot" --check-only -python3 "$B/audit-support/p04-s4-source-r22/run_s4_native.py" \ + --output "$B/p04-s4-native-r22" --plan "$B/p04-s4-plan-r23.json" \ + --godot "$B/audit-support/p04-s4-source-r23/Godot" --check-only +python3 "$B/audit-support/p04-s4-source-r23/run_s4_native.py" \ --project-root "$B/audit-support/p04-r17-full-inputs-r01/product" \ - --output "$B/p04-s4-native-r22" --plan "$B/p04-s4-plan-r22.json" \ - --cache-run "$B/p04-final-product-full-r01" \ - --godot "$B/audit-support/p04-s4-source-r22/Godot" + --output "$B/p04-s4-native-r22" --plan "$B/p04-s4-plan-r23.json" \ + --godot "$B/audit-support/p04-s4-source-r23/Godot" ``` The first invocation only prepares the pinned plan: zero engine launches. The @@ -41,6 +39,11 @@ inputs. Reader uses only the existing IO1 formal package mapping. Exact input footprints: +- Current S4 wrapper SHA256: + `6d5f4e05e87607413bfb5498dc9c9e17c2bfd96bf751c9e645050ca6f8e69d5c`. + The plan pins these exact bytes; `p04_native_series.py` checks the wrapper + against the current source file dynamically. Historical r22 receipts remain + unchanged and do not describe this r23 wrapper. - `B/audit-support/p04-r17-full-inputs-r01/MANIFEST.json`, SHA256 `a15f29fa12537f6d8aaf7cabea390922a9f16e3eb9c10981e5742aafc8c4c8a8`. - All 1338 files below that relocation's `product/`, each matched to the @@ -48,17 +51,23 @@ Exact input footprints: - Its `fixed/6ce6b28c5985e8a4f13b78bfeb1f1e09f6216d874fb01e0656ec1633bfa01cd7/completion_marker_contracts.json`. - `B/audit-support/p04-review-repair22-r01/ACTUAL_CURRENT_PUBLIC_POWER_FUNCTIONS.json`. - The three staged S4 files above, pinned by the plan, and the staged native - executable at B/audit-support/p04-s4-source-r22/Godot, pinned before native + executable at B/audit-support/p04-s4-source-r23/Godot, pinned before native admission and checked unchanged after collection. The only stage override is `tests/s3/test_runtime_staff_assignment.gd` with the S4 probe. Harness and kitchen fixture are the unchanged product files; inherited sources are included in the full1338 map. The parse roster is all316 `.gd` inputs. -- `B/p04-final-product-full-r01/{runner-input.json,runner-ended.json,stage/.godot/**}`: - immutable ended cache. Its selected1339 map equals the complete product1338 - plus the checker. Cache cloning uses separate inodes; normal import and parse - still run. The checker is not a `.gd` parse input or a product-suite dependency. +- Fresh mode is the default: no cache receipt or cache directory is accessed, + read or cloned. The private `stage/.godot` must be absent immediately before + the actual full import. All316 scripts are parsed before Writer and Reader. +- The engine SHA256 is + `c7cccbf8fb143e34e02fd6521e09be2c2b974f0d5db080b19071c9c570718ccf`, + matching the installed executable and preserved r22 staged executable during + source preparation. Fresh mode does not obtain engine identity from a cache. +- Optional `--cache-run` retains the registered path, passed-run, complete-source + and engine identity guards. The known red run remains ineligible. The commands + above use no cache. Preserve the old r22 staging and plan unchanged. -Exact output footprints are `B/p04-s4-plan-r22.json` and the fresh +Exact output footprints are `B/p04-s4-plan-r23.json` and the fresh `B/p04-s4-native-r22/**`: private selected source stage, complete phase receipts and logs, raw JSON/Variant points and all phase observations, full source maps, PID and cleanup receipts. `formal/{writer,reader}/S4-{boundary,held,recovered}/` diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py b/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py index 8a40f71..5cd39f4 100644 --- a/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01/s4/run_s4_native.py @@ -18,6 +18,7 @@ CACHE_RUN = BUILD / "p04-final-product-full-r01" TEST = "tests/s3/test_runtime_staff_assignment.gd" QA = HERE / "p04_s4_power_probe.gd" ENGINE = HERE / "Godot" +ENGINE_SHA256 = "c7cccbf8fb143e34e02fd6521e09be2c2b974f0d5db080b19071c9c570718ccf" MANIFEST = BUILD / "audit-support/p04-r17-full-inputs-r01/MANIFEST.json" MANIFEST_SHA = "a15f29fa12537f6d8aaf7cabea390922a9f16e3eb9c10981e5742aafc8c4c8a8" CONTRACTS = BUILD / "audit-support/p04-r17-full-inputs-r01/fixed/6ce6b28c5985e8a4f13b78bfeb1f1e09f6216d874fb01e0656ec1633bfa01cd7/completion_marker_contracts.json" @@ -72,14 +73,15 @@ def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--project-root", type=Path, default=PRODUCT) parser.add_argument("--output", type=Path, default=BUILD / "p04-s4-native-r22") - parser.add_argument("--plan", type=Path, default=BUILD / "p04-s4-plan-r22.json") - parser.add_argument("--cache-run", type=Path, default=CACHE_RUN) + parser.add_argument("--plan", type=Path, default=BUILD / "p04-s4-plan-r23.json") + parser.add_argument("--cache-run", type=Path, default=None, + help="optional passed registered cache; default is fresh, without cache access") parser.add_argument("--godot", type=Path, default=ENGINE) parser.add_argument("--check-only", action="store_true") args = parser.parse_args() if args.godot.resolve() != ENGINE.resolve(): raise ValueError("use the exact own-B staged engine") - if args.cache_run.resolve() != CACHE_RUN.resolve(): + if args.cache_run is not None and args.cache_run.resolve() != CACHE_RUN.resolve(): raise ValueError("only registered own-B full-run cache") root = args.project_root.resolve() out = args.output.resolve() @@ -101,7 +103,7 @@ def main(): selected = dict(root_before=source_before, map={n: p["sha256"] for n, p in refs.items()}, timeout=1200) cache_note = None cache_receipts = [] - for leaf in ["runner-ended.json", "runner-input.json"]: + for leaf in (["runner-ended.json", "runner-input.json"] if args.cache_run is not None else []): path = args.cache_run / leaf try: cache_receipts.append(pin(path)) @@ -111,7 +113,10 @@ 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, cache_run=str(args.cache_run), + QA_overrides=[TEST], fixed_input_pins=fixed, + cache_run=str(args.cache_run) if args.cache_run is not None else None, + import_mode="cache" if args.cache_run is not None else "fresh", + engine_sha256=ENGINE_SHA256, cache_receipts=cache_receipts, cache_access=cache_note, phases=["import", "parse", "writer", "reader"], native_engine_launches=0, whole_goal_accepted=False, unit_accepted=False) @@ -137,21 +142,25 @@ def main(): for value in fixed + cache_receipts: r.require(pin(value["path"]) == value, "fixed input changed: " + value["path"]) fixed_guard() - # Native admission is Root-only and fails closed on unreadable cache. - r.require(cache_note is None, "Root must read exact cache receipts: " + str(cache_note)) old = args.cache_run - r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed") - old_map = r.read(old / "runner-input.json")["selected_source_map"] - current_map = {n: p["sha256"] for n, p in source_before.items()} - r.require({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") + if old is not None: + # Native cache admission remains Root-only and fails closed. + r.require(cache_note is None, "Root must read exact cache receipts: " + str(cache_note)) + r.require(r.read(old / "runner-ended.json")["passed"], "ended cache run must have passed") + old_map = r.read(old / "runner-input.json")["selected_source_map"] + current_map = {n: p["sha256"] for n, p in source_before.items()} + r.require({k: v for k, v in old_map.items() if k != "tools/check_p04_order_evidence.py"} == current_map and len(old_map) == 1339, "immutable full cache: all 1338 product inputs equal; checker is not parsed/executed by product suites") protected = r.default_player(root) outer = module("s4_owned_outer", r.SUPPORT / "owned_outer.py") r.require(not outer.native.helper["live_engines"](), "another Godot owns CPU") engine = args.godot.resolve() r.require(engine.is_file(), "Root native Godot path") engine_descriptor = pin(engine) - r.require(engine_descriptor["sha256"] == r.read(old / "runner-input.json")["engine_sha256"], - "staged engine matches preserved full proof; no environment substitution") + r.require(engine_descriptor["sha256"] == ENGINE_SHA256, + "exact reviewed staged engine; no environment substitution") + if old is not None: + r.require(engine_descriptor["sha256"] == r.read(old / "runner-input.json")["engine_sha256"], + "staged engine matches preserved full proof; no environment substitution") r.require(shutil.disk_usage(out.parent).free >= 1024**3 + engine.stat().st_size + 136*1024**2, "reviewed native disk admission") r.require(not out.exists(), "fresh output required; preserve previous attempts") @@ -191,21 +200,23 @@ def main(): data = value["text"].encode() r.require(hashlib.sha256(data).hexdigest() == value["sha256"], "bootstrap pin") (out / "bootstrap" / name).write_bytes(data) - cache = old / "stage/.godot" - cache_before = r.inventory(cache) - r.require(bool(cache_before), "nonempty ended cache") - for name in cache_before: - src = cache / name - dst = stage / ".godot" / name - dst.parent.mkdir(parents=True, exist_ok=True) - subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True) - r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino), - "cache clone is a separate inode") - r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes") - r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts, - whole_cache=cache_before, independent_inode=True, - ordinary_import_required=True, ordinary_parse_required=True)) + if old is not None: + cache = old / "stage/.godot" + cache_before = r.inventory(cache) + r.require(bool(cache_before), "nonempty ended cache") + for name in cache_before: + src = cache / name + dst = stage / ".godot" / name + dst.parent.mkdir(parents=True, exist_ok=True) + subprocess.run(["/bin/cp", "-c", str(src), str(dst)], check=True) + r.require((src.stat().st_dev, src.stat().st_ino) != (dst.stat().st_dev, dst.stat().st_ino), + "cache clone is a separate inode") + r.require(r.inventory(stage / ".godot") == cache_before, "whole cache clone hashes") + r.write(out / "cache-reuse.json", dict(ended_run=str(old), receipts=cache_receipts, + whole_cache=cache_before, independent_inode=True, + ordinary_import_required=True, ordinary_parse_required=True)) paths = ["res://" + n for n in sorted(refs) if n.endswith(".gd")] + r.require(len(paths) == 316, "complete 316-script parse roster") r.write(out / "parse-paths.json", paths) markers = module("s4_markers", root / "tools/strict_test_markers.py") contracts = markers.load_contracts(CONTRACTS) @@ -226,6 +237,9 @@ def main(): writer = r.read(out / "raw/writer.json") formal_before = {n: r.inventory(Path(p)) for n, p in writer["slots"].items()} r.require(sorted(formal_before) == SLOTS, "exact three formal points for isolated power case") + if phase == "import" and old is None: + r.require(not (stage / ".godot").exists() and not (stage / ".godot").is_symlink(), + "fresh private .godot absent at actual import") row = r.execute_phase(str(engine), stage, out, phase, test, selected, expected, previous, policy, contracts, paths, public, protected, root, outer, markers, diagnostics, owners, audio)