diff --git a/AGENTS.md b/AGENTS.md index 5a1e7873..3189e15f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -62,6 +62,9 @@ release remain frozen. names a stricter checked-in runner. The command owns one source/HOME/cache/ TMP/browser root and removes it after archiving compact evidence on success, failure, timeout or handled interruption. +- A zero child exit is not sufficient. Godot/runtime diagnostics remain strict, + and formal calls must pass each expected terminal with `--require-marker`; + every required marker must appear exactly once before the runner records PASS. - Test commands write retained artifacts only below `ABG_EVIDENCE_DIR`. Do not place source archives, Godot import caches, browser profiles, raw Chrome code-signing copies or temporary HOME directories there. diff --git a/CURRENT_CHECKPOINT.md b/CURRENT_CHECKPOINT.md index 205c5dc9..9727527c 100644 --- a/CURRENT_CHECKPOINT.md +++ b/CURRENT_CHECKPOINT.md @@ -2372,15 +2372,21 @@ Owner checkpoint 2 without changing gameplay, content or presentation. before loading Playwright. The helper confines Chrome profiles, artifacts and macOS signing copies, cleans normal/signal exits and removes stale owned roots. - Self-test marker is - `ABG_TEST_ATTEMPT_RUNNER_OK pass=2 fail_attempts=7 retained_failures=3 - archive_cleanup=true interrupt_cleanup=true stale_cleanup=true - browser_cleanup=true`. + `ABG_TEST_ATTEMPT_RUNNER_OK pass=2 fail_attempts=8 retained_failures=3 + archive_cleanup=true interrupt_cleanup=true strict_diagnostics=true + marker_gate=true stale_cleanup=true browser_cleanup=true`. - A real fresh-archive Godot import plus FG-4 content-registry smoke passes at `/private/tmp/abg-runner-smoke-evidence/fg4-runner-smoke/20260817T031332Z-96715/`. Its temporary work root is empty after the run and retained output is about `140 KiB`. No repository Playwright package is currently installed, so the actual Chrome launch remains a Step-10 H5 transport check rather than an inferred pass. +- Dirty-tree midpoint attempt 01 at + `/private/tmp/abg-step10-dev-evidence/fg4-midpoint-dev/20260817T032600Z-8140/` + is development-only `INVALID_RUNNER_DIAGNOSTIC`: Godot emitted parse errors + but returned zero, exposing the old exit-code-only classifier. It is not + product evidence and is never reused. The forward runner repair rejects the + strict diagnostics and requires every named terminal exactly once. Shortest next action: add the continuous RG-03/RG-04 five-profile simulation test and run it together with the three existing Save-v11 persistence matrices. diff --git a/docs/goals/FG4_MIDGAME_RG03_RG04_GOAL.md b/docs/goals/FG4_MIDGAME_RG03_RG04_GOAL.md index e78a5777..a150aa8f 100644 --- a/docs/goals/FG4_MIDGAME_RG03_RG04_GOAL.md +++ b/docs/goals/FG4_MIDGAME_RG03_RG04_GOAL.md @@ -96,7 +96,9 @@ The Step-10 attempt runner now confines fresh archive/import, HOME, cache, TMP and browser state to one owned root, archives only compact evidence, removes the root at terminal and retains no more than three unprotected failed attempts per label. Repository Playwright checks install the same owned-root lifecycle before -loading Playwright. +loading Playwright. A zero child exit is insufficient: strict runtime +diagnostics must be empty and every declared terminal marker must occur exactly +once. ## Legal Terminal diff --git a/docs/reviews/PHASE9_GODOT_VERTICAL_SLICE_LEDGER.md b/docs/reviews/PHASE9_GODOT_VERTICAL_SLICE_LEDGER.md index 15d7d015..c947148c 100644 --- a/docs/reviews/PHASE9_GODOT_VERTICAL_SLICE_LEDGER.md +++ b/docs/reviews/PHASE9_GODOT_VERTICAL_SLICE_LEDGER.md @@ -2381,3 +2381,23 @@ candidate, then create one runtime-only cached H5 for Owner checkpoint 2. Shortest next action: implement the combined two-Region five-profile authority and execute it with the existing RG-03 and RG-04 Save-v11 matrices. + +## FG-4 Step 10 Runner Strict-Terminal Repair - 2026-08-17 + +- Dirty-tree midpoint attempt 01 is retained at + `/private/tmp/abg-step10-dev-evidence/fg4-midpoint-dev/20260817T032600Z-8140/` + as `INVALID_RUNNER_DIAGNOSTIC`. Four GDScript parse diagnostics were present, + but Godot returned zero and the first runner revision incorrectly recorded + PASS. It supplies no product judgment and is not reused. +- The forward repair scans the complete command log for script, parse, error, + ObjectDB, resource and RID cleanup diagnostics. Formal calls declare one or + more `--require-marker` values, each of which must occur exactly once. A zero + exit with diagnostics or a missing/duplicate terminal now returns `86` and + cannot be recorded as PASS. +- The expanded self-test passes two successes and eight failed-class attempts, + including synthetic zero-exit strict diagnostics, exact marker gating, + timeout and handled interruption. All failed classes still share the same + three-attempt payload ceiling and every owned workspace is removed. + +Shortest next action: retain only the repaired-runner midpoint result, execute +the four profile/Save regressions, then commit the bounded Step-10 test source. diff --git a/docs/runtime/fg4/IMPLEMENTATION_PLAN.md b/docs/runtime/fg4/IMPLEMENTATION_PLAN.md index 254446a3..1a0fda10 100644 --- a/docs/runtime/fg4/IMPLEMENTATION_PLAN.md +++ b/docs/runtime/fg4/IMPLEMENTATION_PLAN.md @@ -735,6 +735,6 @@ NEXT STEP: stop for Owner checkpoint 2; RG-05 and native delivery stay frozen. | `FG4-I07` | `RESOLVED_STEP_6` | One validated combined graph preserves all RG-03 rows and adds complete RG-04 content, deterministic Markets and descriptor-only Bosses. | | `FG4-I08` | `RESOLVED_STEP_7` | Exact RG-03 close activates RG-04; 36 routes, Walking Index, permanent-loss recovery, one Record and Save-v11 C2 handoff are atomic. | | `FG4-I09` | `RESOLVED_STEP_9` | The final Quillroot mix reserves 3 dB SFX headroom and the recording keeps RG-05 visible through teardown; R5 is strict-clean. | -| `FG4-I10` | `RESOLVED_STEP_10_TOOLING` | `run_test_attempt.py` now archives compact results and removes owned source/HOME/cache/TMP/browser roots; all failed outcomes share a three-attempt ceiling, and repository Playwright checks use one cleanup/stale-recovery helper before loading Playwright. | +| `FG4-I10` | `RESOLVED_STEP_10_RUNNER` | Cleanup/retention passed; after dirty-tree attempt 01 proved Godot can return zero on parse error, the runner added strict diagnostic rejection and exact-one required-marker gates. Attempt 01 is development-only `INVALID_RUNNER_DIAGNOSTIC` and is not reused. | diff --git a/tools/run_test_attempt.py b/tools/run_test_attempt.py index a81290fb..26dd77fc 100755 --- a/tools/run_test_attempt.py +++ b/tools/run_test_attempt.py @@ -23,6 +23,15 @@ RUNNER_ID = "aetherbound-test-attempt-v1" OWNER_FILE = ".abg-attempt-owner.json" RESULT_FILE = "result.json" KEEP_FILE = ".keep" +STRICT_DIAGNOSTICS = ( + "SCRIPT ERROR:", + "Parse Error:", + "ERROR:", + "ObjectDB instances leaked", + "resources still in use at exit", + "RID allocations of type", + "RID of type", +) _child: subprocess.Popen[bytes] | None = None _interrupted_signal: int | None = None @@ -38,6 +47,8 @@ def parse_args() -> argparse.Namespace: parser.add_argument("--keep-failed", type=int, default=3) parser.add_argument("--keep-passed", type=int, default=3) parser.add_argument("--timeout", type=float, default=900.0) + parser.add_argument("--require-marker", action="append", default=[]) + parser.add_argument("--allow-diagnostics", action="store_true") parser.add_argument("command", nargs=argparse.REMAINDER) args = parser.parse_args() if args.command and args.command[0] == "--": @@ -155,6 +166,17 @@ def hash_inventory(root: Path) -> list[str]: return rows +def inspect_terminal(log_path: Path, required_markers: list[str], allow_diagnostics: bool) -> tuple[list[str], dict[str, int]]: + text = log_path.read_text(encoding="utf-8", errors="replace") + diagnostics: list[str] = [] + if not allow_diagnostics: + for line in text.splitlines(): + if any(marker in line for marker in STRICT_DIAGNOSTICS): + diagnostics.append(line.strip()) + marker_counts = {marker: text.count(marker) for marker in required_markers} + return diagnostics, marker_counts + + def extract_source(repository: Path, git_ref: str, destination: Path, log) -> str: archive_path = destination.parent / "source.tar" subprocess.run( @@ -236,6 +258,8 @@ def main() -> int: archive_sha256 = "" outcome = "FAIL" error = "" + diagnostics: list[str] = [] + marker_counts: dict[str, int] = {} try: with command_log.open("wb") as log: if args.git_ref: @@ -286,6 +310,16 @@ def main() -> int: _child.wait(timeout=5) return_code = 124 pump.join(timeout=5) + diagnostics, marker_counts = inspect_terminal( + command_log, args.require_marker, args.allow_diagnostics + ) + marker_failure = any(count != 1 for count in marker_counts.values()) + if not timed_out and return_code == 0 and (diagnostics or marker_failure): + return_code = 86 + if diagnostics: + error = "strict runtime diagnostics detected" + else: + error = "required marker count is not exactly one" outcome = "TIMEOUT" if timed_out else ("PASS" if return_code == 0 else "FAIL") except KeyboardInterrupt: outcome = "INTERRUPTED" @@ -304,10 +338,16 @@ def main() -> int: terminate_child(signal.SIGKILL) _child.wait(timeout=5) archive_path = artifact_dir / "evidence.tar.gz" - archive_count, archive_sha256 = archive_evidence(evidence_dir, archive_path) - if archive_count == 0 and archive_path.exists(): - archive_path.unlink() - shutil.rmtree(attempt_root) + try: + archive_count, archive_sha256 = archive_evidence(evidence_dir, archive_path) + if archive_count == 0 and archive_path.exists(): + archive_path.unlink() + except Exception as exc: + outcome = "HARNESS_ERROR" + return_code = 1 + error = f"evidence archival failed: {type(exc).__name__}: {exc}" + finally: + shutil.rmtree(attempt_root) finished_at = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) result = { @@ -322,6 +362,8 @@ def main() -> int: "return_code": return_code, "timed_out": timed_out, "error": error, + "strict_diagnostics": diagnostics, + "required_marker_counts": marker_counts, "workspace_removed": not attempt_root.exists(), "stale_workspaces_removed": stale_removed, "evidence_files": archive_count, diff --git a/tools/test_run_test_attempt.py b/tools/test_run_test_attempt.py index 2b58f73a..e83e0ad5 100755 --- a/tools/test_run_test_attempt.py +++ b/tools/test_run_test_attempt.py @@ -24,6 +24,7 @@ def invoke( *, timeout: str = "5", git_ref: str = "", + required_markers: tuple[str, ...] = (), ) -> subprocess.CompletedProcess[str]: arguments = [ sys.executable, @@ -45,6 +46,8 @@ def invoke( ] if git_ref: arguments.extend(["--git-ref", git_ref]) + for marker in required_markers: + arguments.extend(["--require-marker", marker]) arguments.extend(["--", *command]) completed = subprocess.run( arguments, @@ -102,9 +105,14 @@ def main() -> int: archived = invoke( base, "lifecycle", - ["/bin/sh", "-c", 'test -f README.md; printf archive > "$ABG_EVIDENCE_DIR/archive.txt"'], + [ + "/bin/sh", + "-c", + 'test -f README.md; printf "archive\\n"; printf archive > "$ABG_EVIDENCE_DIR/archive.txt"', + ], 0, git_ref="HEAD", + required_markers=("archive",), ) assert "ABG_TEST_ATTEMPT_PASS" in archived.stdout assert list((base / "work").iterdir()) == [], "git-archive attempt leaked source or cache data" @@ -112,6 +120,14 @@ def main() -> int: timed_out = invoke(base, "lifecycle", ["/bin/sh", "-c", "sleep 2"], 124, timeout="0.2") assert "ABG_TEST_ATTEMPT_TIMEOUT" in timed_out.stdout + strict_failure = invoke( + base, + "lifecycle", + ["/bin/sh", "-c", "printf 'SCRIPT ERROR: synthetic parse failure\\n'"], + 86, + ) + assert "ABG_TEST_ATTEMPT_FAIL" in strict_failure.stdout + interrupted_process = subprocess.Popen( [ sys.executable, @@ -157,7 +173,7 @@ def main() -> int: ) assert failed == 3, "all failed evidence classes combined must be bounded to three" journal = (family / "attempts.jsonl").read_text(encoding="utf-8").splitlines() - assert len(journal) == 9, "all attempt terminals remain in the compact append-only journal" + assert len(journal) == 10, "all attempt terminals remain in the compact append-only journal" assert list((base / "work").iterdir()) == [], "failed attempts leaked workspaces" browser_parent = base / "browser" @@ -186,7 +202,7 @@ def main() -> int: assert browser_check.returncode == 0, browser_check.stdout assert list(browser_parent.iterdir()) == [], "browser temp helper leaked current or stale owned roots" - print("ABG_TEST_ATTEMPT_RUNNER_OK pass=2 fail_attempts=7 retained_failures=3 archive_cleanup=true interrupt_cleanup=true stale_cleanup=true browser_cleanup=true") + print("ABG_TEST_ATTEMPT_RUNNER_OK pass=2 fail_attempts=8 retained_failures=3 archive_cleanup=true interrupt_cleanup=true strict_diagnostics=true marker_gate=true stale_cleanup=true browser_cleanup=true") return 0