Skip to content

feat(fleet): shrink always-loaded AGENTS.md and generate the skill index from frontmatter - #1341

Open
sbracewell64 wants to merge 2 commits into
kunchenguid:mainfrom
sbracewell64:fm/doc-truth-fleet-lane
Open

feat(fleet): shrink always-loaded AGENTS.md and generate the skill index from frontmatter#1341
sbracewell64 wants to merge 2 commits into
kunchenguid:mainfrom
sbracewell64:fm/doc-truth-fleet-lane

Conversation

@sbracewell64

Copy link
Copy Markdown

Intent

Execute Lane B of the captain-authorized documentation single-source-of-truth commission (2026-07-30) for the firstmate fleet repo. Lane B is defined by section 11 of data/doc-truth-review/report.md, a prior read-only scout review; this branch implements its B1, B4, B2, and B3 rows.

GOAL: shrink firstmate's always-loaded AGENTS.md contract to only what it alone can own, and convert the review's documentation-ownership table from prose into a mechanically enforced artifact.

B1+B4 - AGENTS.md section 2 was 10,777 bytes, of which a 9,407-byte fenced directory tree restated docs/configuration.md. docs/configuration.md already declares itself the single owner of the operational-home layout and explicitly delegates exact child fields to each producing script's header. Before deleting anything I verified every artifact the tree named has such an owner; several (check-trust, pr-poll-retirement, turnend-claude-blocks, the grok/kimi turn-end tokens, pr-check-quarantine) are documented ONLY in bin/ scripts and not in docs/, which is exactly what the owner's declared boundary prescribes, so their removal from AGENTS.md is correct rather than a loss. What deliberately survives is every fact with no other owner anywhere in the repo: the status-line-is-a-wake-event rule, the never-touch rule for watcher/Claude-auto-arm/sub-supervisor state under state/ (I grepped the whole repo and this instruction exists nowhere else), the check.sh execution-trust boundary, the scout report surviving teardown, and B4's corrected secondmates.md wording (created lazily by fm-home-seed.sh, so absence means no secondmate is registered rather than a lost registry). The plan targeted -6,907 bytes; the measured result is -8,019 because collapsing the tree to five safety bullets beat the estimate. The report's own section 15.2 marks its after-column byte figures as engineering targets, not measurements, so beating one is expected.

B2 - AGENTS.md section 13 was a hand-maintained 2,913-byte roster of 13 agent-only skill triggers, duplicating each skill's own frontmatter description, which some harnesses inject into the session prompt unprompted. New bin/fm-skill-index.sh renders that roster from frontmatter, selecting on the existing user-invocable:false marker (verified to match the old roster exactly, 13 for 13). It is composed into the session-start digest by bin/fm-session-start.sh.

DELIBERATE DEPARTURE FROM THE REPORT, made on safety grounds and worth not flagging as a mistake: the report's section 7.3 table lists codex and kimi as 'likely' injecting skill descriptions, but its own section 15.2 admits those cells are unverified. I suppress the generated index ONLY where injection is positively verified - claude (proved by direct observation) and grok (harness-adapters records 'firstmate skills are discovered' plus a verified end-to-end invocation) - and emit it for every other harness including unknown. The asymmetry is intentional: a redundant index only costs bytes, whereas a wrongly suppressed one silently removes every agent-only skill's load trigger. The script header documents this and requires positive evidence before adding a harness to the suppression list.

Section 13 kept three sentences rather than collapsing to the report's suggested single sentence, so it fell 619 bytes short of the -2,927 target: the ownership pointer to fm-skill-index.sh and the register-once rule are contract facts a future maintainer needs, not roster. Net across AGENTS.md is -10,166 bytes, 332 better than the combined plan target.

Also honestly measured and contrary to the report's estimate: the report predicted the generated index would be byte-neutral on non-injecting harnesses. It actually costs 5,329 bytes there because frontmatter descriptions are richer than the old abridged roster. Net is therefore -10,166 on claude/grok and -4,837 elsewhere - still a reduction everywhere, but not the wash predicted. This is stated plainly rather than rounded away.

