Skip to content

feat(brief): orient every crewmate at birth - #2

Merged
TastyTom13 merged 8 commits into
mainfrom
fm/fm-brief-env-link
Aug 31, 2026
Merged

TastyTom13 merged 8 commits into
mainfrom
fm/fm-brief-env-link

Conversation

@TastyTom13

Copy link
Copy Markdown
Owner

What this does

Generated crewmate briefs now carry the context a worker previously had to rediscover, or never learned at all. Closes fm-brief-env-link and fm-opus-tone-rules.

Five additions to the scaffold in bin/fm-brief.sh:

  1. Env link - new --env-file <absolute-source>[:<worktree-relative-dest>] renders a setup block that links the primary checkout's gitignored env file into the worktree, with the worktree-versus-primary explanation in the same paragraph so a foreign path never reads as an injected instruction. Opt-in, so docs-only tasks carry no env step; refused on a --secondmate charter; absolute source required; a destination that escapes the worktree is refused.
  2. Merge wait - the two PR-raising delivery modes tell the worker to follow its done line with paused: awaiting merge of PR {url}, so waiting on a merge is a declared external wait instead of an idle pane the watcher escalates. Rendered from bin/fm-dod-lib.sh, the single owner an ordinary brief and a promoted scout both use, and it follows the configured wait verb.
  3. CONTEXT.md - ship and scout briefs point the worker at the project's CONTEXT.md when one exists.
  4. Toolkit - names the standard research and forge tools using the measured browse comparison's own numbers, so a worker can pick the right one per page rather than guessing.
  5. Reporting rules - "no finding" is a complete answer; every claimed problem cites clickable evidence; what was run stays separate from what was reasoned; findings, decisions, options and risks carry stable F1/D1/O1/R1 codes. No banned-word list, deliberately.

Downstream fix the review found

The new trailing wait line becomes the last status line, and bin/fm-crew-state.sh read only that line to decide a crewmate was finished, so a worker that had shipped green would have read as still working. The reader now looks back past a trailing run of declared-wait lines, for the done case only, using the configured wait verb. failed-then-wait keeps its existing meaning.

Pipeline

no-mistakes run 01M1C22J32FGTZGEDRHX52E44R: intent, rebase, review, test, document and lint all completed. Review ran three fix rounds covering an empty --env-file value, an unquoted link path, a duplicated wait-verb default, nested and trailing-slash env destinations, and the crew-state read sites above. The push step failed with a 403 against kunchenguid/firstmate, so custody was recovered through no-mistakes axi sync --recover and the branch pushed to this fork by hand. Local bin/fm-lint.sh is clean on the recovered head (ShellCheck 0.11.0, actionlint 1.7.12), and tests/fm-brief.test.sh and tests/fm-crew-state.test.sh pass.

One accepted limitation is recorded rather than fixed: a source path that itself contains a colon is ambiguous against the :<dest> separator.

kunchenguid and others added 8 commits August 30, 2026 11:27
* fix: publish promote and Relay meta rewrites through contained replace

Bare mv still rewrote live task records in place, so a symlink meta could
be followed to a target outside state/. Route those field rewrites through
the shared publisher and drop the unused library aliases.

Co-authored-by: Cursor <[email protected]>

* no-mistakes(review): Refuse dangling symlinks during X metadata clear

* no-mistakes(review): Refuse unsafe metadata before follow-up and promotion side effects

* no-mistakes(review): Exercise dangling symlink refusal through clear helper

---------

Co-authored-by: Cursor <[email protected]>
* fix(watch): absorb a turn-end whose pane churned since the previous poll

The watcher's "absorb a benign turn-end when the crew is provably working"
triage was structurally unreachable for any harness whose semantic busy state
has no verified source. crew_absorb_class only reports working for an actively
running no-mistakes step or an exact busy verdict, and bin/fm-crew-state.sh can
only answer unknown for such an adapter, so codex crewmates surfaced a signal
wake at every turn boundary with nothing to act on - a full supervisor drain,
inspect and acknowledge turn per worker turn, scaling with the number of workers
in flight and drowning the wakes that matter in identical noise.

Widen the proof rather than bound the wake rate. A wake carrying only bare
turn-ended markers is now also benign when the task's pane content changed since
the previous poll, compared against the same state/.hash-* marker the staleness
backbone already records and already trusts as liveness. That evidence claims no
harness semantics, so it fabricates no busy verdict an adapter has not earned,
and it needs no adapter cooperation.

Absorb stays evidence-driven in both directions. A wake naming any status file
keeps the strict proof, every captain-relevant verb still surfaces immediately,
and an unresolvable task, a missing prior hash, a failed or empty capture, or an
unchanged pane all surface exactly as before. The absorb defers rather than
swallows: a crew that has stopped renders nothing further, so its now-static pane
surfaces through the staleness backbone within a poll or two. Bounding the
surfacing rate instead would have suppressed genuinely stopped workers.

The derivation lives with the .hash-* marker format in bin/fm-watch.sh, which
owns it, and costs one bounded capture reached only for a no-verb turn-end whose
crew is not already provably working.

* no-mistakes(review): Captain, guard pane-churn absorption from collisions and secondmates

* no-mistakes(review): Captain, make watcher marker identities injective

* no-mistakes(review): Captain, isolate ambiguous legacy markers and restore Herdr sourcing

* no-mistakes(review): Captain, localize pane-churn collision guard

* no-mistakes(review): Captain, reject malformed pane-churn hashes

* no-mistakes(document): Document pane-churn turn-end evidence

* no-mistakes: apply CI fixes

* fix(watch): gate and bound the pane-churn turn-end absorb

