refactor: remove KEEP/REF marker system - #33
Merged
Conversation
The [[KEEP:mNNNNN]] and [[REF:mNNNNN|desc]] marker system is removed. KEEP is semantically contradictory with compression: its purpose is to re-inject verbatim original content into a summary, but if a message is important enough to keep verbatim it should be excluded from the compress range (pai-acp supports per-message ranges), not compressed then padded back. In a fine-grained adapter like pai-acp there is no 'must compress a big block but save one gem inside' scenario that justifies it, and expanding verbatim content risks blowing the context budget. REF added nothing over the model writing (see m00005) — the acp tags already expose refs, so a dedicated syntax and resolver is dead weight. Removed: - src/keep-markers.ts (resolveKeepMarkers, KeepMarkerResult) - index.ts exports of resolveKeepMarkers / KeepMarkerResult - KEEP marker bullet from COMPRESS_PHILOSOPHY - KEEP MARKERS paragraph from HOW_TO_COMPRESS_RULES - 3 resolveKeepMarkers tests + their now-unused imports - README standalone-modules table row The four compression-rule constants are now marker-free, so adapters can import them without inheriting marker teaching (no drift risk).
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why remove it
The
[[KEEP:mNNNNN]]/[[REF:mNNNNN|desc]]marker system (src/keep-markers.ts) is being removed.KEEP is semantically contradictory with compression. Its purpose is to re-inject verbatim original content into a summary — but if a message is important enough to keep verbatim, it should be excluded from the compress range, not compressed then padded back. In a fine-grained adapter (pai-acp supports per-message ranges) there is no "must compress a big block but save one gem inside" scenario that justifies it. Worse, expanding verbatim content can blow the context budget — compressing to save space, then un-expanding to spend it again.
REF added nothing. The expansion result
[→ m00005: desc]is no better than the model writing(see m00005). The acp tags already expose refs on every message, so a dedicated syntax + resolver is dead weight.Removed
src/keep-markers.ts(resolveKeepMarkers,KeepMarkerResult)index.tsexports ofresolveKeepMarkers/KeepMarkerResultCOMPRESS_PHILOSOPHYHOW_TO_COMPRESS_RULESresolveKeepMarkerstests + their now-unused importsEffect
The four compression-rule constants are now marker-free. Adapters can import them without inheriting marker teaching — eliminating the drift risk that motivated keeping a hardcoded copy. This is a breaking change (removed exports) but pai-acp is the only consumer and is updated in lockstep.
Test plan