B3 - docs/documentation-audiences.json gains an injection field (always/lazy/generated/referenced/never) and a one-sentence responsibility for each of its 57 surfaces, and bin/fm-doc-audience-check.sh now REQUIRES both, refusing rather than defaulting a missing field. The one-sentence limit on responsibility is enforced by regex and is the point of the mechanism, per the commission: a surface that needs two sentences owns too much and should be split. This makes the always-loaded set a queryable list rather than a claim, and a test asserts it stays bounded to AGENTS.md plus its CLAUDE.md symlink.

CROSS-REFERENCES updated for the one-owner rule: firstmate-coding-guidelines and fmx-respond skills pointed at 'section 13' as the place to register a trigger; README.md said triggers are named in AGENTS.md; docs/scripts.md gains a row for the new script. All corrected in the same change.

CERTIFICATION already run locally: the plan requires a session-start smoke read for B1 proving no operator action lost its instruction - done under both a claude and an opencode primary, walking each instruction the removed tree carried. New tests/fm-skill-index.test.sh (6 cases) covers suppression, emission including unknown harnesses, roster derivation independently from frontmatter, folded multi-line description rendering, and digest composition. tests/fm-documentation-audiences.test.sh gains 2 cases for the required fields. bin/fm-lint.sh and bin/fm-doc-audience-check.sh are green.

KNOWN PRE-EXISTING FAILURE, not introduced here: tests/fm-session-start.test.sh has one failing case ('MISSING diagnostic did not appear at all'). I stashed this branch's changes and re-ran it on the base commit f0d7cbe, where it fails identically - it is environment-dependent tool detection, unrelated to this change.

CONSTRAINTS: this is firstmate's own shared tracked material, so repo style rules apply - one sentence per line in tracked Markdown, plain dash never em dash, no agent co-author on commits, bin/*.sh shellcheck-clean via bin/fm-lint.sh, tests colocated in tests/ as .test.sh extending existing runners, and tests must exercise behavior through executable interfaces rather than asserting implementation-source bytes.

What Changed

  • Cut AGENTS.md by 10,166 bytes: section 2's 9,407-byte directory tree that restated docs/configuration.md is collapsed to five safety bullets (keeping only facts with no other owner, e.g. the status-line wake rule, the never-touch state/ rule, and the check.sh trust boundary), and section 13's hand-maintained 2,913-byte roster of agent-only skill triggers is reduced to a three-sentence ownership pointer.
  • New bin/fm-skill-index.sh renders the agent-only skill roster from each skill's frontmatter (verified 13-for-13 against the old roster) and is composed into the session-start digest by bin/fm-session-start.sh; the generated index is suppressed only on harnesses positively verified to inject skill descriptions (claude, grok) and emitted everywhere else, including unknown harnesses.
  • docs/documentation-audiences.json gains required injection and one-sentence responsibility fields for all 57 surfaces, enforced by bin/fm-doc-audience-check.sh (refuses rather than defaults a missing field), with a test asserting the always-loaded set stays bounded to AGENTS.md plus its CLAUDE.md symlink; stale "section 13" cross-references in the firstmate-coding-guidelines and fmx-respond skills, README.md, and docs/scripts.md are updated, and new tests cover the skill index (6 cases) and the required audience fields.

Risk Assessment

✅ Low: A well-bounded documentation-consolidation and tooling change whose key claims I independently verified: the generated skill index matches the removed 13-entry roster exactly, suppression is limited to the two positively verified injecting harnesses per the stated intent, the stricter inventory check passes green on the updated 57-surface inventory, removed AGENTS.md facts have confirmed owners elsewhere, and new behavior-level tests cover the suppression/emission matrix and required-field enforcement.

Testing

Ran the two new/extended test suites (12/12 cases green), then manually verified every intent claim end-to-end: skill-index emission/suppression per harness including the positive-evidence rule for unknown harnesses, real session-start digest composition under opencode vs claude primaries, doc-audience-check refusing missing injection and two-sentence responsibility fields while green on the real 57-surface inventory, exact 13-for-13 roster parity with the old hand-maintained section 13, byte deltas matching the claimed -10,166 net and -8,019 section 2, survival of all five no-other-owner facts, and corrected cross-references; the single fm-session-start.test.sh failure was reproduced identically at the base commit, confirming it pre-exists this change. No visual evidence applies - this is a CLI/docs repo and the transcripts captured are the end-user surface.

