feat(watcher): add fm-jules-check.sh poll arm for Jules coding-agent sessions - #511
Closed
blazingbunny wants to merge 3 commits into
Closed
blazingbunny wants to merge 3 commits into
blazingbunny wants to merge 3 commits into
Conversation
bin/fm-jules-check.sh mirrors fm-pr-check.sh's structure: appends jules_session= to state/<id>.meta idempotently, then writes state/<id>.check.sh that polls jules-axi watch for state transitions. The generated check.sh is thin (4 lines) — jules-axi watch already owns the no-change-is-silent contract. tests/fm-jules-check.test.sh covers: first-arm meta append, idempotent re-arm, check.sh invocation shape, silence-on-no-output, transition echo, and graceful exit when jules-axi is absent.
…rm, register script in docs
…e mechanics that omitted the new Jules session poll; no gaps remain unresolved.
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
Add watcher poll arm for Jules coding-agent sessions so firstmate can wake on session state transitions instead of manually polling jules-axi
What Changed
bin/fm-jules-check.sh, a watcher poll-arm script (same pattern asfm-pr-check.sh) that callsjules-axi watchand recordsjules_session=instate/<id>.metaso the watcher can wake firstmate on Jules session state transitions instead of manual polling.jules_sessionleft the previous poll's watermark file (state/<id>.jules.state) in place; the watermark is now cleared on re-arm so a changed session doesn't inherit a stale state.jules_session=meta field indocs/scripts.md's toolbelt table andAGENTS.md'sstate/<id>.metafield list, and fixed 3 other stale doc references to check-poll wake mechanics that omitted the Jules session poll.tests/fm-jules-check.test.shcovering the script's behavior.Risk Assessment
✅ Low: Round-1 findings (stale watermark on re-arm, missing docs registration) are both correctly fixed, tests cover the fix, and the new script/doc entries closely mirror the existing fm-pr-check.sh pattern with no new issues introduced.
Testing
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-jules-check.sh:23- When fm-jules-check.sh is invoked again for the same task id with a different jules_session (a legitimate re-arm, e.g. a retried Jules run), the previous poll's watermark file state/<id>.jules.state is never removed. jules-axi watch is handed a state file that was populated while watching a different session id. If jules-axi's state format doesn't itself key on session id, this can suppress the first real transition of the new session (watcher stays silent) or otherwise misreport transitions. The idempotency check only guards exact-duplicate session values (line 19), not a changed session for the same id.docs/scripts.md- bin/fm-jules-check.sh follows the same 'arm the watcher's poll' pattern as fm-pr-check.sh, which is listed in docs/scripts.md's bin/ toolbelt table and whose meta field (pr=/pr_head=) is called out in AGENTS.md section 2's state/<id>.meta field list. The new script and its jules_session= meta field aren't added to either, breaking that documentation convention and making the new tool undiscoverable via the toolbelt table.🔧 Fix: fix: clear stale jules watermark on session re-arm, register script in docs
✅ Re-checked - no issues remain.
⏭️ **Test** - skipped
Step was skipped.
✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed (2) ✅
🔧 Fix: No fix needed: shellcheck 0.11.0 run is clean, local binary was stale
1 warning still open:
🔧 Fix: No fix needed: shellcheck 0.11.0 confirmed clean on full run
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.