Repository navigation
Description
Why this exists
#448 established that the dedup false positive is not a threshold problem: the pair worth releasing scores 0.8235 and the changed-fact pair the suite pins scores 0.8333, so any separating threshold is a window one hundredth wide fitted to two observations. A token-overlap score cannot tell "the swap replaced a fact" from "the swap added one".
This issue proposes attacking the input and the output instead of the constant. Both ideas come out of that analysis, and both were measured against the maintainer's store on 2026-11-19. A throwaway POC is following; its results will be appended here rather than asserted now.
Idea 1 — a symptom clause is the discriminator the score is missing
The asymmetry that makes this work: a changed fact keeps its symptom, an added fact brings a new one. Two rows answering the same question share the symptom, so a When <symptom>: prefix adds shared tokens and pushes them closer. Two rows answering different questions bring different symptom prose, and they move apart.
Measured on the two pairs from #448, using clauses written in the shape the gate already enforces:
| pair | today | with symptom clauses | desired |
|---|---|---|---|
npm run build vs npm run build:example-images |
0.8235 suppressed — wrong | 0.500 both kept — right | keep both |
runbook every friday vs every monday, same symptom |
0.8333 suppressed — right | 0.875 suppressed — right | suppress |
| the gufo cutover, written twice | 1.000 suppressed — right | 1.000 suppressed — right | suppress |
Three cases, one threshold, all correct — and the direction is structural rather than tuned: distinct symptoms contribute distinct tokens, so the parallel-fact case cannot re-collide by accident.
The honest caveat. The symptom clauses in that table were authored by hand for the experiment, not produced by a capture run. The direction holds by construction; the specific 0.500 is authorship. Before this is built, the claim needs real rows captured under the rule, or a POC that derives symptoms from the store rather than from a person.
The gap that matters. The symptom rule currently binds learning and blocker only (symptomRuleEnabled in src/gate/gate.ts). The BabylonDocs rows are pattern, which is exempt — and the exempt types are where shape collisions live, because they are short, formulaic and written in batches. So the concrete change is extending the convention to pattern, and possibly context.
Idea 2 — surface both, flagged AMBIGUOUS, instead of dropping one
Today the pass silently deletes a row. Even when it is right, the reader never knows a sibling existed; when it is wrong, the loss is invisible — which is exactly why #448 needed a full store replay to find.
There is a working precedent for the alternative. conflictLine() in src/recall/conflicts.ts renders both facts, the provenance and a fixed Action onto a row; src/recall/relevant.ts attaches it to a shallow copy of the rendered text and adds a header caveat so the reader knows CONFLICT rows were code-checked. An AMBIGUOUS variant is the same plumbing with the verdict left open: keep both rows, attach a line naming the sibling and the reason, and let the model pick by what it is actually doing.
The two ideas are complementary, not competing. Idea 1 prevents most collisions at write time; idea 2 makes the residue visible at read time. Visibility has value on its own — a flagged pair is debuggable, a dropped one is not.
What has to be decided before idea 2 is built
- Window slots. Grouping both spends 2 of the 5 slots instead of 1. Negligible on the current store, which holds exactly one such pair, but it needs a cap: a scope of parallel short facts could otherwise eat the window.
- Signature change.
dedupeWindowreturns a filtered list today. A group marker has to ride throughsrc/recall/relevant.tsandsrc/inject/epochs.ts. The CONFLICT path shows the shape — rendered copy plus header caveat — but it is not a one-liner. - Work moved to the model. More prompt text, and a standing instruction that may be ignored. CONFLICT tolerates this because its Action is fixed; AMBIGUOUS deliberately leaves the choice open, so it needs wording strong enough that "pick one" does not degrade into "use the first".
- When to group at all. Grouping every pair in a near-copy band would re-admit the crowding the pass exists to prevent. The candidate rule to test is: suppress when the rows are genuinely interchangeable, group when they are same-shape-different-content, and the symptom clause is what tells them apart — so idea 2 depends on idea 1 rather than standing alone.
Context: how much of this pass is doing anything?
Worth settling alongside these ideas. On the maintainer's store the dropped-chunk guard, not the threshold, decides what the pass ever sees: rows differing by a timestamp have different dropped fragments and are never compared, so all 149 pr-watch cursor rows are exempt and all 78 candidates in the repository's own review scope are stopped there. The ADR's stated motivation is timestamp-differing rows crowding the window. What the pass actually suppresses is prose with no short fragments — and its one visible effect today is the wrong one in #448.
So the question may not be "what should the threshold be" but "should this pass's remaining job be flagging rather than dropping". Ideas 1 and 2 are compatible with that answer; idea 2 is basically it.
Out of scope
Embedding-based semantic recall — that is #420, and this should be re-tested against whatever lands there. Also the write-gate gap where identical prose filed as two types is promoted twice, named in bench/dedup-live-results.md; it is a separate defect.
Activity
abogartz commentedon Nov 19, 2026
POC results — 2026-11-19, throwaway, against the maintainer's live store
Scripts (temp, not committed):
poc-symptom.ts,poc-symptom2.ts. Scan set: 1,321 active rows — this repository plus un-stamped rows, since both share a window.The headline: idea 1 is not what the store supports, and the POC turned up a structural rule that gets all three cases right without touching the threshold.
A. Symptom coverage is near zero
When …:clausecontextlearningdecisionpatternpreferenceblockerThe rule binds
learningandblocker, and 325 of 373 learning rows and all 54 blocker rows predate it —scripts/symptom-fixer.tsrepairs them keyword-only by design, so they stay non-conformant. Extending the convention topatternwould therefore change nothing about theBabylonDocspair sitting in the store right now. It is a forward-only fix, and calling it a fix for #448 would be wrong.B. No evidence that symptom rows collide less
Within the same token-count band: 16-30 tokens, both-symptom pairs mean 11.0% overlap against 6.9% for neither-symptom — i.e. more, not less, on a sample of 16 pairs against 7,980. The 31+ band is a wash (9.6% vs 9.4%). n=16 measures nothing. The hand-authored experiment in the issue body stands alone, and it should not be treated as evidence.
C. The structural split — this is the finding
Classify a colliding pair by what is unique to each side:
build:example-imagestokenizes to includebuild.All three named cases, with no threshold change:
npm run buildvsbuild:example-imagesevery fridayvsevery mondayfriday↔monday)Wider scan with the guards off, 96 pairs: 29 identical, 1 addition, 66 substitution. The substitution class is the
pr-watchcursor rows — correctly named, and the dropped-chunk guard already exempts them. The identical class in that unguarded scan is contaminated by rows likelate 0vslate 1, whose single digits are dropped chunks, so the tokens match while the facts do not; the shipped guard is what stops those, and it must stay.D. What the rule would change on the real store
Replayed at window 5 across every scope: today 1 row is dropped; under the rule, 0 are dropped and 1 pair is flagged and both kept. One extra slot out of 513 used.
Rendered in the CONFLICT style, with the unique tokens named so the reader can see why they are not copies:
Revised recommendation
Lead with the structural rule, not the symptom clause or a new threshold. It needs no capture-convention change, no threshold change, and no model instruction beyond one Action line; on this store it changes exactly one decision, and that decision is the wrong one today.
Where it can be wrong, and why that is the cheap side. If a row is superseded by a longer row that contains it — "the runbook rotates the key on Friday" followed by "…on Friday, and we moved the window to Tuesday" — the pair classifies as addition and both are kept, where today the older is dropped. That costs one extra row in a window. The failure it prevents is losing a command outright, which is #448. The asymmetry is the whole argument for trying it.
Honest limits.
additionhas exactly one live example plus the reasoning. The class is defined structurally, so it is reproducible, but one observation is not a distribution — a real change needs fixtures for the shapes above before it ships, and theidenticalcase must keep relying on the dropped-chunk guard rather than on token equality.Symptom clauses stay worth doing as a capture-quality improvement — the recall argument in ADR 0007 is independent of all this — but this POC does not support them as the discriminator, and #449 should not sell them as one.
abogartz commentedon Nov 19, 2026
POC round 2 — the store-cruft objection, and what it changes
A fair objection was raised against the previous comment: this repository is the author's own store,
auto-captured by one agent over months, and the symptom rule is new with a handful of users. New stores
will be conformant from their first row. Judging a forward-looking convention by a backlog that predates
it is not evidence.
That objection is correct and part of the previous comment is retracted. It does not survive contact with
the one measurement the store can make, and it surfaces a failure mode neither idea predicted.
Retracted: "no evidence that symptom rows collide less"
The band analysis compared 16 both-symptom pairs against 7,980 pairs from a pre-rule backlog. The
conformant rows are 48 of 373
learningrows, all written under the rule by the same agent. That samplesays nothing about symptom-bearing rows in general, and the conclusion should not have been drawn from it.
Coverage is a property of the rule's age, not of the convention's value.
What the store can answer: do authors reuse a symptom for the same question?
This cannot be synthesized — hand-written clauses are authorship, already conceded once. But 48 rows were
captured under the rule, and their clauses can be compared with each other. Splitting each row into clause
and fact and scoring the parts separately, across the 35 same-scope pairs among them:
When …:clause aloneA symptom clause is a diversifier, not a unifier. Authors state a new symptom per incident, and the
clause is if anything less repetitive than the fact it introduces. Nothing in this is cruft — those rows
are the convention working exactly as written. The consequence is what matters.
The consequence, measured
Symptom-first capture pushes same-scope rows apart. That is a collision reducer, which reads like a win.
The pass exists to catch the case where rows should still collide:
npm run buildvsbuild:example-imagesevery fridayvsevery mondayfridayrow survivesSo symptom-first capture resolves #448 by re-admitting the §17 case the tool test pins. Not by tuning — by
making the pair invisible to the pass. The intuition that symptoms would help the model pick between two
commands is right; the side effect is that they also hide a superseded fact.
Does the structural rule survive this? Yes, and it becomes more necessary
The identical / addition / substitution split is token-set algebra. It does not care how many rows in a
store are cruft, or whose store it is. In a symptom-first store the pass fires rarely — the guard already
exempts timestamped rows and symptoms now push prose apart — so each firing carries more weight, and a
firing that silently deletes a row is worse, not better. The two ideas compose, with the structural rule
doing the work that remains.
A third idea this produced, and why it is not ready
If the clause is a distinctness signal and the fact is the collision signal, score them separately:
The fact-only score is stable against symptom wording — 0.700 and 0.818 regardless of whether the
clause is shared or invented — and it classifies both pairs correctly. That is the property the whole
discussion has been looking for: a score that does not move when the prose around the fact changes.
It is not shippable. The build pair reaches the right answer only because 0.700 falls below the threshold,
a tenth of a point on text authored here, not because it was classified as addition. The margin is the
shared scaffolding that the clause itself supplies. Treat this as a direction to test on a real corpus.
The implementation constraint, and a latent trap. The symptom is not a field. It is prose, matched by
one boolean in
src/gate/gate.ts:461. That regex is greedy —[^\n]{0,160}:runs to the last colon onthe line — which is harmless while it only answers yes-or-no, and wrong the moment anything tries to split
the row. An early version of this POC did exactly that and silently swallowed the command out of the build
row, producing a confident 0.400 that was pure artifact. Any "score the fact, use the clause for
distinctness" design needs the symptom stored as a separate field, not parsed back out.
Store-cruft cuts both ways, including against an earlier claim of mine
This store is one author, auto-captured, stylistically homogeneous. That inflates similarity, which is
probably why the false positive exists here at all. A multi-user store would likely show more paraphrase
pairs in the 0.85–0.95 band — the band where this store has zero rows, and the reason "raise it to 0.9,
nothing is in between" looked safe. That argument was as store-dependent as the coverage one, and it should
not be reused.
Where this leaves #449
or the capture convention, and is the only proposal that keeps the §17 behavior. Still the lead.
independent of this. Not as a dedup discriminator: they reduce collisions in general, including the one
collision the pass is for.
on a corpus that is not one author's store or my own prose.
auto-captured data. That is the actual gap, larger than any of the design questions.
abogartz commentedon Nov 19, 2026
Idea 2 shipped as #450, and idea 1 did not — which is the shape the POC comments predicted.
Built. The structural split from the round-1 comment is the rule now.
classifyPairreads the leftover token sets; anadditionclash keeps both rows and reports the pair, and #450 adds the AMBIGUOUS render in the CONFLICT style with the verdict left open. Replayed on the same scan set: one suppression reversed, one extra slot of 514.Not built, on purpose. Extending the symptom convention to
patternwould change nothing about the row already in the store, and the round-2 measurement says a symptom clause is a diversifier rather than a unifier — 35 same-scope pairs among the conformant rows, zero identical clauses, mean clause overlap 0.062 against 0.070 for the facts themselves. Distinct symptoms pushed the changed-fact pair from 0.833 to 0.750, below the threshold, so the stale row survives. Symptoms remain worth having for the recall argument in ADR 0007; they are not a dedup discriminator.Still open, and this is what should keep this issue alive.
src/gate/gate.ts. The most promising thing measured here.additionclass rests on one live example plus the reasoning. That is the actual gap, larger than any design question on the list.Keeping this open against those three.
WhollyMindless commentedon Nov 21, 2026
We tried the second-store experiment on OpenCode 2.3.2 with OCSI 0.33.7 (
c48aea6). We deliberately chose related tasks in one benchmark-reporting project, including fixes to how its JSON, Markdown and HTML reports handle the same data. We let the agent choose what to remember and supplied no sample memories or suggested wording.In the archived snapshot, one recall query matched all nine memories in scope. Zero of the 36 pairs reached the 0.8 dedup threshold. The closest pair scored 0.252 on content-and-keyword Jaccard. Six memories carried the auto-capture tag. Looking only at the 15 pairs among those six, the maximum was 0.245. In the shipped comparison order, the polarity guard screened out eight pairs and differing short chunks screened out the other 28. We froze the last completed-session snapshot when a later
memory_forgetremoved two rows, and verified the replay from the archive.For this workload, it was easy to get memories relevant to the same query and hard to get two worded alike enough to exercise
classifyPair. That leaves the live addition example from #448 as the positive case. A fixture can reproduce it reliably. To learn how often it happens in use, the next sample I’d look for is a longer-running project that revisits the same commands or procedures as they change.WhollyMindless commentedon Nov 21, 2026
Do you remember what you were doing in BabylonDocs when the
npm run buildandnpm run build:example-imagesmemories were created? The replay shows their timestamps only 30 ms apart and both use the same “run … from the repo root” wording. Did one operation record several scripts frompackage.jsontogether, or did those facts enter the store some other way?Even a rough recollection of the task and how the rows were written would help us try the same workflow on another repo and see whether a close pair emerges on its own.
ocsi-architect commentedon Nov 27, 2026
Scoring-input fix, measured at
966bb7e(from a closed proposal)Seed row:
The default timeout is 30 seconds.The rewording pair is the seed againstThirty seconds is the default timeout.; the correction pair is the seed againstChange the default timeout to 90 seconds.Normalization experiment — offline measurement with the tokenizer copied verbatim, not integrated code:
Two caveats travel with this table. First, the numbers are an offline measurement with a copied tokenizer, not integrated code. Second, a score of 1.0 lands above the 0.90 floor, which under today's semantics means review-gated rather than rejected, so "reject the duplicate" still needs its exact outcome decided.
Calibration bank unmoved
Nine calibration pairs measured unchanged across all four variants: 0.2500 / 0.2632 / 0.2800 / 0.3000 / 0.9000 / 0.8667 / 0.8462 / 0.4375 / 0.0909. None of the nine carries a trailing dot, so the de-glue variant cannot touch them. The only word-form numeral in the bank (
ninety, in a below-floor pair) swaps one unique token for another, moving neither intersection nor union. No pin moves; the fix is additive with respect to the existing calibration.Why this is an input fix, not another threshold
The variants do not propose a new constant. They remove representation artifacts — glued sentence dots, word-form/digit disjointness — so the existing floors mean what they claim:
OVERLAP_FLOOR 0.90separates restatements from distinct facts because restatements score near 1.0 on content, not because the floor was retuned to dodge a surface effect. That is the same direction as this ticket's existing proposal: attack the input, not the constant.The limit, stated honestly
This makes a restatement recognizable as a restatement. It says nothing about telling an added fact from a changed one — the correction pair sits at 0.4444 in every variant. Discriminating replacement from addition remains this ticket's actual problem.
The numbers came from a row of closed proposal #471; the full four-row record lives in this ticket's closure comment there.
abogartz commentedon Dec 1, 2026
Closed as done. Its buildable half shipped as #450 (src/recall/dedupe.ts:140, src/recall/ambiguous.ts:202); the symptom-clause discriminator was measured against on record. Split scoring waits on a second corpus.
Reopen it whenever the premise comes back; nothing here is deleted and the history stays put.