Evidence: Skill index emission/suppression transcript (opencode, claude, grok, unknown harness)
$ bin/fm-skill-index.sh --harness opencode
AGENT-ONLY SKILL TRIGGERS (harness opencode does not inject skill descriptions)
These skills are not captain-invocable; load one only at its trigger below.

- ask-user-authority - Agent-only decision procedure for ask-user findings. Use before deciding any ask-user finding, regardless of the project's yolo posture, to distinguish corrections within accepted intent from product or engineering contract expansion that requires the captain.
- bootstrap-diagnostics - Agent-only handling playbook for session-start bootstrap diagnostics. Use whenever the session-start digest's bootstrap section prints an actionable diagnostic line - MISSING, MISSING_MANUAL, BACKEND_INVALID, NEEDS_GH_AUTH, TANGLE, STARTUP_MEMORY_BUDGET, CREW_DISPATCH invalid, FLEET_SYNC, PR_CHECK_MIGRATION, SECONDMATE_SYNC, SECONDMATE_LIVENESS, NUDGE_SECONDMATES, or FMX - or when a standalone bin/fm-bootstrap.sh run prints one of those lines. A silent bootstrap section, or a BOOTSTRAP_INFO fact, means no skill load.
- decision-hold-lifecycle - Agent-only policy for completing investigations and visual reviews without losing unresolved captain decisions. Load before treating an investigation, scout report, structured review, or Lavish review as complete, before ending a visual review that exposed a decision, and when recording or routing the captain's answer.
- diagnostic-reasoning - Agent-only procedure for diagnosing reported bugs. Use before scoping a reported bug and before acting on a diagnostic report. Owns end-user-aligned reproduction, causal separation, divergent-path and history inspection, counterfactual testing, and disconfirming evidence.
- firstmate-codexapp - Agent-only playbook for coordinating visible Codex Desktop threads alongside Firstmate without pretending they are a selectable shell backend. Use before creating, reading, steering, archiving, debugging, or reviewing a Codex App visible thread for Firstmate work, and before responding to requests to make Codex App native to Firstmate.
- firstmate-coding-guidelines - Agent-only reference for changing firstmate's shared, tracked material per AGENTS.md section 1. Use before editing any of that material, whether working as firstmate directly or as a crewmate briefed on a firstmate-repo task. Covers the knowledge-placement decision tree, the one-owner rule for contracts, the inline-stub pattern for content moved into a skill, AGENTS.md size discipline, trigger hygiene for new skills, and repo style rules (one sentence per line, plain dash, no agent co-author, shellcheck-clean bin scripts, colocated tests, and maintainer-verification evidence).
- firstmate-orca - Agent-only operator checklist for Firstmate's Orca runtime backend. Use when switching to Orca, spawning or supervising Orca-backed work, smoke-testing Orca backend behavior, debugging Orca task state, or reconciling Orca-backed task metadata.
- fmx-respond - Agent-only playbook for handling X mode mentions and follow-ups. Use on an "x-mention <request_id>" check wake to read the stashed mention, classify it, act autonomously on eligible requests, reply or dismiss, and link spawned work. Also use on an "x-mode-error ..." check wake to report the X-mode configuration blocker instead of answering a mention. Also use on milestone and terminal wakes for an X-mode-linked task before posting completion follow-ups, ending terminal outcomes with --final. Loaded only when X mode is enabled.
- harness-adapters - Agent-only reference for firstmate harness operations. Use before spawning or recovering a crewmate or secondmate, handling a trust dialog, sending a harness-specific skill invocation, interrupting or exiting an agent, resuming an exited agent, or verifying a new harness adapter. Contains verified facts for claude, codex, opencode, pi, pi-signed, grok, and kimi.
- project-management - Agent-only procedure for Firstmate project management. Use before adding, creating, removing, or initializing a project. Cloning or registering a project is add intake and uses the same trigger. Owns project add, create, clone, remove, initialization, registry, delivery-mode, autonomy, and outward-consent decisions.
- quota-array-dispatch - Agent-only decision procedure for resolving a matched crew-dispatch profile array from current quota-axi output, including quota-window pace signals. Load when a dispatch rule or default resolves to more than one profile candidate.
- secondmate-provisioning - Agent-only reference for persistent secondmate setup and retirement. Use when creating, seeding, validating, launching, recovering, handing backlog to, pushing inherited local material into, or retiring a secondmate home, or when editing data/secondmates.md. Covers home leases, transactional seeding, project clone restrictions, secondmate harness pins, inherited local-material push, idle charter, handoff helper, and teardown safety.
- stuck-crewmate-recovery - Agent-only playbook for stuck or missing ordinary Firstmate direct reports. Use when the session-start digest reports an ordinary direct report's endpoint dead or its metadata has no window, or after a stale wake, looping pane, repeated confusion, an answered-by-brief question, an unresponsive crewmate, or a failed steer. Reconciles recorded work before escalating from targeted inspection through safe relaunch or failure.

