Skip to content

docs: trim duplicated harness guidance - #255

Merged
kunchenguid merged 3 commits into
mainfrom
fm/agentsmd-trim-h2
Jul 4, 2026
Merged

kunchenguid merged 3 commits into
mainfrom
fm/agentsmd-trim-h2

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

AGENTS.md diet PR 2 of 3: trim section 4's per-harness harness/dispatch content that duplicates agent-only skills, per the agentsmd-diet-s2 scout report's move-plan items 3-4 (redundancy item 2 folded into item 3). (1) Removed the five claude/codex/grok/pi/opencode model/effort-flag bullets from section 4 - verified first that harness-adapters SKILL.md's 'Launch profile axes' table already contains every fact (and more: verified CLI versions per adapter) before deleting; replaced with a one-line pointer since harness-adapters is already loaded before every spawn per section 4's own closing trigger. (2) Moved the config/secondmate-harness model/effort pin-format detail (the [] [] line format, the secondmate-model/secondmate-effort accessors, back-compat, respawn-durability, and applies-only-when-file-governs subtleties) into secondmate-provisioning SKILL.md, which is already a mandatory load at every secondmate lifecycle touchpoint - added the content to the skill first, then replaced the AGENTS.md paragraph with a short inline pointer. Scope is intentionally narrow: only AGENTS.md section 4, harness-adapters SKILL.md, and secondmate-provisioning SKILL.md were touched; no other AGENTS.md sections and no script changes (that is out of scope for PR 3 of this diet series). Net effect: AGENTS.md shrinks from 958 to 901 lines with zero facts lost - every fact removed from AGENTS.md is reachable through one of the two skills, both already mandatory loads at the relevant lifecycle points. A full mechanical line-by-line audit (every removed line's new home) is in the commit message.

What Changed

  • Trimmed duplicated per-harness model and effort guidance from AGENTS.md section 4 and replaced it with a pointer to the existing harness adapter skill.
  • Moved config/secondmate-harness pin-format and accessor details into the secondmate provisioning skill, keeping lifecycle-specific guidance with the mandatory secondmate instructions.
  • Cleaned Markdown style after the documentation reshuffle.

Risk Assessment

✅ Low: Captain, risk is low because this is a narrow documentation relocation with the removed facts still reachable through the relevant mandatory skills and no script behavior changes.

Testing

The full configured baseline was already green; I then ran the two focused behavior suites for dispatch-profile launch flags and secondmate harness/model/effort behavior, plus a reader-facing documentation routing audit showing AGENTS.md at 901 lines with the removed facts reachable through harness-adapters and secondmate-provisioning. All checks passed, and the working tree stayed clean.

Evidence: AGENTS.md diet routing audit
Firstmate AGENTS.md diet validation evidence
Worktree: /Users/kunchen/.no-mistakes/worktrees/016d88035d58/01KWQDDA6HC0VGJVVR3QJ5G3G3
Commit: e1e1f44
Base: 2db0a5ddbd31b781549cb8684341305ddcae2246

Changed files in this target commit:
.agents/skills/secondmate-provisioning/SKILL.md
AGENTS.md

Line counts:
  AGENTS.md: 901 lines

AGENTS.md stubs and mandatory load triggers now visible to a firstmate reader:
261:Per-harness model/effort flags: `harness-adapters` (loaded before every spawn per section 4's closing trigger).
272:`config/secondmate-harness` can also pin a model/effort for the secondmate agent in one line (`<harness> [<model>] [<effort>]`); format, accessors, and inheritance exceptions live in `secondmate-provisioning` (load before creating/seeding/recovering a secondmate).
290:Load `harness-adapters` before any spawn, recovery, trust-dialog handling, harness-specific skill invocation, interrupt, exit, resume, or adapter verification.
344:Load `secondmate-provisioning` before creating, seeding, validating, handing backlog to, recovering, pushing inherited config into, or retiring a secondmate home, and before editing `data/secondmates.md`.
862:- `harness-adapters` - load 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.
864:- `secondmate-provisioning` - load before creating, seeding, validating, recovering, handing backlog to, pushing inherited config into, or retiring a secondmate home, and before editing `data/secondmates.md`.

Replacement home for per-harness model/effort facts: harness-adapters Launch profile axes table:
## Launch profile axes

`bin/fm-spawn.sh` accepts concrete `--harness`, `--model`, and `--effort` values chosen by firstmate at intake.
Do not make the shell scripts parse or match natural-language dispatch rules.
The supported launch-profile flags below were verified locally on 2026-06-30 with each CLI's help and parser path.

| Harness | Model flag | Effort flag | Notes |
|---|---|---|---|
| claude | `--model <model>` | `--effort <low\|medium\|high\|xhigh\|max>` | Verified on Claude Code 2.1.196. |
| codex | `--model <model>` | `-c 'model_reasoning_effort="<low\|medium\|high\|xhigh>"'` | Verified on codex-cli 0.142.1. The installed binary schema contains `model_reasoning_effort`, the active config uses it, and the bundled model catalog advertises only low/medium/high/xhigh. `max` is omitted. |
| grok | `--model <model>` | `--reasoning-effort <low\|medium\|high\|xhigh>` | Verified on grok 0.2.73. `--effort` parses too, but firstmate's profile axis is reasoning effort. `--reasoning-effort max` is rejected, so `max` is omitted. |
| pi | `--model <model>` | `--thinking <low\|medium\|high\|xhigh>` | Verified on pi 0.80.2. `max` prints an invalid-thinking warning, so firstmate omits Pi effort when the requested effort is `max`. |
| opencode | `--model <provider/model>` | none for firstmate's interactive launch | Verified on opencode 1.17.6. `opencode run` has `--variant`, but firstmate launches the interactive `opencode --prompt` path, which has no verified effort flag. |

When a requested effort value is outside the harness-specific accepted set, `fm-spawn` records the requested `effort=` in meta but emits no effort flag for that harness.
This preserves launch success instead of passing a known-bad value.

Replacement home for config/secondmate-harness model/effort pin details: secondmate-provisioning excerpt:
`config/secondmate-harness` may also pin a concrete model and effort for the secondmate agent, in the SAME file rather than a new one: the format is a single whitespace-separated line `<harness> [<model>] [<effort>]`, with only the first non-empty, non-comment line parsed.
A bare `<harness>` (today's format, e.g. `claude`) behaves exactly as before - harness only, no model/effort flag - so this is fully backward-compatible.
`bin/fm-harness.sh secondmate-model` and `bin/fm-harness.sh secondmate-effort` print the optional 2nd/3rd tokens (empty when absent, or when the file is absent/`default`/harness-only); they read only `config/secondmate-harness`, never `config/crew-harness`, which stays a bare adapter name.
For a `--secondmate` spawn, `bin/fm-spawn.sh` populates `MODEL`/`EFFORT` from those tokens only when the harness itself came from the secondmate config path for that spawn.
An explicit per-spawn `--harness` flag, positional harness arg, or raw launch command starts clean on model and effort too, unless the caller also passes explicit `--model` or `--effort`.
When the file's tokens do apply, an explicit per-spawn `--model` or `--effort` flag always wins over the file's token for that axis.
Because this resolves from the file on every spawn, the pin is durable across every respawn (recovery, `/updatefirstmate`, restart) exactly like the harness axis itself - e.g. `config/secondmate-harness` containing `claude opus` keeps a secondmate pinned to Opus even if the primary's own default model later changes.
This is secondmate-only: crewmate/scout model resolution is untouched by this file.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • Baseline already completed before this validation: command -v tmux &gt;/dev/null || { echo &#34;tmux is required for e2e tests&#34; &gt;&amp;2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo &#34;== $t ==&#34;; bash &#34;$t&#34; || rc=1; done; exit &#34;$rc&#34;
  • bash tests/fm-spawn-dispatch-profile.test.sh
  • bash tests/fm-secondmate-harness.test.sh
  • Generated evidence with rg/awk extracts into /var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KWQDDA6HC0VGJVVR3QJ5G3G3/agentsmd-diet-routing-audit.txt
  • Manual repository checks: git diff --name-only 2db0a5ddbd31b781549cb8684341305ddcae2246..HEAD, targeted rg checks for moved per-harness and secondmate pin details, and git status --short cleanup check
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

AGENTS.md diet PR 2 of 3 (data/agentsmd-diet-s2/report.md, move-plan
items 3-4; redundancy item 2 folded into item 3).

Removed the five claude/codex/grok/pi/opencode model/effort-flag
bullets from section 4 - byte-for-byte duplicated by
harness-adapters' "Launch profile axes" table (which is already a
superset: it carries verified CLI versions per adapter that the
AGENTS.md bullets lacked). Replaced with a one-line pointer; the
skill is already loaded before every spawn per section 4's own
closing trigger, so no new trigger was needed.

Moved the config/secondmate-harness model/effort pin-format detail
(the `<harness> [<model>] [<effort>]` line format, the
secondmate-model/secondmate-effort accessors, back-compat, and the
durability-across-respawn behavior) into secondmate-provisioning,
which is already a mandatory load at every secondmate lifecycle
touchpoint. Added the destination content to the skill first, then
replaced the AGENTS.md paragraph with a 3-line pointer.

Mechanical audit - every removed line's new home:
- 5 harness bullets (claude/codex/grok/pi/opencode model+effort
  flags, per-harness max-omission rationale) -> already present in
  harness-adapters SKILL.md's "Launch profile axes" table (lines
  53-59), confirmed fact-by-fact before deleting.
- "config/secondmate-harness may also pin..." paragraph (pin format,
  bare-harness back-compat, secondmate-model/secondmate-effort
  accessors, per-spawn override precedence, respawn durability,
  secondmate-only scope) -> secondmate-provisioning SKILL.md's
  "Charter and seed" section, added verbatim before this trim.
- The following paragraph (inheritable config: crew-dispatch.json,
  crew-harness, backlog-backend) is untouched - out of scope for
  this PR, still inline.
- The bootstrap CREW_DISPATCH effort-mismatch diagnostic sentence is
  untouched - not part of the five-bullet duplication, stays inline.

No script changes. Section 4 shrinks from 104 to 87 lines
(958 -> 901 total AGENTS.md lines) with zero facts lost: every fact
is reachable through harness-adapters or secondmate-provisioning,
both already mandatory loads at the relevant lifecycle points.
@kunchenguid
kunchenguid merged commit 207e776 into main Jul 4, 2026
4 checks passed
@kunchenguid
kunchenguid deleted the fm/agentsmd-trim-h2 branch July 4, 2026 21:00
mielyemitchell added a commit to mielyemitchell/firstmate that referenced this pull request Jul 6, 2026