Skip to content

docs(skills): split harness adapter operations reference - #3289

Merged
kunchenguid merged 9 commits into
kunchenguid:mainfrom
M00NLIG7:fm/firstmate-split-runtime-operations-reference-v1-b8
Aug 29, 2026
Merged

kunchenguid merged 9 commits into
kunchenguid:mainfrom
M00NLIG7:fm/firstmate-split-runtime-operations-reference-v1-b8

Conversation

@M00NLIG7

@M00NLIG7 M00NLIG7 commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Implement the captain-approved strong split of Firstmate's monolithic .agents/skills/harness-adapters/SKILL.md and publish it as a separate public PR whose canonical base is exactly github.com/kunchenguid/firstmate, without merging it. Keep harness-adapters as the single catalogued skill, trigger, and authoritative router at the same path with the same name, direct-loading behavior, and frontmatter semantics. Reduce that file to an approximately 4-8 KB router containing universal non-negotiable safety, detection, and an explicit operation-to-reference matrix. Move shared detail into narrowly owned references under the same skill directory for dispatch, control/recovery, primary hooks, and model/effort, and move each supported tool's detail into one harness reference, combining Pi/Pi-signed only because they genuinely share one contract. The router must identify exactly which common and tool reference to load for start, trust handling, skill invocation, interrupt, exit, resume, recovery, primary startup/integration, model/effort selection, and adapter verification.

Preserve every unique safety and operational fact exactly once, pruning duplicates rather than creating second prose owners. Keep executable mechanics, schemas, and command ownership in existing scripts and documentation and continue pointing references to those owners. Make all on-demand relative paths resolve from the skill directory in Pi and every supported consumer of the shared skill tree. Do not change AGENTS.md unless its existing trigger pointer becomes false. Do not add or remove disable-model-invocation; this work is separate from the 15-skill metadata correction, and the field must simply follow the rebased public base if that correction lands. Do not alter executable runtime behavior, add an extension, change compaction, session restoration, monitoring, the broader skill catalog, or perform an AGENTS diet.

Keep the PR limited to the router/reference split, narrowly required maintainable structural or behavioral-interface tests, and current maintained verification/documentation pointers. Do not add source-byte assertions or prose snapshots. Demonstrate scenario reference selection and preserved requirements across every supported tool, review the complete pre/post inventory for lost facts or duplicate owners, and report measured sizes rather than enforcing them. The pre-fix split measured a 5,372-byte router and 11,185-14,809-byte normal loads; after the approved review corrections, the current acceptance evidence is a 6,043-byte router and 11,504-15,236-byte normal router-plus-common-plus-tool loads, versus the 66,217-byte original. Use Git author and committer M00NLIG7 <[email protected]> and verify it before publication.

Run the complete Firstmate validation and applicable live agent-tool checks. Do not weaken or silently skip failures. Preserve and carry the clean-base differential evidence: the unchanged composer half-block-edge and Muse ancestry checks fail byte-identically on the task's exact original public base, and a further 14 portable failures also reproduce in a clean detached copy of that exact base, for 16 reproducible public-base limitations rather than split regressions. Accurately document that live liveness passed Claude, Codex, OpenCode, and Pi; the live composer check was blocked for Claude by its workspace-trust dialog; the credentialed steering check passed Codex and Pi but Claude remained at trust and OpenCode timed out without acting or acknowledging; Pi-signed, Grok, Kimi, Cursor, and Muse were absent and must remain explicitly unverified rather than counted as passes. Complete every no-mistakes gate through green CI, open the authorized public PR against exactly github.com/kunchenguid/firstmate, report its full URL and risk level, and do not merge.

What Changed

  • Split the monolithic harness-adapters skill into a compact authoritative router plus shared operation and per-harness references.
  • Added structural routing checks and an opt-in local-model evaluation covering every operation scenario and supported harness identity.
  • Updated test selection, documentation ownership pointers, and verification records for the new skill-tree layout.

Risk Assessment

✅ Low: Captain, the change is a well-bounded instruction/reference split with explicit routing, honest evaluation limitations, and no source-verifiable runtime behavior regression.