$ bin/fm-skill-index.sh --harness claude   # injects skill descriptions itself -> suppressed
(no output, exit 0)

$ bin/fm-skill-index.sh --harness grok     # verified injecting -> suppressed
(no output, exit 0)

$ bin/fm-skill-index.sh --harness some-future-harness   # unknown -> emitted (positive-evidence rule)
AGENT-ONLY SKILL TRIGGERS (harness some-future-harness does not inject skill descriptions)
These skills are not captain-invocable; load one only at its trigger below.

- ask-user-authority - Agent-only decision procedure for ask-user findings. Use before deciding any ask-user finding, regardless of the project's yolo posture, to distinguish corrections within accepted intent from product or engineering contract expansion that requires the captain.
- bootstrap-diagnostics - Agent-only handling playbook for session-start bootstrap diagnostics. Use whenever the session-start digest's bootstrap section prints an actionable diagnostic line - MISSING, MISSING_MANUAL, BACKEND_INVALID, NEEDS_GH_AUTH, TANGLE, STARTUP_MEMORY_BUDGET, CREW_DISPATCH invalid, FLEET_SYNC, PR_CHECK_MIGRATION, SECONDMATE_SYNC, SECONDMATE_LIVENESS, NUDGE_SECONDMATES, or FMX - or when a standalone bin/fm-bootstrap.sh run prints one of those lines. A silent bootstrap section, or a BOOTSTRAP_INFO fact, means no skill load.
- decision-hold-lifecycle - Agent-only policy for completing investigations and visual reviews without losing unresolved captain decisions. Load before treating an investigation, scout report, structured review, or Lavish review as complete, before ending a visual review that exposed a decision, and when recording or routing the captain's answer.
...
Evidence: Doc-audience-check: green run plus refusals for missing injection and two-sentence responsibility

$ bin/fm-doc-audience-check.sh fm-doc-audience-check: ok surfaces=57 local_links=162 exit 0 (green) $ bin/fm-doc-audience-check.sh --inventory <copy with one surface's injection field removed> fm-doc-audience-check: .agents/skills/afk/SKILL.md: unsupported injection None exit 1 $ bin/fm-doc-audience-check.sh --inventory <copy with a two-sentence responsibility> fm-doc-audience-check: .agents/skills/ahoy/SKILL.md: responsibility must be exactly one sentence - split the document instead of widening the field exit 1

$ bin/fm-doc-audience-check.sh          # real inventory: 57 surfaces, all fields required
fm-doc-audience-check: ok surfaces=57 local_links=162
exit 0 (green)

$ bin/fm-doc-audience-check.sh --inventory <copy with one surface's injection field removed>
fm-doc-audience-check: .agents/skills/afk/SKILL.md: unsupported injection None
exit 1

$ bin/fm-doc-audience-check.sh --inventory <copy with a two-sentence responsibility>
fm-doc-audience-check: .agents/skills/ahoy/SKILL.md: responsibility must be exactly one sentence - split the document instead of widening the field
exit 1
Evidence: Real session-start digest: AGENT-ONLY SKILLS section present under opencode primary, absent under claude
### Session-start digest under an opencode primary (non-injecting harness) - AGENT-ONLY SKILLS section:
AGENT-ONLY SKILLS
--------------------------------------------------------------------------------
AGENT-ONLY SKILL TRIGGERS (harness opencode does not inject skill descriptions)
These skills are not captain-invocable; load one only at its trigger below.

