Skip to content

feat(bin): run crewmates and scouts on Kiro CLI - #4679

Closed
Marsjohn-11 wants to merge 39 commits into
kunchenguid:mainfrom
Marsjohn-11:fm/kiro-adapter-pipeline-r2
Closed

Marsjohn-11 wants to merge 39 commits into
kunchenguid:mainfrom
Marsjohn-11:fm/kiro-adapter-pipeline-r2

Conversation

@Marsjohn-11

@Marsjohn-11 Marsjohn-11 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Intent

The captain asked for kiro-cli support so the fleet can run crewmates and scouts on it, and
ruled: build against the CURRENT engine now rather than the newer one, because a shipped engine with
working hooks beats a promised one. The newer engine is out of scope entirely - it is unsupported on
the machine that could test it, and an earlier survey's behavioural findings about it were withdrawn.

The adapter is ALREADY WRITTEN AND VERIFIED by another worker on the Linux desk, which is where the
real tool lives. It is not yours to design or extend. It covers the crewmate/scout tier only - not
primary, not secondmate - and spans the harness resolver, spawn, busy-state, composer, control and
teardown, plus the harness-adapters router, a per-harness reference page, a verification doc, a
portable regression test and a live guard.

That worker reported its own local green as a CLAIM, not a verdict, and asked for this pipeline to be
the authority. Its evidence: 19 of 19 portable tests, shellcheck clean, lint clean, and the live
guard passing against the real tool - both per-turn hooks, the busy footer, interrupt, exit and
resume. It re-ran the live guard after rebasing, because the rebase absorbed someone else's refactor
of the harness resolver and that is exactly the drift that changes real launch behaviour while unit
tests stay green.

ONE DESIGN TRADEOFF THE CAPTAIN WILL SEE AT REVIEW, already decided and documented: the tool's agent
selection is name-only, so there is no single-file config pointer like the one another harness uses.
The per-task config is reached by relocating the tool's whole home into this repo's state directory,
never into the disposable worktree. The cost is that a worker on this harness does NOT inherit the
operator's globally configured MCP servers or skills. That tradeoff is FORCED rather than chosen -
the only alternative writes config into a project checkout, which is a hard boundary - and it is
recorded as present-tense fact in the reference page. Do not revisit it.

What Changed

  • Adds kiro (Kiro CLI, V2 engine) as a verified crewmate/scout harness across the whole dispatch path: harness detection anchors the kiro-cli foreground name, fm-spawn.sh builds the chat --agent-engine v2 --agent firstmate --trust-all-tools launch, fm-busy-lib.sh records state from a kiro-hook userPromptSubmit/stop pair, fm-control-lib.sh gets its Escape//quit mechanics and wiring paths, and crew_dispatch_validate accepts it. A --secondmate launch on kiro is refused, as it already is for muse, gemini, and agy.
  • Because kiro selects agents by name only, the spawn relocates KIRO_HOME to a firstmate-owned per-task home at state/<id>.kiro-home, holding the generated agent config, the two hook scripts, and a seeded chat.disableTrustAllConfirmation, so nothing is written into the worktree's own .kiro/ and the operator's ~/.kiro is untouched — the documented cost is that a kiro worker does not inherit globally configured MCP servers or skills. Spawn also validates --model against kiro-cli --list-models (failing open with a notice when the listing is unreachable) and refuses before launch when the per-task home path contains whitespace, since a hook command must be a single unquoted token; teardown removes the home recursively.
  • The composer ghost-text stripper now gives a near-achromatic foreground a higher luminance ceiling via the new FM_COMPOSER_GHOST_GRAY_LUMA_MAX (180) and FM_COMPOSER_GHOST_GRAY_SPREAD_MAX (12) knobs, covering both truecolor grays and the xterm 232-255 palette ramp, so kiro's and rovo's gray placeholders read empty instead of deferring steers forever while chromatic real glyphs stay kept. Ships with a portable regression suite (tests/fm-kiro-harness.test.sh), a live guard (tests/fm-kiro-signals-live-e2e.test.sh), new composer fixtures, a per-harness reference page, and docs/verification/kiro.md.

Risk Assessment

⚠️ Medium: The kiro adapter itself is well-bounded, mirrors the established gemini/agy patterns, and adds no reachable behavior outside harness=kiro, but it also widens a shared fleet-wide default - fm_composer_strip_ghost's near-achromatic ceiling from 128 to 180 plus new 256-colour greyscale testing - on the strength of four measured colour samples, which changes composer classification for every harness and leaves a 27-point margin to rovo's real typed text; that widening is already recorded as separately authorized above this run, so it is a follow-up concern rather than a merge blocker.

Testing

Ran the three test files this change touches as the baseline (kiro harness 21/21, composer 38/38, busy adapter wiring 15/15), then drove the adapter itself against a real kiro-cli 2.22.1-nightly.4 worker in real tmux panes on macOS rather than stopping at the suite. A real spawn launched the vendor tool with the verified V2 command and a per-task KIRO_HOME under state/, never touching the worktree's own .kiro/; the V2 hooks carried the busy record through busy→idle with the turn-end touch; the rendered footer acknowledged the submit while the idle row did not; a steer through fm-send.sh landed and came back acknowledged in handled/; Escape preserved the adapter-owned record exactly as the documented gap describes; /quit exited with kiro's resume line. The composer change reproduced as a genuine regression on the same live capture — base reads pending, target reads empty — and I captured that visually as rendered HTML plus screenshots since this is a colour-driven terminal surface. All four refusal guards fired live, the unlisted-model one against the real vendor catalog. Two scenarios are not live results. The near-gray ghost-ceiling boundary sweep ran through the shipped library function on measured colour values and through the unit suite, never against a running pane, so it is reported untested at the live bar even though the kiro colour in it was separately proven on a live pane. And a worker's own harness self-identification could not be driven at all: this host's toolbox install runs kiro's tool commands inside the aim sandbox, which denies /bin/ps outright, so the ancestry probe cannot execute and the result here says nothing about the arm; it needs an Amazon Linux 2 host with an unsandboxed kiro-cli 2.21.x. I recorded the macOS observation as an informational note rather than a defect because the change already scopes macOS out of its verified record.

  • Live validation: ✅ go - 12 of 14 scenarios driven live against the product
