@zerwiz/ymir 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/.agents/config/app-repos.yaml +38 -0
  2. package/.claude/settings.json +31 -0
  3. package/.codex/hooks.json +43 -0
  4. package/.cursor/hooks.json +33 -0
  5. package/.pi/extensions/README.md +39 -0
  6. package/.pi/extensions/gna-pi-watch.ts +15 -0
  7. package/.pi/extensions/lib/ro-assistant-layout.ts +96 -0
  8. package/.pi/extensions/lib/ro-operational-user-layout.ts +145 -0
  9. package/.pi/extensions/lib/ro-visibility.ts +99 -0
  10. package/.pi/extensions/lib/ro-working-ship.ts +243 -0
  11. package/.pi/extensions/lib/rodd-operational-input.ts +62 -0
  12. package/.pi/extensions/lib/skuld-branch-dispatch.ts +252 -0
  13. package/.pi/extensions/lib/skuld-branch-model-picker.ts +77 -0
  14. package/.pi/extensions/lib/vordr-sessionstart-supervisor.mjs +48 -0
  15. package/.pi/extensions/ro.ts +11 -0
  16. package/.pi/extensions/skuld-branch-supervision.ts +11 -0
  17. package/.pi/extensions/syn-turnend-guard.ts +11 -0
  18. package/.pi/mcp.json +16 -0
  19. package/.pi/mcp.json.example +11 -0
  20. package/.pi/npm/.gitignore +2 -0
  21. package/.pi/settings.json +8 -0
  22. package/.pi/shared/extensions/gna-pi-watch.ts +750 -0
  23. package/.pi/shared/extensions/herdr-agent-state.ts +257 -0
  24. package/.pi/shared/extensions/open-editor.ts +509 -0
  25. package/.pi/shared/extensions/ro.ts +504 -0
  26. package/.pi/shared/extensions/skuld-branch-supervision.ts +1535 -0
  27. package/.pi/shared/extensions/syn-turnend-guard.ts +683 -0
  28. package/.pi/shared/extensions/todo.ts +133 -0
  29. package/.pi/shared/extensions/ymir-subagents.ts +287 -0
  30. package/.pi/shared/extensions/ymir-well.ts +130 -0
  31. package/CHANGELOG.md +23 -0
  32. package/assets/Ymir.md +4654 -0
  33. package/assets/healer.html +717 -0
  34. package/assets/icon-family/family-sheet.png +0 -0
  35. package/assets/icon-family/hlidskjalf.svg +1 -0
  36. package/assets/icon-family/sessrumnir.svg +1 -0
  37. package/assets/icon-family/smidja.svg +1 -0
  38. package/assets/icon-family/ymir.svg +1 -0
  39. package/assets/mimirswell.html +880 -0
  40. package/assets/mock/README.md +16 -0
  41. package/assets/mock/feeds.ts +175 -0
  42. package/assets/mock/mock.ts +408 -0
  43. package/assets/reference/docs/agent-control.md +122 -0
  44. package/assets/reference/docs/apodex/Appdex_as_Orchestrator_Planner_Reviewer_Assessment.md +176 -0
  45. package/assets/reference/docs/apodex/Final Report(1).md +198 -0
  46. package/assets/reference/docs/apodex/Final Report(2).md +54 -0
  47. package/assets/reference/docs/apodex/Final Report(3).md +40 -0
  48. package/assets/reference/docs/apodex/Final Report(4).md +234 -0
  49. package/assets/reference/docs/apodex/Final Report(5).md +13 -0
  50. package/assets/reference/docs/apodex/Final Report.md +82 -0
  51. package/assets/reference/docs/architecture.md +392 -0
  52. package/assets/reference/docs/arm-pretool-check.md +247 -0
  53. package/assets/reference/docs/calm-mode-feasibility.md +541 -0
  54. package/assets/reference/docs/calm.md +59 -0
  55. package/assets/reference/docs/captain-hold-lifecycle.md +96 -0
  56. package/assets/reference/docs/cd-guard.md +165 -0
  57. package/assets/reference/docs/cmux-backend.md +133 -0
  58. package/assets/reference/docs/codex-app-backend.md +57 -0
  59. package/assets/reference/docs/configuration.md +924 -0
  60. package/assets/reference/docs/documentation-audiences.json +468 -0
  61. package/assets/reference/docs/documentation-audiences.md +28 -0
  62. package/assets/reference/docs/examples/crew-dispatch.json +26 -0
  63. package/assets/reference/docs/examples/process-event-extension/file-signal.mjs +96 -0
  64. package/assets/reference/docs/examples/process-event-extension/firstmate-extension.json +15 -0
  65. package/assets/reference/docs/examples/watched-tools.json +24 -0
  66. package/assets/reference/docs/examples/wedge-alarm +22 -0
  67. package/assets/reference/docs/extension-bindings.md +237 -0
  68. package/assets/reference/docs/fm-test-isolation-proof.json +37 -0
  69. package/assets/reference/docs/fm-test-isolation-proof.md +149 -0
  70. package/assets/reference/docs/fm-test-portable-shards.md +118 -0
  71. package/assets/reference/docs/gitlab-merge-watch.md +275 -0
  72. package/assets/reference/docs/herdr-backend.md +346 -0
  73. package/assets/reference/docs/orca-backend.md +84 -0
  74. package/assets/reference/docs/pi-supervision-branch-poster.svg +125 -0
  75. package/assets/reference/docs/pi-supervision-branch.md +96 -0
  76. package/assets/reference/docs/plans/agentic-engineering-workflow.md +395 -0
  77. package/assets/reference/docs/plans/agentic-factory-implementation-plan.md +615 -0
  78. package/assets/reference/docs/plans/command-factory-enhancement-plan.md +420 -0
  79. package/assets/reference/docs/plans/phase-1-layer3-program-design.md +134 -0
  80. package/assets/reference/docs/plans/phase-2-vertical-slices.md +100 -0
  81. package/assets/reference/docs/plans/phase-3-measurable-goals.md +106 -0
  82. package/assets/reference/docs/plans/phase-4-context-budget.md +106 -0
  83. package/assets/reference/docs/plans/phase-5-pre-mortem-confidence.md +100 -0
  84. package/assets/reference/docs/plans/phase-6-incident-to-agent.md +109 -0
  85. package/assets/reference/docs/remote-secondmates.md +268 -0
  86. package/assets/reference/docs/scripts.md +146 -0
  87. package/assets/reference/docs/sessionstart-nudge.md +115 -0
  88. package/assets/reference/docs/subagent-guard.md +383 -0
  89. package/assets/reference/docs/supervision-protocols/claude.md +27 -0
  90. package/assets/reference/docs/supervision-protocols/codex.md +16 -0
  91. package/assets/reference/docs/supervision-protocols/cursor.md +31 -0
  92. package/assets/reference/docs/supervision-protocols/grok.md +39 -0
  93. package/assets/reference/docs/supervision-protocols/opencode.md +17 -0
  94. package/assets/reference/docs/supervision-protocols/pi.md +33 -0
  95. package/assets/reference/docs/supervision-protocols/unknown.md +13 -0
  96. package/assets/reference/docs/tmux-backend.md +115 -0
  97. package/assets/reference/docs/trace-context.md +117 -0
  98. package/assets/reference/docs/turnend-guard.md +170 -0
  99. package/assets/reference/docs/verification/dispatch-auth.md +204 -0
  100. package/assets/reference/docs/verification/muse.md +221 -0
  101. package/assets/reference/docs/verification/process-event-sources.md +208 -0
  102. package/assets/reference/docs/verification/public-followup.md +119 -0
  103. package/assets/reference/docs/verification/runtime-backends.md +1022 -0
  104. package/assets/reference/docs/verification/stow-memory.md +53 -0
  105. package/assets/reference/docs/verification/supervision.md +534 -0
  106. package/assets/reference/docs/verification/trace-context.md +31 -0
  107. package/assets/reference/docs/voice-relay.md +295 -0
  108. package/assets/reference/docs/watcher-continuity.md +119 -0
  109. package/assets/reference/docs/wedge-alarm.md +39 -0
  110. package/assets/reference/docs/zellij-backend.md +114 -0
  111. package/assets/reference/index.html +1172 -0
  112. package/assets/reference/skills/afk/SKILL.md +241 -0
  113. package/assets/reference/skills/ahoy/SKILL.md +56 -0
  114. package/assets/reference/skills/ask-user-authority/SKILL.md +56 -0
  115. package/assets/reference/skills/bearings/SKILL.md +161 -0
  116. package/assets/reference/skills/bearings/assets/board-template.html +731 -0
  117. package/assets/reference/skills/bootstrap-diagnostics/SKILL.md +68 -0
  118. package/assets/reference/skills/captain-hold-lifecycle/SKILL.md +54 -0
  119. package/assets/reference/skills/decision-hold-lifecycle/SKILL.md +15 -0
  120. package/assets/reference/skills/diagnostic-reasoning/SKILL.md +53 -0
  121. package/assets/reference/skills/firstmate-codexapp/SKILL.md +110 -0
  122. package/assets/reference/skills/firstmate-codexapp/agents/openai.yaml +4 -0
  123. package/assets/reference/skills/firstmate-coding-guidelines/SKILL.md +127 -0
  124. package/assets/reference/skills/firstmate-orca/SKILL.md +92 -0
  125. package/assets/reference/skills/fmx-respond/SKILL.md +283 -0
  126. package/assets/reference/skills/harness-adapters/SKILL.md +95 -0
  127. package/assets/reference/skills/harness-adapters/references/common/control-and-recovery.md +37 -0
  128. package/assets/reference/skills/harness-adapters/references/common/dispatch.md +32 -0
  129. package/assets/reference/skills/harness-adapters/references/common/model-and-effort.md +42 -0
  130. package/assets/reference/skills/harness-adapters/references/common/primary-hooks.md +40 -0
  131. package/assets/reference/skills/harness-adapters/references/harness/claude.md +55 -0
  132. package/assets/reference/skills/harness-adapters/references/harness/codex.md +43 -0
  133. package/assets/reference/skills/harness-adapters/references/harness/cursor.md +75 -0
  134. package/assets/reference/skills/harness-adapters/references/harness/grok.md +69 -0
  135. package/assets/reference/skills/harness-adapters/references/harness/kimi.md +51 -0
  136. package/assets/reference/skills/harness-adapters/references/harness/muse.md +70 -0
  137. package/assets/reference/skills/harness-adapters/references/harness/opencode.md +42 -0
  138. package/assets/reference/skills/harness-adapters/references/harness/pi.md +56 -0
  139. package/assets/reference/skills/process-event-sources/SKILL.md +137 -0
  140. package/assets/reference/skills/project-management/SKILL.md +92 -0
  141. package/assets/reference/skills/quota-array-dispatch/SKILL.md +131 -0
  142. package/assets/reference/skills/secondmate-provisioning/SKILL.md +254 -0
  143. package/assets/reference/skills/stow/SKILL.md +309 -0
  144. package/assets/reference/skills/stuck-crewmate-recovery/SKILL.md +54 -0
  145. package/assets/reference/skills/updatefirstmate/SKILL.md +64 -0
  146. package/assets/skills/README.md +5 -0
  147. package/assets/yggdrasil.html +649 -0
  148. package/assets/ymir-banner-01.png +0 -0
  149. package/assets/ymir-banner-02.png +0 -0
  150. package/assets/ymir-banner-03.png +0 -0
  151. package/assets/ymir-banner-04.png +0 -0
  152. package/assets/ymir-banner-05.png +0 -0
  153. package/assets/ymir-banner-06.png +0 -0
  154. package/assets/ymir-emblem-darksteel.svg +63 -0
  155. package/assets/ymir-emblem-forged.svg +55 -0
  156. package/assets/ymir-emblem-slate.svg +55 -0
  157. package/assets/ymir-mark-algiz-anvil.svg +9 -0
  158. package/assets/ymir-stave.svg +53 -0
  159. package/assets/ymir.html +563 -0
  160. package/bin/ymir-install.sh +6 -1
  161. package/data/learnings.md +33 -0
  162. package/data/local-models.md +34 -0
  163. package/data/operator.md +15 -0
  164. package/data/projects.md +28 -0
  165. package/data/realm.md +1 -0
  166. package/deploy/Containerfile +27 -0
  167. package/deploy/README.md +104 -0
  168. package/deploy/compose/compose.yaml +45 -0
  169. package/deploy/env.example +30 -0
  170. package/deploy/quadlet/ymir.container +57 -0
  171. package/package.json +10 -8
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: bootstrap-diagnostics
3
+ description: >-
4
+ Agent-only handling playbook for session-start bootstrap diagnostics.
5
+ Use whenever the session-start digest's bootstrap or network-checks section prints an actionable diagnostic line - MISSING, MISSING_MANUAL, BACKEND_INVALID, NEEDS_GH_AUTH, TANGLE, STARTUP_MEMORY_BUDGET, CREW_DISPATCH invalid, FLEET_SYNC, NETWORK_CHECKS, HOME_SUMMARY, BACKLOG_RECONCILE, SECONDMATE_SYNC, SECONDMATE_LIVENESS, SECONDMATE_HANDOFF, NUDGE_SECONDMATES, or FMX - or reports that an interrupted backlog cleanup may have left an endpoint or local copy, or when a standalone bin/fm-bootstrap.sh or bin/fm-startup-network.sh run prints one of those lines.
6
+ A silent bootstrap section, or any other BOOTSTRAP_INFO fact, means no skill load.
7
+ user-invocable: false
8
+ metadata:
9
+ internal: true
10
+ ---
11
+
12
+ # bootstrap-diagnostics
13
+
14
+ Handle each printed line as below, before dispatching work that depends on it.
15
+ The line formats themselves are owned by `bin/fm-bootstrap.sh`'s header; this playbook owns the response to actionable lines.
16
+ The inline rules in `AGENTS.md` section 3 still bind: detect, then consent, then install - never install anything the captain has not approved in this session - and no work is dispatched until the tools it needs are present and GitHub auth is good.
17
+ When any diagnostic needs captain attention, report the plain consequence and requested action using `AGENTS.md` section 9's captain-facing translation contract; do not name the diagnostic label unless the captain needs to paste it into a command or issue.
18
+
19
+ - `MISSING: <tool> (install: <command>)` - list the missing tools to the captain with a one-line purpose each plus the printed install commands, wait for consent (one approval may cover the list), then run `bin/fm-bootstrap.sh install <approved tools...>`.
20
+ For `treehouse`, this also covers an installed version whose `treehouse get` lacks `--lease`; treat it as an upgrade request.
21
+ For `no-mistakes`, this also covers an installed version older than 1.46.0, because this repo's PR gate requires structured pipeline attestation that older builds do not write.
22
+ For any axi-family tool - `gh-axi`, `lavish-axi`, `tasks-axi`, `quota-axi` - an installed version below its floor is a plain upgrade request; [`bin/fm-bootstrap.sh`](../../../bin/fm-bootstrap.sh) owns the floor policy, and never argue the floor down to whatever the home happens to have installed.
23
+ For `tasks-axi`, this additionally covers an installed build that fails the separate feature probe (`bin/fm-tasks-axi-lib.sh` owns the definition); `config/backlog-backend=manual` only suppresses the verbose `BOOTSTRAP_INFO: tasks-axi available` fact, not this missing-tool report.
24
+ For `quota-axi`, bootstrap requires it because firstmate reads its current output directly before resolving every crew-dispatch profile array; without it, report the missing requirement and do not choose around an unexamined candidate.
25
+ - `MISSING_MANUAL: <tool> (instructions: <url>)` - tell the captain why the tool is required and give them the printed instructions URL, but do not pass the tool to `bin/fm-bootstrap.sh install`; wait for the captain to complete the manual installation, then rerun session start to confirm the dependency is present.
26
+ - `BACKEND_INVALID: <name> (known: <names>)` - the resolved runtime backend has no verified dependency or lifecycle contract, so do not dispatch work until the invalid `FM_BACKEND` or `config/backend` value is corrected to one of the listed backends.
27
+ - `NEEDS_GH_AUTH` - ask the captain to run `! gh auth login` (interactive; you cannot run it for them).
28
+ This probe now arrives from the deferred network stage, so it is also how an unreachable network shows up: `gh` cannot validate its token offline and reports the same failure. Confirm reachability before asking the captain to re-authenticate a credential that may be fine.
29
+ - `NETWORK_CHECKS: <what did not complete>; rerun <command>` - the deferred network stage itself could not finish, so the checks it names are simply unknown, not failed.
30
+ Rerun the printed command; it is idempotent and re-derives every finding.
31
+ A `hit the ...s bound` line means one of those checks is slow or unreachable - most often a remote secondmate host - and the stage stopped rather than letting it wedge; a `lock was no longer held` line means the session that asked for the sweeps no longer owns them, so leave them to the session that does.
32
+ - `TANGLE: <remediation>` - the primary checkout is stranded on a feature branch instead of its default branch; `AGENTS.md` section 8 explains why this guard exists and what it protects.
33
+ The work is safe on that branch ref; restore the primary to its default branch with the printed `git -C <root> checkout <default>`, then re-validate that branch in a proper worktree.
34
+ This is the only sanctioned firstmate-initiated git write to the primary, and it is a non-destructive branch switch that strands nothing.
35
+ - `STARTUP_MEMORY_BUDGET: invalid config/startup-memory-budget - <reason>` - the visible startup-memory budget is not a safe one-line positive decimal file; do not infer the default or propagate it.
36
+ Correct the local primary file, then rerun session start so the normal convergence path can deliver the validated value to secondmate homes.
37
+ - `CREW_DISPATCH: invalid config/crew-dispatch.json - <reason>` - the optional dispatch profile file exists but failed low-cost bootstrap validation; stop profile-based dispatch, report the actionable error, and require correction of the malformed schema, unverified harness name, or invalid harness/effort pair rather than falling back around it or selecting a bad profile.
38
+ - `FLEET_SYNC: <repo>: skipped: <reason>` - a benign one-off skip (offline, no origin, local-only); bootstrap continued, investigate only if it blocks work.
39
+ A skip can also report the bounded fleet-refresh timeout (`FM_FLEET_SYNC_BOOTSTRAP_TIMEOUT`, or a fleet-size-aware default with a 20 second floor); a timeout never blocks startup.
40
+ - `FLEET_SYNC: <repo>: recovered: <detail>` - the clone had drifted onto a clean detached HEAD holding no unique commits and the sync self-healed it (re-attached the default branch and fast-forwarded); no action needed, it is reported only so the self-heal is visible.
41
+ - `FLEET_SYNC: <repo>: STUCK: on <state>, N commits behind <base> - needs attention` - the clone is dirty, on a non-default branch, detached with unique commits, or diverged, so the sync left it untouched (never forcing or discarding); it will keep falling behind until you look.
42
+ A loud STUCK, especially a growing N across bootstraps, means that clone needs hands-on attention; dispatch a crewmate or resolve it before it strands work.
43
+ - `HOME_SUMMARY: this home has never published state/home-summary.json` or `... has not been republished since <stamp>` - this home's structured summary publication has failed repeatedly, and the line carries the failure count and the newest recorded reason from `state/.home-summary-refresh.log`.
44
+ Publication is deliberately best-effort, so it cannot change another session-start, spawn, teardown, or watcher-poll result, and the watcher runs it detached so a slow attempt cannot delay the liveness beacon.
45
+ Read the named record for the recorded reasons, then reproduce with a direct `bin/fm-home-summary-refresh.sh` (no `--best-effort`, which is what keeps the failure quiet) so the refresh error reaches you.
46
+ A recorded deadline means the complete refresh did not finish inside `FM_HOME_SUMMARY_TIMEOUT`, so inspect lock acquisition and producer completion before validation or publication, and fix the blocked phase rather than raising this load-bearing bound.
47
+
48
+ - `BOOTSTRAP_INFO: closed the backlog item for <id> after interrupted cleanup; its endpoint or local copy may remain and should be reconciled` - replay closed the item, but the durable close says physical cleanup was interrupted.
49
+ Verify process reaping, the local-copy return, and endpoint closure, then reconcile any surviving resource.
50
+ - `BACKLOG_RECONCILE: <id>: recorded backlog close could not be replayed: <reason>` - this session start found a pending-close record but could not land it.
51
+ A valid teardown record proves the close was authorized and recorded, but physical cleanup may be partial: verify process reaping, the local-copy return, and endpoint closure before assuming those resources are gone.
52
+ A validation error means the record cannot be trusted, so do not assume cleanup completed or follow any path or argument stored in it.
53
+ Read the named reason, inspect the marker as inert data when validation failed, fix the record or backlog-file problem, and rerun session start so a valid recorded close replays.
54
+ Never hand-close the item by deleting `state/<id>.backlog-close` - that can discard a completion link the cleanup captured, and the surviving marker prevents the record sweep from starting the item meanwhile.
55
+ - `BACKLOG_RECONCILE: <id>: worker record exists but its backlog item could not be read: <reason>` - this home could not determine whether the item matches its worker record.
56
+ Resolve the named backlog read problem and rerun session start; never guess by starting or closing an unreadable item.
57
+ - `BACKLOG_RECONCILE: <id>: worker record exists but its backlog item could not be moved to In flight: <reason>` - this home owns a worker whose backlog item is still queued, and the reconciliation could not correct it.
58
+ Until it is corrected, the fleet view reads that worker as work no backlog item owns; resolve the named backlog problem and rerun session start.
59
+ - `SECONDMATE_SYNC: secondmate <id>: skipped: <reason>` - secondmate convergence left a live home on its existing checkout because the home was dirty, diverged, unsafe, on the wrong branch, missing its placement-specific target commit, unreachable, or otherwise not fast-forwardable, or because inherited local-material propagation failed; bootstrap continued, but inspect the reason because the secondmate's tracked instructions, inherited settings, or shared captain preferences may be stale after a primary update.
60
+ - `SECONDMATE_LIVENESS: secondmate <id>: skipped: <reason>|respawn failed after <cause>: <reason>` - the session-start liveness sweep could not guarantee that the registered secondmate is running a real agent process.
61
+ Investigate the reason because that secondmate is not guaranteed live.
62
+ - `SECONDMATE_HANDOFF: secondmate <id>: pending delivery: <n> item(s)` - queued work has already left the main dispatchable backlog and remains safe in the named remote route's backlog-format outbox, pending backlog receipt or receiver-wake confirmation.
63
+ Preserve that outbox and rerun `bin/fm-backlog-handoff.sh --resume-pending` after the route or endpoint problem is resolved; never re-add or dispatch the items from the main backlog.
64
+ An unsafe-outbox variant requires path and file-type inspection before any retry.
65
+ - `NUDGE_SECONDMATES: secondmate <id>: send failed: <reason>` - secondmate convergence changed a running home's loaded instructions or inherited config, but the deterministic `fm-send.sh fm-<id>` re-read nudge failed.
66
+ Inspect the reason, keep the pending marker under `state/.secondmate-nudge-pending/` intact, and rerun session start after the endpoint or metadata issue is fixed so bootstrap can retry the exact same marked send on the same local or remote route.
67
+ - `FMX: X mode on ...` / `FMX: X mode off ...` - bootstrap confirmed or removed the local Relay poll artifacts (`docs/configuration.md` "Relay (.env)"); the emitted line still carries Relay's former `X mode` wording.
68
+ Only when a running watcher needs the cadence transition applied immediately, restart the home-scoped watcher through the emitted harness supervision protocol; bootstrap deliberately never restarts the watcher itself.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: captain-hold-lifecycle
3
+ description: >-
4
+ Agent-only policy for completing investigations and visual reviews without losing unresolved captain calls, and for closing what the captain owns with his actual words.
5
+ Load before treating an investigation, scout report, structured review, or Lavish review as complete, before ending a visual review that exposed a captain decision, when recording or routing the captain's answer, and on any RECORD DIVERGENCE line the wake drain prints.
6
+ user-invocable: false
7
+ metadata:
8
+ internal: true
9
+ ---
10
+
11
+ # Captain-hold lifecycle
12
+
13
+ A decision is not a separate thing: it is simply a task waiting on the captain.
14
+ The one primitive is an ordinary backlog task held for the captain (`tasks-axi hold <id> --kind captain`), its identity is the task id, and `bin/fm-captain-hold.sh` owns the deterministic mechanics this policy relies on.
15
+ The agent performs the semantic inventory because scripts must not infer captain calls from report prose, visual-review artifacts, terminal output, or chat.
16
+
17
+ ## Policy
18
+
19
+ Every unresolved question that belongs to the captain and is discovered while producing, reading, presenting, or ending an investigation or visual review must be carried by a captain-held task in the authoritative backlog of the home that owns the originating work before that work or review may be treated as complete.
20
+ Prefer holding the work item the question gates over minting a new row; create a new task only when no work item exists to hold.
21
+ Put the question and its options in the hold reason, and keep one held task per genuine gate: a multi-question review is one held task pointing at its report, not a row per question. Represent that task with exactly one board card that consolidates its questions and options; never fan one task id into duplicate same-key cards.
22
+ Register or re-hold through `bin/fm-captain-hold.sh hold`, which is idempotent per task id.
23
+ After inventorying the whole report and review surface, run `bin/fm-captain-hold.sh complete` with every captain-held task id, or with `--none` only when the reviewed surface leaves nothing waiting on the captain.
24
+ A completed investigation and an ended visual review use this same owner and completion command; a visual tool, including Lavish, never owns a parallel completion policy.
25
+ Run the command in the originating work's authoritative `FM_HOME`; secondmate-owned work registers in that secondmate home's backlog, and a question already held anywhere is never re-registered as a second row.
26
+ Do not close a captain-held task merely because the originating investigation completed, its report was archived, its visual review ended, or its task was torn down.
27
+
28
+ Never close anything the captain owns without recording what he actually said: `bin/fm-captain-hold.sh answer` writes his exact words into the task and closes it in the same act, with `--release` when the answer frees a captain-gated work item to proceed instead of completing a question.
29
+ When the captain says "later", that is an answer too: re-hold with `tasks-axi hold <id> ... --until <date>` so the item leaves the live Captain's Call and resurfaces on its date, instead of leaving a live-looking card or fabricating a closure.
30
+ "A keyed answer closes its matching captain-held task" is one capability with one owner, `bin/fm-captain-hold.sh answers`, and every channel that carries a captain answer feeds it the same task id and answer; a channel never maps keys to tasks, records a decision, or closes anything itself.
31
+ Chat already feeds it through `bin/fm-send.sh --resolve-key`, and a captured-answer source feeds it once bound with `bin/fm-captain-hold.sh bind <source-id>`; bind before arming the source, and key each structured question by the held task's id.
32
+ An unbound source and a key that names no captain-held task both simply feed nothing: the answer is still captured and firstmate is still woken, and closing falls back to the direct command above.
33
+ A captain-held task closed outside this owner leaves no durable answer, so the completion gate keeps failing until `answer` records the decision the captain actually gave.
34
+ Resolved findings, recommendations that need no captain choice, and prose that merely sounds decision-like do not create held tasks.
35
+ Bearings reads the resulting structured state and must never compensate by scraping historical reports, visual-review artifacts, terminal output, chat, or other prose.
36
+
37
+ A captain call can be written down twice - as the keyed status decision the fold reads, and as the backlog task held for the captain - and those two records can disagree without either surface saying so.
38
+ `bin/fm-captain-hold.sh diverged` reports that contradiction and the wake drain prints it as `RECORD DIVERGENCE`; it closes nothing, because a captain call closed wrongly leaves review entirely, which is worse than the noise.
39
+ Read such a line as "these two records disagree", never as "the captain ruled and someone forgot to file it": a call can dissolve because its premise was false, or turn out to have been a question of fact rather than the captain's to answer.
40
+ Reconcile it with what actually happened - `answer` when the captain's own words exist to record, and a fresh `needs-decision` line re-opening the status decision when that resolution was not the captain's word.
41
+ The absence of a routed work item is not a divergence and the guard never requires one: when the decision IS the deliverable there is nothing to route.
42
+
43
+ ## Operating sequence
44
+
45
+ 1. Read the complete investigation result and complete the visual review before declaring either complete.
46
+ 2. Inventory only genuine unresolved choices that require the captain, and find the task each one gates.
47
+ 3. Hold that task - or create one captain-held task for the review's open questions - with a concise reason carrying the question and options.
48
+ 4. Run `complete` with the full captain-held inventory for that review pass.
49
+ 5. Relay the choices to the captain as decisions from Bearings' Captain's Call section under `AGENTS.md` section 9; do not use the word hold in captain chat.
50
+ 6. Close each call only through `answer` (or a channel that feeds `answers`), through `--until` when the captain defers it, or confirm a channel already closed it.
51
+ 7. Confirm Bearings reflects the outcome: answered calls leave Captain's Call, released work resumes, and deferred calls sit in Charted Next with their date.
52
+
53
+ `bin/fm-captain-hold.sh --help` owns command syntax, close modes, legacy-identity compatibility, completion attestation, retry behavior, and close ordering.
54
+ `docs/captain-hold-lifecycle.md` records the mechanism and regression evidence without restating this policy.
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: decision-hold-lifecycle
3
+ description: >-
4
+ Renamed pointer kept for in-flight briefs: the decisions concept collapsed into "a task held for the captain".
5
+ Load captain-hold-lifecycle instead; this stub only redirects and will be removed one release after the collapse.
6
+ user-invocable: false
7
+ metadata:
8
+ internal: true
9
+ ---
10
+
11
+ # decision-hold-lifecycle (renamed)
12
+
13
+ The separate decision concept was collapsed into the one primitive the captain cares about: a task held for the captain.
14
+ Read and follow `.agents/skills/captain-hold-lifecycle/SKILL.md`; it owns the completion gate, the recorded-answer rule, and every command this skill used to describe.
15
+ Where an older brief says `bin/fm-decision-hold.sh`, that command still works as a one-release compatibility shim over `bin/fm-captain-hold.sh`.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: diagnostic-reasoning
3
+ description: >-
4
+ Agent-only procedure for diagnosing reported bugs.
5
+ Use before scoping a reported bug and before acting on a diagnostic report.
6
+ Owns end-user-aligned reproduction, causal separation, divergent-path and history inspection, counterfactual testing, and disconfirming evidence.
7
+ user-invocable: false
8
+ metadata:
9
+ internal: true
10
+ ---
11
+
12
+ # diagnostic-reasoning
13
+
14
+ Use this procedure before scoping a reported bug and before acting on a diagnostic report.
15
+ This skill is the single owner of Firstmate's bug-diagnosis reasoning procedure.
16
+ Firstmate applies it when briefing delegated investigation and evaluating the resulting evidence, without taking over project-specific investigation itself.
17
+
18
+ ## Establish the observed behavior
19
+
20
+ Start from the end user's experience rather than an internal error string or an implementation hypothesis.
21
+ Require an end-to-end reproduction aligned with the real user path whenever it is feasible and safe.
22
+ If a faithful reproduction is not feasible, record the exact limitation and use the closest representative path without presenting it as equivalent evidence.
23
+ Capture the expected behavior, observed behavior, setup, inputs, and repeatability before assigning a cause.
24
+
25
+ Separate these three facts explicitly:
26
+
27
+ - The **initiating trigger** is the event, input, or transition that starts the faulty behavior.
28
+ - The **masking condition** is the independent state, environment, timing, cache, configuration, or path difference that hides or exposes the fault.
29
+ - The **visible symptom** is what the end user or operator can actually observe.
30
+
31
+ Do not collapse those facts into one label.
32
+ A masking condition may explain why a fault appears only sometimes without being the initiating cause, and the visible symptom may be several layers downstream from both.
33
+
34
+ ## Test the causal explanation
35
+
36
+ Inspect the failing path and a proven path where the intended behavior is known to work.
37
+ Compare their inputs, state transitions, dependencies, timing, and control flow to find the earliest meaningful divergence.
38
+ Inspect relevant history, including blame, commits, migrations, and prior implementations, when it can explain why the paths diverged or which invariant was intended.
39
+ Do not treat the most recent nearby change as causal without evidence.
40
+
41
+ Identify the smallest counterfactual that should change the outcome if the leading explanation is true.
42
+ Change one condition at a time where practical, and record whether the symptom appears, disappears, or remains unchanged.
43
+ Seek disconfirming evidence deliberately: name what observation would falsify the leading explanation, run that check when feasible, and retain contradictory results instead of explaining them away.
44
+ Compare the final explanation against the proven path and show why the proposed causal boundary accounts for both the failure and the success.
45
+
46
+ ## Scope and act on the result
47
+
48
+ A diagnosis brief should ask for the reproduction, trigger/mask/symptom separation, divergent and proven path comparison, relevant history, smallest counterfactual, and disconfirming evidence in the report.
49
+ A diagnostic report should distinguish observed facts from hypotheses and state any unresolved uncertainty that could change the recommended scope.
50
+ Before acting on the report, verify that its claimed cause explains the end-user reproduction and the proven path without relying on an untested masking condition.
51
+ If a load-bearing element is missing, route a focused follow-up investigation instead of treating confidence or implementation detail as proof.
52
+ A diagnosis or implementation-ready recommendation is evidence, not authorization to change code.
53
+ Implementation still requires the captain's request or another existing lifecycle authority, and the reproduction should become the regression test when a fix is authorized.
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: firstmate-codexapp
3
+ description: >-
4
+ Agent-only playbook for coordinating visible Codex Desktop threads alongside Firstmate without pretending they are a selectable shell backend.
5
+ 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.
6
+ user-invocable: false
7
+ metadata:
8
+ internal: true
9
+ ---
10
+
11
+ # firstmate-codexapp
12
+
13
+ ## Overview
14
+
15
+ Use this playbook when Firstmate work needs a visible Codex Desktop thread.
16
+ The current supported shape is Desktop host-tool choreography plus an explicit status-file return-channel check, not a `codex-app` value in `FM_BACKEND`.
17
+
18
+ ## Boundary
19
+
20
+ Codex Desktop visible threads are companion host-tool workflows, not a selectable Firstmate backend.
21
+ Read `docs/codex-app-backend.md` when it exists in this checkout; that document owns the acceptance contract, bridge requirement, status-return requirement, and staged rollout.
22
+
23
+ If local helper scripts exist for Codex App work, use only helpers explicitly provided by the operator or maintained by Firstmate.
24
+ For helpers outside `bin/`, inspect the source or header before running `--help`.
25
+
26
+ ## Preflight
27
+
28
+ 1. Confirm this session is running inside Codex Desktop and that the host tools are exposed.
29
+ Search exact names when needed: `create_thread`, `list_threads`, `read_thread`, `send_message_to_thread`, `archive`, and `set_thread_archived`.
30
+ 2. Confirm the target repository is already saved as a Codex Desktop project.
31
+ No host tool currently creates Codex App projects for an agent, so the human must add the project in Desktop before a created thread can reliably land there.
32
+ 3. Do not create projectless threads for repo work.
33
+ If the project is absent, stop and ask for the project to be added or use a normal Firstmate backend instead.
34
+ 4. Decide whether this is a real Firstmate-managed task or a visible companion thread.
35
+ A real task needs a task id, an isolated worktree or Desktop-owned cwd, a branch plan, and a writable `state/<id>.status` path.
36
+
37
+ ## Create And Send
38
+
39
+ When creating a visible thread, use the Desktop host tool, not shell imitation.
40
+ Target the saved project and ask the worker to start by reporting:
41
+
42
+ ```text
43
+ pwd
44
+ git rev-parse --show-toplevel
45
+ git branch --show-current
46
+ git log --oneline --max-count=3
47
+ ```
48
+
49
+ For writable repo work, instruct the worker to use the Codex-created current directory.
50
+ Do not tell it to `cd` into the saved project checkout for edits, commits, no-mistakes, pushes, or PR work.
51
+
52
+ When sending follow-up instructions, use `send_message_to_thread`.
53
+ If the user types directly into the visible thread, treat that as authoritative and reconcile from `read_thread` instead of undoing it.
54
+
55
+ ## Status Return Channel
56
+
57
+ A Desktop-owned Codex thread can append to Firstmate status files only when the prompt gives an absolute path and the Desktop permission context can write that checkout.
58
+ That makes status writes a verified return-channel requirement, not a fact to assume.
59
+
60
+ For a Firstmate-managed task, include an explicit status instruction:
61
+
62
+ ```text
63
+ Append supervisor-visible status lines to <absolute-firstmate-home>/state/<task-id>.status.
64
+ Use only these prefixes for status changes: working:, needs-decision:, blocked:, paused:, done:, failed:.
65
+ Use paused: only for a deliberate known external wait that should be rechecked later, never for a blocker that needs firstmate to act.
66
+ Before doing substantive work, append "working: Codex Desktop thread started".
67
+ ```
68
+
69
+ Verify the return channel before treating the thread as supervised:
70
+
71
+ - `read_thread` shows the worker attempted the status write.
72
+ - The local `state/<task-id>.status` file contains the expected line.
73
+ - If available, the transcript includes a file-change entry for that status file.
74
+
75
+ If the thread cannot write the status file, keep it as a visible companion thread only.
76
+ Do not claim it is a complete Firstmate backend.
77
+
78
+ ## Observe And Reconcile
79
+
80
+ Use `read_thread` for thread truth.
81
+ Use `list_threads` only to find or recover a visible thread id, not as a replacement for reading the transcript.
82
+
83
+ For Firstmate reconciliation, prefer concrete evidence:
84
+
85
+ - thread id and project
86
+ - current Desktop-owned cwd
87
+ - branch name
88
+ - last meaningful thread state
89
+ - latest status file line
90
+ - PR URL when one exists
91
+
92
+ Avoid repeating long transcripts into Firstmate docs or PR bodies.
93
+ Summarize only the host-tool calls, the status-file result, and the archive result.
94
+ When reporting a Desktop-thread result to the captain, translate status prefixes and return-channel evidence through `AGENTS.md` section 9.
95
+
96
+ ## Archive
97
+
98
+ Archive through the Desktop host tool: `archive` when that is the exposed primitive, or `set_thread_archived(threadId=<id>, archived=true)` when that is the exposed tool name.
99
+ Archiving can remove the thread from normal sidebar/project views, but it should not erase the transcript or landed work.
100
+
101
+ For companion threads, archive the thread and report where the durable work landed.
102
+ If there is a real Firstmate task record, leave teardown decisions to the normal Firstmate task flow instead of this skill.
103
+
104
+ ## Failure Signals
105
+
106
+ - Missing Desktop project: ask the human to add the target project in Codex Desktop, or use a normal backend.
107
+ - Missing host tools: do not simulate them with shell files; use a terminal backend instead.
108
+ - Status file not updated: treat the thread as unsupervised until the return channel is proven.
109
+ - Worker editing the saved project checkout instead of its Desktop cwd: stop and decide whether to salvage the branch before continuing.
110
+ - Production `codex-app` backend request: read `docs/codex-app-backend.md` and do not invent a local adapter.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Firstmate Codex App"
3
+ short_description: "Operate visible Codex Desktop threads"
4
+ default_prompt: "Use $firstmate-codexapp to coordinate visible Codex Desktop threads without pretending they are a shell backend."
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: firstmate-coding-guidelines
3
+ description: >-
4
+ Agent-only reference for changing firstmate's shared, tracked material per AGENTS.md section 1.
5
+ Use before editing any of that material, whether working as firstmate directly or as a crewmate briefed on a firstmate-repo task.
6
+ 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).
7
+ user-invocable: false
8
+ metadata:
9
+ internal: true
10
+ ---
11
+
12
+ # firstmate-coding-guidelines
13
+
14
+ Load this before changing firstmate's shared, tracked material, as defined by `AGENTS.md` section 1.
15
+ It exists because `AGENTS.md` grew from 585 to 958 lines between its last two restructures, entirely from conditional detail added inline instead of routed to its right home.
16
+ Applying the rules below on every change is what keeps that from happening again.
17
+
18
+ ## Knowledge-placement decision tree
19
+
20
+ Before writing a new fact anywhere in this repo, ask where it belongs, in this order.
21
+
22
+ 1. Does the firstmate AGENT need this on every session or every turn to operate?
23
+ If yes: `AGENTS.md`, inline.
24
+ 2. Does the agent need it only in a nameable situation - a spawn, a recovery, a specific wake type, a specific lifecycle step?
25
+ If yes: an agent-only skill under `.agents/skills/`, plus a one-line trigger pointer left inline in `AGENTS.md` (usually section 13).
26
+ 3. Is it public product, setup, or user/operator reference?
27
+ If yes: the surface classified for that audience in [`docs/documentation-audiences.md`](../../../docs/documentation-audiences.md), limited to current behavior, setup, supported limits, stable invariants, concise rationale, and current verification entry points.
28
+ 4. Is it contributor/maintainer architecture?
29
+ If yes: the classified maintainer-architecture owner for stable ownership, extension points, mechanism boundaries, and safety rationale.
30
+ 5. Is it active reusable verification for a current guarantee?
31
+ If yes: an explicitly classified maintainer-verification record may keep current dates, versions, exact commands, and exact output.
32
+ 6. Is it task or incident evidence - chronology, transcripts, branches, temporary paths, failed hypotheses, or delivery proof?
33
+ If yes: keep it in the private task report or PR evidence by default, after distilling every unique current fact into its authoritative owner.
34
+ 7. Is it mechanics - exact flags, exact commands, exact paths?
35
+ If yes: the script's own header comment plus its `--help` output, not prose in `AGENTS.md`, a skill, or a second documentation owner.
36
+
37
+ Stop at the first tier that answers yes.
38
+ Do not place a fact at a more convenient tier than the one this tree gives you.
39
+ The machine-consumed inventory in [`docs/documentation-audiences.json`](../../../docs/documentation-audiences.json) is the single classification owner for maintained prose surfaces; do not add parallel front matter or a second audience list.
40
+
41
+ ## One-owner rule
42
+
43
+ Every contract - a data format, a state machine, a decision procedure - is stated in full exactly once.
44
+ Every other mention of it is a one-line cross-reference, never a restatement.
45
+ A single deliberate one-line reinforcement at a genuine risk point is allowed, for example a "don't forget X" placed exactly where forgetting X is costly.
46
+ Restating the contract's substance a second time is not allowed: the two copies will drift the moment only one is edited.
47
+ When you touch a contract, patch, replace, or prune the owner's existing language rather than appending a new clause or paragraph wherever possible, then grep the repo for its other mentions and update the cross-references, not duplicate the change into a second full copy.
48
+
49
+ ## Inline-stub pattern
50
+
51
+ When content moves out of `AGENTS.md` into a skill, decide what stays behind by asking one question: what must survive with no skill loaded?
52
+ That is the trigger condition for loading the skill, plus any safety-critical fact that fires on a wake the skill itself is not loaded for.
53
+ Everything else - the procedure, the mechanism, the surrounding detail - moves out completely.
54
+ Do not leave a partial restatement behind "just in case".
55
+ A partial copy is exactly the duplication the one-owner rule forbids.
56
+ The model to copy is `AGENTS.md` section 8's "Away-mode stub": it keeps only the marker format, the ownership-transfer rule, and the exit condition inline, and points everything else at the `/afk` skill.
57
+
58
+ ## Size discipline
59
+
60
+ Apply the decision tree above to every line you are about to add to `AGENTS.md`.
61
+ If an addition needs more than a few lines of conditional detail (detail that matters only in a specific situation) or reference detail (a wire format, an exact schema, historical rationale), you are almost certainly adding it to the wrong file.
62
+ `AGENTS.md`'s token cost is paid by every session of every fleet member, every time, whether or not that session ever hits the situation the new lines describe.
63
+ A skill's cost is paid only by the sessions that actually load it.
64
+ When in doubt, write the fact into the skill or doc first by patching that owner's existing language, and add only the one-line trigger to `AGENTS.md`.
65
+
66
+ ## Trigger hygiene
67
+
68
+ A new skill is dead weight if nothing loads it.
69
+ Every new skill needs its load trigger declared inline: section 13 for agent-only reference skills, or the relevant operating section for anything else.
70
+ State the trigger as a condition ("load before X", "load on Y wake"), never as a vague pointer.
71
+ Briefs for tasks that touch firstmate's own tracked material should tell the crewmate to load this skill.
72
+ `bin/fm-brief.sh`'s `REPO` argument is a caller-supplied string with no reliable signal that it names firstmate's own repo, unlike a project registered in `data/projects.md`, so there is no clean point inside the scaffold to detect this case automatically.
73
+ Firstmate adds this skill's load instruction to firstmate-repo briefs by hand instead.
74
+ `CONTRIBUTING.md`'s "Development" section carries the same instruction as a durable reminder.
75
+
76
+ ## Compatibility and enforcement
77
+
78
+ Before changing shared tracked behavior, review every affected supported primary harness and runtime backend rather than checking only the adapters active in the current fleet.
79
+ Mark an axis not applicable only after inspecting its integration surface, and update the corresponding verification evidence when behavior changes.
80
+
81
+ For critical safety, routing, startup, and supervision infrastructure, prefer deterministic and idempotent enforcement over relying on agent memory alone.
82
+ Keep instructions as the authority and discovery layer, but make repeated execution converge safely and make invalid or unsafe states fail closed wherever the runtime can enforce them.
83
+
84
+ ### Harness-dependent checks
85
+
86
+ This section is the single owner of the rule and of how to satisfy it.
87
+
88
+ A check is harness-dependent when its verdict comes from something the vendor emits: a process name, rendered output, a spinner or keybind glyph, a banner, or a key the harness binds.
89
+ Anything in that class must be proven end to end against the real harness, because a stub or fake agent can only confirm the assumption already written into the stub.
90
+ That proof is authorized to spend tokens; the cost is small against a check that silently stops working.
91
+
92
+ Build the check on the most structural signal that answers the question, and prefer a kernel or protocol fact over anything a release note could change.
93
+ When a rendered surface is genuinely the only source, read more than one independent signal and let any of them carry a positive verdict, so no single vendor string is load-bearing.
94
+ Where a surface signal is unavoidable, back it with a guard that fails loudly naming the harness and version rather than degrading quietly.
95
+
96
+ Every such check needs two tests, because they fail for different reasons:
97
+
98
+ - A portable regression in `tests/` that pins the logic with real processes and no harness, so CI enforces the classifier everywhere it runs tmux.
99
+ Drive the signals apart deliberately and assert the verdict survives losing one; assert the divergence itself so the case cannot go quietly vacuous.
100
+ Confirm which signal a given construction actually blinds on each supported platform rather than assuming, because the same trick can break different sources on macOS and Linux.
101
+ - A live guard in the `live-harness-optin` family (`bin/fm-test-run.sh`), env-gated and self-skipping, that exercises every INSTALLED harness for real and fails naming the harness and version.
102
+ Report an absent harness explicitly rather than passing silently over it, and refuse a pass that checked nothing.
103
+ This guard is opt-in and on-demand because standard CI has neither harness binaries nor credentials; run it after every harness upgrade and before trusting refreshed per-harness evidence.
104
+
105
+ Record the dated per-harness result in `docs/verification/runtime-backends.md`, and point at the live guard as the command that refreshes it, rather than leaving a version-scoped observation to rot into a false claim.
106
+
107
+ ## Documentation change review
108
+
109
+ For every changed maintained prose surface, identify its inventory audience, authoritative owner, current-behavior relevance, destination for supporting evidence, and any unique safety fact that removal could lose.
110
+ Move or delete evidence only after the current owner and regression pointer are verified.
111
+ After all documentation, review-fix, and lint-fix commits, review the complete branch diff again against those criteria rather than reviewing only the latest commit.
112
+ Run `bin/fm-doc-audience-check.sh`; it enforces classification, README setup routing, local link targets, and owner pointers without keyword-linting legitimate evidence prose.
113
+
114
+ ## Repo style rules
115
+
116
+ - Put one full sentence per line in tracked Markdown.
117
+ - Never wrap multiple sentences onto one physical line.
118
+ - Plain dash `-`, never an em dash.
119
+ - Never add an agent name as a commit co-author.
120
+ - `bin/*.sh` and `bin/backends/*.sh` must pass `shellcheck`.
121
+ - Run `bin/fm-lint.sh` before treating a script change as done; it is the single owner of the lint definition (file set, config, pinned shellcheck version, and pinned actionlint workflow lint) that CI and the no-mistakes pre-push gate both invoke, and it refuses to run under any other version of either linter.
122
+ - When a task names a specific tool, implement the work with that tool, or explicitly flag the substitution and its new dependency footprint for review before shipping.
123
+ - Colocate tests with the existing pattern in `tests/`, name them `<subject>.test.sh`, and extend an existing script rather than inventing a new runner.
124
+ - Tests must exercise behavior through an executable or public interface and must never assert implementation-source bytes, including through parsers, regexes, snapshots, or indirect wrappers.
125
+ - A maintainer-verification record under `docs/verification/` records active empirical facts, not assumptions or task chronology.
126
+ - Include the date, version, exact commands run, and exact output needed to support the current guarantee.
127
+ - Keep incident chronology and delivery evidence in private task reports or PR evidence unless a concise rationale is required to maintain a current safety boundary.
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: firstmate-orca
3
+ description: 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.
4
+ user-invocable: false
5
+ metadata:
6
+ internal: true
7
+ ---
8
+
9
+ # firstmate-orca
10
+
11
+ Use this as the operator checklist for Firstmate's experimental Orca runtime backend.
12
+ It does not replace `AGENTS.md`, `docs/orca-backend.md`, or `harness-adapters`.
13
+
14
+ Orca is a runtime backend, not an agent harness.
15
+ The runtime backend owns the task endpoint and, for Orca, the task worktree.
16
+ The harness is the agent process launched inside that endpoint, such as `claude`, `codex`, `opencode`, `pi`, `pi-signed`, `grok`, or `kimi`.
17
+ Load `harness-adapters` for harness-specific launch, interrupt, resume, trust-dialog, and skill-invocation facts.
18
+
19
+ Implementation details, metadata fields, teardown guarantees, and limitations live in `docs/orca-backend.md`.
20
+ `docs/verification/runtime-backends.md` "Orca" owns active smoke evidence.
21
+ Prefer the `bin/fm-*` helpers over raw `orca` commands.
22
+ Use raw `orca` only when the helper surface cannot answer the inspection question, and keep the recorded firstmate metadata as the task identity.
23
+
24
+ ## Preflight
25
+
26
+ Work from the current firstmate home or repo root.
27
+ If `FM_HOME` is set, remember that operational state lives under `$FM_HOME` while the helper scripts still run from this repo's `bin/`.
28
+
29
+ Before switching or spawning against Orca:
30
+
31
+ - Confirm Orca is intentionally selected through `--backend orca`, `FM_BACKEND=orca`, or local `config/backend`.
32
+ - Confirm the Orca app is running and the backend readiness checks pass before expecting spawn to work.
33
+ - Inspect active `state/*.meta` records before changing backend selection.
34
+ - Treat a backend switch as affecting future spawns only; existing tasks keep their recorded backend.
35
+ - Reconcile watcher wakes before unrelated work, especially if Orca tasks are already in flight.
36
+
37
+ ## Spawn
38
+
39
+ Use `bin/fm-spawn.sh` so firstmate creates the brief, worktree, terminal, metadata, status file, and watcher surface together.
40
+ Pass `--backend orca` for a one-off Orca task, or rely on the already-selected Orca backend when that selection is intentional.
41
+
42
+ After spawn, check the task with firstmate helpers:
43
+
44
+ - `bin/fm-peek.sh fm-<id>` for launch failures, trust dialogs, or first output.
45
+ - `state/<id>.meta` for `backend=orca`, `terminal=`, `orca_worktree_id=`, and `worktree=`.
46
+ - `bin/fm-crew-state.sh <id>` when the current run state matters.
47
+ - `bin/fm-watch.sh` whenever there are tasks in flight and this session owns supervision.
48
+
49
+ Do not manually create the Orca worktree or terminal for a normal firstmate task.
50
+ Do not manually patch metadata to make an externally-created Orca terminal look like a firstmate task.
51
+
52
+ ## Supervision
53
+
54
+ Use `bin/fm-peek.sh`, `bin/fm-send.sh`, `bin/fm-crew-state.sh`, and `bin/fm-teardown.sh` for routine operation.
55
+ For steer messages, use `bin/fm-send.sh <id> '...'`; the stable `fm-<id>` alias also works, and ordinary local text steers may contain newlines because they ride the durable inbox.
56
+ Keep initial scope in the task brief; a temporary file remains useful when the instruction includes supporting material the worker should inspect separately.
57
+
58
+ When supervising, treat `state/<id>.meta` as the routing record and Orca's own ids as backend implementation details.
59
+ The stable firstmate alias is `fm-<id>`.
60
+ The recorded `terminal=` and `orca_worktree_id=` fields are what backend helpers use under the hood.
61
+
62
+ If an ordinary steer fails to enqueue, or a typed-plane `fm-send` fails to submit, do not immediately repeat the instruction.
63
+ Read the reported failure and peek first, then decide whether the record exists or the target is busy, waiting on a prompt, stuck behind a popup, or genuinely wedged.
64
+ For harness-specific interrupts or exits, load `harness-adapters`.
65
+
66
+ ## Recovery
67
+
68
+ For a messy Orca-backed task:
69
+
70
+ 1. Read `state/<id>.meta` and the relevant status tail first.
71
+ 2. Confirm the task is actually Orca-backed before using Orca-specific assumptions.
72
+ 3. Use the recorded `terminal=`, `orca_worktree_id=`, and `worktree=` as the task identity.
73
+ 4. Prefer firstmate helpers for peek, send, state, and teardown.
74
+ 5. Avoid raw deletion of Orca worktrees or manual branch cleanup.
75
+ 6. Stop and inspect if the recorded worktree path, Orca worktree id, or project checkout no longer matches expectations.
76
+
77
+ Teardown remains governed by the normal firstmate landing rules.
78
+ Scout work can be torn down after the report exists and the `captain-hold-lifecycle` completion gate passes.
79
+ Ship work can be torn down only after the work is landed by its project mode.
80
+
81
+ ## Smoke Test
82
+
83
+ Keep Orca smoke tests focused on lifecycle plumbing:
84
+
85
+ 1. Select Orca intentionally for a disposable task or scout.
86
+ 2. Spawn through `bin/fm-spawn.sh`.
87
+ 3. Confirm metadata records the Orca backend, terminal, Orca worktree id, and isolated worktree path.
88
+ 4. Verify `bin/fm-peek.sh`, a short `bin/fm-send.sh` steer, watcher wake behavior, and `bin/fm-crew-state.sh`.
89
+ 5. Tear down through `bin/fm-teardown.sh` after the task is safely disposable or landed.
90
+ 6. Restore the previous backend selection if Orca was selected only for the smoke test.
91
+
92
+ Do not mix a backend smoke test with unrelated feature work.