- ask-user-authority - Agent-only decision procedure for ask-user findings. Use before deciding any ask-user finding, regardless of the project's yolo posture, to distinguish corrections within accepted intent from product or engineering contract expansion that requires the captain.
- bootstrap-diagnostics - Agent-only handling playbook for session-start bootstrap diagnostics. Use whenever the session-start digest's bootstrap section prints an actionable diagnostic line - MISSING, MISSING_MANUAL, BACKEND_INVALID, NEEDS_GH_AUTH, TANGLE, STARTUP_MEMORY_BUDGET, CREW_DISPATCH invalid, FLEET_SYNC, PR_CHECK_MIGRATION, SECONDMATE_SYNC, SECONDMATE_LIVENESS, NUDGE_SECONDMATES, or FMX - or when a standalone bin/fm-bootstrap.sh run prints one of those lines. A silent bootstrap section, or a BOOTSTRAP_INFO fact, means no skill load.
- decision-hold-lifecycle - Agent-only policy for completing investigations and visual reviews without losing unresolved captain decisions. Load before treating an investigation, scout report, structured review, or Lavish review as complete, before ending a visual review that exposed a decision, and when recording or routing the captain's answer.
- diagnostic-reasoning - Agent-only procedure for diagnosing reported bugs. Use before scoping a reported bug and before acting on a diagnostic report. Owns end-user-aligned reproduction, causal separation, divergent-path and history inspection, counterfactual testing, and disconfirming evidence.
- firstmate-codexapp - Agent-only playbook for coordinating visible Codex Desktop threads alongside Firstmate without pretending they are a selectable shell backend. Use before creating, reading, steering, archiving, debugging, or reviewing a Codex App visible thread for Firstmate work, and before responding to requests to make Codex App native to Firstmate.
- firstmate-coding-guidelines - Agent-only reference for changing firstmate's shared, tracked material per AGENTS.md section 1. Use before editing any of that material, whether working as firstmate directly or as a crewmate briefed on a firstmate-repo task. Covers the knowledge-placement decision tree, the one-owner rule for contracts, the inline-stub pattern for content moved into a skill, AGENTS.md size discipline, trigger hygiene for new skills, and repo style rules (one sentence per line, plain dash, no agent co-author, shellcheck-clean bin scripts, colocated tests, and maintainer-verification evidence).
- firstmate-orca - Agent-only operator checklist for Firstmate's Orca runtime backend. Use when switching to Orca, spawning or supervising Orca-backed work, smoke-testing Orca backend behavior, debugging Orca task state, or reconciling Orca-backed task metadata.
- fmx-respond - Agent-only playbook for handling X mode mentions and follow-ups. Use on an "x-mention <request_id>" check wake to read the stashed mention, classify it, act autonomously on eligible requests, reply or dismiss, and link spawned work. Also use on an "x-mode-error ..." check wake to report the X-mode configuration blocker instead of answering a mention. Also use on milestone and terminal wakes for an X-mode-linked task before posting completion follow-ups, ending terminal outcomes with --final. Loaded only when X mode is enabled.
- harness-adapters - Agent-only reference for firstmate harness operations. Use before spawning or recovering a crewmate or secondmate, handling a trust dialog, sending a harness-specific skill invocation, interrupting or exiting an agent, resuming an exited agent, or verifying a new harness adapter. Contains verified facts for claude, codex, opencode, pi, pi-signed, grok, and kimi.
- project-management - Agent-only procedure for Firstmate project management. Use before adding, creating, removing, or initializing a project. Cloning or registering a project is add intake and uses the same trigger. Owns project add, create, clone, remove, initialization, registry, delivery-mode, autonomy, and outward-consent decisions.
- quota-array-dispatch - Agent-only decision procedure for resolving a matched crew-dispatch profile array from current quota-axi output, including quota-window pace signals. Load when a dispatch rule or default resolves to more than one profile candidate.
- secondmate-provisioning - Agent-only reference for persistent secondmate setup and retirement. Use when creating, seeding, validating, launching, recovering, handing backlog to, pushing inherited local material into, or retiring a secondmate home, or when editing data/secondmates.md. Covers home leases, transactional seeding, project clone restrictions, secondmate harness pins, inherited local-material push, idle charter, handoff helper, and teardown safety.
- stuck-crewmate-recovery - Agent-only playbook for stuck or missing ordinary Firstmate direct reports. Use when the session-start digest reports an ordinary direct report's endpoint dead or its metadata has no window, or after a stale wake, looping pane, repeated confusion, an answered-by-brief question, an unresponsive crewmate, or a failed steer. Reconciles recorded work before escalating from targeted inspection through safe relaunch or failure.

