# v0.13.0 W4 — picker UX (JIT plan)

> Grounded 2026-06-19 (todlando) after W5 GATE PASS (@f0cfa0c). doyle assigned W4 ("yours next"),
> doyle gates. These are 4 concrete picker/`endpoint run` UX fixes — NOT repro-heavy like W5.
> Discipline: GROUND the picker code FIRST (read before editing). Tests via spt-test-engineer (ONE,
> background, no Monitor, ≤4 iter) where a unit/behavior seam exists. Gates = clippy
> `--workspace --all-targets -D warnings` + `traceable-reqs check` EXIT=0 + real `cargo build -p spt
> --bin spt`. Picker is a live TUI → most acceptance is HITL/manual-verify (REQ-RUN-PICKER precedent:
> the decision/render seams are unit-testable; the live keypress path is operator-verified). doyle gates.

## The 4 items (from V0.13.0-DELIVERY-CONTROL-JIT.md §W4)
1. **Open on Pick-existing.** Skip the Layer-1 kind screen → land directly on **Pick existing**; `n`
   jumps to **Create new**. (Layer-1 becomes a jump-target, not the entry.)
2. **Auto-attach after Start-new AND Resume-from-history.** Both currently start the session but do
   NOT attach (no stdout shown). Make them attach by default; add an **`h`** shortcut = run headless
   (start, no attach). Mirror the existing Attach/Start/View action routing (single bringup path —
   route through `cmd_endpoint_run`, intent a parameter; do NOT add a second bringup path).
3. **`controlled by` shows the node NAME, not raw hex.** Render `driven_by` through
   `node_label_display` (the same label resolver the roster/`endpoint list` uses) instead of the raw
   node hex. (D item.)
4. **Clean Start-new output.** Drop the Rust `pid=Some(142748)` debug leak and the "harness binds its
   perch on startup" internals from the start path's stdout — user-friendly, not a process log.

## Grounding to do FIRST (anchors to read before any edit)
- The picker TUI: `grep -rn "endpoint run\|RunPicker\|Pick existing\|Create new" crates/spt/src` — find
  the ratatui picker module (likely `crates/spt/src/.../picker*.rs` or under cli). Layer-1 entry state
  + the action enum (REQ-RUN-PICKER says a single action enum is source-of-truth — items 1+2 are
  state/keybind, not new actions).
- Auto-attach: how Attach vs Start currently route (`cmd_endpoint_run`, the `--attach|--start|--view`
  flags, REQ-HOST-RUN-1). Item 2 = make Start-new/Resume default to the attach route + an `h` headless
  escape. Check the keybind legend (pinned) — add `h`.
- `node_label_display`: `grep -rn "node_label_display\|fn .*label" crates/` — the existing hex→name
  resolver (item 3). Find where the picker currently renders `driven_by`/`controlled by`.
- pid/internals leak: `grep -rn "pid=\|binds its perch\|harness binds" crates/spt/src` — the Start-new
  stdout path (item 4); likely an eprintln/println in `cmd_endpoint_run` or spawn_session glue.

## REQ posture
- Most of W4 EXTENDS **REQ-RUN-PICKER** (picker behavior) + the displace/status slice reqs (495–527).
  Item 3 (label render) may also touch the picker-status slice. Check the registry: prefer EXTENDING
  the existing picker REQ note (impl/unit additions) over minting new reqs — these are refinements of
  shipped picker behavior, not new requirements. If any item is genuinely new contract (e.g. the `h`
  headless keybind as a durable flag), mint a small REQ or fold into REQ-RUN-PICKER with a dated note.
- Tag evidence in the same commit (`[impl->REQ-RUN-PICKER]` etc.). Picker live path = HITL verify leg
  (no int gate for the keypress path, REQ-PAIR-6/REQ-CMD-PRIV precedent); unit-test the decision/render
  seams (the action-enum state transition for item 1, the label-format for item 3).

## Watch-outs
- Single bringup path (REQ-RUN-PICKER invariant): items 1+2 must NOT introduce a second launch path —
  route every terminal action through `cmd_endpoint_run` / existing CLI fns.
- The blue "attached/controlled" tri-state + Kick were DEFERRED (M12-W2-RULING Q1) — item 3 only
  changes the LABEL rendering of `driven_by`, not the status-square state machine.
- Don't regress the non-interactive path (flags-present = REQ-HOST-RUN-1, untouched).
- Item 4: drop the leak from the INTERACTIVE picker output; keep any debug behind a log level if it
  exists elsewhere — don't delete genuine error reporting.

## Sequencing
W4 independent of W6/perri (doyle) + Layer F gravity (doyle) + the A2 SEED
(REQ-HAZARD-DRIVEN-BY-IDLE-REMOTE-EVICT, doyle-tracked, post W4/W6). After W4: doyle gates; then the
v0.13.0 PR bundles W1/W1b/W2/W3/W5/W4 + confirms gravity-linux green (W2 g1 byte-receipt + Layer F +
W1b F3) — doyle tracks the gravity leg.
