---
name: prebuilt-xtask-bakes-its-build-trees-root
description: "A prebuilt xtask.exe runs its inner cargo AS the tree that BUILT it, not your cwd — under a foreign-pool claim its build legs red SPT_POOL_FOREIGN naming a tree you never invoked from"
metadata: 
  node_type: memory
  type: project
  originSessionId: 42f9a8c3-5d36-484d-a163-c5c201b82d07
  modified: 2026-08-29T08:37:40.652Z
---

Measured 2026-08-29, gate-emit-w1 (a27e45fa gate). A prebuilt `xtask.exe` resolves the project
root it bakes at BUILD time, so its inner `cargo build` (e.g. `xtask check` building `spt`) runs
as the tree that BUILT the exe — regardless of the cwd you invoke it from. Main-tree-built
xtask.exe invoked from my gate worktree (with `CARGO_TARGET_DIR` = main pool, pool CLAIMED by the
gate lane) redded `SPT_POOL_FOREIGN` with `this tree: <main checkout>` while my cwd was the gate
worktree — my own claim refusing my own leg, wearing a diff-red's clothes. Confirmed by fix, not
by reading: `cargo build -p xtask` from the gate tree (same pool, same claim, same cwd), then that
fresh xtask.exe — clean, `xtask check: OK`.

**Why:** the refusal names a tree the command line never mentions, so the first read is "the pool
guard is confused" or "the diff broke the build". The guard was RIGHT both times — it is the meter
that exposed which tree was really building.

**How to apply:** in any rig that runs xtask legs from a worktree against a claimed pool, build
xtask FROM THAT WORKTREE first (one ~cheap cargo build into the pool) and run the pool's fresh
`debug/xtask.exe`. Refines [[lane-check-via-main-pool-prebuilt-xtask]]: the prebuilt-xtask shortcut
is safe for verbs that DON'T build (pool-claim/release), and a trap for verbs that DO (check, gen).
Kin: [[pool-claim-writes-a-record-the-BUILD-enforces]] — enforcement speaks at the build, and it
speaks about the BAKED tree.
