# JIT plan — answer the gating question on REQ-SPILL-PARTIAL-INLINE

Board: `BigscreenVR/claude-spt-bs#1` (spill-to-file tax). REQ minted, `required_stages = []`.

## Scope

ONE question, load-bearing for whether partial-inline ships at all (deployah, adopted as
direction; burden of proof is on partial-inline, not on today's total-spill):

> Can an agent that acted on the inlined half WITHOUT reading the spilled remainder be
> detected after the fact?

If NO -> record the answer, close the design, leave total-spill in place. That is a
legitimate outcome and is the cheaper one.
If YES -> the detector is the FIRST deliverable, shipped and proven BEFORE any partial
inline, so the quiet failure is instrumented before it is created.

Explicitly NOT in scope: implementing partial inline; raising the cap; anything justified
by the 665-byte trust advisory (that is `spt-bs-releases#63`, a core BUG whose cost core
intends to remove — operator ruling 2026-07-31).

## Refreshed population (this node, 2026-08-21, `~/.claude/sptc-drain-*.txt`)

3676 spills, 19.5 MB, mean 5564 B, max 203873. Bands: <=2000 19.4%, 2001-2500 12.5%,
2501-4000 28.1%, 4001-8000 20.9%, 8001+ 19.2%. 80.6% remain past CC's measured hard
limit, so presentation is still the only adapter-side lever. Volume is ~3x the filing.

## Candidate detection mechanism (to be measured, not assumed)

Our PreToolUse hook is registered with NO matcher (`plugin/sptc/hooks/hooks.json`), so it
fires on EVERY tool call, and `hook.rs` already reads `tool_name` + `tool_input.*`. So:

1. emit a spill -> record the path as OUTSTANDING in durable session state
2. every PreToolUse -> if the payload references that path, mark it READ
3. Stop -> any spill still outstanding at turn end IS the skipped-remainder event

That is only sound if CC actually hands us the path. Two read routes both occur in the
field and BOTH must be covered: the `Read` tool (`tool_input.file_path`) and a Bash `cat`
(`tool_input.command`). A route we cannot see reads exactly like an agent that skipped the
remainder -- a false positive of the same shape as the failure we are hunting.

## Tasks

- T1  Probe CC's PreToolUse payload on a DISPOSABLE session (temp config root, own settings
      with a logging hook, import-free cwd -- never this live session): does the payload
      carry the spill path for (a) `Read`, (b) Bash `cat`, (c) a subagent's read? Positive
      control on each: a read that DID happen must show up, or the instrument is blind.
- T2  Decide from T1: detectable / not. Write the answer into the REQ text and comment it
      on `#1` with the raw evidence, whichever way it falls.
- T3  Only if T1 says detectable: mint `REQ-SPILL-REMAINDER-SKIP-DETECT` (detector ships
      first, alone, against TODAY's total-spill emit -- it must observe real reads with no
      partial inline anywhere near it), and leave `REQ-SPILL-PARTIAL-INLINE` unactivated
      until the detector has field numbers.

## Gate

`sh ci/run-gates.sh` PASS + `traceable-reqs check` exit 0 before anything lands. T1/T2 are
measurement + record only; no adapter binary change, so no release.

## PARKED 2026-08-21 — operator direction

Reavo, mid-session: do not spend more time on adapter-side spill work. A long-term fix is
intended in spt-core, gated behind a large chunk of work that must land first.

T1 (measure) and T2 (record) are DONE and are the whole delivery. T3 is dropped: the
detector is NOT being built. Both `REQ-SPILL-PARTIAL-INLINE` and the newly minted
`REQ-SPILL-REMAINDER-SKIP-DETECT` stay `required_stages = []`. Nothing shipped, no adapter
change, no release. The measurement is recorded only so it does not have to be re-derived
when the core fix arrives.
