Repository navigation
test: consolidate lifecycle behavior coverage - #80
Conversation
…elpers Move operator-visible lifecycle behavior into focused end-to-end tests, table- drive repetitive cases, and add shared test helpers, without weakening any safety-critical coverage. - Add tests/lib.sh (reporters, self-cleaning temp root, fakebin/git/meta helpers, common assertions) plus behavior-area helpers tests/secondmate- helpers.sh and tests/wake-helpers.sh; refactor every test file onto them. - Split the two giant files by behavior area: fm-secondmate -> lifecycle e2e + safety; fm-wake-queue -> wake-queue losslessness + fm-watcher-lock + fm-daemon. - Add fm-secondmate-lifecycle-e2e (seed -> spawn -> routed send -> backlog handoff -> recovery respawn -> teardown) and fm-wake-daemon-lifecycle-e2e (routine/terminal routing across a watcher restart, one buffered digest, no duplicate, stale transient/persistent/resume). - Expand fm-afk-inject-e2e with a normal single-digest scenario and delete the five overlapping fake-tmux injection cases (persistent-swallow kept as a unit). - Table-drive the secondmate teardown path-boundary matrix, watch-arm started/self-heal, guard warnings, spawn-batch and bootstrap parsers, and the fm-update worlds. - Add an explicit timeout-minutes (15) to the behavior-test CI job. Preserved as focused matrices/units: teardown unlanded-work safety, lock- primitive races and watcher singleton, wake-queue losslessness and no-duplicate escalation, secondmate path-boundary validation on every entrypoint, fast- forward-only update skips, the captain-relevant status-phrase matrix, and no-mistakes init / origin preservation / never-write-through-a-project.
Post-rebase reconciliation after upstream restructured the test suite (kunchenguid#80) and the brief contract (kunchenguid#73): - bin/fm-brief.sh: collapse the gate-check definition-of-done clause, which had landed once per delivery-mode heredoc (3x), into a single GATE_CHECK variable appended once after the mode DOD. Identical brief output, no duplication. - tests/fm-secondmate-lifecycle-e2e.test.sh: re-land the scoped-watch coverage on the relocated spawn phase — stub the watch start via FM_CTX_WATCH_START_CMD (no leaked daemon) and assert a secondmate spawn starts a context-watch scoped to its own home; stub the recovery respawn's watch start too. - tests/fm-tangle-guard.test.sh: assert the crew-launch FM_HOME pin on the existing genuine-isolated-worktree success path (the post-kunchenguid#83 harness that can actually reach a successful ship launch), proving a crew launch pins FM_HOME to the spawning home for context-sentinel routing; teach its fake tmux to log send-keys so the launch env is observable. Full suite green (24 files), shellcheck clean, zero leaked daemons. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…unchenguid#80) * fix(tests): make jobs scheduler and Pi hung-successor checks deterministic Replace the jobs=2 0.5s/0.05s race with marker handshakes, and start the Pi ready-timeout only after first successor stdout so spawn latency is not treated as a hung watcher. Co-authored-by: Cursor <[email protected]> * no-mistakes(document): Document Pi watcher spawn grace semantics --------- Co-authored-by: Cursor <[email protected]>
Recorded agent runsTwo fresh agents were given only the two built-in skills (and their linked references) plus a wrapper Add a second skills folder (operator: "pick up the skills in its
Create a source (operator: new source with one skill
What the runs changed in the skill: they asked what to expect when |
… cleanup and relaunch (kunchenguid#80) * fix(bin): stop processes a job left in its copies at cleanup and relaunch A test loop or server a finished job started in its validation copy kept running after cleanup, because cleanup only stopped processes whose working directory was the task's own copy and only while that directory existed. Cleanup now also stops processes in the validation copies of the task's finished no-mistakes runs, still matches a copy that was already deleted, and matches a process running a file from inside a copy. Relaunch stops the same leftovers in finished validation copies before the replacement starts. Every stopped process is logged with its command line. * no-mistakes(review): Scan copies in one lsof pass, narrow arg match * no-mistakes(document): Document the ship relaunch reap in agent-control * no-mistakes(lint): Spell out grep flags to pass the leak guard
E8 scored for the first time: the gate passes, the atlas claim is not supported on readout editsE8 (edit prediction on the archived pi0.5 atlas capture) had never scored a predictions file. This PR adds the The claim, predicted against measuredClaim (C-1): predictions made with the published atlas, before the run, pass E8's rule on a frozen pool. C-2: they Every number is about checkpoint
Predictions sha256 (all hashed into one status line before the scoring run):
The full hashes are in The E8 verdict and what the eval can and cannot see
My answer to the open problem
Method, blinding and integrity
Changes
Dead ends and what is left unproven
|
Intent
Implement the firstmate test-suite consolidation specified by the audit report at data/tests-e2e-t7/report.md. Goal: move operator-visible lifecycle behavior into a few real end-to-end tests, table-drive repetitive cases, and add a shared test helper, WITHOUT weakening any safety-critical coverage - net result a smaller, less brittle suite with similar-or-better real coverage and runtime under ~2-3 minutes.
Key decisions and tradeoffs (so the diff's deletions read as intentional, not lost coverage):
Every removed or folded case was cross-checked against a new e2e phase or a retained matrix so no assertion was lost (only acceptable losses per the report: exact stdout copy and internal send-keys counts). Full suite is green (156 assertions across 12 files, ~2:00 wall clock) and shellcheck-clean.
What Changed
Risk Assessment
✅ Low: Captain, the remaining diff is confined to tests, README test listings, and a CI timeout/tmux preflight, with prior coverage gaps now explicitly covered.
Testing
Baseline inspection confirmed the change is a test-suite consolidation; the CI-equivalent shell behavior suite passed in 122 seconds, including the secondmate lifecycle e2e, wake-daemon lifecycle e2e, expanded AFK injection e2e, and retained safety matrices; lifecycle transcript artifacts were captured, and
git status --shortshowed no transient working-tree files left behind.Evidence: Full behavior test transcript
Evidence: Lifecycle evidence excerpt
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed (3) ✅
tests/fm-afk-inject-e2e.test.sh:28- This e2e exits 0 when tmux is missing, but this branch removes the fake-tmux unit checks for marker, single-line, and no-duplicate injection behavior and moves that operator-visible coverage here. CI does not explicitly install or require tmux, so a runner image change could silently drop that coverage while the job stays green. Make tmux required in CI or keep a small non-skipping unit fallback for those contracts.🔧 Fix: Require tmux for AFK e2e coverage
1 warning still open:
tests/fm-afk-inject-e2e.test.sh:203- This self-check still exits 0 when real tmux cannot expose typed composer text, but the consolidation now relies on this e2e for the marker, single-line, no-duplicate, and partial-input injection contracts. In CI, that would silently skip the replacement coverage even though tmux is present. Make this fail under CI or otherwise require the e2e coverage instead of treating it as a passing skip.🔧 Fix: Captain, require AFK e2e self-check coverage
1 warning still open:
tests/fm-secondmate-lifecycle-e2e.test.sh:123-phase_spawnno longer checks that codex secondmate launches omit the parent turn-end hook. The old unit rejectednotify=andturn-ended; with only the positive charter/FM_HOME assertions here, a regression that uses the normal codex launch template for secondmates would still pass while causing isolated secondmates to write parent turn-end signals. Add negative assertions fornotify=andturn-endedin the launch log.🔧 Fix: Captain: preserve secondmate launch isolation coverage
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
Inspected the test-suite diff withgit diff --stat 9e21160a2393850f4a17ece8c473cfc226ef4734..fb499a8ab2fc3f21b9e592a47997d6b07683ca90.Reviewed the CI test entrypoint and relevant consolidated tests:tests/lib.sh,tests/fm-secondmate-lifecycle-e2e.test.sh,tests/fm-wake-daemon-lifecycle-e2e.test.sh,.github/workflows/ci.yml, and the README test list.Ran the CI-equivalent behavior suite without lint/static analysis:for test_script in tests/*.test.sh; do "$test_script"; done.Captured reviewer evidence to/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KVYX4R3BFYR4P8PXZBBJ73PB/behavior-tests-transcript.txt.Extracted the operator-visible e2e phases to/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KVYX4R3BFYR4P8PXZBBJ73PB/lifecycle-evidence-excerpt.txt.Checked cleanup withgit status --short.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.