Skip to content

fix(bin): allocate Treehouse copies from a per-home pool root and refuse other clones' slots - #7464

Open
yasuhito wants to merge 10 commits into
kunchenguid:mainfrom
yasuhito:fm/firstmate-project-scoped-pool-routing-v1
Open

yasuhito wants to merge 10 commits into
kunchenguid:mainfrom
yasuhito:fm/firstmate-project-scoped-pool-routing-v1

Conversation

@yasuhito

@yasuhito yasuhito commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Intent

QA2 #2081 の担当起動で、QA2担当のプロジェクトとは別のMain側QA2から作られたコピーが割り当てられ、安全確認で拒否された。Firstmate側で正しいコピーを選び、取り違えを変更前に検出する修正を実装し、上流へ修正PRを出すところまで進めてよいか、という確認への回答: ok
根拠は QA2 #2081 pool mismatch 診断レポート。GitHub originが同じでも2つのcloneのGit common directoryは異なり、割当コピーはMain側に登録されていた。現行の早い隔離判定ではこの不一致が通り、所有確認がfalseでも拒否せず、base refresh後のClaude trust判定で拒否された。
レポートの内容: secondmate home の QA2 clone (projects/qa2) と primary home の QA2 clone は同じ origin https://github.com/qniapp/qa2.git を持つが Git common directory が異なる。secondmate からの ship spawn で plain treehouse get が default Treehouse root の共有 pool qa2-542c07 から primary clone に登録されたコピーを割り当てた。fm-spawn.sh の spawn_worktree_isolated は worktree root / project 自身でない / primary checkout でないことしか確認せず common dir の一致を見ないため通過し、fm_treehouse_pool_slot の common dir 不一致 false は拒否にならず slot owner claim を飛ばすだけで、freshen_spawn_worktree_base が fetch/reset できる経路を通った後、fm-claude-trust.sh が "not a worktree of project" で拒否した。見えている Claude trust エラーは遅い検出点で、根因は project/home 専用 pool の欠如と allocation ownership 検証漏れ。推奨対応: 対象 clone の common directory に属さないコピーを freshen_spawn_worktree_base より前に拒否し、同じ clone/home 専用の Treehouse root (treehouse get --root / TREEHOUSE_ROOT) から pool を選ぶこと。primary clone を trust 引数にする、Claude trust を bypass する、account/runtime を替える、失敗 pool を reset/cleanup することは採らない。

What Changed

  • bin/fm-spawn.sh: spawn_worktree_isolated now also checks that a Treehouse copy belongs to the spawning project's own common git dir. A free slot that another clone of the same origin created is refused before any base refresh, slot claim, or launch. Orca worktrees are exempt from this check.
  • bin/fm-spawn.sh: every home (primary or secondmate) now runs treehouse --root <base>/fm-homes/<home-id> get instead of a plain treehouse get. The new spawn_treehouse_pool_root chooses <base>: an absolute TREEHOUSE_ROOT if set, otherwise $HOME/.treehouse. <home-id> comes from a hash of the home's physical path. Spawning is refused if that root would sit inside the Firstmate home or its state, or under a directory below $HOME that contains CLAUDE.md/AGENTS.md. Teardown and relaunch still use the worktree path each task recorded, so tasks already on a default-root slot run to completion there.
  • bin/fm-install-treehouse.sh now pins Treehouse v2.3.0 (--root needs v2.2.0 or later), with updated checksums. docs/configuration.md documents the per-home pool root, the ownership check, and how to deal with old default-root slots. Tests cover the per-home root, refusal of foreign-clone slots, and teardown returning a slot by its recorded path, and the fixtures and e2e tests now handle the --root invocation.

Risk Assessment

🚨 High: The routing and ownership-screen logic is correct: real Treehouse v2.3.0 returns custom-root slots by path, and foreign-clone slots are refused before any mutation. But the chosen pool location nests every worker copy under a Firstmate home whose CLAUDE.md/AGENTS.md supervisor contract worker harnesses load from ancestor directories, which changes worker behavior across all homes.

Testing

Six scenarios ran through the real fm-spawn.sh on a private fm-lab tmux socket with real Treehouse, in disposable lab homes and clones, and all passed. S1/S2/S2b: each home allocates from its own stable root, a different root per home, outside the home, and the worktree's common git dir matches its own clone. S3: a planted slot from the other clone is refused with 'belongs to a different clone' and its HEAD, reflog and FETCH_HEAD stay unchanged. S4/S5: a root below an AGENTS.md-bearing $HOME subdirectory or inside the Firstmate home is refused and no root is created. S6: with TREEHOUSE_ROOT unset, the spawn uses $HOME/.treehouse/fm-homes/<id>; $HOME/CLAUDE.md does not cause a refusal and the in-project treehouse.toml is ignored. The targeted suites fm-spawn-pool-base-freshen and fm-teardown both passed. The S3 refusal arrives only after the 60s discovery poll, which matches the known behaviour already recorded as a decision. The lab was removed and the worktree is clean. There is no UI surface, so the evidence is the CLI transcript.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
S1: a spawn from the primary home allocates its copy under <TREEHOUSE_ROOT>/fm-homes/<home-id>, outside the home, owned by the same clone ✅ pass live live-pool-root-transcript.txt S1: worktree=<th>/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/1/qa2, and the worktree and project common dirs are the same
S2: a secondmate home whose clone has the same origin and name gets a separate root, so the two clones never share a pool; the same home maps to the same root again ✅ pass live live-pool-root-transcript.txt S2/S2b: homeB gets fm-homes/83ff0f99163d and homeA gets fm-homes/0ddafeda86af both times, with the same pool name qa2-39e933 under each root
S3 (adversarial): a free slot made by the other clone inside this home's root is refused before any fetch, reset or claim ✅ pass live live-pool-root-transcript.txt S3: rc=1 'it belongs to a different clone', no task meta written, slot HEAD/reflog/FETCH_HEAD unchanged
S4 (adversarial): a TREEHOUSE_ROOT under a $HOME subdirectory that has AGENTS.md is refused before Treehouse runs ✅ pass live live-pool-root-transcript.txt S4: rc=1 'carries agent instructions ... refusing to spawn', no pool root created
S5 (adversarial): a TREEHOUSE_ROOT inside the Firstmate home is refused ✅ pass live live-pool-root-transcript.txt S5: rc=1 'lies inside this firstmate home', no pool root created
S6: with TREEHOUSE_ROOT unset, the default base $HOME/.treehouse is used; $HOME/CLAUDE.md does not refuse and an in-project treehouse.toml root is ignored ✅ pass live live-pool-root-transcript.txt S6: worktree=<userhome>/.treehouse/fm-homes/0ddafeda86af/..., nothing created inside the project checkout
Evidence: Live pool-root spawn transcript (S1–S6)

