Skip to main content

Module skill_collapse

Module skill_collapse 

Source
Expand description

Cross-entry skill-template + content-hash collapse.

Detects repeated message bodies (e.g. /loop fire’ing the same skill template, repeated tool outputs, fixture reposts) and collapses every occurrence after the first into a stub reference. Operates message-level across an entry sequence, complementing line-level crate::noise.

Originating signal: extracting a /loop-driven session yielded ~16k lines, ~60% of which were verbatim re-pastes of the same skill prompt (vc-ownership ~290 lines per fire × 6 fires). The line-level noise filter could not catch this — the lines themselves are semantic prose, they’re just identical across messages. Collapse acts at message level across the sequence: keep the first full body, replace later identical bodies with a one-line stub pointing at the first occurrence.

Structs§

CollapseStats
Aggregate statistics from a single collapse_repeats pass.

Constants§

DEFAULT_THRESHOLD_LINES
Minimum line count for a message to be eligible for collapse.

Functions§

collapse_repeats
Collapse repeated message bodies in-place across an entry sequence.
detect_skill_marker
Detect a skill-template marker in the first ~8 lines of a message body.