← Commit history

verb suite: end-of-run cleanup contract

John Lauer ·79f3069754 ·1mo ago ·parent 295faf3
2 files changed +45−3
dev-skills/fusion-verb-tests/SKILL.md+27−2
@@ -79,8 +79,9 @@ The runner asserts response shapes. Four things still need eyes each daily run:    not a dialog, not an empty tab. 2. **Timing drift.** Each result carries `sec`. A verb that passed but took 5x its    usual time is tomorrow's failure; compare against the previous report.-3. **The box was left as found.** Fusion running-state restored, the test board tab-   closed, no stray dialogs. `fusion_get_app_state` at the end should match the start.+3. **The box was left as found.** No stray dialogs, and `fusion_get_app_state` at the+   end should match the start. The runner handles the mechanical part (see the+   end-of-run cleanup below); the eyes-on part is confirming nothing weird survived. 4. **Failures get filed, not just logged.** A red verb gets an issue on    adom/fusion-bridge with the runner's JSON snippet, the bridge + add-in versions    (`fusion_readiness`), and repro args, per the issue-reporting skill.@@ -96,6 +97,30 @@ The runner asserts response shapes. Four things still need eyes each daily run:   are cleaned with `fusion_cleanup_cloud_files`; never the project root, per the   fusion-cloud-hygiene skill. +## End-of-run cleanup (John, 2026-08-14: "clean up also means closing fusion and other windows you opened including pup windows")++Cleanup is not just deleting temp files. **Close every window the test session caused+to exist.** The contract: *if the run opened it, the run closes it; if the user already+had it open, leave it alone.*++The runner does the box side automatically at the end of every run:+- wipes the `%TEMP%\fusion-verb-tests` scratch dir;+- snapshots whether Fusion was running BEFORE the run (the warmup app-state read), and+  if the run started Fusion, closes it with `fusion_stop`. If Fusion was already up it+  is the user's session and is LEFT RUNNING - never close a Fusion the user opened.++The AI running the session owns the rest, every time, unprompted:+- **Pup windows**: close every pup window/tab your test thread opened+  (`pup_close_window` on your own sessionIds). The one exception is a window you just+  opened deliberately to SHOW John results, that one stays until he is done with it,+  then gets closed too. Windows owned by OTHER threads are not yours; only take one+  over (takeover:true) when John has asked for cleanup and the window is unambiguous+  debris (placeholder pages), never when it holds real work.+- **Local debris**: /tmp working files, one-off scripts, stale build zips (release zips+  live in wiki releases; keep only the current one locally). Anything reusable gets+  promoted into `tools/` instead of lingering in /tmp.+- **Reports stay**: `tests/reports/` is the record, never part of cleanup.+ ## Reading a failure  - `wrong_document` where a PASS was expected: the guard fired - which document was
tests/run_verb_tests.py+18−1
@@ -286,7 +286,12 @@ def main():      print("warmup: waking the bridge (unscored)...")     call(a.target, "fusion_get_app_state", {}, timeout=45)-    call(a.target, "fusion_get_app_state", {}, timeout=45)+    pre = call(a.target, "fusion_get_app_state", {}, timeout=45) or {}+    # Cleanup contract (John, 2026-08-14): close what we opened. Snapshot whether Fusion+    # was running BEFORE the run; if the run started it, the run closes it at the end.+    # errorCode fusion_not_running is the definitive "was closed" signal; any successful+    # app-state read means it was already up (and stays up - it is the user's session).+    fusion_was_running = pre.get("errorCode") != "fusion_not_running"      described = {v[0] for v in describe._T}     untriaged = described - {k.split("#")[0] for k in PLAN}@@ -330,6 +335,18 @@ def main():     except Exception as e:         results.append({"verb": "focus_invariance", "status": "SKIP", "why": str(e)}) +    call(a.target, "shell_execute",+         {"command": 'cmd /c if exist "%TEMP%\\fusion-verb-tests" rd /s /q "%TEMP%\\fusion-verb-tests"',+          "reason": "verb-test cleanup: wipe the scratch dir"}, timeout=60)+    if not fusion_was_running:+        print("cleanup: this run started Fusion - closing it (fusion_stop)...")+        stopped = (call(a.target, "fusion_stop",+                        {"reason": "verb-test cleanup: run started Fusion, run closes it"},+                        timeout=120) or {}).get("success")+        print("  fusion_stop:", "ok" if stopped else "FAILED - close it by hand")+    else:+        print("cleanup: Fusion was already running before the run - leaving it (user's session).")+     passed = sum(1 for r in results if r["status"] == "PASS")     failed = [r for r in results if r["status"] == "FAIL"]     for r in results: