Repository navigation
fix(bin): fold correlated decision lines and drop routine no-op wakes - #13
Merged
Merged
Conversation
…3093) * fix(supervision): silence empty board closes and decouple the heartbeat Two unrelated sources of noise put routine supervision events in the captain's chat. An empty Lavish board close - the captain reads a review surface, says nothing, and closes it - became a check wake whose entire content was that nothing happened. Suppress it at its source instead of routing it anywhere: the generic runner gains a `silent` adapter seam mirroring the existing `terminal` one, and the Lavish adapter answers it for exactly one positively-determined shape, an `ended` session carrying no queued content block. A silenced result is recorded durably handled so it does not return on a later reconcile. Everything else announces unchanged - a `Send & End` close carrying the captain's real answer, an `ended` result still carrying content, a waiting or missing session, an unreadable result, and every adapter that implements no `silent` command at all. The keyed-answer feed is untouched, so suppressing an announcement never suppresses the captain's own answer. A fleet heartbeat was deferred to main merely because some unrelated check row happened to be sitting unread, which put a routine fleet review in the chat for a reason that had nothing to do with the fleet. A check row is permanently main-owned, so it is now excluded from a heartbeat claim rather than vetoing the scan, exactly as in every other mode. What all-or-nothing guarantees is unchanged: the branch takes every branch-ownable unread row or none of them, and an unresolvable task-local row, an unknown row kind, or an unreadable queue still defers the whole review to main. Main is still woken for the check on that check's own triggering close, so nothing starves. Main-only classes are unchanged and now each covered by a test: Relay mentions, credential failures, merge confirmations, real board answers, and watcher-failure repair. The per-actor acknowledgement and no-cross-swallow properties are untouched. * no-mistakes(review): Fail closed on all Lavish content headers * no-mistakes(review): Suppress false unacknowledged status for silenced results
kunchenguid#1967) * fix(classify): read the decision fold through a correlation token status_line_verb stripped a trailing [key=...] from a status line's prefix but left everything else glued to the verb, so a line carrying the correlation token bin/fm-pending-reply-lib.sh embeds and a secondmate echoes back matched no arm of _fm_decision_fold_line. Such a line folded as ordinary status in both directions: a needs-decision or blocked opener never opened its key, and a resolved or captain-held closer never closed one. The same glued verb also hid correlated done and blocked lines from status_is_captain_relevant and status_is_terminal_verb, and let correlated working and resolved lines leak through the free-text fallback the nonterminal guard was meant to stop. The verb parse now walks whole words and drops only a token of the exact shape a firstmate library writes - corr=<16 hex>, plus the bracketed form bin/fm-secondmate-report.sh emits - before or after the key token, unkeyed, or doubled. An arbitrary name=value word is deliberately NOT skipped: skipping unknown tokens would let free text carrying an equals sign reduce to a bare verb and impersonate a transition, which is the takeover the strict parse and _fm_decision_key_transition_allowed exist to prevent. A prefix with no corr= substring is returned byte-for-byte as before, so every line without a token keeps its exact historical verb. FM_OPEN_DECISIONS_FOLD_VERSION goes to 3, because every cursor persisted under the previous reading carries an open set computed while correlated lines were invisible and must be rebuilt from byte 0. Measured over a real 383-line status log: 254 lines keep byte-identical captain-relevance, pause, terminal-verb and captain-held verdicts, and all 129 changed lines carry a valid token - 14 correlated done/blocked/ needs-decision lines become captain-visible, and 20 correlated working/resolved lines stop being escalated on prose alone. * fix(review): Captain, block token-first decision impersonation * fix(document): Clarify normalized status verb ownership * fix(classify): reconcile the correlation-token read with the tag-stop parser Rebasing onto main put this change beside kunchenguid#2280, which made verb parsing stop at the first "[name=value]" tag. Both edit status_line_verb with different intents, so the resolution keeps both rules rather than letting one overwrite the other: - kunchenguid#2280's tag stop is kept verbatim and now owns every BRACKETED tag, including the "[corr=...]" form fm-secondmate-report.sh writes. The bracket-unwrapping arm this branch had added to the token test is therefore removed as unreachable. - This branch's token walk is kept and narrowed to the UNBRACKETED token fm-pending-reply-lib.sh writes, which the tag stop does not reach. Two consequences of standing beside kunchenguid#2280 rather than before it: The fold version had collided at 4: kunchenguid#2280 spent it on the tag-stop parser and this branch had spent it on the token read. A cursor persisted under kunchenguid#2280's reading predates this one and must still be rebuilt, so the version moves to 5. A bracketed impostor is dropped from the malformed-token list. On main today "resolved [corr=deadbeef] [key=victim]:" already reads as the bare verb, as does "resolved [anything at all] [key=victim]:", because the tag stop ends the parse at the opening bracket regardless of content. That is kunchenguid#2280's reviewed contract; asserting otherwise here would narrow it. The unbracketed impostors it owns stay strict and still fold as prose. Adds a consumer test for the two verb-string case arms that postdate this branch: fm-supervise-daemon.sh's transient-stale arm and fm-crew-state.sh's map_log_state. * fix(review): Captain: Seed cursor migration fixture with version four * fix(document): Clarify voice status normalization ownership
Brings in two upstream fixes: - 07bf0c8 keeps routine supervision noise out of captain chat: a `silent` adapter seam on the generic process-event runner, answered by the Lavish adapter for an `ended` session carrying no queued content, and a fleet heartbeat that no longer defers to main merely because a permanently main-owned check row sits unread. - 9ce69ac stops a correlation token from hiding and stranding decisions: `status_line_verb` now walks whole words and drops only a firstmate-written `corr=<16 hex>` token, so correlated opener and closer lines fold as the transitions they are. `FM_OPEN_DECISIONS_FOLD_VERSION` goes from 4 to 5 so persisted cursors rebuild from byte 0. No conflict resolution was required. This fork's 47 commits of divergence touch none of the files these two commits change; the one file both sides carry, `docs/configuration.md`, took upstream's new process-event silence section and this fork's `FM_PR_DESCRIPTION_TIMEOUT` line in separate hunks. Every file upstream touched is byte-identical to `upstream/main` in this merge, and the merged tree differs from `upstream/main` only by this fork's own 38 files.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Renew this fork from upstream: merge upstream/main into our main so the fork (sanis/firstmate) carries upstream's (kunchenguid/firstmate) latest work without losing any of our own.
Starting position: merge base was f7a387f (the previous renewal); our main was 47 commits ahead and 2 behind. The two commits to bring in, oldest first, were 07bf0c8 'fix: keep routine supervision noise out of captain chat (kunchenguid#3093)' and 9ce69ac 'fix(bin): stop a correlation token from hiding and stranding decisions (kunchenguid#1967)'.
Explicit requirements the user stated:
Required verification: HEAD..upstream/main empty; the four upstream-touched test scripts pass (tests/fm-classify-corr-token.test.sh, tests/fm-procevent.test.sh, tests/fm-pi-branch-extension.test.sh, tests/fm-pi-watch-extension.test.sh); every shell file touched is shellcheck-clean; git diff upstream/main...HEAD reads as our fork's intentional divergence with no accidental reverts.
The task touches firstmate's shared tracked material, so .agents/skills/firstmate-coding-guidelines/SKILL.md binds: one-owner rule, one sentence per line in tracked Markdown, plain dash never em dash, no agent co-author, bin/*.sh shellcheck-clean via bin/fm-lint.sh, colocated tests named .test.sh, and tests must exercise behavior through a public interface rather than asserting implementation-source bytes.
What was found and decided:
The brief predicted conflicts 'particularly in bin/fm-classify-lib.sh and bin/fm-procevent.sh'. That prediction was wrong, and the absence of conflicts was verified rather than assumed, because a textually-clean merge is exactly the case that hides semantic breakage. Our fork's 47 commits touch 38 files; upstream's two commits touch 15; the sets are disjoint except docs/configuration.md. git diff f7a387f HEAD is EMPTY for all 15 upstream-touched files, so the fork had zero divergence there. The earlier renewal merge commits appearing in 'git log -- ' for those paths carry upstream's own history, not fork divergence, which is what made the prediction look plausible.
So NO conflict resolution was performed and no source file was hand-edited. git merge --no-ff produced a clean two-parent merge. docs/configuration.md, the one file both sides carry, auto-merged into separate hunks: upstream's new process-event 'silent' adapter-seam section plus this fork's FM_PR_DESCRIPTION_TIMEOUT line.
Evidence the merge is correct: all 15 upstream-touched files are byte-identical to upstream/main in the merged tree; git diff --stat upstream/main...HEAD is '38 files changed, 2968 insertions(+), 30 deletions(-)', character-for-character the same stat as the pre-merge git diff f7a387f HEAD, proving zero incidental change; upstream/main and the pre-merge tip 4d32068 are both ancestors of HEAD, so nothing was rebased or squashed; and no fork file consumes status_line_verb, FM_OPEN_DECISIONS_FOLD_VERSION, fm-classify-lib, or procevent, and the fork ships no procevent adapter needing upstream's new 'silent' command, so there is no cross-file semantic coupling.
Verification results: all four upstream test scripts pass (exit=0), plus tests/fm-documentation-audiences.test.sh which covers the one merged file; bin/fm-lint.sh clean (shellcheck 0.11.0, actionlint 1.7.12); bin/fm-doc-audience-check.sh ok with 79 surfaces and 297 local links. Disclosure: tests/fm-pi-branch-extension.test.sh self-skips its harness-dependent half with 'skip: installed @earendil-works/pi-coding-agent package not found' - environmental, pre-existing, unrelated to this merge, reported rather than letting exit=0 imply full coverage.
History of this exact change, so the merge-commit body is not re-flagged: an earlier validation attempt's review step correctly caught that the merge commit body said 'FM_OPEN_DECISIONS_FOLD_VERSION goes to 3' while the code moves it 4 -> 5 (=4 at merge base f7a387f, =5 at bin/fm-classify-lib.sh:616). The wrong number came from upstream 9ce69ac's own squashed message, whose first paragraph says 'goes to 3' but whose later review round ('Seed cursor migration fixture with version four') shows 4 was already spent. The tree was never wrong; only the narrative was. The supervisor ruled FIX with two limits: correct only that number and the sentence around it, and do not touch upstream commit 9ce69ac's own message. Both limits are satisfied in the current head: the body now reads 'goes from 4 to 5', and upstream 9ce69ac is untouched and still carries its own stale 'goes to 3'.
Why this work is on branch fm/fm-upstream-sync-7a: the correction had to be an amendment of the merge commit, since a commit message cannot be corrected by adding a commit on top. The pipeline's own --action fix produced exactly the right commit but then aborted, because amending rewrites the pipeline's recorded head. After that run went terminal, custody was returned via axi sync --recover and the amendment was applied between runs with git commit --amend, reusing the pipeline fix agent's own corrected message verbatim. A fresh run on the original branch then failed at its first step, because the gate's ref for fm/fm-upstream-sync-7 is pinned at the pre-amend commit and the corrected head is an amended sibling, not a descendant, so the push was rejected non-fast-forward. The supervisor ruled to redeliver on this new branch name, which the gate has no ref for, so the push creates it cleanly with no force anywhere. The commit itself was not rebuilt: fm/fm-upstream-sync-7a points at the identical, already-verified commit object. Nothing has ever been pushed to origin for this task.
Deliberate non-changes a reviewer might flag as omissions: no AGENTS.md update, because a conflict-free renewal produced no durable project-intrinsic knowledge and that file's token cost is paid by every session of every fleet member; and no edits of any kind outside the merge and that one commit-message correction, per requirement 5. The local 'main' ref is intentionally still unmerged - moving it is the landing step and belongs to the supervisor.
What Changed
Merges
upstream/maininto this fork (2 commits through 9ce69ac); no conflict resolution was needed, and no file was hand-edited beyond the merge itself.status_line_verbinbin/fm-classify-lib.shnow walks whole words and drops only an unbracketed, firstmate-writtencorr=<16 hex>token, so correlatedneeds-decision/resolvedlines fold as the transitions they are;FM_OPEN_DECISIONS_FOLD_VERSIONgoes from 4 to 5 so persisted cursors rebuild from byte 0. Newtests/fm-classify-corr-token.test.shpins the token shape against the real writers.bin/fm-procevent.shgains asilent <result-file>adapter seam consulted before publishing, treating exit 0 as the only silence verdict (result recorded handled, never announced);bin/fm-procevent-lavish.shanswers it for exactly one shape - anendedsession carrying no top-levelprompts/feedbackblock - so an empty board close no longer wakes a handler.scopeForUnreadWakein.pi/extensions/lib/fm-branch-dispatch.tsstops letting a main-ownedcheckrow veto a heartbeat scan; such rows are excluded fromeligibleSeqsand eligibility is now read off the claim set, so routine fleet reviews stop deferring to main over unrelated check rows. Docs (docs/configuration.md,docs/pi-supervision-branch.md) and the branch/watch extension tests follow.Risk Assessment
✅ Low: The merge introduces upstream's diff byte-for-byte with no hand edits, leaves the fork's 38-file divergence content-identical to its pre-merge state (only a hunk-line offset shifts), preserves every fork and upstream commit as an ancestor, and the one file both sides touch auto-merged into non-overlapping hunks with no cross-file semantic coupling reachable from any fork-changed file.
Testing
I verified the merge structurally and then proved both sides actually behave, rather than trusting a clean textual merge. Structurally: HEAD..upstream/main is empty, both parents are ancestors of HEAD so nothing was rebased or squashed, 15 of 16 upstream-touched files are byte-identical blobs to upstream's tip, and the fork-divergence stat is unchanged by the merge with no path touched outside upstream's set - which is the direct evidence for the no-incidental-edits requirement. Behaviorally, I reproduced upstream's correlation-token bug as a before/after regression by running the real status_open_decisions fold against the merge-base library and against HEAD's: at the merge base a tokened needs-decision is hidden from the captain's open-decisions list and a tokened resolved strands the decision open forever, while at HEAD both fold correctly and the untokened control and the corr=nothex lookalike are unchanged, so the fix is not a loosening. I drove upstream's other fix through its real adapter command, confirming an empty board close is silent while a Send & End answer, a late answer, a waiting board and unreadable output all still announce, and that adapters with no silent command are unaffected. Fork-side behavior survives: the PR description guard suite passes including its FM_PR_DESCRIPTION_TIMEOUT hang-to-warning case, and the merged docs/configuration.md carries both sides' hunks. All six targeted suites pass. One disclosure: tests/fm-pi-branch-extension.test.sh self-skips its harness-dependent half because the pi-coding-agent package is not installed locally - environmental and pre-existing, unrelated to this merge, and remote CI covers it. There is no UI, HTML, or rendered surface in this change (it is a shell, TypeScript-extension and docs merge), so the reviewer-visible evidence is CLI transcripts of the actual captain-facing behavior rather than screenshots. Working tree is clean and all temp scaffolding was removed.
Evidence: Correlation-token fix: before/after the merge, captain's open-decisions list
Source: Correlation-token fix: before/after the merge, captain's open-decisions list
SCENARIO: HIDING - an unanswered decision whose line carries the token needs-decision corr=a1b2c3d4e5f60718 [key=deploy-window]: ship tonight or hold? working corr=a1b2c3d4e5f60718: preparing the release notes BEFORE the merge (merge base f7a387f) captain's open-decisions list: (empty) AFTER the merge (HEAD e5ee8bf) captain's open-decisions list: * deploy-window needs-decision ship tonight or hold? SCENARIO: STRANDING - an untokened opener answered by a tokened closer needs-decision [key=deploy-window]: ship tonight or hold? resolved corr=a1b2c3d4e5f60718 [key=deploy-window]: hold until Monday BEFORE the merge (merge base f7a387f) captain's open-decisions list: * deploy-window needs-decision ship tonight or hold? AFTER the merge (HEAD e5ee8bf) captain's open-decisions list: (empty) SCENARIO: CONTROL - the same pair with no token at all (must not regress) BEFORE: (empty) AFTER: (empty) SCENARIO: STRICTNESS - 'corr=nothex' is not a firstmate token BEFORE: still open AFTER: still openEvidence: Process-event silence seam: what reaches captain chat and what does not
Source: Process-event silence seam: what reaches captain chat and what does not
the captain closed the review board without saying anything -> SILENT: recorded as handled, the captain is NOT woken. the captain hit Send & End with a real answer -> ANNOUNCE: a check wake is published to the captain. the board closed but still carries a late answer -> ANNOUNCE the board is still open and waiting -> ANNOUNCE the result is unreadable (fail closed - never assume silence) -> ANNOUNCE Adapters with no 'silent' command are unaffected: adapter 'remote-reply' -> ANNOUNCE (unchanged by the new seam) adapter 'when' -> ANNOUNCE (unchanged by the new seam)Evidence: Merge shape: no rebase, no squash, no incidental edits
Source: Merge shape: no rebase, no squash, no incidental edits
=== Files changed by the merge that upstream did NOT touch (must be empty) === (end) === Fork divergence stat, before and after the merge (must be identical) === pre-merge f7a387f..4d32068 : 38 files changed, 2968 insertions(+), 30 deletions(-) post-merge upstream...HEAD : 38 files changed, 2968 insertions(+), 30 deletions(-) === History shape (no squash, no rebase) === * e5ee8bf Merge upstream/main: fork renewal (2 commits through 9ce69ac) | | * 9ce69ac fix(bin): stop a correlation token from hiding and stranding decisions (#1967) | * 07bf0c8 fix: keep routine supervision noise out of captain chat (#3093) * | 4d32068 Merge pull request #12 from sanis/fm/fm-upstream-sync-6 === HEAD..upstream/main (9ce69ac) commit count: 0 ===Evidence: Targeted test run summary (upstream suites + fork suites)
Source: Targeted test run summary (upstream suites + fork suites)
Upstream-touched suites (upstream's fixes must keep working): tests/fm-classify-corr-token.test.sh exit=0 (12 assertions) tests/fm-procevent.test.sh exit=0 (53 assertions) tests/fm-pi-branch-extension.test.sh exit=0 (24 assertions) tests/fm-pi-watch-extension.test.sh exit=0 (37 assertions) Fork-side suites (our own behavior must keep working): tests/fm-documentation-audiences.test.sh exit=0 (6 assertions) tests/fm-pr-description-guard.test.sh exit=0 (23 assertions) Disclosed skip (environmental, pre-existing, unrelated to this merge): tests/fm-pi-branch-extension.test.sh: skip: installed @earendil-works/pi-coding-agent package not foundEvidence: Full log: tests/fm-procevent.test.sh (includes the new silence-seam assertions)
Source: Full log: tests/fm-procevent.test.sh (includes the new silence-seam assertions)
Evidence: Full log: tests/fm-classify-corr-token.test.sh
Source: Full log: tests/fm-classify-corr-token.test.sh
Evidence: Full log: tests/fm-pi-branch-extension.test.sh (contains the disclosed skip)
Source: Full log: tests/fm-pi-branch-extension.test.sh (contains the disclosed skip)
Evidence: Full log: tests/fm-pi-watch-extension.test.sh
Source: Full log: tests/fm-pi-watch-extension.test.sh
Evidence: Full log: tests/fm-pr-description-guard.test.sh (fork-side FM_PR_DESCRIPTION_TIMEOUT)
Source: Full log: tests/fm-pr-description-guard.test.sh (fork-side FM_PR_DESCRIPTION_TIMEOUT)
Evidence: Full log: tests/fm-documentation-audiences.test.sh (covers the merged docs/configuration.md)
Source: Full log: tests/fm-documentation-audiences.test.sh (covers the merged docs/configuration.md)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
docs/configuration.md, took upstream's new process-event silence section and this fork'sFM_PR_DESCRIPTION_TIMEOUTline in separate hunks." The first clause is factually wrong and is contradicted by the second clause in the same sentence: the fork does touch one of the 16 files upstream changed (docs/configuration.md), which is precisely why that file needed a two-hunk auto-merge. The tree is correct - only the narrative overstates. Reported at info because the exception is disclosed in the same breath so no reader is actually misled, and because correcting it would require a secondgit commit --amendon the merge commit, whose known cost (a non-fast-forward gate ref and a branch rename to fm/fm-upstream-sync-7a) the captain already paid once for the FOLD_VERSION correction. Whether that trade is worth making again is the captain's call, not a merge blocker.✅ **Test** - passed
✅ No issues found.
git log --oneline HEAD..9ce69ac(upstream tip) - 0 commits;git merge-base --is-ancestorconfirms both 9ce69ac and pre-merge tip 4d32068 are ancestors of HEADPer-file blob comparisongit rev-parse HEAD:<f>vs9ce69ac:<f>across all 16 upstream-touched paths - 15 identical, only docs/configuration.md differs (by the fork's one added line)git diff --shortstat f7a387f 4d32068vsgit diff --shortstat 9ce69ac...HEAD- identical stat, proving no incidental changecomm -23 <(git diff --name-only 4d32068 HEAD) <(upstream-touched paths)- empty, so the merge touched nothing outside upstream's setgit diff 9ce69ac HEAD -- docs/configuration.mdandgit diff 4d32068 HEAD -- docs/configuration.md- both sides' hunks present in the merged filebash tests/fm-classify-corr-token.test.sh(12 assertions, exit=0)bash tests/fm-procevent.test.sh(53 assertions, exit=0)bash tests/fm-pi-branch-extension.test.sh(24 assertions, exit=0)bash tests/fm-pi-watch-extension.test.sh(37 assertions, exit=0)bash tests/fm-documentation-audiences.test.sh(6 assertions, exit=0) - fork-side suite covering the one merged shared filebash tests/fm-pr-description-guard.test.sh(23 assertions, exit=0) - fork-side suite; includes the FM_PR_DESCRIPTION_TIMEOUT hang-to-warning caseManual regression demo: ranstatus_open_decisionsthrough the merge-base copy of bin/fm-classify-lib.sh and through HEAD's on the same status logs, covering the hiding case, the stranding case, an untokened control, and acorr=nothexlookalikeManual seam demo:bin/fm-procevent-lavish.sh silent <result>exit status across empty board close, Send & End with an answer, close carrying a late answer, waiting session, and unreadable garbage; plus every other fm-procevent-*.sh adapter to confirm they still announcegrep -n FM_OPEN_DECISIONS_FOLD_VERSIONat f7a387f (=4) and at HEAD bin/fm-classify-lib.sh:616 (=5), cross-checked against the merge commit bodygit log -1 --format='%(trailers)' HEAD- no agent co-author trailer;git status --porcelainclean after testing✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.