fix(bin): only tell no-mistakes workers to pause for compaction when idle-compact is enabled - #14
Merged
Merged
Conversation
added 2 commits
October 1, 2026 20:14
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
Every new no-mistakes worker stops after its implementation commit with "paused: awaiting compaction before validation" and waits for an idle-compact hand-off that never comes, because this home has idle-compact turned off (only config/idle-compact.off exists, no config/idle-compact). Firstmate has had to steer each worker by hand to start validation. The fix: the Definition of done in bin/fm-dod-lib.sh should only tell a worker to pause for compaction when the home actually has idle-compact enabled; otherwise it should tell the worker to start validation right after its commit. Never run gh issue close, gh issue reopen, or any gh project command.
What Changed
bin/fm-dod-lib.sh: addedfm_dod_compaction_step, which uses the idle-compact watcher's ownfm_idle_compact_threshold_minutescheck onconfig/idle-compact. The no-mistakes Definition of done now includes the "paused: awaiting compaction before validation" instruction only when idle-compact is enabled. When it is off, the brief tells the worker to start validation (no-mistakes axi run) right after its implementation commit.docs/configuration.md: the declared-state fast path now says the pause instruction applies only when idle-compact is enabled, and describes the idle-compact-off behavior.tests/fm-brief.test.sh: added coverage for the brief's Definition of done (+38 lines).Risk Assessment
✅ Low: The DoD now derives the compaction pause from the watcher's own fm_idle_compact_threshold_minutes verdict with identical config resolution, falls back safely to "start validation" on any failure, and the tests exercise the real fm-brief.sh output for absent, empty, 0 and off configs, so both prior findings are verifiably fixed.
Testing
I ran the repo's fm-brief test file, which passes including the new regression test; that was a unit test run, not a live product drive. I also generated real no-mistakes briefs with bin/fm-brief.sh in a disposable home across seven config states, plus the base commit as a before check. With only idle-compact.off, the brief says to start validation, and the base commit still emits the pause line. Enabled, empty, and commented-numeric files keep the pause. The off, 0, and absent cases drop it, and a config override resolves correctly from another cwd. The temp home and worktree were removed and the working tree is clean.
Evidence: Live brief output per config state
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
bin/fm-dod-lib.sh:408- The new gate treats idle-compact as enabled whenever the file config/idle-compact exists ([ -f "$config/idle-compact" ]). The comment calls this "the same presence test" as bin/fm-idle-compact.sh, but the watcher does not decide enablement on presence alone.fm_idle_compact_threshold_minutes(bin/fm-idle-compact.sh:187), called first infm_idle_compact_tick(:918), returns disabled when the first content line is not a positive integer. Failing sequence: config/idle-compact contains0,off, or other non-numeric text. The watcher stays inert and never hands off. The DoD still emits "paused: awaiting compaction before validation". The worker stops and waits forever, which is the stall the change set out to fix. Fix: derive the DoD gate from the same predicate, either by sourcing and callingfm_idle_compact_threshold_minutes "$config" >/dev/nullor by sharing one helper. Add a test with a0orofffile expecting the start-validation text.docs/configuration.md:604- docs/configuration.md (the Declared-state fast path paragraph) still says a no-mistakes ship brief tells the worker to append the pause line unconditionally. Behavior is now conditional on config/idle-compact being enabled, so the doc is stale.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-brief.test.sh(includes new test_no_mistakes_dod_compaction_pause_follows_idle_compact_config; all ok)Livebin/fm-brief.sh <id> some-proj --mode no-mistakesin a disposable FM_HOME with only config/idle-compact.offSame command with config/idle-compact empty, containing a comment plus 20, containing off, containing 0, and removedSame command with FM_CONFIG_OVERRIDE pointing at a dir with idle-compact=10, run from a different cwdSame command from a throwaway worktree of base commit 5b9f42c with only idle-compact.off, to reproduce the original bug✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.