Testing

The bounded local evaluation showed the implicit e2b model was insufficient while explicit zero-provider-call e4b selected every operation scenario and all nine identities; native loader coverage remains explicitly limited to installed tools rather than inferred from that harness-neutral evaluation. Current post-fix measurements are a 6,043-byte router and 11,504-15,236-byte normal loads; 5,372 and 11,185-14,809 are historical pre-fix measurements only. The clean-base differential preserved 16 reproducible original-base portable failures without counting them as passes or split regressions. Live liveness passed Claude, Codex, OpenCode, and Pi; the live composer check reached Claude's workspace-trust dialog, and the credentialed steering check passed Codex and Pi while Claude remained at trust and OpenCode timed out. Pi-signed, Grok, Kimi, Cursor, and Muse were unavailable and remain unverified. All 14 PR checks are green.

Evidence: Live model routing plan for all scenarios

Source: Live model routing plan for all scenarios

{
  "cases": [
    {
      "id": "start.default",
      "common": [
        "references/common/dispatch.md",
        "references/common/model-and-effort.md"
      ],
      "harness": "references/harness/claude.md"
    },
    {
      "id": "start.trust-dialog",
      "common": [
        "references/common/control-and-recovery.md"
      ],
      "harness": "references/harness/codex.md"
    },
    {
      "id": "trust.default",
      "common": [
        "references/common/control-and-recovery.md"
      ],
      "harness": "references/harness/opencode.md"
    },
    {
      "id": "skill.default",
      "common": [
        "references/common/control-and-recovery.md"
      ],
      "harness": "references/harness/pi.md"
    },
    {
      "id": "interrupt.default",
      "common": [
        "references/common/control-and-recovery.md"
      ],
      "harness": "references/harness/pi.md"
    },
    {
      "id": "exit.default",
      "common": [
        "references/common/control-and-recovery.md"
      ],
      "harness": "references/harness/grok.md"
    },
    {
      "id": "resume.default",
      "common": [
        "references/common/control-and-recovery.md"
      ],
      "harness": "references/harness/kimi.md"
    },
    {
      "id": "recovery.default",
      "common": [
        "references/common/control-and-recovery.md"
      ],
      "harness": "references/harness/cursor.md"
    },
    {
      "id": "recovery.replacement-profile",
      "common": [
        "references/common/control-and-recovery.md",
        "references/common/dispatch.md",
        "references/common/model-and-effort.md"
      ],
      "harness": "references/harness/muse.md"
    },
    {
      "id": "recovery.secondmate",
      "common": [
        "references/common/control-and-recovery.md",
        "references/common/primary-hooks.md"
      ],
      "harness": "references/harness/claude.md"
    },
    {
      "id": "recovery.replacement-secondmate",
      "common": [
        "references/common/control-and-recovery.md",
        "references/common/dispatch.md",
        "references/common/model-and-effort.md",
        "references/common/primary-hooks.md"
      ],
      "harness": "references/harness/codex.md"
    },
    {
      "id": "primary.default",
      "common": [
        "references/common/primary-hooks.md"
      ],
      "harness": "references/harness/opencode.md"
    },
    {
      "id": "model-effort.default",
      "common": [
        "references/common/model-and-effort.md"
      ],
      "harness": "references/harness/pi.md"
    },
    {
      "id": "model-effort.configured-profile",
      "common": [
        "references/common/model-and-effort.md",
        "references/common/dispatch.md"
      ],
      "harness": "references/harness/pi.md"
    },
    {
      "id": "verify.default",
      "common": [
        "references/common/dispatch.md",
        "references/common/control-and-recovery.md",
        "references/common/primary-hooks.md",
        "references/common/model-and-effort.md"
      ],
      "harness": "references/harness/grok.md"
    }
  ]
}
Evidence: Focused validation and native-tool availability transcript

Source: Focused validation and native-tool availability transcript

