Expand description
§Module: ipc_corruption
§Spec
Forensic detector for the #ipcfullprompt corruption shape: a full-document
editor-side IPC mutation (e.g. PatchWatcher.setText) that deletes or
duplicates a previously-committed assistant ### Re: response block while
the user is typing a live prompt. The binary’s IPC snapshot-adoption guards
fail closed against the snapshot, but the editor-visible buffer can still be
corrupted; this detector turns each occurrence into a durable forensic signal
(default-on capture) without changing any mutation behavior.
detect_response_block_corruptioncompares apriordocument (the committed baseline) against acurrentdocument (the live editor buffer / candidate) and returns one finding per prior### Re:heading that is now absent (deleted) or appears more times than it did inprior(duplicated).summarize_findingsrenders findings as a compact, single-line, ops.log-friendly string.
§Agentic Contracts
- Detection only. This module never mutates a document or changes an adoption decision. A finding is a forensic log signal, not a block.
- Only headings that were present in
priorare considered, so a brand-new response added this cycle (present incurrent, absent fromprior) is never flagged — that is expected growth, not corruption. - Heading identity ignores the working-tree-only
(HEAD)annotation and leading/trailing whitespace, matching how the rest of the binary treats the(HEAD)boundary artifact.
§Evals
detect_flags_deleted_prior_responsedetect_flags_duplicated_prior_responsedetect_ignores_new_response_blockdetect_ignores_head_annotation_differencedetect_clean_document_has_no_findings
Structs§
- IpcCorruption
Finding - One detected corruption of a previously-committed response block.
Enums§
- IpcCorruption
Kind - The kind of
#ipcfullpromptcorruption detected for a response heading.
Functions§
- detect_
duplicated_ scaffold - Detect a duplicated structural scaffold in
current(a self-check; no prior needed). Counts only lines that, when trimmed, exactly equal a canonical structural marker — so an inline mention inside response prose does not inflate the count — and returns one finding per marker that appears more than once. This is the#ipcfullpromptfull-tail-duplication signature thatdetect_response_block_corruption(which keys on### Re:headings) misses. - detect_
response_ block_ corruption - Detect the
#ipcfullpromptcorruption shape by comparing the committedpriordocument against the livecurrent(candidate) document. - summarize_
findings - Render findings as a compact single-line summary for ops.log. Truncates each heading so a long topic cannot blow up the log line.