Scenario Result Live Evidence
Spawning a kiro crewmate launches the real kiro-cli with the verified V2 command and a per-task home outside the worktree ✅ pass live bin/fm-spawn.sh … --harness kiro --model claude-haiku-4.5 --effort xhigh emitted `KIRO_HOME=<state>/<id>.kiro-home … kiro-cli chat --agent-engine v2 --agent firstmate --model 'claude-haiku-4.5' --ef…
A turn opening and closing moves the fleet's busy record through kiro's real V2 hooks and touches the turn-end marker ✅ pass live Live record went state=busy source=kiro-hook event=user-prompt-submit on submit and state=idle source=kiro-hook event=stop at turn end, with state/&lt;id&gt;.turn-ended touched; fm_busy_classify rep…
The rendered Kiro is working footer acknowledges a landed submit while kiro's idle row does not, and agy's bare esc-to-cancel cannot fake one ✅ pass live fm_busy_lines_match kiro acknowledged the live busy capture, gave no acknowledgement on the live idle capture, and rejected a bare esc to cancel row. kiro-ghost-ceiling-boundary.txt
An idle kiro composer reads empty rather than pending, so a steer is not deferred forever ✅ pass live On the identical live capture at the live cursor row, base 795e5e4 classified pending and target f01f924 classified empty; the real placeholder is drawn ESC[38;5;241m (xterm greyscale ramp) and…
A steer sent through fm-send.sh reaches a live idle kiro worker and the worker acknowledges it ✅ pass live bin/fm-send.sh &lt;id&gt; &#34;steer probe: reply with STEERED…&#34; exited 0, the pane showed Kiro is working, the userPromptSubmit hook re-opened the record at seq=11, and the inbox record ended at `state/<id…
Escape interrupts a running kiro turn and preserves the adapter-owned busy record (kiro fires no stop hook there) ✅ pass live Record before Escape state=busy … event=user-prompt-submit seq=4; after Escape the pane returned to its idle placeholder and the record was byte-identical, matching `fm_control_interrupt_ack_source…
/quit exits a kiro worker and prints kiro's resume line ✅ pass live Sending fm_control_exit_command kiro (/quit) ended the session: the pane printed Session ended. Resume with: kiro-cli --resume-id 97d9111e-… and the foreground process left kiro-cli. kiro-live-p…
Adversarial: a --model the real vendor catalog does not list refuses the spawn before any pane or state exists ✅ pass live Against the authenticated real kiro-cli chat --agent-engine v2 --list-models -f json, --model no-such-model exited 1 with `error: kiro model 'no-such-model' is not listed by 'kiro-cli --list-model…
Adversarial: an unreachable model listing establishes nothing and launches unvalidated instead of refusing every spawn ✅ pass live With the probe running under a HOME carrying no kiro sign-in, the real listing did not answer inside the bound and the spawn printed `notice: 'kiro-cli --list-models' did not answer within 30s; launch…
Adversarial: a state path containing whitespace refuses the kiro spawn before any pane exists ✅ pass live Run against a state root under /private/tmp/fm-kiro-live/lab spaced/…, fm-spawn exited 1 naming the offending &lt;…&gt;/kiro-space.kiro-home path and armed nothing. kiro-spawn-guards-live.txt
Adversarial: a kiro secondmate launch is refused ✅ pass live bin/fm-spawn.sh --secondmate sm-kiro &lt;home&gt; kiro exited 1 with error: kiro is a verified crewmate/scout adapter only and cannot run a secondmate…. kiro-spawn-guards-live.txt
Teardown removes the per-task kiro home so no firstmate-owned kiro config outlives the task ✅ pass live bin/fm-teardown.sh &lt;id&gt; --force exited 0 and state/&lt;id&gt;.kiro-home went from present to No such file or directory. kiro-spawn-guards-live.txt item 6
Adversarial: the raised near-gray ghost ceiling does not swallow real input — rovo's real text, muse's chromatic glyph, and palette indexes outside the 232-255 ramp all survive ⏸️ untested no The prior payload did not establish a live result for this scenario. The boundary sweep was driven through the shipped fm_composer_strip_ghost library function on measured colour values and through…
A kiro crewmate identifies its own harness as kiro by ancestry rather than being renamed by an inherited foreign marker ⏸️ untested no This host's toolbox install runs kiro's tool commands inside the aim sandbox, which denies /bin/ps (Operation not permitted, rc 126; ps -A returns zero rows), so the ancestry probe the detection a…
Evidence: Same composer evidence as rendered HTML with the real ANSI colours

Source: Same composer evidence as rendered HTML with the real ANSI colours

<!doctype html><meta charset="utf-8"><title>Kiro CLI idle composer: the placeholder is ghost text now, so a steer lands</title><style>body{background:#0d1117;color:#d8dee9;font:13px/1.45 "SF Mono",Menlo,monospace;padding:24px}h1{font:600 15px/1.4 -apple-system,system-ui,sans-serif;color:#e6edf3;margin:0 0 4px}p.note{font:12px/1.5 -apple-system,system-ui,sans-serif;color:#8b949e;margin:0 0 18px;max-width:70em}pre{background:#010409;border:1px solid #21262d;border-radius:6px;padding:14px 16px;overflow-x:auto;margin:0 0 20px}h2{font:600 12px/1.4 -apple-system,system-ui,sans-serif;color:#8b949e;text-transform:uppercase;letter-spacing:.06em;margin:0 0 8px}</style><h1>Kiro CLI idle composer: the placeholder is ghost text now, so a steer lands</h1><p class="note">Captured live from a real <code>kiro-cli 2.22.1-nightly.4</code> crewmate pane launched by <code>bin/fm-spawn.sh</code> on macOS. Kiro draws its idle placeholder in the xterm-256 greyscale ramp (<code>ESC[38;5;241m</code>). Before this change the 256-colour path was never luminance-tested, so the placeholder survived stripping and the composer read <b>pending</b> - firstmate then skipped the doorbell and the steer deferred. After the change the ramp is tested, the placeholder strips to the bare agent glyph, and the composer reads <b>empty</b>.</p><h2>1. Live pane, real kiro-cli, as the operator sees it</h2><pre>  decisions, and tradeoffs are specification, not captain intent.
  The Definition of done&#x27;s rule that `--intent` must be self-sufficient still
  governs the string you pass: resolve any report, decision, or PR the intent
  below refers to into its substance rather than passing the pointer.

  ## Captain intent authorized for --intent
  Reply with exactly the single word ACK and then stop. Do not call any tools,
  do not read or write files.

<span style="color:#5f8787">•</span> ACK

<span style="color:#808080">▸</span> <span style="color:#808080">Credits: 0.01 • Time: 0s</span>

<span style="color:#eeeeee">────────────────────────────────────────────────────────────────────────────────
</span> <span style="color:#808000">Trust All Tools active, confirmations are off</span><span style="color:#808080"> · /quit to exit</span>
<span style="color:#eeeeee">────────────────────────────────────────────────────────────────────────────────
</span><span style="color:#d7af5f">firstmate</span> <span style="color:#808080">·</span> claude-haiku-4.5 <span style="color:#808080">·</span> <span style="color:#00af5f">◔</span> <span style="color:#00af5f">7%</span> <span style="color:#808080">·</span> <span style="color:#00af5f">Midway: 18h 38m</span>
<span style="color:#8700ff">/private/tmp/fm-kiro-live/lab-ok/case/wt</span> <span style="color:#808080">·</span> <span style="color:#808080">(</span>wt-live<span style="color:#808080">)</span>

›  <span style="color:#626262">ask a question or describe a task ↵</span>
                                                             <span style="color:#626262">/copy to clipboard</span>



</pre><h2>2. The composer row alone (raw, styled)</h2><pre>›  <span style="color:#626262">ask a question or describe a task ↵</span>
</pre><h2>3. fm_composer_strip_ghost at base 795e5e4 - placeholder survives -&gt; verdict pending</h2><pre>›  ask a question or describe a task ↵
</pre><h2>4. fm_composer_strip_ghost at target f01f924 - only the glyph remains -&gt; verdict empty</h2><pre>›  
</pre>
Evidence: Same lifecycle evidence as rendered HTML with the real ANSI colours

Source: Same lifecycle evidence as rendered HTML with the real ANSI colours

<!doctype html><meta charset="utf-8"><title>Kiro crewmate lifecycle, driven live end to end on macOS</title><style>body{background:#0d1117;color:#d8dee9;font:13px/1.45 "SF Mono",Menlo,monospace;padding:24px}h1{font:600 15px/1.4 -apple-system,system-ui,sans-serif;color:#e6edf3;margin:0 0 4px}p.note{font:12px/1.5 -apple-system,system-ui,sans-serif;color:#8b949e;margin:0 0 18px;max-width:70em}pre{background:#010409;border:1px solid #21262d;border-radius:6px;padding:14px 16px;overflow-x:auto;margin:0 0 20px}h2{font:600 12px/1.4 -apple-system,system-ui,sans-serif;color:#8b949e;text-transform:uppercase;letter-spacing:.06em;margin:0 0 8px}</style><h1>Kiro crewmate lifecycle, driven live end to end on macOS</h1><p class="note">A real <code>kiro-cli</code> worker launched by the exact command <code>bin/fm-spawn.sh</code> emitted (relocated <code>KIRO_HOME</code>, <code>--agent-engine v2 --agent firstmate --trust-all-tools --model claude-haiku-4.5 --effort xhigh</code>, brief as a positional prompt). The footer line firstmate's delivery guard matches is <code>Kiro is working</code>; the trust banner shows the seeded <code>chat.disableTrustAllConfirmation</code> suppressed kiro's confirmation modal.</p><h2>1. Turn open - brief auto-submitted, userPromptSubmit hook fired, busy footer rendered</h2><pre>                                                                                      <span style="color:#8700ff">https://kiro.dev/docs/cli/v3/</span>

                                                           Tip: Want a simpler, lighter-weight terminal with all the same features? Try <span style="color:#8700ff">/lite!</span>


<span style="color:#008080">●</span> Agent sandboxing is enabled — your AI agent receives short-lived, least-privilege AWS credentials instead of direct access to your ~/.aws directory. Learn more:
  https://w.amazon.com/bin/view/BuilderTools/GenAIDevX/AgentSandboxing

<span style="color:#eeeeee">────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
</span>  ⁣FIRSTMATE_OP: v1 launch-brief: # Current worker role contract                                                                                                                                        
  You are a crewmate: an autonomous worker agent managed by firstmate.
  This section establishes your current identity before every project or task instruction below and supersedes any conflicting role identity in those instructions.
  Do the assigned work yourself and report only to firstmate; do not adopt a firstmate or secondmate supervisor identity, delegate the task, run fleet supervision, or address the captain.
  Your steering inbox is `/tmp/fm-kiro-live/lab-ok/case/home/state/kiro-live-ok.inbox`; this exact path belongs to your current task even when it is outside the worktree or under the supervising
  firstmate home, so read and acknowledge its messages and do not reject it as another home&#x27;s state.
  Never inspect or change any other home&#x27;s endpoint namespace; this authorization is limited to the exact task paths named by this brief.
  When this task works on Firstmate itself, the repository root `AGENTS.md` (also imported by `CLAUDE.md`) is project content and the supervisor contract for the firstmate managing you: follow this
  brief instead of that supervisor contract.
  Project instructions still govern the work wherever they do not conflict with this worker identity, including `CONTRIBUTING.md` and `firstmate-coding-guidelines` for Firstmate changes.

  # Task
  ## Captain&#x27;s intent
  Reply with exactly the single word ACK and then stop. Do not call any tools, do not read or write files.

  ## Firstmate spec
  Reply with exactly the single word ACK and then stop.

  # Current no-mistakes intent contract
  This section supersedes every earlier brief instruction about constructing `--intent`, but not later clarifications actually supplied by the captain.
  Use everything under `## Captain intent authorized for --intent` through the end of this brief, including any nested subheadings but excluding that heading, plus any later words the captain actually
  supplied as `--intent`; never include Firstmate specification or other mixed Task content.
  Preserve those words without adding speaker labels or direct address.
  Firstmate-authored constraints, acceptance criteria, implementation details, decisions, and tradeoffs are specification, not captain intent.
  The Definition of done&#x27;s rule that `--intent` must be self-sufficient still governs the string you pass: resolve any report, decision, or PR the intent below refers to into its substance rather than
  passing the pointer.

  ## Captain intent authorized for --intent
  Reply with exactly the single word ACK and then stop. Do not call any tools, do not read or write files.

<span style="color:#5f8787">⣿</span> <span style="color:#5f8787">Thinking...</span><span style="color:#626262"> (esc to cancel)</span>

<span style="color:#eeeeee">────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
</span> <span style="color:#808000">Trust All Tools active, confirmations are off</span><span style="color:#808080"> · /quit to exit</span>
<span style="color:#eeeeee">────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
</span><span style="color:#d7af5f">firstmate</span> <span style="color:#808080">·</span> claude-haiku-4.5 <span style="color:#808080">·</span> <span style="color:#00af5f">◔</span> <span style="color:#00af5f">4%</span> <span style="color:#808080">·</span> <span style="color:#00af5f">Midway: 18h 41m</span>                                                                                               <span style="color:#8700ff">/private/tmp/fm-kiro-live/lab-ok/case/wt</span> <span style="color:#808080">·</span> <span style="color:#808080">(</span>wt-live<span style="color:#808080">)

</span>›  <span style="color:#626262">Kiro is working · Type to steer · Ctrl+S to queue</span>



</pre><h2>2. Turn closed - stop hook fired, idle placeholder back</h2><pre>

<span style="color:#008080">●</span> Agent sandboxing is enabled — your AI agent receives short-lived, least-privilege AWS credentials instead of direct access to your ~/.aws directory. Learn more:
  https://w.amazon.com/bin/view/BuilderTools/GenAIDevX/AgentSandboxing

<span style="color:#eeeeee">──────────────────────────────────────────────────────────────────────────

... [10776 bytes truncated] ...

──────────────────────────────────
</span> <span style="color:#808000">Trust All Tools active, confirmations are off</span><span style="color:#808080"> · /quit to exit</span>
<span style="color:#eeeeee">────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
</span><span style="color:#d7af5f">firstmate</span> <span style="color:#808080">·</span> claude-haiku-4.5 <span style="color:#808080">·</span> <span style="color:#00af5f">◔</span> <span style="color:#00af5f">7%</span> <span style="color:#808080">·</span> <span style="color:#00af5f">Midway: 18h 41m</span>                                                                                               <span style="color:#8700ff">/private/tmp/fm-kiro-live/lab-ok/case/wt</span> <span style="color:#808080">·</span> <span style="color:#808080">(</span>wt-live<span style="color:#808080">)

</span>›  <span style="color:#626262">ask a question or describe a task ↵</span>
                                                                                                                                                                                     <span style="color:#626262">/copy to clipboard</span>


</pre><h2>4. /quit exit with kiro&#x27;s resume line</h2><pre>  Your steering inbox is `/tmp/fm-kiro-live/lab-ok/case/home/state/kiro-live-ok.inbox`; this exact path belongs to your current task even when it is outside the worktree or under the supervising
  firstmate home, so read and acknowledge its messages and do not reject it as another home&#x27;s state.
  Never inspect or change any other home&#x27;s endpoint namespace; this authorization is limited to the exact task paths named by this brief.
  When this task works on Firstmate itself, the repository root `AGENTS.md` (also imported by `CLAUDE.md`) is project content and the supervisor contract for the firstmate managing you: follow this
  brief instead of that supervisor contract.
  Project instructions still govern the work wherever they do not conflict with this worker identity, including `CONTRIBUTING.md` and `firstmate-coding-guidelines` for Firstmate changes.

  # Task
  ## Captain&#x27;s intent
  Reply with exactly the single word ACK and then stop. Do not call any tools, do not read or write files.

  ## Firstmate spec
  Reply with exactly the single word ACK and then stop.

  # Current no-mistakes intent contract
  This section supersedes every earlier brief instruction about constructing `--intent`, but not later clarifications actually supplied by the captain.
  Use everything under `## Captain intent authorized for --intent` through the end of this brief, including any nested subheadings but excluding that heading, plus any later words the captain actually
  supplied as `--intent`; never include Firstmate specification or other mixed Task content.
  Preserve those words without adding speaker labels or direct address.
  Firstmate-authored constraints, acceptance criteria, implementation details, decisions, and tradeoffs are specification, not captain intent.
  The Definition of done&#x27;s rule that `--intent` must be self-sufficient still governs the string you pass: resolve any report, decision, or PR the intent below refers to into its substance rather than
  passing the pointer.

  ## Captain intent authorized for --intent
  Reply with exactly the single word ACK and then stop. Do not call any tools, do not read or write files.

• ACK

▸ Credits: 0.01 • Time: 1s
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  please count slowly from 1 to 200, one number per line

