Repository navigation
feat(#45): consolidation pass — replayed onto main after #100's wrong-base merge - #104
Merged
Merged
Conversation
added 2 commits
October 25, 2026 13:13
…read-proven, proposal-only Episodic→semantic consolidation is the step the surveys agree is fragile (arXiv:2603.07670: "rarely automatic… fragile and hard to validate"), and NOOA's numbers are the warning label: reflection records were 22% of rows and ~1% of reads, and abstraction hurt pinpoint lookup. So the pass is built to say no more often than yes: - DETERMINISTIC MERGE. The canonical row is the survivor's prose verbatim plus the absorbed rows' aliases as keywords. No model rewrites anything: a rewrite cannot be diffed, audited, or proven to preserve meaning, and this plugin ships no model. kw is indexed and never renders (#40), so a merge never grows the injected bytes of the row that keeps them. - PROVEN READS, PER CLUSTER. Every read the use ledger recorded for the cluster is replayed against the merged store. A merge is proposed only when the canonical row catches at least as many of the cluster's own reads as the BEST single member did alone. A cluster with no recorded reads is reported unmeasured and never merged on resemblance. - PROPOSALS, NOT WRITES. memory_consolidate writes nothing — the tests assert the store is identical before and after the call. Output ends with the exact memory_merge_review call that resolves each proposal; resolving stays supersede-not-delete, recoverable via memory_undo. - Most recently used member is never a loser (#42's rule, inherited here). - Clusters never cross scope or type, and open threads are excluded: a live plan is not episodic material to compress. The ticket's HOLD asked for ~a month of hits data before building this, because the cost is not obviously paid. The harness answers that directly, per cluster, on every run, so the gate is evidence instead of a calendar. Measured on the shipped eval dataset: 200 rows -> 52, R@3 52 -> 53, R@1 52 -> 50, store-wide injected characters 25945c -> 6933c. The trade is asserted, not assumed: R@3 must not fall, at most 5 of 105 queries may see a bigger block, and no query may grow by more than 100 characters. Cluster bookkeeping uses object identity, not ts: the eval store legitimately holds rows sharing a timestamp, and a ts-keyed filter silently absorbs an entire cluster into its survivor. Test: test/consolidate.test.ts (clustering boundaries, open-row and superseded exclusion, jaccard floor, survivor by use recency, byte-identical canonical prose, the acceptance rule including the unmeasured refusal), test/consolidate- bench.test.ts (non-regression and budget bounds on the real dataset), test/consolidate-tool.test.ts (proposes with a read history, reports unmeasured without one, scope-limits, and leaves the store byte-identical). ticket: #45
Same class as the #97 review note, one layer up: the pool sort, the cluster-order sort and the survivor tie-break in survivorFor all compared ISO stamps as strings, so a legacy second-precision row could be called newer than a millisecond row from the same second plus change. cmpTs is now exported from inject.ts and is the single comparator for recency.
|
🎉 This PR is included in version 0.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Contributor
|
Post-merge follow-up: I reproduced two differences between the proposal and its printed resolution command at both
The proposal itself stayed read-only; these differences appeared after following its resolution instruction in the fixture. An end-to-end regression that executes the printed instruction, repeats the original queries, and counts the active rows would cover both. |
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 this PR exists
PR #100 was merged into the wrong base. The stack retarget loop had merged #96–#99 into
mainwhen #100's base was left pointing atfeat/status-self-metrics— a branch already merged — so GitHub merged its head into that stale branch instead ofmain. The merge "succeeded" (e86e923) but moved nothing intomain: after it,mainlackedsrc/consolidate.tsand its three test files. Caught by diffingmainagainst the old branch tip after the last merge.This branch is the two #45 commits (
b5e38a0feat +a77fbecfix, cherry-picked with content verified byte-identical to the reviewed #100 head) replayed on currentmain. Full suite: 461 pass / 5 skip / 0 fail (43 files);tscand Biome clean.What it ships
Unchanged from #100: deterministic consolidation proposals (cluster by shared vocabulary, survivor = most recently used member, canonical = survivor's prose + absorbed aliases, no model rewrite), accepted only when replayed ledger reads prove the merged row catches ≥ the best single member's reads, unmeasured clusters refused.
memory_consolidateis the 14th tool and writes nothing.Closes #45 (the review record stays in #100: approved approach, adversarial notes all resolved before merge).