- spill-policy enforces the true cap invariant: it never emits a replacement
larger than maxInlineBytes. When the notice alone exceeds the cap (tiny cap or
long spill root) there is no within-cap replacement, so the inline result is
kept — the previous guard only compared against the original size and could
still return content over the cap for a large original. A within-cap
replacement is always smaller than the original, so this subsumes the earlier
check.
- Add the HMR-disposal test the conventions require for a new registration:
dispose the plugin fiber and assert oversized results stop being transformed
and nothing more is spilled (no leaked tools/post-execute listener on reload).
- spill-policy reserves the spill notice's byte cost inside maxInlineBytes, so
the replacement (preview + notice) never exceeds the documented model-facing
cap. When the notice alone fills the budget the preview is empty; when even a
notice-only replacement is not smaller than the original, the inline result is
kept (spilling would only add bytes).
- retention TextRetainer trims an oversized single suffix chunk to the last
suffixCap bytes on push, so tail/headTail retention stays bounded by suffixCap
instead of retaining and re-copying the whole chunk in finish() — this is the
spill preview path, which pushes the whole result as one chunk.
- spill-policy validates maxInlineBytes as a non-negative integer at LOAD, so a
bad config fails the deployment instead of letting a negative value reach
TextRetainer and turn every oversized-result call into an isError.
- Document the spill seam vocabulary in docs/core-data-structures/spill.md
(SaveTextSpill/SpillOwner/SpillSource/SpillRef/SpillPath, verbatim + type-equiv
gated) and index it from core.md, matching the other capability seams.
Oversized plain-text tool results now spill to a session-scoped file and
return a bounded preview plus the spill path, so a verbose result stays
readable via `read` without consuming the next model request in full.
- dsh-spill: minimal SpillFiles seam (saveText → session-scoped SpillPath)
- dsh-spill-local: private 0700 session dirs, traversal-safe names, exclusive
owner-only writes
- dsh-spill-policy: tools/post-execute transformer; no-op unless maxInlineBytes
is set; skips read; best-effort on save failure (never turns a success into
an isError)
web_fetch is the showcase — no tool-specific spill code. The coding-agent
example loads the stack so its keyless Loader smoke guards the namespace-plugin
export shape. Snapshot gap for a transcript-visible web_fetch spill is recorded
in the RFC's Consequences (ACP replay is keyless and cannot hit the web).