Focused harness-adapter validation at 2026-08-29T17:24:32Z
ok - harness adapter routing artifact is normalized and every target is readable
ok - local model ambient-router-gemma4:e4b selected every operation scenario and all nine harness identities
# native loader not claimed: claude 2.1.220 (Claude Code) is installed, but this harness-neutral evaluation does not exercise its provider transport
# native loader not claimed: codex codex 0.147.0-alpha.6+local.4 0f64c204bfc17d61e519b755e9b7f0ed2b75e90b dirty=false is installed, but this harness-neutral evaluation does not exercise its provider transport
# native loader not claimed: opencode 1.14.48 is installed, but this harness-neutral evaluation does not exercise its provider transport
# native loader not claimed: pi 0.84.0 is installed, but this harness-neutral evaluation does not exercise its provider transport
# unverified native loader: pi-signed is not installed on this machine
# unverified native loader: grok is not installed on this machine
# unverified native loader: kimi is not installed on this machine
# unverified native loader: cursor is not installed on this machine
# unverified native loader: muse is not installed on this machine
# installed native tools recorded without overstating loader coverage: 4
# unavailable native tools: pi-signed grok kimi cursor muse

Changed-file test selection from public base:
tests/fm-arm-pretool-check.test.sh
tests/fm-ask-user-authority.test.sh
tests/fm-bearings-board.test.sh
tests/fm-brief.test.sh
tests/fm-calm-pi-extension.test.sh
tests/fm-captain-hold-lifecycle.test.sh
tests/fm-cd-pretool-check.test.sh
tests/fm-classify-decision-key.test.sh
tests/fm-composer-ghost.test.sh
tests/fm-composer-lib.test.sh
tests/fm-crew-state.test.sh
tests/fm-documentation-audiences.test.sh
tests/fm-ensure-agents-md.test.sh
tests/fm-grok-harness.test.sh
tests/fm-harness-adapter-references.test.sh
tests/fm-herdr-lab.test.sh
tests/fm-kimi-harness.test.sh
tests/fm-lint-workflows.test.sh
tests/fm-lint.test.sh
tests/fm-muse-harness.test.sh
tests/fm-operational-input.test.sh
tests/fm-pi-primary-types.test.sh
tests/fm-send-popup-settle.test.sh
tests/fm-send-settle.test.sh
tests/fm-subagent-pretool-check.test.sh
tests/fm-supervision-instructions.test.sh
tests/fm-task-delivery.test.sh
tests/fm-test-isolation-proof.test.sh
tests/fm-test-run.test.sh
tests/fm-tmux-submit-busy.test.sh
tests/fm-trace-context-lib.test.sh
tests/fm-transition-lib.test.sh
tests/fm-vendor-auth-probe.test.sh
tests/fm-afk-pi-herdr-return-e2e.test.sh
tests/fm-cmux-claude-composer-live-e2e.test.sh
tests/fm-codex-continuity-live-e2e.test.sh
tests/fm-composer-matrix-live-e2e.test.sh
tests/fm-cursor-primary-live-e2e.test.sh
tests/fm-grok-continuity-live-e2e.test.sh
tests/fm-grok-stop-live-e2e.test.sh
tests/fm-harness-adapter-instructions-live-e2e.test.sh
tests/fm-harness-liveness-drift-live-e2e.test.sh
tests/fm-herdr-submit-confirm-live-e2e.test.sh
tests/fm-herdr-version-floor-live-e2e.test.sh
tests/fm-muse-signals-live-e2e.test.sh
tests/fm-opencode-primary-live-e2e.test.sh
tests/fm-pi-branch-live-e2e.test.sh
tests/fm-pi-primary-live-e2e.test.sh
tests/fm-quota-array-dispatch-live-e2e.test.sh
tests/fm-send-inbox-doorbell-live-e2e.test.sh
tests/fm-send-secondmate-marker-herdr-e2e.test.sh
tests/fm-sessionstart-hook-live-e2e.test.sh
tests/fm-sessionstart-instruction-refresh-live-e2e.test.sh
Evidence: Normalized routing contract

Source: Normalized routing contract

