KeepErrors only matched tool results starting with "error:" or "blocked:",
the shape the host formats for an execution failure. A tool that ran fine
but reported a failure — a go test FAIL, a compiler error, any non-zero
exit — never matched, so its evidence folded into the digest and the
specific assertion was gone. Measured against a full-history control on
benchmarks/compaction, evidence buried mid-result survived 0 of 6 runs
while the control kept it every time.
provider.Message.ToolExecution already carries State/ExitCode/Verification
and is already stripped before provider requests, so isErrorMessage reads
it instead of guessing. Because the failure then stays identifiable without
its text prefix, a protected failure can also be shortened: snipFailureResult
keeps the failure-carrying lines with two lines of context and drops the
passing noise, holding the projection cost to +3.5% rather than the +100%
that keeping the whole result costs. A text-only failure has no such anchor
and is still carried whole.
The rewrite happens on three paths — the planning pass, the re-write that
follows archiving, and the fold's kept partition — now unified through
maintenanceReplacement/keptForProjection so one cannot silently overwrite
another.
benchmarks/compaction gains the probe that measures this, a -snip arm,
cross-generation planting for revisions that land across a fold, and
alignment with boot's default KeepPolicy. Buried evidence now survives
18 of 18 runs.