Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .agents/skills/harness-adapters/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ The primary integrations for `claude`, `codex`, `opencode`, `pi`, `pi-signed`, a
`opencode`, `pi`, and `pi-signed` block by throwing from `tool.execute.before` / returning `{block: true}` from `tool_call`.
The exact hook files, commands, output-shaping quirks (Claude Code only honors the deny when stdout is empty), and validation transcripts are owned by `docs/arm-pretool-check.md`.
When changing any watcher-arm PreToolUse hook, validate the real harness behavior in a scratch project before trusting it, then update that doc.

## Primary delegation-shape guard

Claude exposes built-in delegation, scheduling, and worktree tools that a primary session can use to create work with no `state/<id>.meta`, which makes the whole guard stack inert because every guard counts that metadata.
Expand Down Expand Up @@ -117,6 +118,10 @@ Choose intermediate levels proportionally as complexity, uncertainty, blast radi
When a verified adapter lacks `xhigh`, cap the choice at its highest supported non-`max` level rather than omitting the intended effort silently.
Never select `max` from this fallback; use it only when the captain has explicitly expressed that per-task or standing preference.

Role-specific effort and reviewer boundaries are owned here: routine deep Oracle review uses `xhigh`, while `max` requires an explicit architecture or security escalation from the captain.
`Fixer` is implementation-only, `Oracle` is read-only correctness and architecture review, and `Lelouch` is read-only post-PR release-risk review.
`AGENTS.md` section 7 owns Oracle review timing, fallback, and cycle budget.

The supported launch-profile flags below are verified locally; each row records its evidence.

| Harness | Model flag | Effort flag | Notes |
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/stuck-crewmate-recovery/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Use `treehouse status` for treehouse-backed tmux, herdr, zellij, or cmux tasks,
Do not sweep another home's endpoints or infer ownership from a matching window label.

Before relaunch, prove that no live agent still owns the recorded task and that the existing worktree remains available.
Preserve its uncommitted changes and commits, keep the same task identity, and resume or relaunch the recorded harness in that existing worktree with the same brief plus a concise progress note.
Preserve its uncommitted changes and commits, keep the same task identity, and relaunch through `bin/fm-spawn.sh --resume` with the same brief plus a concise progress note; the script header owns exact invocation, profile reuse or override, and recovery metadata.
Do not use a fresh generic spawn while the recorded worktree is unaccounted for, because allocating another worktree can split one task across two copies.
If the worktree or ownership cannot be reconciled safely, leave all state intact and report the task failed or blocked with the conflicting evidence.

Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ state/ volatile runtime signals; gitignored
<id>.turn-ended touched by turn-end hooks
<id>.grok-turnend-token firstmate-owned grok hook registry token for the task; removed by teardown
<id>.kimi-turnend-token firstmate-owned Kimi hook registry token for the task; removed by teardown
<id>.meta written by fm-spawn: window=, endpoint_task_id=, worktree=, project=, harness=, model=, effort=, kind=, mode=, yolo=, tasktmp=; kind=secondmate also records home= and projects=; a non-default runtime backend records further backend-specific fields (docs/configuration.md "Runtime backend"; bin/fm-backend.sh, section 8); fm-pr-check, including through fm-pr-merge, records one canonical pr= and the forge's pr_head= when available (GitHub pull requests and GitLab merge requests; docs/gitlab-merge-watch.md); fm-x-link appends x_request=, x_request_ts=, x_followups=, and optional x_platform=/x_reply_max_chars= for an X-mode-originated task (section 14)
<id>.meta written by fm-spawn: window=, endpoint_task_id=, worktree=, project=, harness=, model=, effort=, kind=, mode=, yolo=, tasktmp=; same-branch recovery also records thinking=, resume=1, and branch=; kind=secondmate also records home= and projects=; a non-default runtime backend records further backend-specific fields (docs/configuration.md "Runtime backend"; bin/fm-backend.sh, section 8); fm-pr-check, including through fm-pr-merge, records one canonical pr= and the forge's pr_head= when available (GitHub pull requests and GitLab merge requests; docs/gitlab-merge-watch.md); fm-x-link appends x_request=, x_request_ts=, x_followups=, and optional x_platform=/x_reply_max_chars= for an X-mode-originated task (section 14)
<id>.herdr-presentation quarantinable attempt and restart-binding journal for Herdr's optional visual projection; never task or endpoint authority; see docs/herdr-backend.md "Optional presentation spaces"
<id>.check.sh authenticated slow poll; the watcher dispatches validated PR data and the byte-identified X shim through trusted repository scripts, runs registered custom checks from hash-validated private snapshots, and rejects every other state check without execution
<id>.check-trust private content binding created by fm-check-register.sh for an intentional custom check
Expand Down Expand Up @@ -178,6 +178,7 @@ Break genuine evidence ties without array-order or harness bias.
`quota-axi` owns how model or product windows relate to bounding account windows and remains data-only.
Load `quota-array-dispatch` before choosing among a matched profile array; that skill is the single owner of the completion-aware selection procedure.
The generic effort fallback and its precedence are owned by `harness-adapters`: explicit captain and standing configured effort win; otherwise use low for well-understood explicit work, xhigh for ambiguous investigation or design, intermediate levels proportionally, and never max without explicit captain preference.
The role-specific effort and reviewer boundaries are owned by `harness-adapters`; section 7 owns Oracle review timing, fallback, and cycle budget.
Do not add model-specific versions of that policy.

