Skip to content

feat(bin): carry the status boundary as a typed event with derived blocking_on (CFVC-06) - #71

Merged
sbracewell64 merged 4 commits into
mainfrom
fm/cfvc-06-status-event-envelope-landing
Aug 10, 2026
Merged

sbracewell64 merged 4 commits into
mainfrom
fm/cfvc-06-status-event-envelope-landing

Conversation

@sbracewell64

@sbracewell64 sbracewell64 commented Aug 10, 2026 •

Copy link
Copy Markdown
Owner

Intent

CFVC-06: make the worker-to-supervisor event boundary carry typed fields instead of free prose, without introducing a worker self-report.

Each status event is now a typed fm-status-event.v1 envelope carrying verb, key, phase, repeatable evidence references and one bounded summary. New bin/fm-status-event-lib.sh owns the wire format; bin/fm-classify-lib.sh remains the single owner of what a verb MEANS and reads that field instead of a regex.

What a task is waiting on is derived, never declared. status_event_blocking_on combines the verb, the keyed open-decision fold and bin/fm-crew-state.sh's typed verdict, so proof that a run is advancing overrules a stale blocked: claim. A worker cannot write the field at all: the envelope's field set is closed, and an event carrying blocking_on= is refused whole and surfaced as malformed rather than silently stripped and half believed.

Retired: FM_CLASSIFY_CAPTAIN_RE_DEFAULT's free-text arm (PR ready|checks green|ready in branch|merged). That arm matched a crew's own prose, so working: rebased onto merged #76 escalated as a terminal event and had to be defended by a rule excluding nonterminal verbs - a guard around a guess. The default classification path now runs no regex at all. The nonterminal-verb rule survives as declared policy and still applies on the opt-in FM_CAPTAIN_RE path, where prose matching is what the home asked for.

Consequence, intentional: a bare verbless legacy line such as merged is no longer captain-relevant. Prose lines carrying a verb (done: ..., blocked: ...) remain fully readable and fully classified - that is the migration compatibility guarantee, achieved through the three shared parsers every consumer in bin/ already uses.

Provenance - read this before merging

This branch was hand-cut and is not the head the no-mistakes pipeline validated. Disclosing that plainly:

  • The pipeline run (01KZMB71PC5EE21WVC3PTDA6E6) pushed to a head based on a pre-hotfix upstream base and opened its PR at the upstream venue rather than this fork. That head still carried the committed AGENTS.md conflict markers, because its base predated the ef1ff03 hotfix that resolved them.
  • This branch instead carries the same three commits cut fresh from fork trunk 93f67a3, which does include ef1ff03 and its conflict-marker CI guard.
  • The structural no-mistakes attestation is therefore RED for this head, and no attestation has been written for it. It would be false: the pipeline never validated these bytes. The evidence below is what stands in its place, and it is my own.

Merge screen

Check Result
Fork trunk 93f67a3 strict ancestor PASS
Commits beyond trunk 3, exactly the intended ones
Replayed landing-queue commits 0 (none already upstream by patch-id)
Conflict markers in tree 0

Commit fidelity was checked with git range-diff against the validated commits. The document commit is byte-identical; the other two differ only in context lines belonging to the two different bases (bin/fm-brief.sh uses a $RULE4_PHASES variable upstream versus the literal phrase on the fork trunk; docs/architecture.md has newer surrounding prose upstream; the new docs/scripts.md row lands beside a different neighbouring entry). No changed line of the contribution itself differs.

Verification on this base

Because the base differs from the one the pipeline validated, the pipeline's verdict does not carry and everything below was re-run against 93f67a3.

  • bin/fm-lint.sh (pinned ShellCheck 0.11.0): clean, exit 0. Negative control performed separately: an injected violation makes it go red.
  • CI on this head (ad2a9ba): 13 of 14 checks pass. Every behaviour shard, the Herdr suite, the stock-macOS-Bash snapshot, repo invariants, lint, coverage guard and the Windows launcher bridge are green.
  • The single remaining failure is PR must be raised via no-mistakes - the structural attestation red disclosed above. It is expected and unavoidable for a hand-cut head.

A regression this branch's first head had, now fixed

The first pushed head failed three behaviour shards, and those failures were caused by this change, not pre-existing. They are fixed in ad2a9ba.

bin/fm-wake-lib.sh and bin/fm-classify-lib.sh source the new sibling bin/fm-status-event-lib.sh eagerly, so every fixture that builds a synthetic bin/ from a hand-maintained manifest must carry that sibling too. The review gate caught four such fixtures; three more used shapes the follow-up search missed:

  • tests/fm-gotmp.test.sh - symlinks the libraries into a fake FM_ROOT (two sites).
  • tests/fm-backend.test.sh - a variable manifest, OLD_BIN_UNCHANGED_SIBLINGS. That file's own header already records that a sourced sibling must be a real reachable file in the synthetic tree or the source aborts under set -eu.
  • tests/fm-remote-backlog-handoff.test.sh - a fixed multi-file copy into a fake remote root.

The eager source was deliberately left hard rather than made conditional. Two of the three break through fm-classify-lib.sh, whose dependency is a correctness contract: a silently absent parser would let a sandbox read a typed event as prose, which is the exact failure this increment removes. Softening it to keep a manifest short would trade a loud fixture break for a quiet wrong answer.

Attribution was established both directions: all three suites pass in a clean detached worktree at bare 93f67a3 with none of these commits applied, and all three failed on this branch before the fix. Red before, green after on the same tree (3, 28 and 10 assertions).

Separately, one genuinely pre-existing failure

tests/fm-turnend-guard.test.sh - "Pi guard must inject once for no-tool and multi-tool logical runs" - fails locally on bare 93f67a3 with none of these commits applied, producing an identical 43-passing-then-one-failure result. This branch neither introduces nor repairs it. It does not fail in CI, which lacks the local Pi harness.

Pipeline findings that were fixed during the run

The review gate caught three real misses in the original commit, all fixed and carried here:

  • Four sandbox test fixtures copy fm-wake-lib.sh/fm-classify-lib.sh into a temporary bin/ without the new sibling library, which the eager source needs (fm-turnend-guard, fm-claude-stop-autoarm, fm-session-lock-ancestry, fm-afk-return).
  • A shellcheck-disable comment claimed FM_STATUS_EVENT_FIELDS was read by a conformance gate that did not exist. It now is: a test asserts the parser's accepted field set equals that constant, so the closed-set claim is enforced rather than asserted.
  • docs/scripts.md's library index had no row for the new file.

A fourth finding added key to the snapshot's last_event.envelope projection, so a consumer correlating a typed event with the open-decision set never has to re-parse raw prose.

Known follow-up, out of scope here

bin/fm-crew-state.sh's log_reports_ci_ready still reads note prose for checks green. Its behaviour is unchanged by this work, and CFVC-06's completion criteria name only fm-classify-lib.sh's free-text arm, so it is left for its own increment.

…ocking_on (CFVC-06)

The worker-to-supervisor boundary's control facts were prose.
bin/fm-classify-lib.sh classified wakes by grepping a crew's own sentence
against `PR ready|checks green|ready in branch|merged`, so
"working: rebased onto merged #76" escalated as a terminal event and had to be
defended by a rule excluding nonterminal verbs - a guard around a guess.

Each event is now a typed `fm-status-event.v1` envelope carrying verb, key,
phase, repeatable evidence references and one bounded summary. New
bin/fm-status-event-lib.sh owns the format; bin/fm-classify-lib.sh remains the
single owner of what a verb MEANS and reads that field instead of a regex. The
default classification path runs no regex at all, so the free-text arm and the
collision class it created are gone rather than caught after the fact.

What a task is waiting on is derived, never declared. status_event_blocking_on
combines the verb, the keyed open-decision fold and bin/fm-crew-state.sh's typed
verdict, so proof that a run is advancing overrules a stale blocked claim, and a
decision left open earlier is not masked by a later unrelated event. A worker
cannot write the field: the envelope's field set is closed, and an event
carrying blocking_on= is refused whole and surfaced as malformed rather than
silently stripped and half believed.

Compatibility is the three shared parsers. Every consumer in bin/ already reads
status lines through status_line_verb, status_line_note and the decision-key
parser, so teaching those the envelope taught the fleet at once and a log part
way through the migration reads correctly. Prose remains the human note.

bin/fm-brief.sh teaches the typed form to every reporting scaffold, including
the rule that blocking_on is derived. bin/fm-fleet-snapshot.sh projects the
envelope and the derived field, reusing the crew read it already paid for.
bin/fm-wake-lib.sh renders a typed event to its prose projection before the
drain annotation's byte budget, so evidence references cannot truncate away the
summary.

Retired: FM_CLASSIFY_CAPTAIN_RE_DEFAULT's free-text arm, and the nonterminal
verb rule as a defence against it. That rule survives as declared policy and
still applies on the opt-in FM_CAPTAIN_RE path, where prose matching is what the
home asked for. A bare verbless line such as "merged" is no longer
captain-relevant, and tests/fm-daemon.test.sh records that change of behavior.

Tests assert the retirement with a negative control that requires each collision
line to match the retired arm as a bare regex before requiring it not to
classify; that a typed event classifies with the default pattern blanked, so no
regex fallback remains; that a worker-written blocking_on is refused with its
own reason and cannot reach the answer even through summary prose; that the
derived answer changes with crew state while the status line is held constant;
that both derivation helpers are total over the declared crew-verdict
vocabulary; and that every reporting scaffold teaches the typed form.
…ture

bin/fm-wake-lib.sh and bin/fm-classify-lib.sh source the sibling
bin/fm-status-event-lib.sh eagerly, so every fixture that builds a synthetic
bin/ from a hand-maintained manifest must carry that sibling too. Three did
not, and under `set -eu` the missing source aborts the script under test:

- tests/fm-gotmp.test.sh symlinks the libraries into a fake FM_ROOT (two sites).
- tests/fm-backend.test.sh copies OLD_BIN_UNCHANGED_SIBLINGS into the synthetic
  pre-refactor tree, whose own header already records that a sourced sibling
  must be a real reachable file there or the source aborts.
- tests/fm-remote-backlog-handoff.test.sh copies a fixed list into a fake
  remote root.

The eager source is deliberately left hard rather than made conditional. The
classifier's dependency is a correctness contract: a silently absent parser
would let a sandbox read a typed event as prose, which is the failure this
increment removes. Softening it to keep a manifest short would trade a loud
fixture break for a quiet wrong answer.

Red before and green after on the same tree: each of the three suites failed
with the missing-sibling abort and now passes (3, 28 and 10 assertions).
@sbracewell64
sbracewell64 merged commit 720f06e into main Aug 10, 2026
13 of 15 checks passed
sbracewell64 added a commit that referenced this pull request Aug 10, 2026
…ocking_on (CFVC-06) (#71)

* feat(bin): carry the status boundary as a typed event with derived blocking_on (CFVC-06)

The worker-to-supervisor boundary's control facts were prose.
bin/fm-classify-lib.sh classified wakes by grepping a crew's own sentence
against `PR ready|checks green|ready in branch|merged`, so
"working: rebased onto merged #76" escalated as a terminal event and had to be
defended by a rule excluding nonterminal verbs - a guard around a guess.

Each event is now a typed `fm-status-event.v1` envelope carrying verb, key,
phase, repeatable evidence references and one bounded summary. New
bin/fm-status-event-lib.sh owns the format; bin/fm-classify-lib.sh remains the
single owner of what a verb MEANS and reads that field instead of a regex. The
default classification path runs no regex at all, so the free-text arm and the
collision class it created are gone rather than caught after the fact.

What a task is waiting on is derived, never declared. status_event_blocking_on
combines the verb, the keyed open-decision fold and bin/fm-crew-state.sh's typed
verdict, so proof that a run is advancing overrules a stale blocked claim, and a
decision left open earlier is not masked by a later unrelated event. A worker
cannot write the field: the envelope's field set is closed, and an event
carrying blocking_on= is refused whole and surfaced as malformed rather than
silently stripped and half believed.

Compatibility is the three shared parsers. Every consumer in bin/ already reads
status lines through status_line_verb, status_line_note and the decision-key
parser, so teaching those the envelope taught the fleet at once and a log part
way through the migration reads correctly. Prose remains the human note.

bin/fm-brief.sh teaches the typed form to every reporting scaffold, including
the rule that blocking_on is derived. bin/fm-fleet-snapshot.sh projects the
envelope and the derived field, reusing the crew read it already paid for.
bin/fm-wake-lib.sh renders a typed event to its prose projection before the
drain annotation's byte budget, so evidence references cannot truncate away the
summary.

Retired: FM_CLASSIFY_CAPTAIN_RE_DEFAULT's free-text arm, and the nonterminal
verb rule as a defence against it. That rule survives as declared policy and
still applies on the opt-in FM_CAPTAIN_RE path, where prose matching is what the
home asked for. A bare verbless line such as "merged" is no longer
captain-relevant, and tests/fm-daemon.test.sh records that change of behavior.

Tests assert the retirement with a negative control that requires each collision
line to match the retired arm as a bare regex before requiring it not to
classify; that a typed event classifies with the default pattern blanked, so no
regex fallback remains; that a worker-written blocking_on is refused with its
own reason and cannot reach the answer even through summary prose; that the
derived answer changes with crew state while the status line is held constant;
that both derivation helpers are total over the declared crew-verdict
vocabulary; and that every reporting scaffold teaches the typed form.

* no-mistakes(review): copy status-event lib into fixtures, project envelope key, add conformance test

* no-mistakes(document): align classification docs and comments with typed status events

* fix(tests): carry the status-event library into every sandbox bin fixture

bin/fm-wake-lib.sh and bin/fm-classify-lib.sh source the sibling
bin/fm-status-event-lib.sh eagerly, so every fixture that builds a synthetic
bin/ from a hand-maintained manifest must carry that sibling too. Three did
not, and under `set -eu` the missing source aborts the script under test:

- tests/fm-gotmp.test.sh symlinks the libraries into a fake FM_ROOT (two sites).
- tests/fm-backend.test.sh copies OLD_BIN_UNCHANGED_SIBLINGS into the synthetic
  pre-refactor tree, whose own header already records that a sourced sibling
  must be a real reachable file there or the source aborts.
- tests/fm-remote-backlog-handoff.test.sh copies a fixed list into a fake
  remote root.

The eager source is deliberately left hard rather than made conditional. The
classifier's dependency is a correctness contract: a silently absent parser
would let a sandbox read a typed event as prose, which is the failure this
increment removes. Softening it to keep a manifest short would trade a loud
fixture break for a quiet wrong answer.

Red before and green after on the same tree: each of the three suites failed
with the missing-sibling abort and now passes (3, 28 and 10 assertions).
sbracewell64 added a commit that referenced this pull request Aug 11, 2026
…ocking_on (CFVC-06) (#71)

* feat(bin): carry the status boundary as a typed event with derived blocking_on (CFVC-06)

The worker-to-supervisor boundary's control facts were prose.
bin/fm-classify-lib.sh classified wakes by grepping a crew's own sentence
against `PR ready|checks green|ready in branch|merged`, so
"working: rebased onto merged #76" escalated as a terminal event and had to be
defended by a rule excluding nonterminal verbs - a guard around a guess.

Each event is now a typed `fm-status-event.v1` envelope carrying verb, key,
phase, repeatable evidence references and one bounded summary. New
bin/fm-status-event-lib.sh owns the format; bin/fm-classify-lib.sh remains the
single owner of what a verb MEANS and reads that field instead of a regex. The
default classification path runs no regex at all, so the free-text arm and the
collision class it created are gone rather than caught after the fact.

What a task is waiting on is derived, never declared. status_event_blocking_on
combines the verb, the keyed open-decision fold and bin/fm-crew-state.sh's typed
verdict, so proof that a run is advancing overrules a stale blocked claim, and a
decision left open earlier is not masked by a later unrelated event. A worker
cannot write the field: the envelope's field set is closed, and an event
carrying blocking_on= is refused whole and surfaced as malformed rather than
silently stripped and half believed.

Compatibility is the three shared parsers. Every consumer in bin/ already reads
status lines through status_line_verb, status_line_note and the decision-key
parser, so teaching those the envelope taught the fleet at once and a log part
way through the migration reads correctly. Prose remains the human note.

bin/fm-brief.sh teaches the typed form to every reporting scaffold, including
the rule that blocking_on is derived. bin/fm-fleet-snapshot.sh projects the
envelope and the derived field, reusing the crew read it already paid for.
bin/fm-wake-lib.sh renders a typed event to its prose projection before the
drain annotation's byte budget, so evidence references cannot truncate away the
summary.

Retired: FM_CLASSIFY_CAPTAIN_RE_DEFAULT's free-text arm, and the nonterminal
verb rule as a defence against it. That rule survives as declared policy and
still applies on the opt-in FM_CAPTAIN_RE path, where prose matching is what the
home asked for. A bare verbless line such as "merged" is no longer
captain-relevant, and tests/fm-daemon.test.sh records that change of behavior.

Tests assert the retirement with a negative control that requires each collision
line to match the retired arm as a bare regex before requiring it not to
classify; that a typed event classifies with the default pattern blanked, so no
regex fallback remains; that a worker-written blocking_on is refused with its
own reason and cannot reach the answer even through summary prose; that the
derived answer changes with crew state while the status line is held constant;
that both derivation helpers are total over the declared crew-verdict
vocabulary; and that every reporting scaffold teaches the typed form.

* no-mistakes(review): copy status-event lib into fixtures, project envelope key, add conformance test

* no-mistakes(document): align classification docs and comments with typed status events

* fix(tests): carry the status-event library into every sandbox bin fixture

bin/fm-wake-lib.sh and bin/fm-classify-lib.sh source the sibling
bin/fm-status-event-lib.sh eagerly, so every fixture that builds a synthetic
bin/ from a hand-maintained manifest must carry that sibling too. Three did
not, and under `set -eu` the missing source aborts the script under test:

- tests/fm-gotmp.test.sh symlinks the libraries into a fake FM_ROOT (two sites).
- tests/fm-backend.test.sh copies OLD_BIN_UNCHANGED_SIBLINGS into the synthetic
  pre-refactor tree, whose own header already records that a sourced sibling
  must be a real reachable file there or the source aborts.
- tests/fm-remote-backlog-handoff.test.sh copies a fixed list into a fake
  remote root.

The eager source is deliberately left hard rather than made conditional. The
classifier's dependency is a correctness contract: a silently absent parser
would let a sandbox read a typed event as prose, which is the failure this
increment removes. Softening it to keep a manifest short would trade a loud
fixture break for a quiet wrong answer.

Red before and green after on the same tree: each of the three suites failed
with the missing-sibling abort and now passes (3, 28 and 10 assertions).
sbracewell64 added a commit that referenced this pull request Aug 11, 2026
…ocking_on (CFVC-06) (#71)

* feat(bin): carry the status boundary as a typed event with derived blocking_on (CFVC-06)

The worker-to-supervisor boundary's control facts were prose.
bin/fm-classify-lib.sh classified wakes by grepping a crew's own sentence
against `PR ready|checks green|ready in branch|merged`, so
"working: rebased onto merged #76" escalated as a terminal event and had to be
defended by a rule excluding nonterminal verbs - a guard around a guess.

Each event is now a typed `fm-status-event.v1` envelope carrying verb, key,
phase, repeatable evidence references and one bounded summary. New
bin/fm-status-event-lib.sh owns the format; bin/fm-classify-lib.sh remains the
single owner of what a verb MEANS and reads that field instead of a regex. The
default classification path runs no regex at all, so the free-text arm and the
collision class it created are gone rather than caught after the fact.

What a task is waiting on is derived, never declared. status_event_blocking_on
combines the verb, the keyed open-decision fold and bin/fm-crew-state.sh's typed
verdict, so proof that a run is advancing overrules a stale blocked claim, and a
decision left open earlier is not masked by a later unrelated event. A worker
cannot write the field: the envelope's field set is closed, and an event
carrying blocking_on= is refused whole and surfaced as malformed rather than
silently stripped and half believed.

Compatibility is the three shared parsers. Every consumer in bin/ already reads
status lines through status_line_verb, status_line_note and the decision-key
parser, so teaching those the envelope taught the fleet at once and a log part
way through the migration reads correctly. Prose remains the human note.

bin/fm-brief.sh teaches the typed form to every reporting scaffold, including
the rule that blocking_on is derived. bin/fm-fleet-snapshot.sh projects the
envelope and the derived field, reusing the crew read it already paid for.
bin/fm-wake-lib.sh renders a typed event to its prose projection before the
drain annotation's byte budget, so evidence references cannot truncate away the
summary.

Retired: FM_CLASSIFY_CAPTAIN_RE_DEFAULT's free-text arm, and the nonterminal
verb rule as a defence against it. That rule survives as declared policy and
still applies on the opt-in FM_CAPTAIN_RE path, where prose matching is what the
home asked for. A bare verbless line such as "merged" is no longer
captain-relevant, and tests/fm-daemon.test.sh records that change of behavior.

Tests assert the retirement with a negative control that requires each collision
line to match the retired arm as a bare regex before requiring it not to
classify; that a typed event classifies with the default pattern blanked, so no
regex fallback remains; that a worker-written blocking_on is refused with its
own reason and cannot reach the answer even through summary prose; that the
derived answer changes with crew state while the status line is held constant;
that both derivation helpers are total over the declared crew-verdict
vocabulary; and that every reporting scaffold teaches the typed form.

* no-mistakes(review): copy status-event lib into fixtures, project envelope key, add conformance test

* no-mistakes(document): align classification docs and comments with typed status events

* fix(tests): carry the status-event library into every sandbox bin fixture

bin/fm-wake-lib.sh and bin/fm-classify-lib.sh source the sibling
bin/fm-status-event-lib.sh eagerly, so every fixture that builds a synthetic
bin/ from a hand-maintained manifest must carry that sibling too. Three did
not, and under `set -eu` the missing source aborts the script under test:

- tests/fm-gotmp.test.sh symlinks the libraries into a fake FM_ROOT (two sites).
- tests/fm-backend.test.sh copies OLD_BIN_UNCHANGED_SIBLINGS into the synthetic
  pre-refactor tree, whose own header already records that a sourced sibling
  must be a real reachable file there or the source aborts.
- tests/fm-remote-backlog-handoff.test.sh copies a fixed list into a fake
  remote root.

The eager source is deliberately left hard rather than made conditional. The
classifier's dependency is a correctness contract: a silently absent parser
would let a sandbox read a typed event as prose, which is the failure this
increment removes. Softening it to keep a manifest short would trade a loud
fixture break for a quiet wrong answer.

Red before and green after on the same tree: each of the three suites failed
with the missing-sibling abort and now passes (3, 28 and 10 assertions).
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