================================================================================
CONTEXT
================================================================================

data/projects.md
--------------------------------------------------------------------------------
...

### Same digest under a claude primary (injects skill descriptions) - index absent:
0
occurrences of 'AGENT-ONLY SKILL TRIGGERS' above: 0
Evidence: Always-loaded set queried from inventory (exactly AGENTS.md + CLAUDE.md)

injection=always surfaces: ['AGENTS.md', 'CLAUDE.md']

$ python3 - <<'PY'  # query the always-loaded set from the inventory
injection=always surfaces: ['AGENTS.md', 'CLAUDE.md']
Evidence: Byte measurements vs base and 13-for-13 roster parity

AGENTS.md byte measurements (base f0d7cbe vs target e5e4161): whole file: 55237 -> 45071 (delta -10166; intent claims -10,166) section 2 (layout tree removed): 10777 -> 2758 (delta -8019; intent claims -8,019 for B1+B4) section 13 (roster replaced by generated index): 2913 -> 605 (delta -2308) Roster parity: old hand-maintained section 13 names vs generated index names: IDENTICAL - 13 skills in both (13-for-13)

AGENTS.md byte measurements (base f0d7cbe vs target e5e4161):
  whole file: 55237 -> 45071 (delta -10166; intent claims -10,166)
  section 2 (layout tree removed): 10777 -> 2758 (delta -8019; intent claims -8,019 for B1+B4)
  section 13 (roster replaced by generated index): 2913 -> 605 (delta -2308)

Roster parity: old hand-maintained section 13 names vs generated index names:
  IDENTICAL - 13 skills in both (13-for-13)
    ask-user-authority
    bootstrap-diagnostics
    decision-hold-lifecycle
    diagnostic-reasoning
    firstmate-codexapp
    firstmate-coding-guidelines
    firstmate-orca
    fmx-respond
    harness-adapters
    project-management
    quota-array-dispatch
    secondmate-provisioning
    stuck-crewmate-recovery