• 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 Trust All Tools active, confirmations are off · /quit to exit
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
firstmate · claude-haiku-4.5 · ◔ 7% · Midway: 18h 40m                                                                                               /private/tmp/fm-kiro-live/lab-ok/case/wt · (wt-live)

› /quit
/quit    Quit the application
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 esc to cancel · ↵ to select




Session ended.
Resume with: kiro-cli --resume-id 97d9111e-e892-413f-8ac1-9dcbfedc60d1

</pre><h2>5. A steer through bin/fm-send.sh lands on the live worker</h2><pre>
• Acting on the message:

  STEERED

  Now I&#x27;ll move the handled file:
● Shell mv
  &#x27;/private/tmp/fm-kiro-live/lab-ok/case/home/state/kiro-live-ok.inbox/001.msg&#x27;
  &#x27;/private/tmp/fm-kiro-live/lab-ok/case/home/state/kiro-live-ok.inbox/handled/&#x27;

• Checking for additional messages:
◔ Shell
  esc to cancel

────────────────────────────────────────────────────────────────────────────────
 Trust All Tools active, confirmations are off · /quit to exit
────────────────────────────────────────────────────────────────────────────────
firstmate · claude-haiku-4.5 · ◔ 7% · Midway: 18h 36m
/private/tmp/fm-kiro-live/lab-ok/case/wt · (wt-live)

›  Kiro is working · Type to steer · Ctrl+S to queue



</pre>
Evidence: fm-spawn guards driven live against the real kiro-cli catalog, plus teardown

Source: fm-spawn guards driven live against the real kiro-cli catalog, plus teardown

bin/fm-spawn.sh guards, driven live against the REAL kiro-cli 2.22.1-nightly.4
model catalog on macOS (no stub listing).

1. Requested model absent from the real listing -> spawn refuses, nothing armed.
   $ fm-spawn.sh kiro-live-badauth <proj> --harness kiro --model no-such-model
   error: kiro model 'no-such-model' is not listed by 'kiro-cli --list-models';
          choose a listed model_id or omit --model
   exit 1; state/ holds no <id>.kiro-home, no <id>.busy-gen, no <id>.meta.

2. Requested model present in the real listing -> spawn launches with it.
   $ fm-spawn.sh kiro-live-ok <proj> --harness kiro --model claude-haiku-4.5 --effort xhigh
   env -u CURSOR_AGENT -u CURSOR_INVOKED_AS -u GEMINI_CLI env -u CLAUDECODE \
     -u PI_CODING_AGENT -u GROK_AGENT -u FM_PI_HARNESS \
     KIRO_HOME='<state>/kiro-live-ok.kiro-home' '<bin>/kiro-cli' \
     chat --agent-engine v2 --agent firstmate --model 'claude-haiku-4.5' \
     --effort 'xhigh' --trust-all-tools "$(fm-operational-input.sh encode launch-brief < <brief>)"
   exit 0; the worktree's own .kiro/ was never created.

3. Unreachable listing establishes nothing -> launches unvalidated with a notice
   (observed for real when the probe ran under a HOME with no kiro sign-in):
   notice: 'kiro-cli --list-models' did not answer within 30s; launching with
           --model 'no-such-model' unvalidated

4. A state path containing whitespace refuses before any pane exists.
   error: kiro hook scripts would live under '/private/tmp/fm-kiro-live/lab spaced/
          case/home/state/kiro-space.kiro-home', whose path contains whitespace;
          kiro hook commands must be a single unquoted token, so point FM_HOME or
          FM_STATE_OVERRIDE at a whitespace-free path
   exit 1.

5. A kiro secondmate is refused.
   $ fm-spawn.sh --secondmate sm-kiro <home> kiro
   error: kiro is a verified crewmate/scout adapter only and cannot run a
          secondmate; it has no primary supervision protocol. Select a harness
          verified for secondmates.
   exit 1.

6. bin/fm-teardown.sh removes the per-task home.
   before: <state>/kiro-live-ok.kiro-home exists
   after:  No such file or directory      (teardown exit 0)
Evidence: Ghost-ceiling boundary and delivery-footer scoping against the live panes

Source: Ghost-ceiling boundary and delivery-footer scoping against the live panes

fm_composer_strip_ghost boundary, shipped bin/fm-composer-lib.sh (f01f924).
'<stripped>' = treated as ghost furniture; 'TEXT' = kept as real input.

kiro truecolor ghost    luma 158 spread 0        -> <stripped>
rovo ghost              luma 163 spread 3        -> <stripped>
rovo REAL text          luma 207 spread 4        -> TEXT
muse REAL glyph         luma 150 spread 165      -> TEXT
palette 241  greyscale ramp, level 98            -> <stripped>
palette 247  greyscale ramp, level 158           -> <stripped>
palette 253  greyscale ramp, level 218 (too bright) -> TEXT
palette 145  6x6x6 grey diagonal (untested by design) -> TEXT
palette 110  chromatic (untested by design)      -> TEXT
palette 7    theme-remapped (untested by design) -> TEXT

Delivery footer scoping, checked against the LIVE captured kiro panes:
  kiro-live-pane-busy.ansi       -> acknowledges a submit
  kiro-live-pane-idle.ansi       -> no acknowledgement
  agy bare "esc to cancel"       -> no acknowledgement
Evidence: Harness self-identification probe from inside a live kiro worker (sandbox denies /bin/ps)

Source: Harness self-identification probe from inside a live kiro worker (sandbox denies /bin/ps)

Harness self-identification probed from INSIDE a live kiro-cli worker (macOS,
toolbox install of kiro-cli 2.22.1-nightly.4).

bin/fm-harness.sh detects kiro by ancestry: it walks up to eight parents and
matches `ps -o comm=` exactly against `kiro-cli`. On this host that probe cannot
run at all - kiro executes tool commands inside the aim sandbox, which denies
/bin/ps:

  harness_verdict=unknown
  harness_ancestry=
  self_pid=69612 ppid=69588
  /bin/ps: Operation not permitted        (ps -o comm= -p $$      -> rc 126)
  ps_total_lines=0                        (ps -A                  -> 0 rows)
  /bin/ps: Operation not permitted        (ps -o comm= -p $PPID   -> rc 126)

With an inherited CLAUDECODE=1 in that same sandbox the marker is then the only
evidence there is, so the worker reports `claude`:

  $ CLAUDECODE=1 bin/fm-harness.sh   ->  claude

Seen from OUTSIDE the sandbox the process tree does carry the anchored name the
arm looks for, so the arm's logic is not what fails here:

  pane_current_command=toolbox-exec
  62799 57178 ~/.toolbox/bin/kiro-cli
  62873 62799 aim
  62941 62873 .../aim/1.0.5917.0/sandbox/launcher
  66147 62941 .../kiro-cli/2.22.1-nightly.4-nightly/Kiro CLI.app/Contents/MacOS/kiro-cli
  67105 66147 .../Kiro CLI.app/Contents/MacOS/kiro-cli-chat
  67390 67105 toolbox

Two macOS-only deviations from what the adapter's comments record as verified on
Amazon Linux 2 / kiro-cli 2.21.4:
  - tmux #{pane_current_command} reports `toolbox-exec`, not `kiro-cli`.
  - the sandbox denies /bin/ps to tool commands, so no in-worker ancestry read
    can succeed.
Neither is reachable on a host where kiro-cli runs unsandboxed, which is the
platform the adapter's record covers.
Evidence: Live pane captures with ANSI styling: busy, idle, interrupted, after /quit, steer delivered