{
  "operations": {
    "start": {
      "default": ["references/common/dispatch.md", "references/common/model-and-effort.md"],
      "trust-dialog": ["references/common/control-and-recovery.md"]
    },
    "trust": {"default": ["references/common/control-and-recovery.md"]},
    "skill": {"default": ["references/common/control-and-recovery.md"]},
    "interrupt": {"default": ["references/common/control-and-recovery.md"]},
    "exit": {"default": ["references/common/control-and-recovery.md"]},
    "resume": {"default": ["references/common/control-and-recovery.md"]},
    "recovery": {
      "default": ["references/common/control-and-recovery.md"],
      "replacement-profile": ["references/common/control-and-recovery.md", "references/common/dispatch.md", "references/common/model-and-effort.md"],
      "secondmate": ["references/common/control-and-recovery.md", "references/common/primary-hooks.md"],
      "replacement-secondmate": ["references/common/control-and-recovery.md", "references/common/dispatch.md", "references/common/model-and-effort.md", "references/common/primary-hooks.md"]
    },
    "primary": {"default": ["references/common/primary-hooks.md"]},
    "model-effort": {
      "default": ["references/common/model-and-effort.md"],
      "configured-profile": ["references/common/model-and-effort.md", "references/common/dispatch.md"]
    },
    "verify": {"default": ["references/common/dispatch.md", "references/common/control-and-recovery.md", "references/common/primary-hooks.md", "references/common/model-and-effort.md"]}
  },
  "harnesses": {
    "claude": "references/harness/claude.md",
    "codex": "references/harness/codex.md",
    "opencode": "references/harness/opencode.md",
    "pi": "references/harness/pi.md",
    "pi-signed": "references/harness/pi.md",
    "grok": "references/harness/grok.md",
    "kimi": "references/harness/kimi.md",
    "cursor": "references/harness/cursor.md",
    "muse": "references/harness/muse.md"
  }
}
- Outcome: ⚠️ 1 error across 2 runs (16m18s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 3 issues found → auto-fixed (6) ✅
  • 🚨 .agents/skills/harness-adapters/SKILL.md:22 - The new path contract applies to every relative path, but this skill also names active-home and project-relative paths such as config/crew-harness, state/&lt;id&gt;.meta, and .claude/settings.json. Following the contract resolves these beneath the skill directory, bypassing the real runtime state. Restrict skill-root resolution to on-demand reference/owner paths and explicitly preserve active-home/project resolution for operational paths.
  • 🚨 .agents/skills/harness-adapters/references/common/control-and-recovery.md:7 - The required criterion says to preserve each unique fact “exactly once,” but lifecycle-only control, recorded harness= selection, and trust postcondition rules are owned both here and in router lines 33–37; line 32 also summarizes resume behavior repeated by tool references. Keep universal safety in the router and have this reference point back to it, leaving tool-specific resume facts solely in tool references.
  • 🚨 tests/fm-harness-adapter-references.test.sh:17 - The required criterion says to “demonstrate scenario reference selection ... across every supported tool,” but this test defines an independent routing table and only checks that its hardcoded paths are readable. It still passes if the router’s operation matrix or harness table is removed, mistyped, or contradicts the test, and it omits conditional additions for model selection, replacement recovery, and secondmates. Exercise a real/normalized router-selection interface or otherwise provide evidence tied to the router’s emitted selection contract without adding prose snapshots.

🔧 Fix: Fix harness adapter routing and ownership contracts
1 error still open:

  • 🚨 .agents/skills/harness-adapters/SKILL.md:32 - The intent requires preserving each unique fact “exactly once,” but duplicate prose owners remain: captain/per-task override is stated here and in references/common/dispatch.md:10; secondmate fallback resolution is here and in dispatch line 12; and Cursor/Grok model identity is duplicated between references/common/model-and-effort.md:28 and references/harness/cursor.md:4. Keep detection and universal overrides solely in the router, cross-harness identity in model-and-effort, and have narrower references point back rather than restating them.

🔧 Fix: Prune duplicate harness adapter ownership prose
2 errors still open:

  • 🚨 .agents/skills/harness-adapters/SKILL.md:61 - The intent requires the router to identify exactly what to load for every start, but start.default omits model-and-effort.md. A dispatch with no explicit effort therefore selects only dispatch/tool references and never loads the required generic effort fallback. Include model/effort in the default start plan or explicitly require every start to union that operation.
  • 🚨 .agents/skills/harness-adapters/references/harness/grok.md:19 - The intent requires preserving behavior, but this says both unsupported xhigh and explicit max should be capped to high. That conflicts with model-and-effort.md, where only fallback xhigh is capped while an unsupported captain-requested value is recorded and omitted. Restrict the cap to fallback xhigh and preserve record-and-omit for explicit max.

🔧 Fix: Fix default effort routing and Grok max semantics
2 errors still open:

  • 🚨 tests/fm-harness-adapter-references.test.sh:17 - The test-quality rule forbids source-content-only assertions, but this test extracts a fenced JSON block from the skill’s Markdown and only asserts its exact routes and referenced-file readability. No shipped consumer executes this contract, so the test can pass without proving that an agent selects or loads the required references. Replace it with an observable selector/loader interface test, or remove the source-scraping assertions in favor of the required live agent-tool evidence.
  • 🚨 .agents/skills/harness-adapters/SKILL.md:38 - The required criterion says to preserve each unique fact “exactly once,” but duplicate owners remain: Muse’s crew/scout-only boundary appears here and in references/harness/muse.md:4; Pi-signed detection is repeated between router line 43 and references/harness/pi.md:23-28; and generic effort record/omit or fallback rules are restated in Cursor, Kimi, and Grok references. Keep universal semantics in the router/common references and leave harness files with only empirical capabilities plus pointers to those owners.

🔧 Fix: Remove source-only routing test and duplicate semantics
1 error still open:

  • 🚨 .agents/skills/harness-adapters/SKILL.md:53 - The required criterion says “Demonstrate scenario reference selection and preserved requirements across every supported tool,” but the routing object has no executable consumer or behavioral evaluation, and the latest fix deleted the only reference-selection test without replacement. The remaining liveness test only classifies launched processes, so it cannot demonstrate that an agent selects and loads these plans. Add observable agent-tool evaluation across all harness entries without inspecting the router’s source text.

🔧 Fix: Add local harness adapter instruction evaluation
2 errors still open:

  • 🚨 tests/fm-harness-adapter-instructions-live-e2e.test.sh:40 - The new live evaluation prints a structural ok before its opt-in skip, but fm-test-run.sh recognizes a gate skip only when it is the first non-empty line. Without FM_HARNESS_ADAPTER_INSTRUCTION_EVAL=1, the behavioral evaluation is therefore reported as a pass rather than an explicit skip. Emit the skip first or separate structural and opt-in evaluations.
  • 🚨 bin/fm-test-run.sh:258 - The registered evaluation is not selected when its subject changes: the router falls through to pure-contract-unit, while files under references/ have no mapping and cause --changed to fail as unmapped. Add a harness-adapters tree mapping to the new live-harness-optin family, retaining any required portable family.

🔧 Fix: Fix harness evaluation gating and change mapping
✅ Re-checked - no issues remain.

⚠️ **Test** - 1 error
  • 🚨 tests/fm-harness-adapter-instructions-live-e2e.test.sh:29 - The documented opt-in command leaves the model unset, causing automatic selection of ambient-router-gemma4:e2b. That model reproducibly invented nonexistent references/harness/pi-signed.md paths on both attempts. Explicitly selecting the installed ambient-router-gemma4:e4b passed all scenarios. Make the documented/default evaluator selection reliably choose a capable model or require an explicit model rather than deterministically choosing the first non-embedding model.
  • 🚨 .agents/skills/harness-adapters/SKILL.md:1 - The authoritative intent’s size report is stale relative to the target commit. The router grew from 5,372 bytes in the initial split commit to 6,043 bytes after review fixes; current single-common router-plus-tool loads measure 11,504–15,236 bytes instead of 11,185–14,809. Decide whether the exact reported measurements must be restored or updated to reflect the review-fixed target.
  • git log -1 --format=&#39;%H%n%an &lt;%ae&gt;%n%cn &lt;%ce&gt;%n%s&#39; — confirmed target commit and required M00NLIG7 author/committer identity
  • git diff --stat --name-status f66be0f8f7f56f78d09458d909bdd555b9dbcf76..ccabb6c211056abdc8bcce776136d100159e93ed — scoped the change and focused tests
  • bash tests/fm-harness-adapter-references.test.sh — parsed the public routing contract and resolved every selected reference
  • bash tests/fm-test-run.test.sh — exercised changed-file selection, including router and nested-reference coverage mapping
  • FM_HARNESS_ADAPTER_INSTRUCTION_EVAL=1 bash tests/fm-harness-adapter-instructions-live-e2e.test.sh — failed twice with the automatically selected 2B model on Pi-signed path fidelity
  • FM_HARNESS_ADAPTER_INSTRUCTION_EVAL=1 FM_HARNESS_ADAPTER_LOCAL_MODEL=ambient-router-gemma4:e4b bash tests/fm-harness-adapter-instructions-live-e2e.test.sh — selected all 15 operation/scenario plans across nine identities
  • Instrumented the same 4B live evaluation to preserve its normalized generated routing plan in the evidence directory
  • Measured current router, common-reference, harness-reference, and composed-load byte sizes with wc -c
  • Compared base and target frontmatter semantically with diff; no frontmatter change
  • git status --short — confirmed testing left the worktree clean

🔧 Fix: Captain, require explicit harness instruction evaluator model
1 error still open:

  • 🚨 .agents/skills/harness-adapters/SKILL.md:1 - The previously identified measurement mismatch remains: the router is now 6,043 bytes and normal router-plus-common-plus-tool loads span 11,504–15,236 bytes, while the authoritative acceptance text states 5,372 and 11,185–14,809. Confirm that the final PR report should use the current measured values.
  • bash tests/fm-harness-adapter-references.test.sh
  • FM_HARNESS_ADAPTER_INSTRUCTION_EVAL=1 FM_HARNESS_ADAPTER_LOCAL_MODEL=ambient-router-gemma4:e4b bash tests/fm-harness-adapter-instructions-live-e2e.test.sh
  • bin/fm-test-run.sh --list --changed --base f66be0f8f7f56f78d09458d909bdd555b9dbcf76
  • Live Ollama routing evaluation recorded in live-routing-plan.json
  • wc -c .agents/skills/harness-adapters/SKILL.md .agents/skills/harness-adapters/references/common/*.md .agents/skills/harness-adapters/references/harness/*.md
  • git show f66be0f8f7f56f78d09458d909bdd555b9dbcf76:.agents/skills/harness-adapters/SKILL.md | wc -c
  • git show -s --format='%an <%ae>%n%cn <%ce>' HEAD
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Aug 29, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking defect identified.

The split preserves the harness-adapter safety and ownership boundaries, all declared routing targets exist, and the test runner visibly distinguishes the opt-in evaluation from portable structural coverage.

Reviews (1): Last reviewed commit: "no-mistakes(document): Fix harness adapt..." | Re-trigger Greptile

@kunchenguid
kunchenguid merged commit c731c36 into kunchenguid:main Aug 29, 2026
15 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @M00NLIG7 — really appreciate you taking the time on this.

VISION.md read in full from current main 4eb587d670ff1a34afaba32fa94d02e74fed0399. HEAD was a53a9ee039b25239d4b4a929a4cb3376f8336e0e. Class restore: same catalogued skill/path/name, executable spawn/control unchanged, facts moved into owned references with a leaner router. Token-efficiency aligns; authority/opt-in unchanged; no workflow files; attestation matched; CI and Require no-mistakes SUCCESS.

Squash merge c731c36c381ea0886fa5aabf6a3be761534d3f30.

cfeddersen pushed a commit to cfeddersen/firstmate that referenced this pull request Aug 30, 2026
Resolve the SKILL.md conflict from the harness-adapters doc split (kunchenguid#3289):
take main's restructured routing doc and port the branch's --approve
trust-dialog sentences into references/harness/pi.md, which now owns that
content. No behavior change: bin/fm-spawn.sh and the dispatch-profile test
merged clean and pass locally.
timbarreto added a commit to timbarreto/firstmate that referenced this pull request Sep 1, 2026