---
name: delegate-build-preflight-hang
description: Background build agents hang silently on the full spt-daemon/spt integration suite during preflight — instruct targeted units only; a hang sends no completion notification
metadata: 
  node_type: memory
  type: feedback
  originSessionId: 8bff47ac-ae57-48ac-a383-fca01d85f232
---

When delegating a spt-core build to a background Agent (delegate-then-gate pattern): the agent's WORK is reliably good, but it HANGS if it runs `cargo test -p spt-daemon` or `cargo test -p spt` (full) in its own preflight — those integration/E2E suites take ~hours. v0.7.4 Feature B agent finished its edits then hung ~1h on the spt-daemon integration suite; produced a 0KB/stale transcript and sent NO completion notification (harness only notifies on finish/death, NOT hang — operator caught it, not the harness).

**Why:** spt-daemon/spt `tests/` integration E2E are long (brain tests, 900s twohost waits, etc.). spt-daemon `--lib` units are fast (286 tests in ~8s).

**How to apply:**
1. In every background-build dispatch, explicitly forbid the full integration suites and require TARGETED preflight only: `cargo check --workspace --all-targets`, `clippy --workspace --all-targets -D warnings`, `traceable-reqs check`, and `cargo test -p spt-runtime` / `cargo test -p spt-daemon --lib <module>` (lib + named tests).
2. Proactively check a background agent's liveness yourself — a silent hang won't re-invoke you. Stop the stalled agent (TaskStop with its agentId), then take ownership: `git status`/`git diff` on the worktree to assess the (usually complete + good) partial work, run the targeted preflight, gate, commit. Don't discard — verify.
3. Check liveness via the transcript file's mtime (Get-Item, do NOT Read it — overflow). Stale mtime + 0KB ≈ stalled.

Related: [[ci-clippy-preflight-workspace]] (the exact clippy invocation), [[v074-build-progress]].