Make the pane-churn form of positive work evidence opt-in per home and
bound how long it may defer one endpoint's bare turn-ends.

Absorbing a bare turn-end on pane churn is now reached only when the home
creates config/turnend-churn-absorb. The other two proofs read a verdict
the harness itself vouches for, while this one infers execution from
rendered bytes, so widening the absorb is a home's choice rather than a
default every fleet inherits. With the flag absent the predicate returns
on its first line and triage is unchanged.

Churn and pane staleness read the same pane, so neither can be the
other's only backstop. A pane that renders continuously never presents
the two consecutive identical hashes the staleness backbone needs, so an
unbounded churn absorb left a worker that had genuinely stopped behind
such a renderer with no path to surface at all. One endpoint's turn-ends
may now ride churn evidence for at most FM_TURNEND_CHURN_ABSORB_SECS,
tracked in state/.churn-since-*, after which the wake surfaces and the
window restarts. The bound is evaluated before any .stale- state is
touched, so a wake that surfaces there leaves the staleness backbone's
own classification alone.

Covers both with behavioral tests: the same churning fixture that absorbs
with the flag surfaces and queues without it, and a spent deferral window
surfaces and restarts. The four existing safety guards now run with the
flag enabled so they keep proving their specific guard.

* no-mistakes(review): Fail closed on invalid churn deferral state

* no-mistakes(review): Validate persisted churn deadlines before arithmetic

* no-mistakes(review): Make churn deadlines transactional and bounds safe

* no-mistakes(review): Compose turn-end evidence per task from one snapshot

* no-mistakes(review): Restore strict turn-end fallback guards

* no-mistakes(document): Clarify pane-churn supervision documentation

* no-mistakes(lint): Fix watcher arithmetic lint issues

* no-mistakes: apply CI fixes

* no-mistakes(document): Clarify pane-churn fail-closed documentation

* fix(bin): prioritize active pipeline-owned crew runs (#3194)

* fix(bin): bind the live pipeline-owned run instead of a superseded failed row

fm-crew-state.sh bound a superseded FAILED no-mistakes run to a task instead
of the LIVE replacement run: the live run's pipeline-owned lane head is not a
git object in the task worktree, so head-equality attribution rejected it and
the coarse runs-list fallback silently continued past the RUNNING row onto an
older failed row whose head equalled the stale worktree HEAD. The home summary
then flipped invalid and Bearings hid the home's live work (F10).

Attribution precedence now follows the daemon's own identity:
- An ACTIVE run for the task's branch binds without head equality while
  branch_sync.state is pipeline_owned (fm_nm_run_is_pipeline_owned_active);
  the pipeline owning the branch is itself the attribution.
- A genuinely failed run with no later run on the branch still reports failed
  through the unchanged head-equality path - real failures are not hidden.
- In the coarse runs scan, an unresolvable head is unknown attribution and
  stops the scan (fm_nm_head_resolvable) instead of falling through to an
  older row; a resolvable-but-mismatched head keeps the historical
  reused-branch skip.

The exemption never applies to a terminal run and requires pipeline_owned
specifically, both pinned by negative-control tests. Fixture shape verified
against the live incident run's real axi status output.

* no-mistakes(document): Updated run-attribution documentation ownership

* no-mistakes(review): Captain, make watcher marker identities injective

* no-mistakes(review): Captain, localize pane-churn collision guard

* no-mistakes(review): Compose turn-end evidence per task from one snapshot

* no-mistakes(review): Restore strict turn-end fallback guards

* no-mistakes(document): Align pane-churn watcher documentation

* no-mistakes(ci): Captain, fixed the flaky cooldown boundary test by freezing its executable clock. The failure reproduced before the fix and passed five consecutive full-suite runs afterward. Extended ShellCheck passed; full lint stopped because actionlint 1.7.12 is not installed

---------

Co-authored-by: Kun Chen <[email protected]>
* fix(bin): add a safe owner for custom-check retirement

Agents were improvising rm of check files with unset STATE/ID, which wedges
headless panes. Unregister validates the id and state directory first.

Co-authored-by: Cursor <[email protected]>

* no-mistakes(review): Refuse explicitly empty custom-check state overrides

* no-mistakes(document): Document custom-check retirement safety contract

---------

Co-authored-by: Cursor <[email protected]>
Generated ship and scout briefs now carry the context a worker previously
had to rediscover, or never learned at all:

- --env-file <absolute path> adds an opt-in setup block that links the
  project's gitignored environment file from the primary checkout into the
  worktree, explaining in the same paragraph why a worktree lacks it and
  why the brief names a foreign path. Docs-only tasks omit the flag and
  carry no env step; charters refuse it.
- The two PR-raising delivery modes tell the worker to follow its done
  line with "<paused>: awaiting merge of PR {url}", so waiting for a merge
  is a declared external wait rather than an idle pane the watcher
  escalates. local-only and scout raise no PR and carry no such line.
- Both scaffolds point at the project's CONTEXT.md when one exists.
- A Toolkit section names the standard research and forge tools, using the
  measured browse comparison's own numbers so a worker can pick the right
  one per page instead of guessing.
- Reporting rules state that "no finding" is a complete answer, require
  clickable evidence for every claimed problem, separate what was run from
  what was reasoned, and pin stable F1/D1/O1/R1 reference codes. No
  banned-word list: it is cosmetic and paraphrased around.

The merge-wait line lives in bin/fm-dod-lib.sh, the single owner both an
ordinary brief and a promoted scout render, and follows the configured
declared-external-wait verb.
@TastyTom13
TastyTom13 merged commit b131c16 into main Aug 31, 2026
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.

3 participants