`secondmate-provisioning` owns secondmate harness pins and inherited local material, while `harness-adapters` owns the harness consequences.
Expand Down Expand Up @@ -277,6 +278,7 @@ Supervise all live work under section 8.
The selected delivery path owns its own rigor.
For every PR-based ship task, after the implementation commit and before raising a PR (for direct-PR) or starting `/no-mistakes` (for no-mistakes), the worker must launch `@oracle` to review the exact committed range, absorb its correctness and risk findings, and resolve actionable findings.
This provides independent review evidence for the worker, not merge authority and not a replacement for the selected delivery path's own validation or the captain's merge decision.
The review budget is one initial Oracle review plus at most one re-review after fixes; unresolved findings after that re-review become a clear escalation or failure, never an unbounded review loop.
For direct-PR tasks, if `@oracle` is unavailable, the worker discloses the fallback and proceeds.
For no-mistakes tasks, the worker runs `@oracle` before starting `/no-mistakes` and includes actionable findings or fallback disclosure in `--intent` before validation starts, so Oracle review does not create an unsanctioned manual clean-verdict gate outside the pipeline.
Never hold work for an unsanctioned manual clean verdict, stack serial manual reviews, or infer merge authority for a reviewer from security, architecture, or risk alone.
Expand Down
1 change: 1 addition & 0 deletions bin/fm-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ crew_dispatch_validate() {
elif [(.rules // [])[]? | select(type != "object")] | length > 0 then "each rule must be an object"
elif [(.rules // [])[]? | select((.when? | type) != "string" or (.when | length) == 0)] | length > 0 then "each rule needs non-empty when"
elif [(.rules // [])[]? | select((.use? | type) != "object" and (.use? | type) != "array")] | length > 0 then "each rule needs use"
elif [(.rules // [])[]? | select(has("why") and ((.why? | type) != "string" or (.why | length) == 0))] | length > 0 then "rule why must be a non-empty string when present"
elif [(.rules // [])[]? | select((.use? | type) == "array" and (.use | length) == 0)] | length > 0 then "each rule needs at least one use profile"
elif [(.rules // [])[]? | profiles(.use?)[]? | select(type != "object")] | length > 0 then "each use profile must be an object"
elif [(.rules // [])[]? | profiles(.use?)[]? | select((.harness? | type) != "string" or (.harness | length) == 0)] | length > 0 then "each use profile needs harness"
Expand Down
2 changes: 1 addition & 1 deletion bin/fm-brief.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ else
fi
SPECIALIST_RULE="8. Standard implementation uses one \`antigravity/gemini-3.6-flash\` crewmate at high effort unless Firstmate explicitly overrides dispatch. You own narrow supporting calls to installed specialists: use \`@fixer\` for targeted implementation, \`@explorer\` for repository mapping and search, \`@plan\` for architecture or implementation planning, \`@designer\` for frontend, UI, and visual work, and \`@oracle\` for independent correctness and risk review when authorized. Inspect and incorporate returned findings yourself, then return $SPECIALIST_RESULT to Firstmate while preserving this brief's isolation, approval, and delivery rules."
WEB_RESEARCH_RULE="9. For web research, use Firecrawl MCP first: call \`firecrawl_search\`, call \`firecrawl_search_feedback\` after using its results, and use \`firecrawl_scrape\` for known pages. If Firecrawl is unavailable, use another tool only as a fallback and disclose that fallback in your findings."
REVIEW_PATH_RULE="10. Before pre-commit review, record the base and HEAD SHAs, then have the reviewer inspect the exact committed range with \`git diff <base>...<HEAD>\` and use \`git show <base>..<HEAD>\` for commit details; if the review tool cannot access those commits or shows an empty range, report the mismatch instead of reviewing it."
REVIEW_PATH_RULE="10. Before pre-commit review, record the base and HEAD SHAs, then have the reviewer inspect the exact committed range with \`git diff <base>...<HEAD>\` and use \`git show <base>..<HEAD>\` for commit details; if the review tool cannot access those commits or shows an empty range, report the mismatch instead of reviewing it. Follow the authoritative role contract in \`harness-adapters\`: Fixer is implementation-only, Oracle is read-only correctness and architecture review, Lelouch is read-only post-PR release-risk review, ordinary deep Oracle review uses xhigh, and max requires explicit architecture or security escalation. Use one initial Oracle review and at most one re-review after fixes; if actionable findings remain after re-review, escalate or fail instead of looping."

if [ "$KIND" = scout ]; then
cat > "$BRIEF" <<EOF
Expand Down
Loading