Source: Live pane captures with ANSI styling: busy, idle, interrupted, after /quit, steer delivered

                                                                                      ^[[38;5;93mhttps://kiro.dev/docs/cli/v3/^[[39m

                                                           ^[[1mTip: ^[[0mWant a simpler, lighter-weight terminal with all the same features? Try ^[[38;5;93m/lite!^[[39m


^[[36m●^[[39m Agent sandboxing is enabled — your AI agent receives short-lived, least-privilege AWS credentials instead of direct access to your ~/.aws directory. Learn more:
  https://w.amazon.com/bin/view/BuilderTools/GenAIDevX/AgentSandboxing

^[[38;5;255m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
^[[39m^[[48;5;255m  ⁣FIRSTMATE_OP: v1 launch-brief: # Current worker role contract                                                                                                                                        ^[[49m
^[[48;5;255m  You are a crewmate: an autonomous worker agent managed by firstmate.
  This section establishes your current identity before every project or task instruction below and supersedes any conflicting role identity in those instructions.
  Do the assigned work yourself and report only to firstmate; do not adopt a firstmate or secondmate supervisor identity, delegate the task, run fleet supervision, or address the captain.
  Your steering inbox is `/tmp/fm-kiro-live/lab-ok/case/home/state/kiro-live-ok.inbox`; this exact path belongs to your current task even when it is outside the worktree or under the supervising
  firstmate home, so read and acknowledge its messages and do not reject it as another home's state.
  Never inspect or change any other home's endpoint namespace; this authorization is limited to the exact task paths named by this brief.
  When this task works on Firstmate itself, the repository root `AGENTS.md` (also imported by `CLAUDE.md`) is project content and the supervisor contract for the firstmate managing you: follow this
  brief instead of that supervisor contract.
  Project instructions still govern the work wherever they do not conflict with this worker identity, including `CONTRIBUTING.md` and `firstmate-coding-guidelines` for Firstmate changes.

  # Task
  ## Captain's intent
  Reply with exactly the single word ACK and then stop. Do not call any tools, do not read or write files.

  ## Firstmate spec
  Reply with exactly the single word ACK and then stop.

  # Current no-mistakes intent contract
  This section supersedes every earlier brief instruction about constructing `--intent`, but not later clarifications actually supplied by the captain.
  Use everything under `## Captain intent authorized for --intent` through the end of this brief, including any nested subheadings but excluding that heading, plus any later words the captain actually
  supplied as `--intent`; never include Firstmate specification or other mixed Task content.
  Preserve those words without adding speaker labels or direct address.
  Firstmate-authored constraints, acceptance criteria, implementation details, decisions, and tradeoffs are specification, not captain intent.
  The Definition of done's rule that `--intent` must be self-sufficient still governs the string you pass: resolve any report, decision, or PR the intent below refers to into its substance rather than
  passing the pointer.

  ## Captain intent authorized for --intent
  Reply with exactly the single word ACK and then stop. Do not call any tools, do not read or write files.
^[[49m
^[[38;5;66m⣿^[[39m ^[[38;5;66mThinking...^[[38;5;241m (esc to cancel)^[[39m

^[[38;5;255m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
^[[39m ^[[33mTrust All Tools active, confirmations are off^[[38;5;244m · /quit to exit^[[39m
^[[38;5;255m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
^[[38;5;179mfirstmate^[[39m ^[[38;5;244m·^[[39m claude-haiku-4.5 ^[[38;5;244m·^[[39m ^[[38;5;35m◔^[[39m ^[[38;5;35m4%^[[39m ^[[38;5;244m·^[[39m ^[[38;5;35mMidway: 18h 41m^[[39m                                                                                               ^[[38;5;93m/private/tmp/fm-kiro-live/lab-ok/case/wt^[[39m ^[[38;5;244m·^[[39m ^[[38;5;244m(^[[39mwt-live^[[38;5;244m)

^[[39m›  ^[[38;5;241mKiro is working · Type to steer · Ctrl+S to queue^[[39m
Evidence: Base-vs-target composer verdict on the identical live vendor capture
BASE(795e5e4) caps=tmux cy=19 -> pending
TARGET(f01f924) caps=tmux cy=19 -> empty

live row: ESC[39m› ESC[38;5;241mask a question or describe a task ↵ESC[39m
base strip: › ask a question or describe a task ↵ (survives -> pending)
target strip: › (ghost -> empty)
- Outcome: ⚠️ 1 info across 1 run (28m38s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 infos
  • ℹ️ bin/fm-control-lib.sh:265 - Comment states a fact the emitted artifacts contradict. The kiro arm's comment says the agent config's "two hook commands are generated scripts beside it under hooks/. All three carry the incarnation's gen, so all three are retired." Only two of the three carry it. bin/fm-spawn.sh:3905-3917 embeds --gen $BUSY_GEN (via busy_suffix) into the two hook SCRIPTS, but the agent config it writes at bin/fm-spawn.sh:3919 is {&#34;name&#34;:&#34;firstmate&#34;,...,&#34;hooks&#34;:{&#34;userPromptSubmit&#34;:[{&#34;command&#34;:&#34;&lt;k_submit path&gt;&#34;}],&#34;stop&#34;:[{&#34;command&#34;:&#34;&lt;k_stop path&gt;&#34;}]}} - two bare absolute paths and no gen anywhere. The real reason the config must be retired is that it NAMES the two scripts, so a survivor would point kiro at deleted files; the stated gen rationale is wrong and would mislead a maintainer weighing whether the config needs retiring at all (a gen-bearing artifact self-invalidates, a path-bearing one does not). Reword to say the two hook scripts carry the gen and the config is retired because it names them.
  • ℹ️ bin/fm-spawn.sh:1674 - FM_KIRO_MODELS_TIMEOUT is a new operator-facing knob with no documentation anywhere. Its sibling FM_AGY_MODELS_TIMEOUT - identical code, identical clamp - is documented at docs/verification/agy.md:87 including the default and the non-positive-clamps-back semantics. FM_KIRO_MODELS_TIMEOUT appears only in bin/fm-spawn.sh:1674 and tests/fm-kiro-harness.test.sh; docs/verification/kiro.md's "Model and effort" section and the reference page's Model row both say the probe "runs stdin-detached under the shared hard bound" without naming the knob or its 15s default, so an operator hitting a slow --list-models on a cold link has no discoverable way to raise the bound. Add the one sentence to docs/verification/kiro.md matching agy.md's wording.
⚠️ **Test** - 1 info
  • ℹ️ bin/fm-harness.sh:242 - Evidence note for the reviewer, no code action. Two macOS-only deviations from what the adapter's comments record as verified on Amazon Linux 2 / kiro-cli 2.21.4 showed up while driving the real tool here. First, tmux #{pane_current_command} reports toolbox-exec, not kiro-cli, on a toolbox install. Second, kiro runs tool commands inside the aim sandbox, which denies /bin/ps (Operation not permitted, rc 126, ps -A returns zero rows), so bin/fm-harness.sh's ancestry walk finds nothing and a kiro worker reports unknown — or claude, if a foreign CLAUDECODE is inherited, since the marker then becomes the only evidence. Seen from outside the sandbox the process tree does carry the anchored kiro-cli name the arm matches, so the arm's logic is not what fails. The change already scopes macOS out of its verified record (docs/verification/kiro.md records the auth precondition as Amazon Linux 2 only and macOS as unestablished), and the recorded decision on this branch accepts that the harness is unusable unattended there, so this reinforces an accepted limitation rather than introducing a new one. Flagging it only so the merge decision is made knowing the macOS gap is wider than auth alone. Evidence: no-mistakes/evidence/.../kiro-live-harness-detection.txt.
  • Live validation: ✅ go - 12 of 14 scenarios driven live against the product
Scenario Result Live Evidence
Spawning a kiro crewmate launches the real kiro-cli with the verified V2 command and a per-task home outside the worktree ✅ pass live bin/fm-spawn.sh … --harness kiro --model claude-haiku-4.5 --effort xhigh emitted `KIRO_HOME=<state>/<id>.kiro-home … kiro-cli chat --agent-engine v2 --agent firstmate --model 'claude-haiku-4.5' --ef…
A turn opening and closing moves the fleet's busy record through kiro's real V2 hooks and touches the turn-end marker ✅ pass live Live record went state=busy source=kiro-hook event=user-prompt-submit on submit and state=idle source=kiro-hook event=stop at turn end, with state/&lt;id&gt;.turn-ended touched; fm_busy_classify rep…
The rendered Kiro is working footer acknowledges a landed submit while kiro's idle row does not, and agy's bare esc-to-cancel cannot fake one ✅ pass live fm_busy_lines_match kiro acknowledged the live busy capture, gave no acknowledgement on the live idle capture, and rejected a bare esc to cancel row. kiro-ghost-ceiling-boundary.txt
An idle kiro composer reads empty rather than pending, so a steer is not deferred forever ✅ pass live On the identical live capture at the live cursor row, base 795e5e4 classified pending and target f01f924 classified empty; the real placeholder is drawn ESC[38;5;241m (xterm greyscale ramp) and…
A steer sent through fm-send.sh reaches a live idle kiro worker and the worker acknowledges it ✅ pass live bin/fm-send.sh &lt;id&gt; &#34;steer probe: reply with STEERED…&#34; exited 0, the pane showed Kiro is working, the userPromptSubmit hook re-opened the record at seq=11, and the inbox record ended at `state/<id…
Escape interrupts a running kiro turn and preserves the adapter-owned busy record (kiro fires no stop hook there) ✅ pass live Record before Escape state=busy … event=user-prompt-submit seq=4; after Escape the pane returned to its idle placeholder and the record was byte-identical, matching `fm_control_interrupt_ack_source…
/quit exits a kiro worker and prints kiro's resume line ✅ pass live Sending fm_control_exit_command kiro (/quit) ended the session: the pane printed Session ended. Resume with: kiro-cli --resume-id 97d9111e-… and the foreground process left kiro-cli. kiro-live-p…
Adversarial: a --model the real vendor catalog does not list refuses the spawn before any pane or state exists ✅ pass live Against the authenticated real kiro-cli chat --agent-engine v2 --list-models -f json, --model no-such-model exited 1 with `error: kiro model 'no-such-model' is not listed by 'kiro-cli --list-model…
Adversarial: an unreachable model listing establishes nothing and launches unvalidated instead of refusing every spawn ✅ pass live With the probe running under a HOME carrying no kiro sign-in, the real listing did not answer inside the bound and the spawn printed `notice: 'kiro-cli --list-models' did not answer within 30s; launch…
Adversarial: a state path containing whitespace refuses the kiro spawn before any pane exists ✅ pass live Run against a state root under /private/tmp/fm-kiro-live/lab spaced/…, fm-spawn exited 1 naming the offending &lt;…&gt;/kiro-space.kiro-home path and armed nothing. kiro-spawn-guards-live.txt
Adversarial: a kiro secondmate launch is refused ✅ pass live bin/fm-spawn.sh --secondmate sm-kiro &lt;home&gt; kiro exited 1 with error: kiro is a verified crewmate/scout adapter only and cannot run a secondmate…. kiro-spawn-guards-live.txt
Teardown removes the per-task kiro home so no firstmate-owned kiro config outlives the task ✅ pass live bin/fm-teardown.sh &lt;id&gt; --force exited 0 and state/&lt;id&gt;.kiro-home went from present to No such file or directory. kiro-spawn-guards-live.txt item 6
Adversarial: the raised near-gray ghost ceiling does not swallow real input — rovo's real text, muse's chromatic glyph, and palette indexes outside the 232-255 ramp all survive ⏸️ untested no The prior payload did not establish a live result for this scenario. The boundary sweep was driven through the shipped fm_composer_strip_ghost library function on measured colour values and through…
A kiro crewmate identifies its own harness as kiro by ancestry rather than being renamed by an inherited foreign marker ⏸️ untested no This host's toolbox install runs kiro's tool commands inside the aim sandbox, which denies /bin/ps (Operation not permitted, rc 126; ps -A returns zero rows), so the ancestry probe the detection a…
  • bash tests/fm-kiro-harness.test.sh — 21/21 ok, drives the real fm-spawn.sh/fm-teardown.sh/fm-harness.sh
  • bash tests/fm-composer-lib.test.sh — 38/38 ok, including the two new near-gray and palette-grey ghost cases
  • bash tests/fm-busy-adapter-wiring.test.sh — 15/15 ok, including the three kiro hook-lifecycle cases that execute the generated hook scripts directly
  • Live: bin/fm-spawn.sh &lt;id&gt; &lt;proj&gt; --harness kiro --model claude-haiku-4.5 --effort xhigh against the real kiro-cli --list-models catalog, then the emitted launch command executed in a real tmux pane
  • Live: real kiro-cli worker turn open/close observed through state/&lt;id&gt;.busy-state (busy kiro-hook → idle kiro-hook) and state/&lt;id&gt;.turn-ended
  • Live: fm_busy_lines_match kiro against the captured busy and idle panes; fm_tmux_composer_state / fm_composer_classify_screen against the live idle pane
  • Live regression contrast: fm_composer_strip_ghost and fm_composer_classify_screen at base 795e5e4 (pending) vs target f01f924 (empty) on the identical live vendor capture
  • Live: bin/fm-send.sh &lt;id&gt; &#34;steer probe…&#34; to the idle kiro worker; inbox record ended in handled/ and the worker re-opened a turn
  • Live: Escape interrupt and /quit driven through the mechanics fm_control_interrupt_key / fm_control_exit_command report for kiro
  • Live adversarial: --model no-such-model against the real catalog, an unauthenticated (unreachable) listing, a state path containing whitespace, and --secondmate … kiro
  • Live: bin/fm-teardown.sh &lt;id&gt; --force removing state/&lt;id&gt;.kiro-home
  • fm_composer_strip_ghost boundary probe over the four measured colours plus greyscale-ramp, cube-diagonal, chromatic and theme-remapped palette indexes (library-level, not against a running pane)
⚠️ **Document** - 1 info
  • ℹ️ docs/verification/runtime-backends.md:553 - Judgment call, left unchanged per the recorded decision. Inside the dated 2026-09-15 codex entry, line 553 still infers that the starfield's "cells above the 128 ghost ceiling survive ghost stripping" - true on that date, false on this tree, because the near-achromatic ceiling this branch adds now strips every cell in that capture (which is exactly what the branch's own test comment and the corrected pointer at line 575-577 say). I did not edit it: the prior document round's user instruction was explicit that the dated live-run matrix records are historical observations and must keep saying what was seen on their date, and this sentence sits inside that record's before/after narrative. The present-tense truth is now stated three lines below it, so a reader is not left with only the stale claim. If the intent was narrower than I read it, the minimal repair is to time-scope line 553's inference ("at the time, the cells above the 128 ceiling survived") without touching the measured luminance range.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

First look on HEAD 2e507c8a080547325d4c042fa3af08a7243693ba (fork Marsjohn-11). Full thread + full tip diff reviewed. No .github/** edits. Authors not on blocked list. No workflow runs on this tip yet (mergeable CONFLICTING/DIRTY — forge has nothing to queue until rebase).

Attestation: MATCH (body head_sha binds tip).

Contract-class: new-default — (1) adds a full kiro crewmate/scout adapter surface; (2) raises fleet-wide near-achromatic composer ghost stripping via FM_COMPOSER_GHOST_GRAY_LUMA_MAX (default 180) + 256-colour grey ramp handling in bin/fm-composer-lib.sh, changing unconfigured empty/pending verdicts for near-gray placeholders (also affects existing adapters such as rovo). Not restore of a single specified broken default path alone; not purely opt-in because the composer ceiling is always-on once landed. Type specimen caution (#4627): new adapter + default-path behavior change is not auto-merge.

VISION.md per-rule

  • One captain, one interface: aligns in motive (more harness choice) but cannot-tell on noise until conflict-free tip + CI.
  • Authority explicit: aligns for spawn — --harness kiro / refuse as secondmate; composer default change is consent-by-merge not an explicit captain grant.
  • Scripts own mechanics: aligns — adapter wiring in scripts + portable/live tests claimed.
  • Restart is a non-event: aligns — per-task state/<id>.kiro-home teardown-owned.
  • Delegation with a spine: aligns — crewmate/scout only; no new task shape.
  • Fleet outlives vendors: aligns — another verified adapter; docs note AL2 auth gap on macOS.
  • Scope: aligns — harness adapter + verification docs.

Mergeability: CONFLICTING vs main 9f8ad95a (merge-base da5e6585). Overlap with main includes at least AGENTS.md, bin/fm-composer-lib.sh, bin/fm-spawn.sh, bin/fm-teardown.sh, bin/fm-bootstrap.sh, bin/fm-test-run.sh, composer tests, architecture/configuration/runtime-backends docs. Please rebase onto current main, renew attestation if HEAD moves, and re-push so CI/NM can run.

Outcome: waiting-author (conflicts). No workflow approval possible yet. Firstmate flag no while blocked on author rebase. Will not auto-merge (new-default).

@Marsjohn-11 Marsjohn-11 changed the title feat(bin): add Kiro CLI (kiro) as a crewmate/scout harness adapter feat(bin): run crewmates and scouts on Kiro CLI Sep 17, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Re-check after newer activity on HEAD d1c22118db59c33a6f374776c07e327a46b9170f (was 2e507c8a; author merged main + follow-up docs/tests). MERGEABLE/UNSTABLE. Attestation MATCH (body head_sha binds tip). No .github/** edits. Authors not on blocked list. Workflow approval this pass: no (CI/NM already ran).

CI / no-mistakes: Require no-mistakes 35172035868 SUCCESS. CI 35171933923 FAIL:

  • Test coverage guard: 27/175 portable serial scripts lack measured duration hints (includes new tests/fm-kiro-harness.test.sh / tests/fm-kiro-signals-live-e2e.test.sh) — refresh docs/fm-test-portable-shards.md from a green timing run.
  • Behavior portable parallel 1: tests/fm-test-run.test.sh exit=1 (same coverage-guard contract). Other portable/Herdr/lint/invariants green.

Contract-class: new-default (own verdict; tip vs main 795e5e4a). (1) Adds full kiro crewmate/scout adapter surface (harness/spawn/busy/composer/control/teardown + docs/tests) — new default-available harness path. (2) Fleet-wide composer change: new FM_COMPOSER_GHOST_GRAY_LUMA_MAX default 180 near-achromatic / 256-grey ramp strip in bin/fm-composer-lib.sh — unconfigured composer reads change for every harness, not kiro-only. Not restore: no concrete prior default path promised kiro + this ceiling; peace-of-mind framing does not convert new-default → restore.

VISION.md per-rule

  • One captain, one interface: aligns — adapter stays below deck; fewer false pending steers once ghost strip works.
  • Authority is explicit and never inferred: does not align for auto-merge — new harness + raised default ghost ceiling ship without an opt-in gate.
  • Scripts own the mechanics, agents own the judgment: aligns — adapter/scripts own detection and strip.
  • A restart is a non-event: aligns — no new chat-memory dependence.
  • Delegation with a spine: aligns — crewmate/scout contracts only; not primary/secondmate.
  • The fleet outlives any vendor: aligns — another verified harness; contracts to CLI semantics.
  • Scope: aligns — command/adapter layer, not workshop.

Security FYI: none material (no workflow RCE / fake pins). Composer strip is raise-only for near-gray — not escalated (CI still red; new-default not otherwise-ready).

Merge-eligible N — new-default never auto-merges; CI red. outcome=waiting-author. Firstmate-flag=no until green CI + CLEAN, then captain squash-merge vs opt-in redesign choice. Please fix coverage hints / portable parallel 1 and re-push.

Claude-shaped kiro-cli adapter (V2 engine only; v3/KAS out of scope,
unsupported on Amazon Linux 2). Ancestry detection on the anchored
process name kiro-cli in fm-harness.sh and liveness naming in
fm-agent-process-lib.sh; launch template in fm-spawn.sh carries the
brief positionally on --agent-engine v2 with --agent, --trust-all-tools,
model, and full low|medium|high|xhigh|max effort, plus reachable-catalog
model validation.

Turn-end and busy hooks (userPromptSubmit opens, stop closes and keeps
the turn-ended touch) live in a firstmate-owned per-task agent config
written under state/<id>.kiro-home/agents/firstmate.json and reached by
relocating KIRO_HOME, never the worktree's own .kiro/ (--agent is
name-only, so a config path is rejected); the same per-task home seeds
chat.disableTrustAllConfirmation to suppress the --trust-all-tools modal,
while auth in the XDG data dir is untouched. Two independent busy signals:
the kiro-hook record (primary) and the rendered Kiro is working footer
(fm-busy-lib.sh / fm-composer-lib.sh). Control mechanics in
fm-control-lib.sh (Escape interrupt, /quit exit, crewmate/scout-only
refusal, out-of-tree wiring retirement); teardown removes the per-task
home. Router entry and references/harness/kiro.md, dated
docs/verification/kiro.md, portable regression plus opt-in live drift
guard.

Verified live on kiro-cli 2.21.4 (V2): per-turn userPromptSubmit and
stop hooks, busy footer, single-Escape cancel, and /quit exit with its
resume-id line.
…fail"

This reverts commit 7092df1681802c2357f697d3194bbb9a4875f2eb.

That round strengthened three live-guard assertions at once and each
strengthening carried its own defect: the leading-glyph predicate compared
one byte and so rejected kiro's real composer row outside a UTF-8 locale,
the foreground-name predicate was added but never called by the guard, a
portable negative ended in `|| true` and asserted nothing, the resume-line
hard fail could redden on a healthy tool because a full-screen TUI exit
leaves no captured output, and the union settled-pane negative ran at a
settle point no tool call precedes, where the row it looks for cannot
appear.

The weaknesses it aimed at are real and are recorded as unproven instead,
along with the traps any future attempt has to avoid. Strengthening the
guard is separate work from adding the adapter.
The guard's resume-line check passes whether or not the resume line
appears, it never asserts the composer glyph, and its settled-pane
negative runs against a signature with no production caller. Record all
three as unproven rather than leaving the guard's header implying
otherwise, and record the union stale-row hazard as an inference from the
token list and delivery path - not an observation, since no run has been
seen doing it.

Also record the four traps that make strengthening those assertions its
own piece of work: byte-wise glyph matching breaks outside UTF-8, an
inline assertion leaves the portable negatives proving an unused
predicate, a trailing `|| true` swallows both outcomes, and a resume-line
check after exit can redden on a healthy tool.
The guard waits on real model turns, so its runtime is unbounded and a
step-capped agent invocation cannot contain it - one attempt spent 64
minutes across two invocations and died on a 30-minute cap without
reporting a result. Say so in its header, and say where a reader meets it
that the portable regression is what CI enforces and does not cover the
vendor-rendered surface, so a green suite is not evidence these signals
still work.
A validation run driving the real kiro-cli reports that the real idle kiro
composer classifies as pending rather than proven-empty, so fm-send never
types a steer into a kiro worker. Ten of its eleven live scenarios passed
and this was the one failure. Recorded as that run's observation, not as an
established fact, because it is not independently reproduced.

Two candidate causes are ruled out by measurement: restoring the absent
kiro entry to the fleet-wide idle-placeholder set changes no verdict, and
the bare composer row classifies unknown rather than pending, so the
verdict comes from the surrounding screen. A worker that cannot be steered
does not satisfy the crewmate contract, so this blocks using the adapter.
My earlier record said the real idle kiro composer classifies as unknown at
both styled and unstyled capture. That was measured with no capability
argument and a row carrying no dim escape codes, which is not a styled
capture, so the verdict was an artifact of the input. With the capabilities
a styled capture actually carries the styled row classifies empty, matching
the portable fixture, and the inference that the pending verdict came from
the surrounding screen rested on the bad measurement and is withdrawn.

What stands: restoring the absent kiro idle-placeholder entry changes no
verdict, re-tested with correct inputs. The fixture's empty result is
reproducible on its own input but is not confirmed faithful to the real
pane, since the live run measured pending there. Say that at both sites,
and mark the reference page's composer row as an open defect so an agent
handed it at spawn does not read empty as established.
…read empty

A real idle kiro composer classified as pending, and the doorbell defers on an
exact pending, so every steer to a kiro worker was skipped and the watcher
re-rang forever. The cause is a colour threshold, not anything kiro-specific:
kiro draws its placeholder in truecolor near-gray at luminance 158, above the
128 ghost ceiling, so the strip left it in place and it read as typed text.
rovo has the same defect at 162.9 and recorded it as an open gap needing a
harness-scoped signal the shared classifier does not carry.

Chromaticity is that signal, and it is intrinsic to the run, so nothing had to
be threaded through the shared composer entry points. A near-achromatic
truecolor run now gets a higher ceiling (default 180 within a channel spread of
12); anything more saturated keeps 128. That separates every measured case:
kiro's ghost at spread 0 and rovo's at spread 3 strip, rovo's real typed text
is near-gray but separated by luminance at 207.0 and is kept, and muse's real
glyph at spread 165 is unreachable by any luminance ceiling. Non-truecolor runs
are unchanged.

Verified two ways: the four measured cases are pinned and fail on pre-fix code,
with rovo's real text and muse's glyph as explicit non-regression assertions;
and a capture of a live kiro pane classified with tmux's own descriptor returns
empty where it returned pending. Fixes the recorded rovo gap in the same change.
The 256-colour fix reached further than authorized: it also treated the 6x6x6
cube diagonal as grey, and pinned that with a test asserting a cube index must
strip. Only the 232-255 greyscale ramp was approved, because that range alone
has RGB fixed by definition rather than by a theme, so it needs no palette
guessing. Narrow the predicate to the ramp and turn that test around into a
scope guard: an index outside 232-255 must be untouched. That case is what
stops the next widening into indices where palette dependence is real.

Record why the gap existed at all. The carve-out saying a 38;5 index is never
luminance-tested was written down, which made it checkable, and driving a real
crewmate on a pane without COLORTERM turned it from a footnote into a defect:
the fix worked on every truecolor pane and left the original failure fully live
everywhere else. A limit stated plainly can be tested against reality.
Upstream's codex 0.154 starfield fixture used near-gray cells incidentally, so
its non-vacuousness guard broke once the near-gray ghost ceiling stripped them.
Correct that guard and its comment to the present truth - the ceiling clears
both starfield rows - and re-express its divergence as a colour one, since
redrawing those positions as letters in a kept colour is what now proves the
verdict comes from the ghost strip.

The braille-furniture rule keeps its coverage in test_braille_furniture_rule,
built on chromatic cells (38;2;120;190;255, luminance 176.5, channel spread
135) that survive the strip at any gray ceiling, so the rule is proven by shape
rather than by a colour accident. The same cells as letters stay pending.
… this PR adds two portable-serial test scripts (tests/fm-kiro-harness.test.sh, tests/fm-kiro-signals-live-e2e.test.sh) with no duration hint in bin/fm-test-run.sh, taking the unmeasured serial share from 25/173 (14.5%) to 27/175 (15.4%), over PORTABLE_SERIAL_MAX_UNHINTED_PERCENT (15). That fails "Test coverage guard" directly, and tests/fm-test-run.test.sh (in "Behavior portable parallel 1") fails on the same guard call — its CI log ends immediately after the guard output with exit=1. Fix (smallest correct, evidence-based): - bin/fm-test-run.sh: added two lines to portable_serial_weight_hints with the durations measured by the green serial shards of the PR's own run 35171933923 — tests/fm-kiro-harness.test.sh 24667, tests/fm-kiro-signals-live-e2e.test.sh 76 (the live guard is gate-skipped in CI, so its value matches the existing 20-76 ms convention for other CI-skipped live-e2e scripts). - docs/fm-test-portable-shards.md: recorded the provenance of those two hints (one sample each, from run 35171933923, first run to include them) and stated plainly that the 76 ms is the gate-skip cost, not a measurement of the live guard's work. Verified locally: bin/fm-test-run.sh --check-coverage now prints FM_TEST_COVERAGE ok total=215 parallel=24 parallel_unhinted=0 serial=175 serial_shards=5 serial_unhinted=25 herdr=16. Running tests/fm-test-run.test.sh, all shard/hint assertions pass: "portable shard union, disjointness, and coverage guard hold", "portable parallel lanes are fully hinted and packed within 5% of each other", "portable serial shards are a deterministic disjoint cover of the serial lane", "coverage guard reports and bounds the unmeasured portable serial share"; "portable serial shard lanes refuse mismatched, out-of-range, and countless names" passes when run in isolation. Local-environment caveat (not a code defect, no change made for it): a full run of tests/fm-test-run.test.sh on this machine aborts in an unrelated later test with "mktemp: mkdtemp failed ... No space left on device" — the host data volume has ~275 MB free. That is host disk exhaustion, not the PR; the same test passes standalone. No other code, test, or behavior was changed; no new guards or machinery added
The wholesale KIRO_HOME relocation is recorded as the forced choice it is, but
the additive alternative sat in that sentence as a bare contrast with gemini.
Name it as follow-up work so a reader does not read the empty per-task home as
a harness limitation.
@Marsjohn-11
Marsjohn-11 force-pushed the fm/kiro-adapter-pipeline-r2 branch from 3a2bce2 to 9637826 Compare September 19, 2026 16:46
davidtandoh added a commit to davidtandoh/firstmate that referenced this pull request Sep 27, 2026
Bring fork main (2f9a106, the 2026-09-26 upstream sync plus fork
fixes #2-#6) into the Kiro V3 crew branch so PR #8 merges cleanly.
A merge, not a rebase, keeps the upstream PR kunchenguid#4679 merge and its
authorship intact.

Textual conflicts (1):

- bin/fm-test-run.sh, family_for_basename live-e2e list: this branch
  added fm-kiro-signals-live-e2e.test.sh on its own line; main added
  fm-herdr-agent-liveness-live-e2e.test.sh beside the version-floor
  test. Kept both entries, so both live tests stay classified in the
  live-harness-optin family.

Auto-merged files touched by both sides, checked by hand:

- bin/fm-spawn.sh: main's agy Opus --effort omission (fork fix #5)
  sits in the agy arm next to this branch's new kiro effort arm;
  effort_flag_for_harness keeps the (harness, effort, model)
  signature on both sides.
- agy.md, docs/configuration.md, docs/verification/runtime-backends.md:
  disjoint hunks.

Semantic review: the Kiro adapter adds no arm to bin/backends/herdr.sh
or fm_harness_pid_alive. Kiro reaches the fork's registration-
independent Herdr liveness (fork fix #3) through
fm_agent_process_classify_name, where kiro-cli classifies as agent.
It is worker-only, so it stays out of the primary session-lock
harness table.

Claude-Session: https://claude.ai/code/session_01B4Krq5gHjEPXbmzMaaeTHs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants