Classify every comment as tautology, stale, excuse or decision record. Tautology/stale/excuse comments are deleted (excuses filed as issues #196-#236), decisions moved to docs/adr/0001-0034. - scripts/lint-comments.sh + .comment-baseline: per-file comment count may only go down; wired into tests/all.sh - .claude/skills/delete-comment: repeatable audit workflow - cargo fmt applied to touched crates Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
16 lines
784 B
Markdown
16 lines
784 B
Markdown
# Context shaping must keep the cached prefix stable
|
|
|
|
Status: accepted
|
|
|
|
## Context
|
|
Prompt caching keys on the request prefix. Any change to earlier bytes invalidates the cache from that point on.
|
|
|
|
## Decision
|
|
- Observation masking is a pure function of the message list and a boundary, so the prefix is byte-stable while the boundary stays put. Moving the boundary rewrites the cache from the first changed result, so the agent moves it rarely, in steps of a fixed number of assistant turns. The session file keeps the originals.
|
|
- The batching nudge is injected at turn end so the cached prefix is untouched.
|
|
|
|
## Consequences
|
|
Masking lags behind the ideal point in exchange for cache hits.
|
|
|
|
Code: crates/hx-core/src/mask.rs (module, `boundary`, `apply`), crates/hx-core/src/nudge.rs
|