Source: Live pool-root spawn transcript (S1–S6)

homeA=/tmp/fm-poolroot-live.oKg2/labA id=0ddafeda86af
homeB=/tmp/fm-poolroot-live.oKg2/labB id=83ff0f99163d

===== S1 primary home allocates from its own dedicated root
----- $ FM_HOME=/tmp/fm-poolroot-live.oKg2/labA TREEHOUSE_ROOT=/tmp/fm-poolroot-live.oKg2/th bin/fm-spawn.sh s1-primary /tmp/fm-poolroot-live.oKg2/primary-side/qa2 --scout --harness 'sleep 600'
fm-gate-refuse: gate agent lifecycle permitted only against lab home /tmp/fm-poolroot-live.oKg2/labA
spawned s1-primary harness=sleep kind=scout window=primary:fm-s1-primary worktree=/tmp/fm-poolroot-live.oKg2/th/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/1/qa2
rc=0
recorded worktree=/tmp/fm-poolroot-live.oKg2/th/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/1/qa2
worktree common dir=/tmp/fm-poolroot-live.oKg2/primary-side/qa2/.git
project common dir=/tmp/fm-poolroot-live.oKg2/primary-side/qa2/.git
S1 ROOT-OK

===== S2 secondmate home with same-origin same-name clone allocates from a different root
----- $ FM_HOME=/tmp/fm-poolroot-live.oKg2/labB TREEHOUSE_ROOT=/tmp/fm-poolroot-live.oKg2/th bin/fm-spawn.sh s2-secondmate /tmp/fm-poolroot-live.oKg2/sm-side/qa2 --scout --harness 'sleep 600'
fm-gate-refuse: gate agent lifecycle permitted only against lab home /tmp/fm-poolroot-live.oKg2/labB
spawned s2-secondmate harness=sleep kind=scout window=primary:fm-s2-secondmate worktree=/tmp/fm-poolroot-live.oKg2/th/fm-homes/83ff0f99163d/.treehouse/qa2-39e933/1/qa2
rc=0
recorded worktree=/tmp/fm-poolroot-live.oKg2/th/fm-homes/83ff0f99163d/.treehouse/qa2-39e933/1/qa2
worktree common dir=/tmp/fm-poolroot-live.oKg2/sm-side/qa2/.git
project common dir=/tmp/fm-poolroot-live.oKg2/sm-side/qa2/.git
S2 ROOT-OK
pools: 
<TH>/fm-homes/83ff0f99163d/.treehouse
<TH>/fm-homes/83ff0f99163d/.treehouse/qa2-39e933
<TH>/fm-homes/0ddafeda86af/.treehouse
<TH>/fm-homes/0ddafeda86af/.treehouse/qa2-39e933

===== S2b same primary home again maps to the same root
----- $ FM_HOME=/tmp/fm-poolroot-live.oKg2/labA TREEHOUSE_ROOT=/tmp/fm-poolroot-live.oKg2/th bin/fm-spawn.sh s2b-primary-again /tmp/fm-poolroot-live.oKg2/primary-side/qa2 --scout --harness 'sleep 600'
fm-gate-refuse: gate agent lifecycle permitted only against lab home /tmp/fm-poolroot-live.oKg2/labA
spawned s2b-primary-again harness=sleep kind=scout window=primary:fm-s2b-primary-again worktree=/tmp/fm-poolroot-live.oKg2/th/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/2/qa2
rc=0
recorded worktree=/tmp/fm-poolroot-live.oKg2/th/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/2/qa2
S2b SAME-ROOT-OK

===== S3 adversarial: a free slot created by the OTHER clone inside home B's root
foreign slot (leased from primary-side clone)=/tmp/fm-poolroot-live.oKg2/th/fm-homes/83ff0f99163d/.treehouse/qa2-39e933/2/qa2

