fix(run-decisionboard): arm poll before selftest answers - #144
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Fix the run-decisionboard selftest so it does not manufacture a false board defect: the selftest must arm the Lavish poll before answering and must assert the listener precondition before trusting the answer path. Keep the board implementation unchanged. Fix screenshot ergonomics so repeated selftest runs do not fail on stale screenshot targets, while preserving the correct refusal to treat an unchanged or missing screenshot as evidence. Pin the false-negative behavior with tests, preserve the one-click board-check practice, and record that sandboxed workers must set TMPDIR and XDG_RUNTIME_DIR inside their own worktree because an unreadable temp board makes the Lavish open step return 500. The branch has already proved the live path with two clean back-to-back selftest runs using worktree-local scratch dirs.
What Changed
run-decisionboardselftest to arm Lavish polling before querying or answering, wait forpoll listening: yes, and refuse to proceed when the listener precondition is not met.FM_RUN_DECISIONBOARD_SHOT_ID, while still rejecting missing or unchanged screenshots as invalid evidence.TMPDIR/XDG_RUNTIME_DIRsetup for sandboxed workers.Risk Assessment
✅ Low: The change is tightly scoped to the run-decisionboard driver and behavior tests, and the reviewed paths now preserve the stated poll-listener and screenshot freshness invariants without changing the board implementation.
Testing
Inspected the run-decisionboard diff, ran the focused shell behavior tests, retried the live selftest after fixing the local setup by setting
FM_BOARD_VESSEL, and captured screenshot/HTML/log evidence showing the poll was armed before answering and the answer returned through Lavish./tmp/no-mistakes-evidence/01M0BKKC571XXK181ZGY7XZETA/run-decisionboard-selftest.png)Evidence: Rendered fixture board from live selftest
Evidence: Live selftest transcript
Live selftest log shows: poll listening: yes before answering; screenshot captured; decision 1 queued option-eins with note; Send to Agent clicked; poll returned the decision, option, and note; all nine hops held.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
.agents/skills/run-decisionboard/fm-run-decisionboard.sh:534- The default screenshot target is still only keyed by$$, so old bridge-owned staging files can collide again after PID reuse. Concrete path: a successful selftest leaves/tmp/fm-run-decisionboard-shot.<user>.<pid>.pngbehind whenrm -fcannot delete the bridge-owned file; later the shell gets the same PID, captures the same board pixels,before == after, andcapture_staged_screenshotreturns stale result 2 even though this run refreshed the file. That leaves the stated stale-target false negative reachable. Use a per-invocation value with practical collision resistance for the default target, while keepingFM_RUN_DECISIONBOARD_SHOT_IDfor tests.tests/fm-run-decisionboard.test.sh:329- This newly added test is source-content-only: it extractscmd_selftest()withsed, greps for helper names and literal text, and asserts their source order. Under the test-quality rule, that does not prove behavior and will fail on behavior-preserving refactors while passing dead/commented code. Replace it with an executable-interface test, for example fakefm-lavish.sh/chrome-devtools-axiinteractions and assert thatselfteststarts poll before answer/send and refuses to answer unlessqueryobservespoll listening: yes.🔧 Fix: Harden decisionboard selftest regressions
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-run-decisionboard.test.shattempted.agents/skills/run-decisionboard/fm-run-decisionboard.sh selftest --keepwith isolated evidence dirs; setup failed before building becauseFM_BOARD_VESSELwas unsetFM_BOARD_VESSEL=test-phase TMPDIR=/tmp/no-mistakes-evidence/01M0BKKC571XXK181ZGY7XZETA/live-selftest-*/tmp XDG_RUNTIME_DIR=/tmp/no-mistakes-evidence/01M0BKKC571XXK181ZGY7XZETA/live-selftest-*/xdg FM_RUN_DECISIONBOARD_TMPDIR=/tmp/no-mistakes-evidence/01M0BKKC571XXK181ZGY7XZETA/live-selftest-*/shot-staging .agents/skills/run-decisionboard/fm-run-decisionboard.sh selftest --keepvisual inspection of/tmp/no-mistakes-evidence/01M0BKKC571XXK181ZGY7XZETA/run-decisionboard-selftest.png✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.