- Outcome: ⚠️ 1 info across 1 run (3m52s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 infos
  • ℹ️ .agents/skills/fmx-respond/SKILL.md:193 - The updated cross-reference says "AGENTS.md §14 declares the load trigger for X-mode-linked milestone or terminal wakes", but §14 only explicitly declares the mention/error check-wake load and the terminal-outcome load; the milestone-wake trigger now lives solely in fmx-respond's own frontmatter description (surfaced via harness injection or fm-skill-index.sh). No trigger is functionally lost, but the sentence slightly overstates what §14 declares.
  • ℹ️ bin/fm-session-start.sh:347 - fm-session-start.sh invokes fm-skill-index.sh with stderr discarded and treats empty output as "suppress". If the index ever renders empty on a non-injecting harness due to a runtime failure (e.g. awk error), the digest silently omits every agent-only skill trigger - the exact silent-suppression failure the script's own header identifies as the dangerous direction. A diagnostic line distinguishing "suppressed by design" from "rendered empty despite agent-only skills existing" would make that failure visible; the independent roster test does mitigate this in CI.
⚠️ **Test** - 1 info
  • ℹ️ tests/fm-session-start.test.sh - tests/fm-session-start.test.sh has one failing case ('MISSING diagnostic did not appear at all') that is confirmed pre-existing: the identical test file extracted from base commit f0d7cbe fails the same way in this environment, matching the author's stated known failure. Because the runner halts at the first failure, the later cases in that file were not exercised on either commit; the change's own digest-composition behavior is instead covered by tests/fm-skill-index.test.sh case 6 and a manual end-to-end run, both green.
  • bash tests/fm-skill-index.test.sh - all 6 cases pass (suppression, emission incl. unknown harness, roster derivation, frontmatter folding, --force, digest composition)
  • bash tests/fm-documentation-audiences.test.sh - all 6 cases pass, including the 2 new required-field cases and the bounded always-loaded-set assertion
  • Manual: bin/fm-skill-index.sh --harness {opencode,claude,grok,some-future-harness} - emitted for opencode and unknown harness, silent (exit 0) for claude and grok
  • Manual: bin/fm-doc-audience-check.sh green on real inventory (57 surfaces); refuses a copy with one surface's injection field removed and a copy with a two-sentence responsibility
  • Manual end-to-end: bin/fm-session-start.sh under a fake-ps opencode primary renders the AGENT-ONLY SKILLS digest section; under CLAUDECODE=1 the index is absent
  • Manual: queried docs/documentation-audiences.json for injection=always - exactly AGENTS.md and CLAUDE.md
  • Manual: diffed old hand-maintained AGENTS.md section 13 roster names against generated index names - identical, 13 for 13
  • Manual: byte measurements vs base f0d7cbe - AGENTS.md 55,237 -> 45,071 (-10,166, matching claim), section 2 10,777 -> 2,758 (-8,019, matching claim), section 13 2,913 -> 605
  • Manual: grepped new AGENTS.md for the five claimed surviving no-other-owner facts (status-line wake event, never-touch state/ internals, check.sh trust boundary, scout report survives teardown, lazy secondmates.md) - all present; no stale 'section 13' cross-references remain in skills or README
  • bash tests/fm-session-start.test.sh on both target and base-commit copies - identical single pre-existing failure ('MISSING diagnostic'), confirming it is not introduced by this change
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@sbracewell64

Copy link
Copy Markdown
Author

Conflict-free at 2039ca5; fork-side CI 9/9 green (mirror: sbracewell64#18, identical SHA); upstream workflow runs awaiting approval.

…c ownership

Lane B of the documentation single-source-of-truth commission: reduce the
always-loaded contract to what only it can own, and convert the review's
ownership table from prose into a mechanically enforced artifact.

B1/B4 - AGENTS.md section 2 becomes a pointer plus safety lines.
The 9,407-byte fenced home tree restated docs/configuration.md, which already
declares itself the layout owner and explicitly pushes exact child fields to
each producing script's header. Every artifact the tree named was verified to
have such an owner before removal. What survives is what has no other owner:
the wake-event-not-truth rule, the never-touch watcher/auto-arm/sub-supervisor
classes, the check.sh execution-trust boundary, the scout report's survival of
teardown, and the corrected secondmates.md wording (created lazily by
fm-home-seed.sh, so absence means no secondmate is registered).

B2 - section 13 becomes a generated trigger index.
bin/fm-skill-index.sh renders the roster from each skill's own frontmatter,
selecting on user-invocable:false. It stays silent on harnesses that already
inject skill descriptions (claude, grok - both verified) and emits everywhere
else, including unknown harnesses: suppression requires positive evidence,
because a wrongly suppressed index silently removes every load trigger. A new
agent-only skill is now registered once, in its own frontmatter.

B3 - documentation-audiences.json gains injection and responsibility per
surface, and fm-doc-audience-check.sh requires both. The one-sentence limit on
responsibility is the enforcement: a surface needing two sentences owns too
much. The always-loaded set is now a queryable list rather than a claim.

Measured byte deltas (always-loaded plane):
  AGENTS.md   55,237 -> 45,071  (-10,166)
    section 2  10,777 ->  2,758  (-8,019; plan target -6,907)
    section 13  2,913 ->    605  (-2,308; plan target -2,927)
  Generated index costs 5,329 bytes only on non-injecting harnesses, so the
  net is -10,166 on claude/grok and -4,837 elsewhere.
  documentation-audiences.json grows 8,344 -> 17,081, never injected.

Certification: session-start smoke read under both a claude and an opencode
primary confirms no operator action lost its instruction; new
tests/fm-skill-index.test.sh (6 cases) covers suppression, emission, roster
derivation, folded-description rendering, and digest composition;
tests/fm-documentation-audiences.test.sh gains 2 cases for the required
fields; fm-lint.sh and fm-doc-audience-check.sh green.
@kunchenguid

kunchenguid commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch.

When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again.

Noted for firstmate#1341 at 81fb4955.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants