---
name: v0121-l2-gate-l1-ruling
description: "v0.12.1 L2 attach-wedge GATE-PASS + L1 breakaway design ruling (int=operator-accept, backstop gated on real-env result)"
metadata: 
  node_type: memory
  type: project
  originSessionId: bfe20bf0-7829-4d00-b1b1-052a9c66e85b
---

doyle gate session 2026-06-18 (after the help-md add).

**L2 GATE-PASS** — todlando's ATTACH-WEDGE @e883f45 (prove-don't-change, like M11-W4; REQ-HAZARD-ATTACH-WEDGE [int], ZERO impl/unit diff). Independently verified: attach_wedge_e2e re-run GREEN 6.81s (all 8 diagnostic legs true — victim served-then-wedged, fresh online+served, victim offlined, stop bounded); real detached daemon+dummy harness, non-vacuous (precondition asserts victim SERVED before wedge trigger); all 3 prove-don't-change claims confirmed in code — serve_attach `net_stream_send(op_id=None)` unjournaled fire-and-forget (attach.rs hdr 17-23), `send_stream`→`bounded_block_on` BROKER-QUIC-DEADLINE (nethost.rs:1090/1104), `StreamLog.retentive_cap==0` evict-not-park (nethost.rs:179/196). traceable EXIT=0, workspace clippy clean. NIT flagged: ATTACH-WEDGE *title* still says "FIX: loopback sends fail-fast — ENDS serve_attach" (a change NOT made); required_stages comment supersedes — todlando to reconcile title.

**L1 BREAKAWAY RULING** (REQ-HAZARD-VIEWER-CLOSE-DETACH; todlando landed @5ae68f8 partial: CREATE_BREAKAWAY_FROM_JOB both spawn paths + in-job fallback on ACCESS_DENIED(5)/INVALID_PARAM(87), no spawn regression). Load-bearing finding: the CI RUNNER's own ancestor job FORBIDS breakaway → a job CAN deny it → efficacy vs real WT/VSCode job unknown until measured. RULINGS:
1. **int = OPERATOR MANUAL ACCEPTANCE, not CI.** CI structurally can't: runner is inside a breakaway-denying job, every test-created job NESTS inside it → CREATE_BREAKAWAY_FROM_JOB always ACCESS_DENIES → faithful tab-close test = guaranteed false-red. Keep the 2 units as CI evidence; document int as manual-accept in REQ + KNOWN-HAZARDS.
2. **Don't build the daemon-out-of-job backstop speculatively** — gate on operator result.
3. **daemon-OWNED harness Job = L4 reap backstop ONLY**, NOT tab-close survival (a job nested in the terminal's kill-on-close job dies with it). todlando's L4 fold is correct.

**L1 RE-SCOPED 2026-06-18 (operator-approved, dispatched to todlando): JOB-NEUTRAL DAEMON LAUNCH = PRIMARY, breakaway demoted to fallback.** Operator's insight: the harness is ALREADY the daemon's child (KIND_SPAWN), never the terminal's — so the only thing in the terminal job is a COLD-STARTED daemon (CLI ensure_daemon_announced→start_daemon→spawn_detached→detached_no_inherit runs from the terminal-child CLI → daemon inherits terminal Job Object; a child inherits the parent's job regardless of DETACHED_PROCESS — console-detach ≠ job-escape). FIX: never put the daemon in a terminal job — launch it job-neutral so it's WmiPrvSE/Task-Scheduler-owned from birth (why autostarted daemons never had the bug); harness rides along; NO breakaway anywhere.

LAUNCHER CHAIN (both cold-start AND `spt daemon start`): 1. WMI `Win32_Process.Create` (PRIMARY — daemon=WmiPrvSE child, outside terminal job; direct COM windows-rs Win32::System::Wmi preferred, powershell `Invoke-CimMethod` hop acceptable since the daemon is WMI's child not powershell's); 2. schtasks one-shot; 3. CREATE_BREAKAWAY_FROM_JOB (todlando's landed code, reordered below); 4. in-job last-resort (log DETACH_IN_JOB + caveat).

**L1.5 LANDED + GATE-PASS @bbcf6a6** (todlando): job-neutral launch shipped. daemon.rs ladder [Wmi,Schtasks,Breakaway,InJob] (pure drive_ladder seam), WMI=abs-powershell `-EncodedCommand` base64-UTF16LE (zero quoting) + RV==0&parsed-ProcessId-or-fallthrough, `wrapped_daemon_command` forwards SPT_*-only via `cmd /c set "K=V" & start "" /b` (todlando's autonomous env-forward catch — WMI child doesn't inherit transient SPT_HOME → wrong-universe collision otherwise; APPROVED). Test seams SPT_FORCE_LAUNCH_RUNG/SPT_LAUNCH_RUNG_MARKER opt-in (no prod effect). job_escape_e2e re-ran GREEN+FAITHFUL (rung=WMI control_died=true daemon_survived=true reachable=true; real KILL_ON_JOB_CLOSE job, in-job control=lethality/non-vacuity, forces+asserts WMI rung, isolated-SPT_HOME bind=env-forward proof). 5 seam units, traceable EXIT=0 (VIEWER +doc+impl+unit+int), clippy clean. NON-BLOCKING note flagged: no single test = WMI-daemon hosts harness+rc after job-close (dummy_harness/attach_wedge launch daemon via foreground `daemon run` not the WMI ladder) — near-zero residual, rc-leg optional. Follow-ups logged: elevated deelevate keeps breakaway (WMI-reparent follow-up), direct-COM WMI follow-up. **Wave 3/4 hold RELEASED.** help-md merge held til AFTER Wave 3/4 (P2 may touch cli.rs) = clean final pre-CI step (dry-run conflict-free).

**(superseded) earlier-ruled BIG WIN: int is NOW CI-TESTABLE** — WMI RE-PARENTS out entirely so the runner's breakaway-denying ancestor job is irrelevant (no nesting confound). CI int: create our own KILL_ON_JOB_CLOSE job, helper IN it cold-starts daemon via WMI path, close job handle → assert daemon pid still ALIVE + reachable + `spt rc` re-attaches. ACTIVATE REQ-HAZARD-VIEWER-CLOSE-DETACH int with this. Operator real-env (WT+VSCode tab-close) = FINAL confirmation, NON-gating now. doyle gates on CI int + traceable + clippy. Wave 3 P2 + Wave 4 E1 held til L1 lands. See [[v0121-l1-viewer-close-detach-findings]] [[v0121-realharness-reopen]].
