Repository navigation
feat(bin): add opt-in Rex attention marks, validation progress, and tint - #7703
Conversation
With config/rex-status-marks set to `on`, the captain sees from Rex itself which worker needs them: bin/fm-rex-marks.sh mirrors each Rex task's latest status into one Firstmate-owned OSC 7501 record (app=firstmate, id=fm) on the worker's pane, titled with the task's tab label, plus one OSC 777 desktop notification when a new attention state appears. Absent the file, nothing changes: the watcher skips the sync and teardown runs nothing new. - Status mapping: needs-decision or a captain hold -> blocked question, blocked -> blocked permission (auth when the note names a credential), failed -> error, done -> done (PR ready with a URL), else removed. - Validation progress: while marks are on and a no-mistakes ship validates with no mark, a working id=fm/validate record shows the share of steps done and the active step (fm_nm_run_progress in bin/fm-nm-run-lib.sh). - config/rex-tint opts in separately to an OSC 11 background tint on waiting and failed workers, reset with OSC 111. - A `rex` wedge-alarm channel, used only when config/wedge-alarm names it, raises an id=fm-wedge record and notification on Firstmate's own pane and removes it after the next delivered digest; `auto` never adds it. - Rex attributes a record written to a pane's terminal to the foreground process, so fm_backend_rex_trusted_record, the push stream consumer, and rex-eventwait.lua now ignore app=firstmate records: a mark can never read as the worker's busy state or blocked edge. - Tests: fake-CLI cases for the sequences, read-back, trust exclusion, default-off, producer convergence, clear, and progress parsing; real-Rex cases in the event-wait smoke; daemon cases for the rex wedge channel.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Speaking as Kun's firstmate: thanks @roderik. I read What I checked: with no Contract-class (my own read): opt-in. VISION.md per rule: One captain aligns (display/desktop notification only, never a wake) · Authority aligns (off unless configured) · Scripts aligns (deterministic marks/progress parsing) · Restart aligns (cached records reconcile on the next sync, cleared at teardown) · Delegation aligns (2/3 scenarios live on a real Rex lab; the wedge channel is covered through the notifier seam) · Vendor aligns (Rex-only, rendered surface untouched) · Scope aligns. Status: waiting on you for one small thing. It's still a draft. Mark it ready when you're happy, and once CI and the no-mistakes check are green on that head it's on track to merge on the opt-in path. (A |
|
Merged current main ( |
|
Speaking as Kun's firstmate: thanks @roderik, for marking this ready and for merging main in. I compared This is just waiting on that CI now, nothing needed from you. If it comes back green with the no-mistakes check passing on this head, I'll merge it on the opt-in path. |
|
Speaking as Kun's firstmate: this is merged. Thank you @roderik — really appreciate you taking the time on this. |
What Changed
bin/fm-rex-marks.shand wired it into the Rex backend and watcher: withconfig/rex-status-marksset toon, each Rex worker's latest status (needs-decision, blocked, failed, done) is written as an OSC 7501 program-status record plus an OSC 777 desktop notification on its pane. Marks are cached instate/.rex-mark-<id>so syncs write only on change, and cleanup/teardown clears them before the pane closes.id=fm/validate, read from a boundedno-mistakes axi statusat most every 30s per task) and an opt-in background tint for waiting and failed workers viaconfig/rex-tint(off,subtle,subtle-light). Supporting changes touchrex-eventwait.lua,fm-nm-run-lib.sh,fm-test-run.sh,fm-watch.sh, andfm-teardown.sh.rexchannel to the wedge alarm infm-supervise-daemon.sh(a blockedid=fm-wedgerecord plus a notification on Firstmate's own pane). Documented all of this indocs/rex-backend.md,docs/configuration.md, and related docs. Added tests infm-backend-rex.test.sh,fm-backend-rex-eventwait-smoke.test.sh, andfm-daemon.test.sh.Why
On the Rex backend, a worker that needs the captain (a decision, a blocker, a failed validation) is only visible through Firstmate's chat.
Rex already gives every pane a program-status badge, a notification, and a hover card, so the captain can see which tab is waiting without switching to the Firstmate session.
This lets Firstmate use those surfaces for its own workers, and lets the wedge alarm reach the captain through Rex when they choose that.
Split out of #7646 as suggested there.
Opt-in
Nothing changes for a home that has not opted in:
config/rex-status-marksabsent oroff(the default): no mark, no notification, no progress, and the watcher does no Rex work at all unless a cache from an earlier opt-in remains to be cleared.config/rex-tintabsent oroff(the default): no tint.rexchannel is used only whenconfig/wedge-alarmorFM_WEDGE_ALARM_CHANNELnames it;autonever selects it.Firstmate's own record is written with
app=firstmate, and bothfm_backend_rex_trusted_recordandrex-eventwait.luaskip that app, so a mark can never be read back as the worker's busy state or as a blocked edge.Records any other program writes are trusted exactly as before.
Live evidence
bin/fm-rex-marks.shand the adapter, run against a private Rex lab server (rex0.0.1792607779-g171246) with aneeds-decisionstatus on a lab pane:config/rex-status-markssyncexits 0, the pane has no program-status records, no cache is writtenconfig/rex-status-marks=on{app: firstmate, id: fm, state: blocked, kind: question, title: fm-t1, msg: "Needs your decision: pick a database"}on the task's panefm_backend_rex_trusted_recordreturns nothing andfm_backend_busy_statereportsunknown, so the mark is not taken as worker stateblocked/authduring a realrex-eventwait.luawaitclear t1The real-Rex smoke (
tests/fm-backend-rex-eventwait-smoke.test.sh, on upstream'stests/rex-test-safety.shprivate server) adds three cases for the same behaviour and still confirms every state-changing call stayed on that server.Risk Assessment
✅ Low: The change is opt-in (config/rex-status-marks, rex-tint, wedge-alarm=rex), costs only file tests when off, uses bounded Rex calls, and I found no concrete failing sequence in the mark, progress, tint or wedge-alarm paths.
Testing
I ran the real-Rex marks driver on a private lab server, the real-Rex smoke suite, and the daemon test suite. The driver showed default-off, mark on, trust exclusion, the pane's own report still escalating, and clear. The smoke suite included the three attention-mark cases. The daemon suite covered the rex channel routing and
autonever adding it, but it used a notifier seam, not the live product. The driver's teardown log ends with teardown_exit=0.Evidence: pr3-live driver log
Source: pr3-live driver log
Evidence: smoke log
Source: smoke log
Evidence: daemon log
Source: daemon log
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
🔧 **Test** - 1 issue found → no changes applied ✅
autonever adds itrexCLI is not on PATH andbin/fm-rex-lab.shdoes not exist in this tree. I was not allowed to search the host for them. To enable this, provide a Rex binary and the lab helper.tests/fm-backend-rex.test.sh), which is not a live run against a real Rex server, so it did not establish a live pass or fail.autonever adds ittests/fm-daemon.test.sh), which is not a live run against the real product, so it did not establish a live pass or fail.bash tests/fm-backend-rex.test.sh(0 failures)bash tests/fm-daemon.test.sh(0 failures, incl. rex wedge channel cases)🔧 No changes applied.
✅ Re-checked - no issues remain.
bash drivers/pr3-live.sh (real Rex private lab server)tests/fm-backend-rex-eventwait-smoke.test.sh with real Rexbash tests/fm-daemon.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.