🌳 Worktree returned to pool.
foreign slot common dir=/tmp/fm-poolroot-live.oKg2/primary-side/qa2/.git
----- $ FM_HOME=/tmp/fm-poolroot-live.oKg2/labB TREEHOUSE_ROOT=/tmp/fm-poolroot-live.oKg2/th bin/fm-spawn.sh s3-foreign /tmp/fm-poolroot-live.oKg2/sm-side/qa2 --scout --harness 'sleep 600'
fm-gate-refuse: gate agent lifecycle permitted only against lab home /tmp/fm-poolroot-live.oKg2/labB
error: treehouse get did not enter an isolated worktree within 60s (last seen '/tmp/fm-poolroot-live.oKg2/th/fm-homes/83ff0f99163d/.treehouse/qa2-39e933/2/qa2': it belongs to a different clone (its common git dir is '/tmp/fm-poolroot-live.oKg2/primary-side/qa2/.git', not the spawning project's '/tmp/fm-poolroot-live.oKg2/sm-side/qa2/.git'); spawning project '/tmp/fm-poolroot-live.oKg2/sm-side/qa2'); inspect window primary:fm-s3-foreign
rc=1
S3 no task meta published
slot HEAD before=5d99a0eb3affbe5c3d97331dbb731606009999f5 after=5d99a0eb3affbe5c3d97331dbb731606009999f5
slot reflog unchanged
slot FETCH_HEAD unchanged (none)

===== S4 adversarial: TREEHOUSE_ROOT under a $HOME subdir carrying AGENTS.md
----- $ FM_HOME=/tmp/fm-poolroot-live.oKg2/labA TREEHOUSE_ROOT=/tmp/fm-poolroot-live.oKg2/userhome/proj/pools bin/fm-spawn.sh s4-instructed /tmp/fm-poolroot-live.oKg2/primary-side/qa2 --scout --harness 'sleep 600'
fm-gate-refuse: gate agent lifecycle permitted only against lab home /tmp/fm-poolroot-live.oKg2/labA
error: Treehouse pool root '/tmp/fm-poolroot-live.oKg2/userhome/proj/pools/fm-homes/0ddafeda86af' lies under '/tmp/fm-poolroot-live.oKg2/userhome/proj', which carries agent instructions (CLAUDE.md or AGENTS.md) every task copy would load; refusing to spawn
rc=1
no pool root created under the instructed dir

===== S5 adversarial: TREEHOUSE_ROOT inside the firstmate home
----- $ FM_HOME=/tmp/fm-poolroot-live.oKg2/labA TREEHOUSE_ROOT=/tmp/fm-poolroot-live.oKg2/labA/pools bin/fm-spawn.sh s5-inside-home /tmp/fm-poolroot-live.oKg2/primary-side/qa2 --scout --harness 'sleep 600'
fm-gate-refuse: gate agent lifecycle permitted only against lab home /tmp/fm-poolroot-live.oKg2/labA
error: Treehouse pool root '/tmp/fm-poolroot-live.oKg2/labA/pools/fm-homes/0ddafeda86af' lies inside this firstmate home '/tmp/fm-poolroot-live.oKg2/labA'; refusing to place task copies under its agent instructions
rc=1
no pool root created inside the home

===== S6 default base: TREEHOUSE_ROOT unset, $HOME/CLAUDE.md present, project treehouse.toml root='.'
----- $ FM_HOME=/tmp/fm-poolroot-live.oKg2/labA TREEHOUSE_ROOT=<unset> bin/fm-spawn.sh s6-default /tmp/fm-poolroot-live.oKg2/primary-side/qa2 --scout --harness 'sleep 600'
fm-gate-refuse: gate agent lifecycle permitted only against lab home /tmp/fm-poolroot-live.oKg2/labA
spawned s6-default harness=sleep kind=scout window=primary:fm-s6-default worktree=/tmp/fm-poolroot-live.oKg2/userhome/.treehouse/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/1/qa2
rc=0
recorded worktree=/tmp/fm-poolroot-live.oKg2/userhome/.treehouse/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/1/qa2
S6 DEFAULT-BASE-OK
nothing created inside the project checkout

===== tmux windows
bash ~/.no-mistakes/worktrees/38526edaf053/01M56ZCQT1D1HEF0CZ0CWH76YK
fm-s1-primary <T>/th/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/1/qa2
fm-s2-secondmate <T>/th/fm-homes/83ff0f99163d/.treehouse/qa2-39e933/1/qa2
fm-s2b-primary-again <T>/th/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/2/qa2
fm-s3-foreign <T>/th/fm-homes/83ff0f99163d/.treehouse/qa2-39e933/2/qa2
fm-s4-instructed <T>/primary-side/qa2
fm-s5-inside-home <T>/primary-side/qa2
fm-s6-default <T>/userhome/.treehouse/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/1/qa2

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ⚠️ bin/fm-spawn.sh:5018 - secondmate home の spawn は無条件に treehouse --root &#39;&lt;state&gt;/treehouse&#39; get を送るようになった。しかし、インストール済み Treehouse が --root に対応しているかを確かめる箇所がどこにもない。bootstrap の gate(bin/fm-bootstrap.sh:906 の treehouse_supports_lease、:1473)が見ているのは get --lease だけなので、v2.0.x/v2.1.x は互換として通ってしまう。そうした Treehouse を使う secondmate home では、crewmate/scout spawn が毎回次のように失敗する。pane のコマンドが unknown flag: --root で即座に失敗し、pane はプロジェクトに留まる。discovery poll(bin/fm-spawn.sh:5059-5074)は 60 秒使い切り、treehouse get did not enter an isolated worktree within 60s (... it is the spawning project itself ...) で終わる。この表示は本当の原因を示していない。CI でも同じ壊れ方をした(コミット 13b7bcf のメッセージ)。対応した互換性要件は docs/configuration.md:427 の一文だけ。修正案: --root を送る前に、fm-spawn 内で能力を probe する(例: treehouse --help 2&gt;&amp;1 | grep -q -- &#39;--root&#39;)。非対応なら「Treehouse >= v2.2.0 が必要」と明示して即座に refuse する。または bootstrap の treehouse 互換 gate に同じ probe を追加する。
  • ⚠️ bin/fm-spawn.sh:5017 - Intent は「同じ clone/home 専用の Treehouse root (treehouse get --root / TREEHOUSE_ROOT) から pool を選ぶこと」を求めている。今回の変更が専用 root を与えたのは secondmate home だけで、primary home は default root(spawn_treehouse_get=&#39;treehouse get&#39;)を使い続ける。そのため、primary の projects/<name> と、同じディレクトリ名と origin を持つ別の clone(default root で Treehouse を使う operator 自身のチェックアウトなど)は、今も1つの pool を共有する。ownership screen は他 clone の slot を正しく拒否するが、拒否されるのは 60 秒の poll の後である。しかも fresh endpoint は abort 時に slot を pool に返すので、retry しても同じ foreign slot が再び割り当てられうる。その場合、primary からのそのプロジェクトへの spawn は失敗し続ける。primary にも専用 root を与えると、既存の default-root pool はすべて孤立する。これは方針のトレードオフなので、「primary は default root のままで良いか(現状の部分的な分離を受け入れるか)」は人間の判断が必要。

🔧 Fix applied.
2 issues (1 warning, 1 info) still open:

  • ⚠️ bin/fm-spawn.sh:5018 - secondmate home の spawn は無条件に treehouse --root &#39;&lt;state&gt;/treehouse&#39; get を送るようになった。しかし、インストール済み Treehouse が --root に対応しているかを確かめる箇所がどこにもない。bootstrap の gate(bin/fm-bootstrap.sh:906 の treehouse_supports_lease、:1473)が見ているのは get --lease だけなので、v2.0.x/v2.1.x は互換として通ってしまう。そうした Treehouse を使う secondmate home では、crewmate/scout spawn が毎回次のように失敗する。pane のコマンドが unknown flag: --root で即座に失敗し、pane はプロジェクトに留まる。discovery poll(bin/fm-spawn.sh:5059-5074)は 60 秒使い切り、treehouse get did not enter an isolated worktree within 60s (... it is the spawning project itself ...) で終わる。この表示は本当の原因を示していない。CI でも同じ壊れ方をした(コミット 13b7bcf のメッセージ)。対応した互換性要件は docs/configuration.md:427 の一文だけ。修正案: --root を送る前に、fm-spawn 内で能力を probe する(例: treehouse --help 2&gt;&amp;1 | grep -q -- &#39;--root&#39;)。非対応なら「Treehouse >= v2.2.0 が必要」と明示して即座に refuse する。または bootstrap の treehouse 互換 gate に同じ probe を追加する。
  • ℹ️ docs/configuration.md:433 - Round 1 の fix(primary-home-shares-default-root への対応で docs を改訂した回)で入った記述が不正確。docs には「New spawns no longer allocate from the default root, so such a slot reaches a spawn only through a Treehouse configuration (TREEHOUSE_ROOT or a config file) that points back at it.」とある。しかし fm-spawn.sh:5016 は毎回 treehouse --root &#39;&lt;state&gt;/treehouse&#39; get を送り、Treehouse 自身のヘルプにも --root は「overriding TREEHOUSE_ROOT and config」と明記されている。つまり TREEHOUSE_ROOT や config ファイルを設定しても、新しい spawn が default-root の slot に戻ることはない。operator はありもしない経路(自分の TREEHOUSE_ROOT や config)を原因として疑い、無駄に調べることになる。修正案: この文を「spawn は常に --root を渡し、それが TREEHOUSE_ROOT と config より優先されるので、新しい spawn は default-root の slot を受け取らない。下記の refusal はそれでも他 clone の copy に当たった場合の最終防衛線として残る」という内容に直す。

🔧 Fix applied.
1 warning still open:

  • ⚠️ bin/fm-spawn.sh:5018 - secondmate home の spawn は無条件に treehouse --root &#39;&lt;state&gt;/treehouse&#39; get を送るようになった。しかし、インストール済み Treehouse が --root に対応しているかを確かめる箇所がどこにもない。bootstrap の gate(bin/fm-bootstrap.sh:906 の treehouse_supports_lease、:1473)が見ているのは get --lease だけなので、v2.0.x/v2.1.x は互換として通ってしまう。そうした Treehouse を使う secondmate home では、crewmate/scout spawn が毎回次のように失敗する。pane のコマンドが unknown flag: --root で即座に失敗し、pane はプロジェクトに留まる。discovery poll(bin/fm-spawn.sh:5059-5074)は 60 秒使い切り、treehouse get did not enter an isolated worktree within 60s (... it is the spawning project itself ...) で終わる。この表示は本当の原因を示していない。CI でも同じ壊れ方をした(コミット 13b7bcf のメッセージ)。対応した互換性要件は docs/configuration.md:427 の一文だけ。修正案: --root を送る前に、fm-spawn 内で能力を probe する(例: treehouse --help 2&gt;&amp;1 | grep -q -- &#39;--root&#39;)。非対応なら「Treehouse >= v2.2.0 が必要」と明示して即座に refuse する。または bootstrap の treehouse 互換 gate に同じ probe を追加する。

  • 🚨 bin/fm-spawn.sh:5043 - The new dedicated pool root is &lt;FM_HOME&gt;/state/treehouse for every home, so every crewmate/scout copy now sits inside the Firstmate checkout (e.g. ~/Work/oss/firstmate/state/treehouse/.treehouse/qa2-xxx/1/qa2). Claude Code loads every CLAUDE.md from cwd up through all ancestors (Pi loads ancestor AGENTS.md too), and the home root's CLAUDE.md is @AGENTS.md, the supervisor contract: 'You are the first mate', hard rule 1 'Do not edit, commit, or run state-changing commands ... in any project worktree', the captain-address rules. The AGENTS.md:4 worker carve-out covers only 'a worktree of this repository', not a qa2 copy. So every Claude/Pi worker spawned from any home now permanently loads instructions that contradict its job. Before this branch, slots lived under ~/.treehouse with no such ancestor, and nothing in bin/ excludes ancestor memory (no claudeMdExcludes etc.). Where it came from: the original author commit e1e9663 introduced this placement for secondmate homes, and review fix round 14dab25 extended it to the primary home. Sibling sites that assume the same placement: docs/configuration.md:94 (the state/treehouse/ entry) and docs/configuration.md:428 (the treehouse --root &lt;state&gt;/treehouse get sentence). Proposed fix: keep a root dedicated to each clone/home, but place it outside any Firstmate checkout (e.g. ~/.treehouse/fm-<home-hash>/ or an XDG state dir). Choosing that location is a product/location decision beyond the recorded 'dedicated root' choice, so a human must make it.

🔧 Fix applied.
2 issues (1 error, 1 info) still open:

  • 🚨 bin/fm-spawn.sh:5043 - The new dedicated pool root is &lt;FM_HOME&gt;/state/treehouse for every home, so every crewmate/scout copy now sits inside the Firstmate checkout (e.g. ~/Work/oss/firstmate/state/treehouse/.treehouse/qa2-xxx/1/qa2). Claude Code loads every CLAUDE.md from cwd up through all ancestors (Pi loads ancestor AGENTS.md too), and the home root's CLAUDE.md is @AGENTS.md, the supervisor contract: 'You are the first mate', hard rule 1 'Do not edit, commit, or run state-changing commands ... in any project worktree', the captain-address rules. The AGENTS.md:4 worker carve-out covers only 'a worktree of this repository', not a qa2 copy. So every Claude/Pi worker spawned from any home now permanently loads instructions that contradict its job. Before this branch, slots lived under ~/.treehouse with no such ancestor, and nothing in bin/ excludes ancestor memory (no claudeMdExcludes etc.). Where it came from: the original author commit e1e9663 introduced this placement for secondmate homes, and review fix round 14dab25 extended it to the primary home. Sibling sites that assume the same placement: docs/configuration.md:94 (the state/treehouse/ entry) and docs/configuration.md:428 (the treehouse --root &lt;state&gt;/treehouse get sentence). Proposed fix: keep a root dedicated to each clone/home, but place it outside any Firstmate checkout (e.g. ~/.treehouse/fm-<home-hash>/ or an XDG state dir). Choosing that location is a product/location decision beyond the recorded 'dedicated root' choice, so a human must make it.
  • ℹ️ bin/fm-spawn.sh:3931 - spawn_treehouse_pool_root が treehouse.toml の root を読む方法は、二重引用符の basic string(root = &#34;...&#34;)を sed で拾うことだけである。TOML の literal string(root = &#39;.&#39; や root = &#39;/srv/pools&#39;)は取りこぼされ、$HOME にフォールバックする。Treehouse 本体はこの値を尊重するので、ラウンド4の決定「<treehouse-default-root> = Treehouse 自身が --root なしで解決する root(TREEHOUSE_ROOT と Treehouse config を尊重)」から外れる。具体例: project の treehouse.toml が root = &#39;/data/th&#39; のとき、Treehouse の default は /data/th/.treehouse だが、Firstmate は $HOME/fm-homes/<id> を使う。安全側には倒れる(root は依然 checkout の外で、home 専用でもある)ので影響は小さい。このコードを導入したのは前回の fix round(0576cbd)である。修正案: sed パターンで単一引用符の値も受け付ける。

🔧 Fix applied.
4 issues (1 error, 1 warning, 2 infos) still open:

  • 🚨 bin/fm-spawn.sh:5043 - The new dedicated pool root is &lt;FM_HOME&gt;/state/treehouse for every home, so every crewmate/scout copy now sits inside the Firstmate checkout (e.g. ~/Work/oss/firstmate/state/treehouse/.treehouse/qa2-xxx/1/qa2). Claude Code loads every CLAUDE.md from cwd up through all ancestors (Pi loads ancestor AGENTS.md too), and the home root's CLAUDE.md is @AGENTS.md, the supervisor contract: 'You are the first mate', hard rule 1 'Do not edit, commit, or run state-changing commands ... in any project worktree', the captain-address rules. The AGENTS.md:4 worker carve-out covers only 'a worktree of this repository', not a qa2 copy. So every Claude/Pi worker spawned from any home now permanently loads instructions that contradict its job. Before this branch, slots lived under ~/.treehouse with no such ancestor, and nothing in bin/ excludes ancestor memory (no claudeMdExcludes etc.). Where it came from: the original author commit e1e9663 introduced this placement for secondmate homes, and review fix round 14dab25 extended it to the primary home. Sibling sites that assume the same placement: docs/configuration.md:94 (the state/treehouse/ entry) and docs/configuration.md:428 (the treehouse --root &lt;state&gt;/treehouse get sentence). Proposed fix: keep a root dedicated to each clone/home, but place it outside any Firstmate checkout (e.g. ~/.treehouse/fm-<home-hash>/ or an XDG state dir). Choosing that location is a product/location decision beyond the recorded 'dedicated root' choice, so a human must make it.
  • ℹ️ bin/fm-spawn.sh:3931 - spawn_treehouse_pool_root が treehouse.toml の root を読む方法は、二重引用符の basic string(root = &#34;...&#34;)を sed で拾うことだけである。TOML の literal string(root = &#39;.&#39; や root = &#39;/srv/pools&#39;)は取りこぼされ、$HOME にフォールバックする。Treehouse 本体はこの値を尊重するので、ラウンド4の決定「<treehouse-default-root> = Treehouse 自身が --root なしで解決する root(TREEHOUSE_ROOT と Treehouse config を尊重)」から外れる。具体例: project の treehouse.toml が root = &#39;/data/th&#39; のとき、Treehouse の default は /data/th/.treehouse だが、Firstmate は $HOME/fm-homes/<id> を使う。安全側には倒れる(root は依然 checkout の外で、home 専用でもある)ので影響は小さい。このコードを導入したのは前回の fix round(0576cbd)である。修正案: sed パターンで単一引用符の値も受け付ける。
  • ⚠️ bin/fm-spawn.sh:3934 - これは round 4 の fix(0576cbd、&lt;default-root&gt;/fm-homes/&lt;home-id&gt; の導入)と round 5 の fix(7f0866a、literal-string root への対応)で入ったコードで、Treehouse の in-project pool(fm-claude-trust.sh:107 に書かれている「relative in-project pool」)の設定をそのまま root の基点に使っている。具体的な経路は次のとおり。project の treehouse.toml が root = &#39;.&#39;(または &#34;.&#34;)で、TREEHOUSE_ROOT が未設定とする。このとき base は $top/. に解決され、pool root は &lt;project-checkout&gt;/fm-homes/&lt;id&gt; になる。(a) project の root に AGENTS.md や CLAUDE.md がある場合(普通にある)、bin/fm-spawn.sh:3946-3955 の祖先チェックがすべての spawn を拒否する。この branch より前は plain treehouse get で動いていた設定であり、そこで読まれるのは同じ project 自身の指示ファイルなので、round 4 で問題になった Firstmate supervisor 契約の注入にもあたらない。(b) そうしたファイルがない場合は、project の primary checkout の中に gitignore されていない fm-homes/ ディレクトリができ、その中に worktree が入るので、primary checkout が untracked として dirty になる(Treehouse 自身の .treehouse/ とは扱いが違う)。どの root 由来の祖先を除外するか、in-project root を TREEHOUSE_ROOT / $HOME の扱いに寄せるか、&lt;root&gt;/.treehouse/fm-homes/&lt;id&gt; のように Treehouse の管理ディレクトリの下に置くかは、round 4 で人間が決めた配置(&lt;treehouse-default-root&gt;/fm-homes/&lt;home-id&gt;、指示ファイルを持つ祖先がある場所はすべて拒否)を変える判断になる。したがって、ここで必要なのは repair ではなく方針の決定である。関連箇所: docs/configuration.md:428(relative value を repository root から解決するという記述)、docs/configuration.md:431(拒否条件)。
  • ℹ️ bin/fm-spawn.sh:3930 - round 5 の fix(7f0866a)を確認した。sed は basic string と literal string の両方を受け付けるようになり、1 行に対して 2 つの -e が両方当たることもない。test_pool_root_follows_the_project_treehouse_toml は spawn を実際に実行し、pane に送られた --root を検査する behavior テストなので、旧コードでは literal のケースで失敗する。追加の対応は不要。

🔧 Fix applied.
1 info still open:

  • ℹ️ bin/fm-spawn.sh:3930 - round 5 の fix(7f0866a)を確認した。sed は basic string と literal string の両方を受け付けるようになり、1 行に対して 2 つの -e が両方当たることもない。test_pool_root_follows_the_project_treehouse_toml は spawn を実際に実行し、pane に送られた --root を検査する behavior テストなので、旧コードでは literal のケースで失敗する。追加の対応は不要。
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
primary home の ship spawn が、自分の <state>/treehouse pool root からプロジェクト自身の clone に紐づいた slot を確保する ✅ pass live live-pool-root-transcript.txt S1: worktree=<primary>/state/treehouse/.treehouse/qa2-*/1/qa2。worktree とプロジェクトの common dir が一致。default root には update-check.json しかない
secondmate home の ship spawn が、自分の <state>/treehouse pool root から slot を確保する ✅ pass live live-pool-root-transcript.txt S2: worktree=<sm-home>/state/treehouse/...、common dir が sm-home/projects/qa2/.git と一致
攻撃的シナリオ: 同じ名前と origin を持つ別 clone の空き slot を Treehouse が割り当てた場合、fetch・reset・claim・meta 作成の前に拒否される ✅ pass live live-pool-root-transcript.txt S3: Treehouse が operator clone の slot 2 を割り当て、spawn が 'it belongs to a different clone' で exit 1。HEAD・reflog・FETCH_HEAD・.fm-slot-owner は不変で、meta は作られなかった
変更前のコードで古い default root に spawn した task が、新しいコードの teardown で記録パスから返却される ✅ pass live live-pool-root-transcript.txt S4: base 1aa2a21 の spawn で worktree=$HOME/.treehouse/qa2-*/1/qa2 になった。新しい teardown が exit 0 で 'Worktree returned to pool' を出し、default-root の status が in-use から available…
  • live-pool-root-driver.sh &lt;worktree&gt; (evidence dir): 使い捨ての lab home 2つ(primary と、.fm-secondmate-home を置いた secondmate)、共有 origin を持つ qa2 clone 3つ(primary・secondmate・operator checkout)、TMUX_TMPDIR=$LAB/tmux、HOME=$LAB/userhome を用意し、本物の treehouse v2.3.0 を使用
  • S1: FM_HOME=$LAB/primary bin/fm-spawn.sh p1 &lt;primary&gt;/projects/qa2 &#34;sh -c ...&#34; --mode local-only --yolo off --backend tmux
  • S2: 同じ手順を secondmate home で実行(s1)
  • S3: operator clone で treehouse --root &lt;sm&gt;/state/treehouse get --lease を実行して slot を作り、return --force で空き slot にした。origin を進めた後、bin/fm-spawn.sh s2 &lt;sm&gt;/projects/qa2 --scout --backend tmux を実行
  • S4: base commit 1aa2a21 の fm-spawn.sh(git archive で取り出したもの)で legacy1 を spawn して default root に置き、作業を local main に ff した後、新しいコードの bin/fm-teardown.sh legacy1 を実行
  • bash tests/fm-spawn-pool-base-freshen.test.sh
  • bash tests/fm-tangle-guard.test.sh

✅ No issues found.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
S1: a spawn from the primary home allocates its copy under <TREEHOUSE_ROOT>/fm-homes/<home-id>, outside the home, owned by the same clone ✅ pass live live-pool-root-transcript.txt S1: worktree=<th>/fm-homes/0ddafeda86af/.treehouse/qa2-39e933/1/qa2, and the worktree and project common dirs are the same
S2: a secondmate home whose clone has the same origin and name gets a separate root, so the two clones never share a pool; the same home maps to the same root again ✅ pass live live-pool-root-transcript.txt S2/S2b: homeB gets fm-homes/83ff0f99163d and homeA gets fm-homes/0ddafeda86af both times, with the same pool name qa2-39e933 under each root
S3 (adversarial): a free slot made by the other clone inside this home's root is refused before any fetch, reset or claim ✅ pass live live-pool-root-transcript.txt S3: rc=1 'it belongs to a different clone', no task meta written, slot HEAD/reflog/FETCH_HEAD unchanged
S4 (adversarial): a TREEHOUSE_ROOT under a $HOME subdirectory that has AGENTS.md is refused before Treehouse runs ✅ pass live live-pool-root-transcript.txt S4: rc=1 'carries agent instructions ... refusing to spawn', no pool root created
S5 (adversarial): a TREEHOUSE_ROOT inside the Firstmate home is refused ✅ pass live live-pool-root-transcript.txt S5: rc=1 'lies inside this firstmate home', no pool root created
S6: with TREEHOUSE_ROOT unset, the default base $HOME/.treehouse is used; $HOME/CLAUDE.md does not refuse and an in-project treehouse.toml root is ignored ✅ pass live live-pool-root-transcript.txt S6: worktree=<userhome>/.treehouse/fm-homes/0ddafeda86af/..., nothing created inside the project checkout
  • Live driver: two disposable homes made with bin/fm-lab-home.sh create (one primary, one secondmate), two clones of one local bare origin that are both named qa2, a private tmux -L fm-lab server with TMUX_TMPDIR and HOME inside the lab, and real treehouse v2.3.0. Each scenario ran bin/fm-spawn.sh &lt;id&gt; &lt;project&gt; --scout --harness &#39;sleep 600&#39; from inside the lab pane
  • S1: spawn from the primary home with an absolute TREEHOUSE_ROOT
  • S2/S2b: spawn from the secondmate home using the other clone, then a second spawn from the primary home
  • S3: treehouse --root &lt;homeB-root&gt; get --lease + return from the primary-side clone to plant a free foreign slot, then a spawn from the secondmate home
  • S4: TREEHOUSE_ROOT=$HOME/proj/pools with $HOME/proj/AGENTS.md present
  • S5: TREEHOUSE_ROOT=<FM_HOME>/pools
  • S6: TREEHOUSE_ROOT unset, $HOME/CLAUDE.md present, project treehouse.toml with root='.'
  • bash tests/fm-spawn-pool-base-freshen.test.sh (all passed)
  • bash tests/fm-teardown.test.sh (rc=0)
  • Lab teardown: tmux -L fm-lab kill-server, then chmod -R u+w and rm -rf of the lab directories
✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ No issues found.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @yasuhito — I reviewed tip 7cf8cc97 against main c7b7798b (3 files: bin/fm-spawn.sh, docs/configuration.md, tests/fm-spawn-pool-base-freshen.test.sh; no workflow, secret, or network changes). The no-mistakes attestation matches this head and the live validation shows 4/4 go.

My read:

  • The foreign-clone ownership screen in spawn_worktree_isolated (refusing a Treehouse slot whose common git dir is not the spawning project's own, before any fetch/reset/claim) is corrective: it enforces the existing "isolated worktree of the spawning project" contract earlier than the Claude trust check did.
  • Routing every secondmate home's spawns to a new state/treehouse/ pool root via treehouse --root changes where an unconfigured secondmate home allocates task copies, and leaves legacy default-root slots refused until an operator sorts them out. That is a new default path rather than a restore of a specified one, so I'm classifying the PR as new-default. It won't be auto-merged; once CI is green it goes to Kun for a merge-or-leave decision.

Right now CI is still running on this head, so nothing is needed from you yet. If CI comes back red, please push a fix through no-mistakes.

Overlap note: this sits near #7382 (restored second mates on their own home), #7401 (Orca secondmates) and #7394 (remote secondmate convergence). I'm not treating any of them as a duplicate of this one.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: a quick update on head 7cf8cc97. CI run 39088619591 has a real failure, and it lines up with this change.

  • Behavior tests (Herdr): 3 failures, all of them crewmate spawns from a secondmate-shaped home: tests/fm-backend-herdr-launcher-workspace-e2e.test.sh "a secondmate-owned crewmate spawn failed", plus "multi-home secondmate A a1 failed" and "a crewmate spawned FROM the secondmate-shaped home failed" in the Herdr presentation family. Each spawn ends with treehouse get did not enter an isolated worktree within 60s (last seen '<scratch-project>': it is the spawning project itself ...). That pattern suggests the new treehouse --root '<state>/treehouse' get line never moved the pane into a pool slot on Herdr (or in those fixtures' Treehouse).
  • Behavior portable serial 4: tests/fm-remote-reply.test.sh "the NUL-bearing line was not captured". I can't see a link to this change, so it may be a flake, but please check it while you're in there.

This is waiting on you: please fix the secondmate-home spawn path for Herdr, either in the code or in the fixtures if they need to understand --root, and push it through no-mistakes. My earlier read hasn't changed: the contract-class is new-default, so once CI is green it goes to Kun for a merge-or-leave decision.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @yasuhito, that diagnosis checks out. Treehouse added --root in v2.2.0, and CI pinned v2.0.1. The new head 65d39362 bumps bin/fm-install-treehouse.sh (used only by CI and the test runner) to v2.3.0. I checked all four SHA-256 pins against the official kunchenguid/treehouse v2.3.0 release asset digests, and they match. The docs line is accurate too. Nothing touches .github/, secrets or the network, and the attestation binds this head with live validation go (4 of 4).

CI on this head: run 39090995307 is green everywhere, including Behavior tests (Herdr) and portable serial 4, except Behavior portable serial 2. That job was cancelled at the workflow's 30-minute limit with no test failure, and main hits the same ceiling right now (push run 39089728530 on 8ba34f1d, #7255). I re-ran only that job.

One non-blocking note for you and Kun: bootstrap's Treehouse check only verifies get --lease support, so a captain still on Treehouse 2.0.x/2.1.x passes bootstrap but would see secondmate-home spawns wait 60s and fail on unknown flag: --root. A fast refusal that names the needed version (in bootstrap or at spawn) would fit "scripts stop safely and report" better. It's your call whether to add it here.

Contract-class: new-default (my own read, unchanged). The foreign-clone refusal on its own is a restore, but every unconfigured secondmate home now draws from a new <state>/treehouse pool root instead of plain treehouse get. VISION.md: it aligns.

Status: nothing is required from you. Once serial 2 finishes green, this goes to Kun as a captain merge-or-leave decision. It won't auto-merge.

@yasuhito
yasuhito force-pushed the fm/firstmate-project-scoped-pool-routing-v1 branch from 65d3936 to f31cc65 Compare October 20, 2026 22:50
@yasuhito yasuhito changed the title fix(bin): route secondmate spawns to their own Treehouse pool and refuse other clones' slots fix(bin): route Treehouse spawns to a per-home pool root and refuse other clones' slots Oct 20, 2026
…use other clones' slots

Treehouse keys a pool by clone directory name and origin, so a secondmate
home's clone and the primary home's clone of one project shared a pool and
handed each other's free slots out. The isolation screen accepted such a
copy, the slot claim silently skipped it, and the base refresh fetched into
and reset it before Claude trust pre-registration finally refused.

Require a Treehouse copy's common git dir to match the spawning project's
inside the shared isolation predicate, so a foreign slot is refused before
any fetch, reset, claim, or metadata. A secondmate home now runs
treehouse --root <state>/treehouse get; the primary home keeps the default
root, and teardown still returns slots by path.
…secondmate home's spawn now sends `treehouse --root <state>/treehouse get`, but `--root` was only added in Treehouse v2.2.0, and CI pins v2.0.1 via bin/fm-install-treehouse.sh. v2.0.1 fails immediately with `unknown flag: --root` (reproduced locally), so the pane never enters a worktree and the three secondmate-spawn E2E tests (launcher-workspace, presentation, workspace-per-home) failed with "it is the spawning project itself" after 60s. Fix: bumped the CI pin to v2.3.0 (the version the local real-Herdr suite uses), updated the four platform SHA-256s from the official release asset digests and the related comments, and added one sentence to docs/configuration.md saying secondmate-home spawns need Treehouse v2.2.0 or later. Verified: the new installer downloads, checksum-verifies and installs v2.3.0, which accepts `--root`; shellcheck and fm-documentation-audiences pass. Locally the previously failing secondmate spawn steps now pass, but both E2E scripts still fail later at teardown (`REFUSED: cannot resolve the shared Treehouse project lock`). The base commit fails the same way with Treehouse 2.0.1, and main CI passes this test, so this is a local environment issue unrelated to the PR or the Treehouse version. fm-lint.test.sh fails one local-only RSS-measurement assertion ("unavailable"); I believe it is unrelated but did not check it against base. ci-1 (Behavior portable serial 4): not caused by this PR. The only failure is tests/fm-remote-reply.test.sh "the NUL-bearing line was not captured", a 60s await timeout in the remote reply stream, which this PR does not touch. It passed fully in two local runs, so it looks timing-dependent; no change made. Changes are uncommitted in the worktree
@yasuhito
yasuhito force-pushed the fm/firstmate-project-scoped-pool-routing-v1 branch from f31cc65 to ab1fc58 Compare October 20, 2026 23:37
@yasuhito yasuhito changed the title fix(bin): route Treehouse spawns to a per-home pool root and refuse other clones' slots fix(bin): allocate Treehouse copies from a per-home pool root and refuse other clones' slots Oct 20, 2026
… 件は main でも起きている既存の flaky なので手を入れていない。 **原因(ci-1〜ci-4):** 失敗していたのは fm-kimi-harness、fm-polytoken-harness、fm-rovo-harness、fm-agy-harness、fm-fleet-ledger、fm-trace-context-spawn の各テスト。どれも bin/fm-spawn.sh を独自の env で直接起動しており、HOME をテスト用 FM_HOME の内側(`$home` か `$home/user-home`)に置いている。この PR で pool root が `$HOME/.treehouse/fm-homes/<id>` になったため、root が FM_HOME の内側に入り、spawn_treehouse_pool_root の「pool root が firstmate home の内側なら拒否」(人間が決めた規則)に当たって spawn が exit 1 になっていた。CI ログのエラー文で確認し、修正前のローカル実行でも同じ失敗を再現した。 **守るべき条件:** テストの spawn は本番と同じく、pool root が FM_HOME の外にある状態で動かなければならない。共有の fm_test_run_spawn(tests/fixtures.sh)はこの PR で既に `TREEHOUSE_ROOT=${home%/}.treehouse-root` を固定している。直接起動している箇所は次の通りで、拒否されていたのはこのうち 6 か所: - kimi・rovo・agy・polytoken の各 run_spawn - fleet-ledger の in_home - trace-context の run_spawn と run_spawn_tc、secondmate ワーカー spawn(`FM_HOME=$sm` で `HOME=$sm/user-home`) - secondmate を拒否する経路と、primary の `--secondmate` spawn(`HOME=$base/user-home`)は pool root の判定まで到達しないか HOME が既に外側なので、変更していない。 **修正:** 上記 6 か所に、fixtures と同じ規約の `TREEHOUSE_ROOT=<home>.treehouse-root` を追加しただけ(テスト 6 ファイル、+9/−5)。本番コードは変えていないので、拒否規則はそのまま残っている。 **検証:** 6 テストとも全件 pass(kimi 30、rovo 11、polytoken 30、agy 30、fleet-ledger 10、trace-context 12)。agy、fleet-ledger、trace-context の 3 本は、手元の mise shim が HOME 差し替え時に設定ファイルの trust エラーを出して失敗するため、PATH から mise/shims を外して実行した。これはこのマシンだけの環境要因で CI とは関係ない。修正した 6 ファイルへの shellcheck も警告なし。 **ci-5(Behavior tests (Herdr))は対象外:** 失敗は fm-backend-herdr-presentation-e2e の「concurrent secondmate recovery」で、エラーは「herdr presentation recovery could not acquire its session lock; refusing a concurrent resume」。同じテストが同じエラー文で、この PR を含まない main の直近 2 回(run 39506645686 の 5db719d、run 39506454292 の 4ae3aaf)でも失敗している。原因は 5 秒で打ち切るロック取得のタイミング依存で、この PR とは無関係なのでコードは変更していない。実 Herdr でのローカル実行は、main での再現を確認できた時点で途中停止した。 変更は未コミットのまま、outer executor に渡す。
@yasuhito

Copy link
Copy Markdown
Contributor Author

CI status

At the current head 17baa3b1 (an empty commit whose tree is identical to 7dd325e8), 17 of 19 checks pass. The two non-green results look like timing problems that also recur on main, not defects introduced by this PR:

  1. Behavior portable serial 2 - cancelled by the 30-minute job limit (job). tests/fm-supervision-host.test.sh had already passed (exit 0, 1,747 s), which left the shard mid tests/fm-teardown-endpoint-safety.test.sh when the limit hit. This PR does not touch that test or bin/fm-supervision-host.sh. The same shard is a recurring non-green job on main (Investigate fm-supervision-host.test.sh failures on unrelated changes and unchanged main #7457).
  2. Behavior portable serial 5 - failed (job) in tests/fm-remote-secondmate-lifecycle-e2e.test.sh at "the watcher did not exit on its auto-relaunch wake within the bound". The same message appears in main CI run 39472834148, and the same shard passed on this PR's previous run at the identical tree 7dd325e8 (run 39520574259).
  3. An earlier serial 2 failure on run 39520574259 (fm-supervision-host.test.sh "return-fail: the host did not hand the wake to main") passed on the rerun.

Local results (scratch copies, bin/fm-test-run.sh, run one at a time):

Test This PR (tree 7dd325e8) origin/main 97316301
tests/fm-remote-secondmate-lifecycle-e2e.test.sh exit 0, 426 s; the auto-relaunch case passes exit 0, 432 s; the auto-relaunch case passes
tests/fm-supervision-host.test.sh (2 runs on this PR) exit 1 (both runs), 104-108 s exit 1, 104 s

The supervision-host failure is identical on both sides ("hook write failure: the Stop hook did not finish", after the same 37 passing cases), so it predates this change.

This account cannot rerun jobs on this repository, so could a maintainer rerun the serial 2 and serial 5 jobs, or waive them?

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Thank you @yasuhito for the clear CI write-up and the side-by-side local runs against main. I agree that neither red traces to this diff:

I re-ran both failed jobs once (run 39524320683). So this is waiting on CI, not on you.

What I reviewed on 17baa3b1: the scope grew since my 2026-10-18 stamp.

  • Every home, primary as well as secondmate, now allocates through treehouse --root <base>/fm-homes/<home-id> get, where <base> is an absolute TREEHOUSE_ROOT or $HOME/.treehouse. It refuses a root inside the Firstmate home or state, or under a $HOME subdirectory that carries CLAUDE.md/AGENTS.md.
  • The foreign-clone common-git-dir refusal still runs before any base refresh or claim.
  • I re-checked all four Treehouse v2.3.0 SHA-256 pins against the official kunchenguid/treehouse release digests, and they match. The installer is CI/test-only.
  • Nothing touches .github, and there are no new network or secret paths, so I have no security concerns.
  • The attestation binds this head, with live go 6/6, including three adversarial refusals.

Contract-class: new-default (my own read). The foreign-clone refusal alone would be a restore. But every unconfigured home now places new task copies under a new per-home pool root instead of a plain treehouse get, and it requires Treehouse ≥2.2.0. VISION: it aligns. Authority is the captain's call because this changes where every home's copies live.

One non-blocking note, now wider than before: there's still no fast version refusal. A captain on Treehouse 2.0.x/2.1.x passes bootstrap's get --lease check, and now every spawn, not only secondmate-home spawns, would wait and then fail on unknown flag: --root. A bootstrap or spawn check that names the needed version would fit "scripts stop safely and report". It's your call whether to add it here. I'll pass it to Kun either way.

Once CI is green, this goes to Kun as a captain merge-or-leave decision. It won't auto-merge, and nothing more is needed from you.

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