Skip to content

fix(bin): only tell no-mistakes workers to pause for compaction when idle-compact is enabled - #14

Merged
NewAiCoder merged 2 commits into
mainfrom
fm/fm-dod-compaction-wait-gate
Oct 2, 2026
Merged

NewAiCoder merged 2 commits into
mainfrom
fm/fm-dod-compaction-wait-gate

Conversation

@NewAiCoder

Copy link
Copy Markdown
Owner

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: added fm_dod_compaction_step, which uses the idle-compact watcher's own fm_idle_compact_threshold_minutes check on config/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.

  • Live validation: ✅ go - 5 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Home with only config/idle-compact.off (the reported setup): generated no-mistakes brief tells the worker to start validation and has no compaction pause ✅ pass live Live fm-brief.sh output: pause=0 start=1
Regression reproduced: base commit 5b9f42c in the same home still emits 'paused: awaiting compaction before validation' ✅ pass live Base worktree brief: pause=1
Idle-compact enabled (empty file or comment plus 20): brief keeps the compaction pause and omits the start-validation line ✅ pass live empty-enabled and comment-20 both pause=1 start=0
Adversarial: config/idle-compact present but disabled for the watcher ('off' or '0') or removed: brief starts validation, not the pause ✅ pass live off-text, zero and removed all pause=0 start=1
FM_CONFIG_OVERRIDE is honored and the brief resolves it when run from a different cwd ✅ pass live override case pause=1 with the override dir enabled
Repo regression test suite for fm-brief, including the new idle-compact config test ⏸️ untested no The prior payload recorded this as a unit test run (tests/fm-brief.test.sh) with live=false, so it did not establish a live result against the running product. Drive the generated brief live (covered…
Evidence: Live brief output per config state
only-off (config/idle-compact.off only): pause=0 start=1
empty config/idle-compact: pause=1 start=0
comment + 20: pause=1 start=0
'off' text: pause=0 start=1
'0': pause=0 start=1
file removed: pause=0 start=1
FM_CONFIG_OVERRIDE with idle-compact=10, other cwd: pause=1
Base commit 5b9f42c with only idle-compact.off: pause=1 (the reported bug)
Generated line with idle-compact off: Right after that implementation commit lands, start validation: measure the lane below, then run `no-mistakes axi run`.

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 in fm_idle_compact_tick (:918), returns disabled when the first content line is not a positive integer. Failing sequence: config/idle-compact contains 0, 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 calling fm_idle_compact_threshold_minutes "$config" >/dev/null or by sharing one helper. Add a test with a 0 or off file 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.

  • Live validation: ✅ go - 5 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Home with only config/idle-compact.off (the reported setup): generated no-mistakes brief tells the worker to start validation and has no compaction pause ✅ pass live Live fm-brief.sh output: pause=0 start=1
Regression reproduced: base commit 5b9f42c in the same home still emits 'paused: awaiting compaction before validation' ✅ pass live Base worktree brief: pause=1
Idle-compact enabled (empty file or comment plus 20): brief keeps the compaction pause and omits the start-validation line ✅ pass live empty-enabled and comment-20 both pause=1 start=0
Adversarial: config/idle-compact present but disabled for the watcher ('off' or '0') or removed: brief starts validation, not the pause ✅ pass live off-text, zero and removed all pause=0 start=1
FM_CONFIG_OVERRIDE is honored and the brief resolves it when run from a different cwd ✅ pass live override case pause=1 with the override dir enabled
Repo regression test suite for fm-brief, including the new idle-compact config test ⏸️ untested no The prior payload recorded this as a unit test run (tests/fm-brief.test.sh) with live=false, so it did not establish a live result against the running product. Drive the generated brief live (covered…
  • bash tests/fm-brief.test.sh (includes new test_no_mistakes_dod_compaction_pause_follows_idle_compact_config; all ok)
  • Live bin/fm-brief.sh <id> some-proj --mode no-mistakes in a disposable FM_HOME with only config/idle-compact.off
  • Same command with config/idle-compact empty, containing a comment plus 20, containing off, containing 0, and removed
  • Same command with FM_CONFIG_OVERRIDE pointing at a dir with idle-compact=10, run from a different cwd
  • Same 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.

@NewAiCoder
NewAiCoder merged commit 72b37d2 into main Oct 2, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant