Repository navigation
feat(bin): make an unobserved result a third value that cannot pass (land of upstream #1827) - #55
Conversation
83db581 to
3130b25
Compare
…land of upstream kunchenguid#1827) Ports upstream PR kunchenguid#1827 onto this fork's trunk. Nothing here is redesigned: bin/fm-verify.sh, bin/fm-verify-lib.sh, the PASS / FAIL / NO_VERIFIER_RAN law, the check-conclusion partition (STARTUP_FAILURE as could-not-observe, CANCELLED/TIMED_OUT as not-observed rather than FAIL), the shared rollup rule for skipped/stale/neutral checks, the bearings label, and the witnessed-red test controls are upstream's as written. Provenance: upstream PR kunchenguid#1827 head commit 0c3afca its base 2cf0283 landed onto ed376cf (sbracewell64/firstmate main) The two trunks diverged at upstream kunchenguid#1495, so the diff did not apply cleanly. Resolutions, all of them fork-versus-upstream divergence rather than changes to what kunchenguid#1827 does: bin/fm-bearings-snapshot.sh - upstream sources bin/fm-timeout-lib.sh here; this fork has no such file and inlines its own bounded gh call instead. Only the fm-verify-lib.sh sourcing this contribution adds is kept. The check-rollup splice itself applied unchanged. bin/fm-test-run.sh - upstream's hunk carried three family entries; two of them (fm-sessionstart-run.sh, fm-timeout-lib.sh) are for files this fork does not have. Only the bin/fm-verify-lib.sh entry, which is this contribution's own, is landed. bin/fm-brief.sh - upstream had no verification-discipline block at all, so the contribution introduced one. This fork already had one, in the older two-bullet form, shared by the ship, scout and secondmate scaffolds. Its single definition is replaced in place with the contribution's three-valued text rather than adding a second definition, so all three scaffolds move together and the one-owner rule holds. The header comment describing that block is updated to the text it now emits. tests/fm-brief.test.sh - both suites are kept. This fork's test_standing_worker_rules_by_variant asserted the old block's wording; those three assertions are re-pointed at the replacement text (witnessed negative control, the three-valued rule, and missing-artifact-is-could-not-observe), which is the same intent against the sentences that now exist. Upstream's test_verification_discipline_is_the_type_rule is added alongside it. docs/scripts.md - the fm-timeout-lib.sh row upstream's hunk carried does not belong on this fork; the two fm-verify rows are landed. Verified on this fork: bin/fm-lint.sh clean (ShellCheck 0.11.0, exit 0), bin/fm-doc-audience-check.sh ok (surfaces=72 local_links=213), and tests/fm-verify.test.sh, tests/fm-brief.test.sh and tests/fm-bearings-snapshot.test.sh all pass.
The snapshot-compatibility job asserts an exact Bearings test count, and this branch adds one Bearings case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 41 to 42, which is what the suite now reports.
3130b25 to
a8821c9
Compare
Rebased onto the current fork trunkRebased onto Conflict and how it was resolvedOne conflict, in A red this branch was already carryingThe snapshot-compatibility job asserts an exact Bearings test count. This branch adds one Bearings case without moving that pin, so That was verified the way CI does it rather than by reading the diff: running Test results, disclosed in full
Everything this branch owns is green:
|
The snapshot-compatibility job asserts an exact fleet-view test count, and this branch adds one snapshot case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 20 to 21, which is what the suite now reports. The Bearings pin needed no change here: #55 moved it to 42 when it landed, and this branch adds no Bearings case, so trunk's value already matches.
…and of upstream kunchenguid#1829) (#59) * feat(bin): give the crew-state reader typed verdicts and freshness CFVC-05. The fleet's authoritative current-state reader answered every question with a confident-looking prose sentence and had no way to say it did not know, so each unmodelled condition was coerced into some other condition's verdict. This adds the structured mode the increment asks for, and closes the four measured defects that shared that single cause. WHAT WAS MEASURED (2026-08-06, no-mistakes v1.40.3) 1. busy-record-never-expires. bin/fm-busy-lib.sh parsed the record's ts= for format and never compared it to the clock, so a worker killed mid-turn classified `busy` forever. The watcher's BUSY_TURN_MAX_SECS cannot cover this: it ages a pane already believed busy, and a dead worker's pane renders an idle footer, so that backstop never arms for exactly these workers. 2. crew-state-unknown-after-resolved-line. A `resolved:` line - the closure verb every brief instructs crews to write - reported `unknown / none / no current-state source available`, claiming no source existed while the endpoint was readable and idle. Checking the whole verb set against bin/fm-classify-lib.sh rather than the two reported cases showed `captain-held:` hit the same fallthrough, confirming it was the verb CLASS and not two instances. 3. crew-state-treats-infrastructure-kill-as-rejection. `error: daemon crashed during execution` appeared on five terminal runs in one afternoon's history, each reported as `failed`. The pipeline broke; the work was never judged. Firstmate read it as the change being rejected. 4. crew-state-reports-aborted-run-as-failed. A deliberate `cancelled` outcome, which supersession produces on purpose, also reported `failed`. WHAT CHANGED Verdict vocabulary, one condition per verdict, none borrowing another: `failed` (a step judged the work and rejected it), `aborted` (deliberately cancelled), `interrupted` (the pipeline broke without judging), `idle` (alive, nothing running, nothing declared), `stale` (evidence aged out), `unknown` (genuinely no usable evidence). The failed/interrupted split reads the pipeline's own structural attribution marker - it prefixes step-attributed errors with "step <name> failed:" - and never reads the error prose to guess whether a step failure was "really" the code's fault. The full text travels to the caller as terminal_error so the semantic residue stays visible instead of being encoded as message-matching. `interrupted` requires POSITIVE evidence: a terminal failure with no error field keeps the plain `failed` verdict, because absence of evidence must not manufacture a claim in either direction. Freshness travels with the verdict. A busy record expires (FM_BUSY_MAX_BUSY_AGE_SECS, 3600s); an idle record never does, because age cannot make a finished turn unfinished. Expiry is terminal like malformed and gen-mismatch, so no weaker source can re-answer for a worker the task's own record just proved had stopped. Each answer reports evidence_age_secs and precedence_applied. RETIREMENT The ad-hoc per-consumer source combination is gone, not left alongside the new path. bin/fm-classify-lib.sh's crew_absorb_class and bin/fm-fleet-snapshot.sh's crew_state_json both reconstructed structure by slicing the prose line on its middle-dot separators; both now read typed fields. No consumer in bin/ parses this reader's prose. crew_absorb_class enumerates every verdict explicitly rather than silently defaulting, which is how a correct reader still produced a wrong supervision outcome. PREVENTION tests/fm-crew-state.test.sh carries a conformance table of evidence-inputs to expected-verdict covering every source combination and every sanctioned status verb. Two coverage gates fail when a verdict or verb exists with no row, so the next one cannot be added silently - that, not the four fixes, is the point. FM_CREW_STATE_VOCABULARY in bin/fm-classify-lib.sh is the single owner consumers and gates read. CERTIFICATION - RED-CAPABLE Run against the pre-change reader, the table reds on exactly the defect rows and passes the other 18, proving it is precise rather than blanket-red: deliberate cancel is aborted want=aborted got=failed pipeline crash is interrupted want=interrupted got=failed expired busy record is stale want=stale got=working verb resolved closes a decision want=idle got=unknown verb captain-held closes a decision want=idle got=unknown idle endpoint with no log is idle want=idle got=unknown Against the change, 24/24 pass. test_conformance_checker_is_red_capable proves in-band on every run that the checker rejects a wrong state, source, and precedence, so it cannot silently become an always-green verifier. The busy-expiry test includes a control that raises the bound and watches the verdict return to `busy`, proving the new check is what decides. TWO COMPLETION CRITERIA SUBSTITUTED, PER THE COMMISSION'S STALE-CRITERION CLAUSE - `pane_hash` is not emitted. The reader computes no pane hash, and adding one would mean capturing and hashing rendered output on every heartbeat - the signal the semantic busy-state redesign deliberately abandoned because rendered output is not turn state. Replaced with `busy_seq`, the busy record's strictly-increasing counter, which answers the same question (did the worker's state actually move between two reads) from the architecture's own advancing-evidence source. - The empty-check-set negative control is written as prose/structured equivalence rather than pinning `green`. bin/fm-crew-state.sh's nm_ci_checks_state is the single owner of that rule and upstream PR 1614 is the open change that tightens it; duplicating its fix here would leave two owners of one invariant. The equivalence assertion is stronger in one respect: it guarantees the structured mode can never be the path that reports a green the prose mode would not, whichever way 1614 resolves. EXCLUDED: RUN SELECTION - AND THE EXPOSURE THAT LEAVES OPEN Resolving the CURRENT run for a task, rather than whatever the repo-scoped status returns, is NOT in this change. Upstream PR 1816 is an open change to this same file implementing exactly that, and the increment's own sequencing note forbids opening another concurrent editor of it. Firstmate ruled that 1816 owns it: duplicating an open PR is the defect CFVC-02 exists to prevent, and rebasing onto an upstream open PR would carry another author's unlanded work into ours. Verified rather than taken on trust, against the installed no-mistakes v1.40.3: - Bare `no-mistakes axi` DOES emit `runs[N]{id,branch,status,head,pr}:`. The comment still in this file saying that table never appears was verified against v1.32.2 and is now STALE. 1816's core mechanism is therefore real code, not the dead path that comment describes. Those exact lines are what 1816 rewrites, so they are deliberately left untouched here rather than edited into a conflict. - 1816 resolves the current run by filtering that table to the task's branch, then to a matching code head, preferring pending/running over completed/failed/cancelled regardless of row order, then re-querying `axi status --run <id>` and verifying id, branch, and head before accepting it. That is genuine current-run resolution, not a repo-scoped answer. - The defect it fixes is live in the run history right now: branch fm/wedge-aging-ignores-provably-working carries one running run plus two older failed runs, distinguishable only by head - exactly the shape that produces a false failed verdict. - One caveat: 1816's `active_run:` block parser matches that key exactly, but v1.40.3 emits `other_branch_active_run:` (confirmed in live output and in the binary's strings; no bare `active_run:` key found). That first helper appears inert on this version, so the runs-table fallback is what actually carries the fix. It is not a defect - a cross-branch block MUST NOT be attributed to this task - but the "authoritative when present" comment overstates what runs today. - 1816 is delivered, not landed: open, unmerged, zero reviews, and no CI checks configured on it. EXPOSURE. Until 1816 lands AND this fork resyncs, the false-failed-verdict defect stays open: crew-state can report `failed` for a lane the pipeline authority shows as running. Measured three times on 2026-08-06. Nothing in this change detects or mitigates it; the typed verdicts make the wrong answer machine-readable, not correct. REVISIT TRIGGER. If 1816 has not landed by the time this fork next resyncs, firstmate re-evaluates rather than letting the gap drift. * no-mistakes(review): enumerate verdicts in decision clearing and keep stale evidence age * no-mistakes(review): gate absorb classes on the vocabulary and reject non-object reads * no-mistakes(document): align crew-state and busy-verdict docs with typed verdicts * docs(bin): correct settled-state rationale for the new run verdicts The fork trunk's crew_state_is_settled explained its `failed` exclusion by noting that failed also reconciled a cancelled run. This contribution splits that: a cancelled run now reports `aborted` and a broken pipeline reports `interrupted`. The case arms already return the right answer for all three - only the stated reason had gone stale, along with two comments describing the reader's prose line that is now a typed verdict. * fix(bin): treat an empty crew-state field as unreadable, not a verdict The typed read replaced a prose parse whose non-matching line yielded `unreadable`, which the watcher's process-liveness source is still allowed to answer for. A present-but-empty state field carries no answer either, so it takes the same path rather than falling through to a decided-looking class. * test(crew-state): stop the mode-equivalence row racing the clock The conformance row compares the prose and structured renderings of the same verdict, but reads them through two separate invocations of the reader. An expired-record detail embeds the age measured at read time, so a second boundary falling between the two invocations rendered 7200s in one and 7201s in the other - the same correct answer one tick apart - and failed the row. Observed on a loaded machine: the row passed on one full run and failed on the next with no code change between them. The measured age is now normalized on both sides, so the row tests the rendering it is there to test. Any other divergence in the detail still fails it, and the age value keeps its own assertion against a single read, which is the only place the two can be compared without a race. * ci: bump the pinned snapshot count for the test this branch adds The snapshot-compatibility job asserts an exact fleet-view test count, and this branch adds one snapshot case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 20 to 21, which is what the suite now reports. The Bearings pin needed no change here: #55 moved it to 42 when it landed, and this branch adds no Bearings case, so trunk's value already matches.
…land of upstream kunchenguid#1827) (#55) * feat(bin): make an unobserved result a third value that cannot pass (land of upstream kunchenguid#1827) Ports upstream PR kunchenguid#1827 onto this fork's trunk. Nothing here is redesigned: bin/fm-verify.sh, bin/fm-verify-lib.sh, the PASS / FAIL / NO_VERIFIER_RAN law, the check-conclusion partition (STARTUP_FAILURE as could-not-observe, CANCELLED/TIMED_OUT as not-observed rather than FAIL), the shared rollup rule for skipped/stale/neutral checks, the bearings label, and the witnessed-red test controls are upstream's as written. Provenance: upstream PR kunchenguid#1827 head commit 0c3afca its base 2cf0283 landed onto ed376cf (sbracewell64/firstmate main) The two trunks diverged at upstream kunchenguid#1495, so the diff did not apply cleanly. Resolutions, all of them fork-versus-upstream divergence rather than changes to what kunchenguid#1827 does: bin/fm-bearings-snapshot.sh - upstream sources bin/fm-timeout-lib.sh here; this fork has no such file and inlines its own bounded gh call instead. Only the fm-verify-lib.sh sourcing this contribution adds is kept. The check-rollup splice itself applied unchanged. bin/fm-test-run.sh - upstream's hunk carried three family entries; two of them (fm-sessionstart-run.sh, fm-timeout-lib.sh) are for files this fork does not have. Only the bin/fm-verify-lib.sh entry, which is this contribution's own, is landed. bin/fm-brief.sh - upstream had no verification-discipline block at all, so the contribution introduced one. This fork already had one, in the older two-bullet form, shared by the ship, scout and secondmate scaffolds. Its single definition is replaced in place with the contribution's three-valued text rather than adding a second definition, so all three scaffolds move together and the one-owner rule holds. The header comment describing that block is updated to the text it now emits. tests/fm-brief.test.sh - both suites are kept. This fork's test_standing_worker_rules_by_variant asserted the old block's wording; those three assertions are re-pointed at the replacement text (witnessed negative control, the three-valued rule, and missing-artifact-is-could-not-observe), which is the same intent against the sentences that now exist. Upstream's test_verification_discipline_is_the_type_rule is added alongside it. docs/scripts.md - the fm-timeout-lib.sh row upstream's hunk carried does not belong on this fork; the two fm-verify rows are landed. Verified on this fork: bin/fm-lint.sh clean (ShellCheck 0.11.0, exit 0), bin/fm-doc-audience-check.sh ok (surfaces=72 local_links=213), and tests/fm-verify.test.sh, tests/fm-brief.test.sh and tests/fm-bearings-snapshot.test.sh all pass. * ci: bump the pinned Bearings count for the test this branch adds The snapshot-compatibility job asserts an exact Bearings test count, and this branch adds one Bearings case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 41 to 42, which is what the suite now reports.
…and of upstream kunchenguid#1829) (#59) * feat(bin): give the crew-state reader typed verdicts and freshness CFVC-05. The fleet's authoritative current-state reader answered every question with a confident-looking prose sentence and had no way to say it did not know, so each unmodelled condition was coerced into some other condition's verdict. This adds the structured mode the increment asks for, and closes the four measured defects that shared that single cause. WHAT WAS MEASURED (2026-08-06, no-mistakes v1.40.3) 1. busy-record-never-expires. bin/fm-busy-lib.sh parsed the record's ts= for format and never compared it to the clock, so a worker killed mid-turn classified `busy` forever. The watcher's BUSY_TURN_MAX_SECS cannot cover this: it ages a pane already believed busy, and a dead worker's pane renders an idle footer, so that backstop never arms for exactly these workers. 2. crew-state-unknown-after-resolved-line. A `resolved:` line - the closure verb every brief instructs crews to write - reported `unknown / none / no current-state source available`, claiming no source existed while the endpoint was readable and idle. Checking the whole verb set against bin/fm-classify-lib.sh rather than the two reported cases showed `captain-held:` hit the same fallthrough, confirming it was the verb CLASS and not two instances. 3. crew-state-treats-infrastructure-kill-as-rejection. `error: daemon crashed during execution` appeared on five terminal runs in one afternoon's history, each reported as `failed`. The pipeline broke; the work was never judged. Firstmate read it as the change being rejected. 4. crew-state-reports-aborted-run-as-failed. A deliberate `cancelled` outcome, which supersession produces on purpose, also reported `failed`. WHAT CHANGED Verdict vocabulary, one condition per verdict, none borrowing another: `failed` (a step judged the work and rejected it), `aborted` (deliberately cancelled), `interrupted` (the pipeline broke without judging), `idle` (alive, nothing running, nothing declared), `stale` (evidence aged out), `unknown` (genuinely no usable evidence). The failed/interrupted split reads the pipeline's own structural attribution marker - it prefixes step-attributed errors with "step <name> failed:" - and never reads the error prose to guess whether a step failure was "really" the code's fault. The full text travels to the caller as terminal_error so the semantic residue stays visible instead of being encoded as message-matching. `interrupted` requires POSITIVE evidence: a terminal failure with no error field keeps the plain `failed` verdict, because absence of evidence must not manufacture a claim in either direction. Freshness travels with the verdict. A busy record expires (FM_BUSY_MAX_BUSY_AGE_SECS, 3600s); an idle record never does, because age cannot make a finished turn unfinished. Expiry is terminal like malformed and gen-mismatch, so no weaker source can re-answer for a worker the task's own record just proved had stopped. Each answer reports evidence_age_secs and precedence_applied. RETIREMENT The ad-hoc per-consumer source combination is gone, not left alongside the new path. bin/fm-classify-lib.sh's crew_absorb_class and bin/fm-fleet-snapshot.sh's crew_state_json both reconstructed structure by slicing the prose line on its middle-dot separators; both now read typed fields. No consumer in bin/ parses this reader's prose. crew_absorb_class enumerates every verdict explicitly rather than silently defaulting, which is how a correct reader still produced a wrong supervision outcome. PREVENTION tests/fm-crew-state.test.sh carries a conformance table of evidence-inputs to expected-verdict covering every source combination and every sanctioned status verb. Two coverage gates fail when a verdict or verb exists with no row, so the next one cannot be added silently - that, not the four fixes, is the point. FM_CREW_STATE_VOCABULARY in bin/fm-classify-lib.sh is the single owner consumers and gates read. CERTIFICATION - RED-CAPABLE Run against the pre-change reader, the table reds on exactly the defect rows and passes the other 18, proving it is precise rather than blanket-red: deliberate cancel is aborted want=aborted got=failed pipeline crash is interrupted want=interrupted got=failed expired busy record is stale want=stale got=working verb resolved closes a decision want=idle got=unknown verb captain-held closes a decision want=idle got=unknown idle endpoint with no log is idle want=idle got=unknown Against the change, 24/24 pass. test_conformance_checker_is_red_capable proves in-band on every run that the checker rejects a wrong state, source, and precedence, so it cannot silently become an always-green verifier. The busy-expiry test includes a control that raises the bound and watches the verdict return to `busy`, proving the new check is what decides. TWO COMPLETION CRITERIA SUBSTITUTED, PER THE COMMISSION'S STALE-CRITERION CLAUSE - `pane_hash` is not emitted. The reader computes no pane hash, and adding one would mean capturing and hashing rendered output on every heartbeat - the signal the semantic busy-state redesign deliberately abandoned because rendered output is not turn state. Replaced with `busy_seq`, the busy record's strictly-increasing counter, which answers the same question (did the worker's state actually move between two reads) from the architecture's own advancing-evidence source. - The empty-check-set negative control is written as prose/structured equivalence rather than pinning `green`. bin/fm-crew-state.sh's nm_ci_checks_state is the single owner of that rule and upstream PR 1614 is the open change that tightens it; duplicating its fix here would leave two owners of one invariant. The equivalence assertion is stronger in one respect: it guarantees the structured mode can never be the path that reports a green the prose mode would not, whichever way 1614 resolves. EXCLUDED: RUN SELECTION - AND THE EXPOSURE THAT LEAVES OPEN Resolving the CURRENT run for a task, rather than whatever the repo-scoped status returns, is NOT in this change. Upstream PR 1816 is an open change to this same file implementing exactly that, and the increment's own sequencing note forbids opening another concurrent editor of it. Firstmate ruled that 1816 owns it: duplicating an open PR is the defect CFVC-02 exists to prevent, and rebasing onto an upstream open PR would carry another author's unlanded work into ours. Verified rather than taken on trust, against the installed no-mistakes v1.40.3: - Bare `no-mistakes axi` DOES emit `runs[N]{id,branch,status,head,pr}:`. The comment still in this file saying that table never appears was verified against v1.32.2 and is now STALE. 1816's core mechanism is therefore real code, not the dead path that comment describes. Those exact lines are what 1816 rewrites, so they are deliberately left untouched here rather than edited into a conflict. - 1816 resolves the current run by filtering that table to the task's branch, then to a matching code head, preferring pending/running over completed/failed/cancelled regardless of row order, then re-querying `axi status --run <id>` and verifying id, branch, and head before accepting it. That is genuine current-run resolution, not a repo-scoped answer. - The defect it fixes is live in the run history right now: branch fm/wedge-aging-ignores-provably-working carries one running run plus two older failed runs, distinguishable only by head - exactly the shape that produces a false failed verdict. - One caveat: 1816's `active_run:` block parser matches that key exactly, but v1.40.3 emits `other_branch_active_run:` (confirmed in live output and in the binary's strings; no bare `active_run:` key found). That first helper appears inert on this version, so the runs-table fallback is what actually carries the fix. It is not a defect - a cross-branch block MUST NOT be attributed to this task - but the "authoritative when present" comment overstates what runs today. - 1816 is delivered, not landed: open, unmerged, zero reviews, and no CI checks configured on it. EXPOSURE. Until 1816 lands AND this fork resyncs, the false-failed-verdict defect stays open: crew-state can report `failed` for a lane the pipeline authority shows as running. Measured three times on 2026-08-06. Nothing in this change detects or mitigates it; the typed verdicts make the wrong answer machine-readable, not correct. REVISIT TRIGGER. If 1816 has not landed by the time this fork next resyncs, firstmate re-evaluates rather than letting the gap drift. * no-mistakes(review): enumerate verdicts in decision clearing and keep stale evidence age * no-mistakes(review): gate absorb classes on the vocabulary and reject non-object reads * no-mistakes(document): align crew-state and busy-verdict docs with typed verdicts * docs(bin): correct settled-state rationale for the new run verdicts The fork trunk's crew_state_is_settled explained its `failed` exclusion by noting that failed also reconciled a cancelled run. This contribution splits that: a cancelled run now reports `aborted` and a broken pipeline reports `interrupted`. The case arms already return the right answer for all three - only the stated reason had gone stale, along with two comments describing the reader's prose line that is now a typed verdict. * fix(bin): treat an empty crew-state field as unreadable, not a verdict The typed read replaced a prose parse whose non-matching line yielded `unreadable`, which the watcher's process-liveness source is still allowed to answer for. A present-but-empty state field carries no answer either, so it takes the same path rather than falling through to a decided-looking class. * test(crew-state): stop the mode-equivalence row racing the clock The conformance row compares the prose and structured renderings of the same verdict, but reads them through two separate invocations of the reader. An expired-record detail embeds the age measured at read time, so a second boundary falling between the two invocations rendered 7200s in one and 7201s in the other - the same correct answer one tick apart - and failed the row. Observed on a loaded machine: the row passed on one full run and failed on the next with no code change between them. The measured age is now normalized on both sides, so the row tests the rendering it is there to test. Any other divergence in the detail still fails it, and the age value keeps its own assertion against a single read, which is the only place the two can be compared without a race. * ci: bump the pinned snapshot count for the test this branch adds The snapshot-compatibility job asserts an exact fleet-view test count, and this branch adds one snapshot case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 20 to 21, which is what the suite now reports. The Bearings pin needed no change here: #55 moved it to 42 when it landed, and this branch adds no Bearings case, so trunk's value already matches.
…land of upstream kunchenguid#1827) (#55) * feat(bin): make an unobserved result a third value that cannot pass (land of upstream kunchenguid#1827) Ports upstream PR kunchenguid#1827 onto this fork's trunk. Nothing here is redesigned: bin/fm-verify.sh, bin/fm-verify-lib.sh, the PASS / FAIL / NO_VERIFIER_RAN law, the check-conclusion partition (STARTUP_FAILURE as could-not-observe, CANCELLED/TIMED_OUT as not-observed rather than FAIL), the shared rollup rule for skipped/stale/neutral checks, the bearings label, and the witnessed-red test controls are upstream's as written. Provenance: upstream PR kunchenguid#1827 head commit 0c3afca its base 2cf0283 landed onto ed376cf (sbracewell64/firstmate main) The two trunks diverged at upstream kunchenguid#1495, so the diff did not apply cleanly. Resolutions, all of them fork-versus-upstream divergence rather than changes to what kunchenguid#1827 does: bin/fm-bearings-snapshot.sh - upstream sources bin/fm-timeout-lib.sh here; this fork has no such file and inlines its own bounded gh call instead. Only the fm-verify-lib.sh sourcing this contribution adds is kept. The check-rollup splice itself applied unchanged. bin/fm-test-run.sh - upstream's hunk carried three family entries; two of them (fm-sessionstart-run.sh, fm-timeout-lib.sh) are for files this fork does not have. Only the bin/fm-verify-lib.sh entry, which is this contribution's own, is landed. bin/fm-brief.sh - upstream had no verification-discipline block at all, so the contribution introduced one. This fork already had one, in the older two-bullet form, shared by the ship, scout and secondmate scaffolds. Its single definition is replaced in place with the contribution's three-valued text rather than adding a second definition, so all three scaffolds move together and the one-owner rule holds. The header comment describing that block is updated to the text it now emits. tests/fm-brief.test.sh - both suites are kept. This fork's test_standing_worker_rules_by_variant asserted the old block's wording; those three assertions are re-pointed at the replacement text (witnessed negative control, the three-valued rule, and missing-artifact-is-could-not-observe), which is the same intent against the sentences that now exist. Upstream's test_verification_discipline_is_the_type_rule is added alongside it. docs/scripts.md - the fm-timeout-lib.sh row upstream's hunk carried does not belong on this fork; the two fm-verify rows are landed. Verified on this fork: bin/fm-lint.sh clean (ShellCheck 0.11.0, exit 0), bin/fm-doc-audience-check.sh ok (surfaces=72 local_links=213), and tests/fm-verify.test.sh, tests/fm-brief.test.sh and tests/fm-bearings-snapshot.test.sh all pass. * ci: bump the pinned Bearings count for the test this branch adds The snapshot-compatibility job asserts an exact Bearings test count, and this branch adds one Bearings case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 41 to 42, which is what the suite now reports.
…and of upstream kunchenguid#1829) (#59) * feat(bin): give the crew-state reader typed verdicts and freshness CFVC-05. The fleet's authoritative current-state reader answered every question with a confident-looking prose sentence and had no way to say it did not know, so each unmodelled condition was coerced into some other condition's verdict. This adds the structured mode the increment asks for, and closes the four measured defects that shared that single cause. WHAT WAS MEASURED (2026-08-06, no-mistakes v1.40.3) 1. busy-record-never-expires. bin/fm-busy-lib.sh parsed the record's ts= for format and never compared it to the clock, so a worker killed mid-turn classified `busy` forever. The watcher's BUSY_TURN_MAX_SECS cannot cover this: it ages a pane already believed busy, and a dead worker's pane renders an idle footer, so that backstop never arms for exactly these workers. 2. crew-state-unknown-after-resolved-line. A `resolved:` line - the closure verb every brief instructs crews to write - reported `unknown / none / no current-state source available`, claiming no source existed while the endpoint was readable and idle. Checking the whole verb set against bin/fm-classify-lib.sh rather than the two reported cases showed `captain-held:` hit the same fallthrough, confirming it was the verb CLASS and not two instances. 3. crew-state-treats-infrastructure-kill-as-rejection. `error: daemon crashed during execution` appeared on five terminal runs in one afternoon's history, each reported as `failed`. The pipeline broke; the work was never judged. Firstmate read it as the change being rejected. 4. crew-state-reports-aborted-run-as-failed. A deliberate `cancelled` outcome, which supersession produces on purpose, also reported `failed`. WHAT CHANGED Verdict vocabulary, one condition per verdict, none borrowing another: `failed` (a step judged the work and rejected it), `aborted` (deliberately cancelled), `interrupted` (the pipeline broke without judging), `idle` (alive, nothing running, nothing declared), `stale` (evidence aged out), `unknown` (genuinely no usable evidence). The failed/interrupted split reads the pipeline's own structural attribution marker - it prefixes step-attributed errors with "step <name> failed:" - and never reads the error prose to guess whether a step failure was "really" the code's fault. The full text travels to the caller as terminal_error so the semantic residue stays visible instead of being encoded as message-matching. `interrupted` requires POSITIVE evidence: a terminal failure with no error field keeps the plain `failed` verdict, because absence of evidence must not manufacture a claim in either direction. Freshness travels with the verdict. A busy record expires (FM_BUSY_MAX_BUSY_AGE_SECS, 3600s); an idle record never does, because age cannot make a finished turn unfinished. Expiry is terminal like malformed and gen-mismatch, so no weaker source can re-answer for a worker the task's own record just proved had stopped. Each answer reports evidence_age_secs and precedence_applied. RETIREMENT The ad-hoc per-consumer source combination is gone, not left alongside the new path. bin/fm-classify-lib.sh's crew_absorb_class and bin/fm-fleet-snapshot.sh's crew_state_json both reconstructed structure by slicing the prose line on its middle-dot separators; both now read typed fields. No consumer in bin/ parses this reader's prose. crew_absorb_class enumerates every verdict explicitly rather than silently defaulting, which is how a correct reader still produced a wrong supervision outcome. PREVENTION tests/fm-crew-state.test.sh carries a conformance table of evidence-inputs to expected-verdict covering every source combination and every sanctioned status verb. Two coverage gates fail when a verdict or verb exists with no row, so the next one cannot be added silently - that, not the four fixes, is the point. FM_CREW_STATE_VOCABULARY in bin/fm-classify-lib.sh is the single owner consumers and gates read. CERTIFICATION - RED-CAPABLE Run against the pre-change reader, the table reds on exactly the defect rows and passes the other 18, proving it is precise rather than blanket-red: deliberate cancel is aborted want=aborted got=failed pipeline crash is interrupted want=interrupted got=failed expired busy record is stale want=stale got=working verb resolved closes a decision want=idle got=unknown verb captain-held closes a decision want=idle got=unknown idle endpoint with no log is idle want=idle got=unknown Against the change, 24/24 pass. test_conformance_checker_is_red_capable proves in-band on every run that the checker rejects a wrong state, source, and precedence, so it cannot silently become an always-green verifier. The busy-expiry test includes a control that raises the bound and watches the verdict return to `busy`, proving the new check is what decides. TWO COMPLETION CRITERIA SUBSTITUTED, PER THE COMMISSION'S STALE-CRITERION CLAUSE - `pane_hash` is not emitted. The reader computes no pane hash, and adding one would mean capturing and hashing rendered output on every heartbeat - the signal the semantic busy-state redesign deliberately abandoned because rendered output is not turn state. Replaced with `busy_seq`, the busy record's strictly-increasing counter, which answers the same question (did the worker's state actually move between two reads) from the architecture's own advancing-evidence source. - The empty-check-set negative control is written as prose/structured equivalence rather than pinning `green`. bin/fm-crew-state.sh's nm_ci_checks_state is the single owner of that rule and upstream PR 1614 is the open change that tightens it; duplicating its fix here would leave two owners of one invariant. The equivalence assertion is stronger in one respect: it guarantees the structured mode can never be the path that reports a green the prose mode would not, whichever way 1614 resolves. EXCLUDED: RUN SELECTION - AND THE EXPOSURE THAT LEAVES OPEN Resolving the CURRENT run for a task, rather than whatever the repo-scoped status returns, is NOT in this change. Upstream PR 1816 is an open change to this same file implementing exactly that, and the increment's own sequencing note forbids opening another concurrent editor of it. Firstmate ruled that 1816 owns it: duplicating an open PR is the defect CFVC-02 exists to prevent, and rebasing onto an upstream open PR would carry another author's unlanded work into ours. Verified rather than taken on trust, against the installed no-mistakes v1.40.3: - Bare `no-mistakes axi` DOES emit `runs[N]{id,branch,status,head,pr}:`. The comment still in this file saying that table never appears was verified against v1.32.2 and is now STALE. 1816's core mechanism is therefore real code, not the dead path that comment describes. Those exact lines are what 1816 rewrites, so they are deliberately left untouched here rather than edited into a conflict. - 1816 resolves the current run by filtering that table to the task's branch, then to a matching code head, preferring pending/running over completed/failed/cancelled regardless of row order, then re-querying `axi status --run <id>` and verifying id, branch, and head before accepting it. That is genuine current-run resolution, not a repo-scoped answer. - The defect it fixes is live in the run history right now: branch fm/wedge-aging-ignores-provably-working carries one running run plus two older failed runs, distinguishable only by head - exactly the shape that produces a false failed verdict. - One caveat: 1816's `active_run:` block parser matches that key exactly, but v1.40.3 emits `other_branch_active_run:` (confirmed in live output and in the binary's strings; no bare `active_run:` key found). That first helper appears inert on this version, so the runs-table fallback is what actually carries the fix. It is not a defect - a cross-branch block MUST NOT be attributed to this task - but the "authoritative when present" comment overstates what runs today. - 1816 is delivered, not landed: open, unmerged, zero reviews, and no CI checks configured on it. EXPOSURE. Until 1816 lands AND this fork resyncs, the false-failed-verdict defect stays open: crew-state can report `failed` for a lane the pipeline authority shows as running. Measured three times on 2026-08-06. Nothing in this change detects or mitigates it; the typed verdicts make the wrong answer machine-readable, not correct. REVISIT TRIGGER. If 1816 has not landed by the time this fork next resyncs, firstmate re-evaluates rather than letting the gap drift. * no-mistakes(review): enumerate verdicts in decision clearing and keep stale evidence age * no-mistakes(review): gate absorb classes on the vocabulary and reject non-object reads * no-mistakes(document): align crew-state and busy-verdict docs with typed verdicts * docs(bin): correct settled-state rationale for the new run verdicts The fork trunk's crew_state_is_settled explained its `failed` exclusion by noting that failed also reconciled a cancelled run. This contribution splits that: a cancelled run now reports `aborted` and a broken pipeline reports `interrupted`. The case arms already return the right answer for all three - only the stated reason had gone stale, along with two comments describing the reader's prose line that is now a typed verdict. * fix(bin): treat an empty crew-state field as unreadable, not a verdict The typed read replaced a prose parse whose non-matching line yielded `unreadable`, which the watcher's process-liveness source is still allowed to answer for. A present-but-empty state field carries no answer either, so it takes the same path rather than falling through to a decided-looking class. * test(crew-state): stop the mode-equivalence row racing the clock The conformance row compares the prose and structured renderings of the same verdict, but reads them through two separate invocations of the reader. An expired-record detail embeds the age measured at read time, so a second boundary falling between the two invocations rendered 7200s in one and 7201s in the other - the same correct answer one tick apart - and failed the row. Observed on a loaded machine: the row passed on one full run and failed on the next with no code change between them. The measured age is now normalized on both sides, so the row tests the rendering it is there to test. Any other divergence in the detail still fails it, and the age value keeps its own assertion against a single read, which is the only place the two can be compared without a race. * ci: bump the pinned snapshot count for the test this branch adds The snapshot-compatibility job asserts an exact fleet-view test count, and this branch adds one snapshot case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 20 to 21, which is what the suite now reports. The Bearings pin needed no change here: #55 moved it to 42 when it landed, and this branch adds no Bearings case, so trunk's value already matches.
…land of upstream kunchenguid#1827) (#55) * feat(bin): make an unobserved result a third value that cannot pass (land of upstream kunchenguid#1827) Ports upstream PR kunchenguid#1827 onto this fork's trunk. Nothing here is redesigned: bin/fm-verify.sh, bin/fm-verify-lib.sh, the PASS / FAIL / NO_VERIFIER_RAN law, the check-conclusion partition (STARTUP_FAILURE as could-not-observe, CANCELLED/TIMED_OUT as not-observed rather than FAIL), the shared rollup rule for skipped/stale/neutral checks, the bearings label, and the witnessed-red test controls are upstream's as written. Provenance: upstream PR kunchenguid#1827 head commit 0c3afca its base 2cf0283 landed onto ed376cf (sbracewell64/firstmate main) The two trunks diverged at upstream kunchenguid#1495, so the diff did not apply cleanly. Resolutions, all of them fork-versus-upstream divergence rather than changes to what kunchenguid#1827 does: bin/fm-bearings-snapshot.sh - upstream sources bin/fm-timeout-lib.sh here; this fork has no such file and inlines its own bounded gh call instead. Only the fm-verify-lib.sh sourcing this contribution adds is kept. The check-rollup splice itself applied unchanged. bin/fm-test-run.sh - upstream's hunk carried three family entries; two of them (fm-sessionstart-run.sh, fm-timeout-lib.sh) are for files this fork does not have. Only the bin/fm-verify-lib.sh entry, which is this contribution's own, is landed. bin/fm-brief.sh - upstream had no verification-discipline block at all, so the contribution introduced one. This fork already had one, in the older two-bullet form, shared by the ship, scout and secondmate scaffolds. Its single definition is replaced in place with the contribution's three-valued text rather than adding a second definition, so all three scaffolds move together and the one-owner rule holds. The header comment describing that block is updated to the text it now emits. tests/fm-brief.test.sh - both suites are kept. This fork's test_standing_worker_rules_by_variant asserted the old block's wording; those three assertions are re-pointed at the replacement text (witnessed negative control, the three-valued rule, and missing-artifact-is-could-not-observe), which is the same intent against the sentences that now exist. Upstream's test_verification_discipline_is_the_type_rule is added alongside it. docs/scripts.md - the fm-timeout-lib.sh row upstream's hunk carried does not belong on this fork; the two fm-verify rows are landed. Verified on this fork: bin/fm-lint.sh clean (ShellCheck 0.11.0, exit 0), bin/fm-doc-audience-check.sh ok (surfaces=72 local_links=213), and tests/fm-verify.test.sh, tests/fm-brief.test.sh and tests/fm-bearings-snapshot.test.sh all pass. * ci: bump the pinned Bearings count for the test this branch adds The snapshot-compatibility job asserts an exact Bearings test count, and this branch adds one Bearings case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 41 to 42, which is what the suite now reports.
…and of upstream kunchenguid#1829) (#59) * feat(bin): give the crew-state reader typed verdicts and freshness CFVC-05. The fleet's authoritative current-state reader answered every question with a confident-looking prose sentence and had no way to say it did not know, so each unmodelled condition was coerced into some other condition's verdict. This adds the structured mode the increment asks for, and closes the four measured defects that shared that single cause. WHAT WAS MEASURED (2026-08-06, no-mistakes v1.40.3) 1. busy-record-never-expires. bin/fm-busy-lib.sh parsed the record's ts= for format and never compared it to the clock, so a worker killed mid-turn classified `busy` forever. The watcher's BUSY_TURN_MAX_SECS cannot cover this: it ages a pane already believed busy, and a dead worker's pane renders an idle footer, so that backstop never arms for exactly these workers. 2. crew-state-unknown-after-resolved-line. A `resolved:` line - the closure verb every brief instructs crews to write - reported `unknown / none / no current-state source available`, claiming no source existed while the endpoint was readable and idle. Checking the whole verb set against bin/fm-classify-lib.sh rather than the two reported cases showed `captain-held:` hit the same fallthrough, confirming it was the verb CLASS and not two instances. 3. crew-state-treats-infrastructure-kill-as-rejection. `error: daemon crashed during execution` appeared on five terminal runs in one afternoon's history, each reported as `failed`. The pipeline broke; the work was never judged. Firstmate read it as the change being rejected. 4. crew-state-reports-aborted-run-as-failed. A deliberate `cancelled` outcome, which supersession produces on purpose, also reported `failed`. WHAT CHANGED Verdict vocabulary, one condition per verdict, none borrowing another: `failed` (a step judged the work and rejected it), `aborted` (deliberately cancelled), `interrupted` (the pipeline broke without judging), `idle` (alive, nothing running, nothing declared), `stale` (evidence aged out), `unknown` (genuinely no usable evidence). The failed/interrupted split reads the pipeline's own structural attribution marker - it prefixes step-attributed errors with "step <name> failed:" - and never reads the error prose to guess whether a step failure was "really" the code's fault. The full text travels to the caller as terminal_error so the semantic residue stays visible instead of being encoded as message-matching. `interrupted` requires POSITIVE evidence: a terminal failure with no error field keeps the plain `failed` verdict, because absence of evidence must not manufacture a claim in either direction. Freshness travels with the verdict. A busy record expires (FM_BUSY_MAX_BUSY_AGE_SECS, 3600s); an idle record never does, because age cannot make a finished turn unfinished. Expiry is terminal like malformed and gen-mismatch, so no weaker source can re-answer for a worker the task's own record just proved had stopped. Each answer reports evidence_age_secs and precedence_applied. RETIREMENT The ad-hoc per-consumer source combination is gone, not left alongside the new path. bin/fm-classify-lib.sh's crew_absorb_class and bin/fm-fleet-snapshot.sh's crew_state_json both reconstructed structure by slicing the prose line on its middle-dot separators; both now read typed fields. No consumer in bin/ parses this reader's prose. crew_absorb_class enumerates every verdict explicitly rather than silently defaulting, which is how a correct reader still produced a wrong supervision outcome. PREVENTION tests/fm-crew-state.test.sh carries a conformance table of evidence-inputs to expected-verdict covering every source combination and every sanctioned status verb. Two coverage gates fail when a verdict or verb exists with no row, so the next one cannot be added silently - that, not the four fixes, is the point. FM_CREW_STATE_VOCABULARY in bin/fm-classify-lib.sh is the single owner consumers and gates read. CERTIFICATION - RED-CAPABLE Run against the pre-change reader, the table reds on exactly the defect rows and passes the other 18, proving it is precise rather than blanket-red: deliberate cancel is aborted want=aborted got=failed pipeline crash is interrupted want=interrupted got=failed expired busy record is stale want=stale got=working verb resolved closes a decision want=idle got=unknown verb captain-held closes a decision want=idle got=unknown idle endpoint with no log is idle want=idle got=unknown Against the change, 24/24 pass. test_conformance_checker_is_red_capable proves in-band on every run that the checker rejects a wrong state, source, and precedence, so it cannot silently become an always-green verifier. The busy-expiry test includes a control that raises the bound and watches the verdict return to `busy`, proving the new check is what decides. TWO COMPLETION CRITERIA SUBSTITUTED, PER THE COMMISSION'S STALE-CRITERION CLAUSE - `pane_hash` is not emitted. The reader computes no pane hash, and adding one would mean capturing and hashing rendered output on every heartbeat - the signal the semantic busy-state redesign deliberately abandoned because rendered output is not turn state. Replaced with `busy_seq`, the busy record's strictly-increasing counter, which answers the same question (did the worker's state actually move between two reads) from the architecture's own advancing-evidence source. - The empty-check-set negative control is written as prose/structured equivalence rather than pinning `green`. bin/fm-crew-state.sh's nm_ci_checks_state is the single owner of that rule and upstream PR 1614 is the open change that tightens it; duplicating its fix here would leave two owners of one invariant. The equivalence assertion is stronger in one respect: it guarantees the structured mode can never be the path that reports a green the prose mode would not, whichever way 1614 resolves. EXCLUDED: RUN SELECTION - AND THE EXPOSURE THAT LEAVES OPEN Resolving the CURRENT run for a task, rather than whatever the repo-scoped status returns, is NOT in this change. Upstream PR 1816 is an open change to this same file implementing exactly that, and the increment's own sequencing note forbids opening another concurrent editor of it. Firstmate ruled that 1816 owns it: duplicating an open PR is the defect CFVC-02 exists to prevent, and rebasing onto an upstream open PR would carry another author's unlanded work into ours. Verified rather than taken on trust, against the installed no-mistakes v1.40.3: - Bare `no-mistakes axi` DOES emit `runs[N]{id,branch,status,head,pr}:`. The comment still in this file saying that table never appears was verified against v1.32.2 and is now STALE. 1816's core mechanism is therefore real code, not the dead path that comment describes. Those exact lines are what 1816 rewrites, so they are deliberately left untouched here rather than edited into a conflict. - 1816 resolves the current run by filtering that table to the task's branch, then to a matching code head, preferring pending/running over completed/failed/cancelled regardless of row order, then re-querying `axi status --run <id>` and verifying id, branch, and head before accepting it. That is genuine current-run resolution, not a repo-scoped answer. - The defect it fixes is live in the run history right now: branch fm/wedge-aging-ignores-provably-working carries one running run plus two older failed runs, distinguishable only by head - exactly the shape that produces a false failed verdict. - One caveat: 1816's `active_run:` block parser matches that key exactly, but v1.40.3 emits `other_branch_active_run:` (confirmed in live output and in the binary's strings; no bare `active_run:` key found). That first helper appears inert on this version, so the runs-table fallback is what actually carries the fix. It is not a defect - a cross-branch block MUST NOT be attributed to this task - but the "authoritative when present" comment overstates what runs today. - 1816 is delivered, not landed: open, unmerged, zero reviews, and no CI checks configured on it. EXPOSURE. Until 1816 lands AND this fork resyncs, the false-failed-verdict defect stays open: crew-state can report `failed` for a lane the pipeline authority shows as running. Measured three times on 2026-08-06. Nothing in this change detects or mitigates it; the typed verdicts make the wrong answer machine-readable, not correct. REVISIT TRIGGER. If 1816 has not landed by the time this fork next resyncs, firstmate re-evaluates rather than letting the gap drift. * no-mistakes(review): enumerate verdicts in decision clearing and keep stale evidence age * no-mistakes(review): gate absorb classes on the vocabulary and reject non-object reads * no-mistakes(document): align crew-state and busy-verdict docs with typed verdicts * docs(bin): correct settled-state rationale for the new run verdicts The fork trunk's crew_state_is_settled explained its `failed` exclusion by noting that failed also reconciled a cancelled run. This contribution splits that: a cancelled run now reports `aborted` and a broken pipeline reports `interrupted`. The case arms already return the right answer for all three - only the stated reason had gone stale, along with two comments describing the reader's prose line that is now a typed verdict. * fix(bin): treat an empty crew-state field as unreadable, not a verdict The typed read replaced a prose parse whose non-matching line yielded `unreadable`, which the watcher's process-liveness source is still allowed to answer for. A present-but-empty state field carries no answer either, so it takes the same path rather than falling through to a decided-looking class. * test(crew-state): stop the mode-equivalence row racing the clock The conformance row compares the prose and structured renderings of the same verdict, but reads them through two separate invocations of the reader. An expired-record detail embeds the age measured at read time, so a second boundary falling between the two invocations rendered 7200s in one and 7201s in the other - the same correct answer one tick apart - and failed the row. Observed on a loaded machine: the row passed on one full run and failed on the next with no code change between them. The measured age is now normalized on both sides, so the row tests the rendering it is there to test. Any other divergence in the detail still fails it, and the age value keeps its own assertion against a single read, which is the only place the two can be compared without a race. * ci: bump the pinned snapshot count for the test this branch adds The snapshot-compatibility job asserts an exact fleet-view test count, and this branch adds one snapshot case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 20 to 21, which is what the suite now reports. The Bearings pin needed no change here: #55 moved it to 42 when it landed, and this branch adds no Bearings case, so trunk's value already matches.
…land of upstream kunchenguid#1827) (#55) * feat(bin): make an unobserved result a third value that cannot pass (land of upstream kunchenguid#1827) Ports upstream PR kunchenguid#1827 onto this fork's trunk. Nothing here is redesigned: bin/fm-verify.sh, bin/fm-verify-lib.sh, the PASS / FAIL / NO_VERIFIER_RAN law, the check-conclusion partition (STARTUP_FAILURE as could-not-observe, CANCELLED/TIMED_OUT as not-observed rather than FAIL), the shared rollup rule for skipped/stale/neutral checks, the bearings label, and the witnessed-red test controls are upstream's as written. Provenance: upstream PR kunchenguid#1827 head commit 0c3afca its base 2cf0283 landed onto ed376cf (sbracewell64/firstmate main) The two trunks diverged at upstream kunchenguid#1495, so the diff did not apply cleanly. Resolutions, all of them fork-versus-upstream divergence rather than changes to what kunchenguid#1827 does: bin/fm-bearings-snapshot.sh - upstream sources bin/fm-timeout-lib.sh here; this fork has no such file and inlines its own bounded gh call instead. Only the fm-verify-lib.sh sourcing this contribution adds is kept. The check-rollup splice itself applied unchanged. bin/fm-test-run.sh - upstream's hunk carried three family entries; two of them (fm-sessionstart-run.sh, fm-timeout-lib.sh) are for files this fork does not have. Only the bin/fm-verify-lib.sh entry, which is this contribution's own, is landed. bin/fm-brief.sh - upstream had no verification-discipline block at all, so the contribution introduced one. This fork already had one, in the older two-bullet form, shared by the ship, scout and secondmate scaffolds. Its single definition is replaced in place with the contribution's three-valued text rather than adding a second definition, so all three scaffolds move together and the one-owner rule holds. The header comment describing that block is updated to the text it now emits. tests/fm-brief.test.sh - both suites are kept. This fork's test_standing_worker_rules_by_variant asserted the old block's wording; those three assertions are re-pointed at the replacement text (witnessed negative control, the three-valued rule, and missing-artifact-is-could-not-observe), which is the same intent against the sentences that now exist. Upstream's test_verification_discipline_is_the_type_rule is added alongside it. docs/scripts.md - the fm-timeout-lib.sh row upstream's hunk carried does not belong on this fork; the two fm-verify rows are landed. Verified on this fork: bin/fm-lint.sh clean (ShellCheck 0.11.0, exit 0), bin/fm-doc-audience-check.sh ok (surfaces=72 local_links=213), and tests/fm-verify.test.sh, tests/fm-brief.test.sh and tests/fm-bearings-snapshot.test.sh all pass. * ci: bump the pinned Bearings count for the test this branch adds The snapshot-compatibility job asserts an exact Bearings test count, and this branch adds one Bearings case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 41 to 42, which is what the suite now reports.
…and of upstream kunchenguid#1829) (#59) * feat(bin): give the crew-state reader typed verdicts and freshness CFVC-05. The fleet's authoritative current-state reader answered every question with a confident-looking prose sentence and had no way to say it did not know, so each unmodelled condition was coerced into some other condition's verdict. This adds the structured mode the increment asks for, and closes the four measured defects that shared that single cause. WHAT WAS MEASURED (2026-08-06, no-mistakes v1.40.3) 1. busy-record-never-expires. bin/fm-busy-lib.sh parsed the record's ts= for format and never compared it to the clock, so a worker killed mid-turn classified `busy` forever. The watcher's BUSY_TURN_MAX_SECS cannot cover this: it ages a pane already believed busy, and a dead worker's pane renders an idle footer, so that backstop never arms for exactly these workers. 2. crew-state-unknown-after-resolved-line. A `resolved:` line - the closure verb every brief instructs crews to write - reported `unknown / none / no current-state source available`, claiming no source existed while the endpoint was readable and idle. Checking the whole verb set against bin/fm-classify-lib.sh rather than the two reported cases showed `captain-held:` hit the same fallthrough, confirming it was the verb CLASS and not two instances. 3. crew-state-treats-infrastructure-kill-as-rejection. `error: daemon crashed during execution` appeared on five terminal runs in one afternoon's history, each reported as `failed`. The pipeline broke; the work was never judged. Firstmate read it as the change being rejected. 4. crew-state-reports-aborted-run-as-failed. A deliberate `cancelled` outcome, which supersession produces on purpose, also reported `failed`. WHAT CHANGED Verdict vocabulary, one condition per verdict, none borrowing another: `failed` (a step judged the work and rejected it), `aborted` (deliberately cancelled), `interrupted` (the pipeline broke without judging), `idle` (alive, nothing running, nothing declared), `stale` (evidence aged out), `unknown` (genuinely no usable evidence). The failed/interrupted split reads the pipeline's own structural attribution marker - it prefixes step-attributed errors with "step <name> failed:" - and never reads the error prose to guess whether a step failure was "really" the code's fault. The full text travels to the caller as terminal_error so the semantic residue stays visible instead of being encoded as message-matching. `interrupted` requires POSITIVE evidence: a terminal failure with no error field keeps the plain `failed` verdict, because absence of evidence must not manufacture a claim in either direction. Freshness travels with the verdict. A busy record expires (FM_BUSY_MAX_BUSY_AGE_SECS, 3600s); an idle record never does, because age cannot make a finished turn unfinished. Expiry is terminal like malformed and gen-mismatch, so no weaker source can re-answer for a worker the task's own record just proved had stopped. Each answer reports evidence_age_secs and precedence_applied. RETIREMENT The ad-hoc per-consumer source combination is gone, not left alongside the new path. bin/fm-classify-lib.sh's crew_absorb_class and bin/fm-fleet-snapshot.sh's crew_state_json both reconstructed structure by slicing the prose line on its middle-dot separators; both now read typed fields. No consumer in bin/ parses this reader's prose. crew_absorb_class enumerates every verdict explicitly rather than silently defaulting, which is how a correct reader still produced a wrong supervision outcome. PREVENTION tests/fm-crew-state.test.sh carries a conformance table of evidence-inputs to expected-verdict covering every source combination and every sanctioned status verb. Two coverage gates fail when a verdict or verb exists with no row, so the next one cannot be added silently - that, not the four fixes, is the point. FM_CREW_STATE_VOCABULARY in bin/fm-classify-lib.sh is the single owner consumers and gates read. CERTIFICATION - RED-CAPABLE Run against the pre-change reader, the table reds on exactly the defect rows and passes the other 18, proving it is precise rather than blanket-red: deliberate cancel is aborted want=aborted got=failed pipeline crash is interrupted want=interrupted got=failed expired busy record is stale want=stale got=working verb resolved closes a decision want=idle got=unknown verb captain-held closes a decision want=idle got=unknown idle endpoint with no log is idle want=idle got=unknown Against the change, 24/24 pass. test_conformance_checker_is_red_capable proves in-band on every run that the checker rejects a wrong state, source, and precedence, so it cannot silently become an always-green verifier. The busy-expiry test includes a control that raises the bound and watches the verdict return to `busy`, proving the new check is what decides. TWO COMPLETION CRITERIA SUBSTITUTED, PER THE COMMISSION'S STALE-CRITERION CLAUSE - `pane_hash` is not emitted. The reader computes no pane hash, and adding one would mean capturing and hashing rendered output on every heartbeat - the signal the semantic busy-state redesign deliberately abandoned because rendered output is not turn state. Replaced with `busy_seq`, the busy record's strictly-increasing counter, which answers the same question (did the worker's state actually move between two reads) from the architecture's own advancing-evidence source. - The empty-check-set negative control is written as prose/structured equivalence rather than pinning `green`. bin/fm-crew-state.sh's nm_ci_checks_state is the single owner of that rule and upstream PR 1614 is the open change that tightens it; duplicating its fix here would leave two owners of one invariant. The equivalence assertion is stronger in one respect: it guarantees the structured mode can never be the path that reports a green the prose mode would not, whichever way 1614 resolves. EXCLUDED: RUN SELECTION - AND THE EXPOSURE THAT LEAVES OPEN Resolving the CURRENT run for a task, rather than whatever the repo-scoped status returns, is NOT in this change. Upstream PR 1816 is an open change to this same file implementing exactly that, and the increment's own sequencing note forbids opening another concurrent editor of it. Firstmate ruled that 1816 owns it: duplicating an open PR is the defect CFVC-02 exists to prevent, and rebasing onto an upstream open PR would carry another author's unlanded work into ours. Verified rather than taken on trust, against the installed no-mistakes v1.40.3: - Bare `no-mistakes axi` DOES emit `runs[N]{id,branch,status,head,pr}:`. The comment still in this file saying that table never appears was verified against v1.32.2 and is now STALE. 1816's core mechanism is therefore real code, not the dead path that comment describes. Those exact lines are what 1816 rewrites, so they are deliberately left untouched here rather than edited into a conflict. - 1816 resolves the current run by filtering that table to the task's branch, then to a matching code head, preferring pending/running over completed/failed/cancelled regardless of row order, then re-querying `axi status --run <id>` and verifying id, branch, and head before accepting it. That is genuine current-run resolution, not a repo-scoped answer. - The defect it fixes is live in the run history right now: branch fm/wedge-aging-ignores-provably-working carries one running run plus two older failed runs, distinguishable only by head - exactly the shape that produces a false failed verdict. - One caveat: 1816's `active_run:` block parser matches that key exactly, but v1.40.3 emits `other_branch_active_run:` (confirmed in live output and in the binary's strings; no bare `active_run:` key found). That first helper appears inert on this version, so the runs-table fallback is what actually carries the fix. It is not a defect - a cross-branch block MUST NOT be attributed to this task - but the "authoritative when present" comment overstates what runs today. - 1816 is delivered, not landed: open, unmerged, zero reviews, and no CI checks configured on it. EXPOSURE. Until 1816 lands AND this fork resyncs, the false-failed-verdict defect stays open: crew-state can report `failed` for a lane the pipeline authority shows as running. Measured three times on 2026-08-06. Nothing in this change detects or mitigates it; the typed verdicts make the wrong answer machine-readable, not correct. REVISIT TRIGGER. If 1816 has not landed by the time this fork next resyncs, firstmate re-evaluates rather than letting the gap drift. * no-mistakes(review): enumerate verdicts in decision clearing and keep stale evidence age * no-mistakes(review): gate absorb classes on the vocabulary and reject non-object reads * no-mistakes(document): align crew-state and busy-verdict docs with typed verdicts * docs(bin): correct settled-state rationale for the new run verdicts The fork trunk's crew_state_is_settled explained its `failed` exclusion by noting that failed also reconciled a cancelled run. This contribution splits that: a cancelled run now reports `aborted` and a broken pipeline reports `interrupted`. The case arms already return the right answer for all three - only the stated reason had gone stale, along with two comments describing the reader's prose line that is now a typed verdict. * fix(bin): treat an empty crew-state field as unreadable, not a verdict The typed read replaced a prose parse whose non-matching line yielded `unreadable`, which the watcher's process-liveness source is still allowed to answer for. A present-but-empty state field carries no answer either, so it takes the same path rather than falling through to a decided-looking class. * test(crew-state): stop the mode-equivalence row racing the clock The conformance row compares the prose and structured renderings of the same verdict, but reads them through two separate invocations of the reader. An expired-record detail embeds the age measured at read time, so a second boundary falling between the two invocations rendered 7200s in one and 7201s in the other - the same correct answer one tick apart - and failed the row. Observed on a loaded machine: the row passed on one full run and failed on the next with no code change between them. The measured age is now normalized on both sides, so the row tests the rendering it is there to test. Any other divergence in the detail still fails it, and the age value keeps its own assertion against a single read, which is the only place the two can be compared without a race. * ci: bump the pinned snapshot count for the test this branch adds The snapshot-compatibility job asserts an exact fleet-view test count, and this branch adds one snapshot case without moving the pin, so the job failed on this PR before the rebase as well. Pinned count moved from 20 to 21, which is what the suite now reports. The Bearings pin needed no change here: #55 moved it to 42 when it landed, and this branch adds no Bearings case, so trunk's value already matches.
Ports upstream PR kunchenguid#1827 onto this fork's trunk. Nothing here is redesigned:
bin/fm-verify.sh,bin/fm-verify-lib.sh, the PASS / FAIL / NO_VERIFIER_RAN law, the check-conclusion partition, the shared rollup rule for skipped/stale/neutral checks, the bearings label, and the witnessed-red test controls are upstream's as written.Provenance
0c3afca2cf0283ed376cf(sbracewell64/firstmate main)The two trunks diverged at upstream kunchenguid#1495, so the diff did not apply cleanly.
Conflict resolutions
All of them fork-versus-upstream divergence rather than changes to what kunchenguid#1827 does.
bin/fm-bearings-snapshot.sh- upstream sourcesbin/fm-timeout-lib.shhere; this fork has no such file and inlines its own boundedghcall instead. Only thefm-verify-lib.shsourcing this contribution adds is kept. The check-rollup splice itself applied unchanged.bin/fm-test-run.sh- upstream's hunk carried three family entries; two of them (fm-sessionstart-run.sh,fm-timeout-lib.sh) are for files this fork does not have. Only thebin/fm-verify-lib.shentry, which is this contribution's own, is landed.bin/fm-brief.sh- upstream had no verification-discipline block at all, so the contribution introduced one. This fork already had one, in the older two-bullet form, shared by the ship, scout and secondmate scaffolds. Its single definition is replaced in place with the contribution's three-valued text rather than adding a second definition, so all three scaffolds move together and the one-owner rule holds. The header comment describing that block is updated to the text it now emits.tests/fm-brief.test.sh- both suites are kept. This fork'stest_standing_worker_rules_by_variantasserted the old block's wording; those three assertions are re-pointed at the replacement text (witnessed negative control, the three-valued rule, and missing-artifact-is-could-not-observe), which is the same intent against the sentences that now exist. Upstream'stest_verification_discipline_is_the_type_ruleis added alongside it.docs/scripts.md- thefm-timeout-lib.shrow upstream's hunk carried does not belong on this fork; the twofm-verifyrows are landed.Contribution containment
git merge-tree --write-tree fork/main HEADexits 0, and the tree it writes is byte-identical to this branch's own tree, so the branch carries only this contribution on top of the current trunk. Both directions of that check were controlled: merge-tree against the raw upstream branch exits 1 (conflicts), and the written tree diffs non-empty againstfork/main.Test evidence
Run on this branch in an isolated worktree at
83db581.bin/fm-lint.shbin/fm-doc-audience-check.shtests/fm-verify.test.shtests/fm-brief.test.shtests/fm-bearings-snapshot.test.shbin/fm-test-run.sh --changed --base fork/mainThe one failure, disclosed
tests/fm-calm-pi-extension.test.shfails with:This is pre-existing and unrelated. Proved on the base before claiming so: a clean
git archive fork/mainextraction, with none of this branch's changes present, runs the same suite and exits 1 with the identical error. This branch touches no file that suite reads; the cause is that this environment'snodehas no TypeScript loader.Check state
Fork CI is currently failing wholesale on this repository, with a separate diagnosis lane live on it. If every check on this PR reports failure, that is the standing condition rather than a result this branch produced; the local evidence above is what stands behind it.