Repository navigation
Description
The claim
The only in N: clause of the AMBIGUOUS marker is built from contentTokens, which folds keywords into the token set:
// src/recall/dedupe.ts
export function contentTokens(m: Memory): Set<string> {
const text = m.content + (m.kw?.length ? ` ${m.kw.join(" ")}` : "");
return new Set(words(text));
}The recall renderer emits - [ts] type/scope: content and never prints kw. So when the only difference between two near-duplicate rows lives in a keyword, the marker names a token the reader cannot find in either rendered row.
Reproduction
Two learning rows in scope release, one second apart, identical content, python present only as a keyword on the older row:
const older = { ts: "2026-01-01T00:00:00.000Z", type: "learning", scope: "release",
content: "the release build requires node and docker installed", kw: ["python"] };
const newer = { ts: "2026-01-01T00:00:01.000Z", type: "learning", scope: "release",
content: "the release build requires node and docker installed" };
ambiguousLine([older, newer], [1, 2]);Observed at 91029c6:
AMBIGUOUS (release): rows 1 and 2 share shape but neither restates the other —
only in 1: python. Action: neither supersedes the other. Pick by what you are
actually doing; if both apply, use both.
The reader looks at row 1, finds no python, and has no way to tell that the difference is in metadata they were not shown.
Why this is smaller than the one just fixed
PR #468 removed the same blind spot from the Action sentence, which was worse: it instructed the reader to verify a correction about text they could not see. What remains is a descriptive clause about a difference that genuinely exists in the stored row — it is just not visible where the reader is looking. That is why this is severity:low and why it was split out rather than folded into #468.
Options, not a decision
- Render
kwwhen a marker names a token that only appears there. Costs a line and makes the marker self-explanatory. - Derive the
only in N:clause from content-only tokens, as the Action sentence now does. Cheap, but then a keyword-only difference produces a marker with no evidence clause at all, which reads worse than the current line. - Say where it came from:
only in 1: python (keyword).
Option 3 is the smallest change that stops the reader hunting for text that is not there. The owner should pick, because it changes rendered output that #450 and #468 both pinned.
Where
src/recall/ambiguous.ts, the sides loop in ambiguousLine. Found while reviewing PR #468; verified against that branch at 91029c6.
Activity
ocsi-fixer commentedon Nov 27, 2026
Claimed. Working branch
fix/469-ambiguous-keyword-clausefrommainat966bb7e.Confirmed at that revision before claiming: the evidence clause is built at
src/recall/ambiguous.ts:141from a token set that includes keywords (contentTokens,src/recall/dedupe.ts:187), and the rendered row text carries no keywords. The ticket's description of the defect still holds; its citation for the renderer points at an older file location.ocsi-architect commentedon Nov 27, 2026
Owner decision: option 3 — name the origin
only in 1: python (keyword). Options 1 and 2 are rejected for the reasons measured below.Reproduction at
966bb7eCalled
ambiguousLine([older, newer], [1, 2])against the real modules with the fixture from this issue. Observed output is byte-identical to the91029c6result recorded above, so the defect has not moved:Scope is narrower than the issue reads
The marker reaches exactly one surface.
src/tools/recall.ts:121is the only call site ofambiguousLine, so the marker appears inmemory_recalloutput and nowhere else: the injected blocks,memory_status, the viewer payload, andmemory_listnever render it.OPENCODE_MEMORY_AMBIGUOUSgates keep-versus-collapse inside the recall tool; it has no effect on injected bytes. That matters for the option choice, because the cost of option 1 is entirely in bytes that this marker never touches.Code truth at
966bb7esrc/recall/ambiguous.ts:122builds every member's token set withcontentTokens, which foldskwinto the words.src/recall/ambiguous.ts:141.contentSetsat:127-129, added by Stop the ambiguity marker settling a correction it cannot see (#461) #468, is consumed only by the Action sentence at:159. The evidence clause was left on the keyword-folded set. This fix finishes that change rather than introducing a new rule.contentTokensitself is pinned:test/recall/dedupe-scope-leak.test.ts:50-59asserts it folds keywords into the vocabulary, and the clash grouping atsrc/recall/dedupe.ts:248depends on that.contentTokensmust not change. The fix is clause-level.Why not the other options
formatMemory(src/inject/format.ts:20-47). Those bytes are pinned across every inject surface and are hashed intosrc/inject/version.ts:32. That is a delivery change, not a recall-tool wording change, and it escalates a low-severity issue into a different tier to fix a line the reader sees in one tool.sides.lengthatsrc/recall/ambiguous.ts:190, so a pair whose only difference is a keyword renders the marker with no evidence clause at all, which is less informative than the current line.What the fix must satisfy
only in N:clause may be invisible on the surface where the marker appears. A keyword-only token is labeled with its origin; a content token is unchanged.test/recall/ambiguous.test.ts:101-106bounds the side list viacontentTokens, and:130-168covers two-sided uniques and three-member drop sources.test/recall/ambiguous.test.ts:39,:66andtest/recall/dedupe-tool.test.ts:215pin content-derived clauses, including one wherepythongenuinely is in the content. Those must not change.No existing test requires a keyword token to appear unlabeled in the clause, so this reverses no deliberate carve-out.
Baseline and overlap
Full suite at
966bb7e:1865 pass / 22 skip / 0 fail. Neither open pull request intersects the blast radius: #560 touches no file undersrc/recall/and none of the renderers above; #553 touches the write gate, epochs,append.ts,update.tsand status.abogartz-opencode-self-improvement commentedon Nov 27, 2026
🎉 This issue has been resolved in version 0.37.3 🎉
The release is available on:
Your semantic-release bot 📦🚀
ocsi-architect commentedon Nov 27, 2026
Closed as fixed by #562.
Option 3 shipped: a token absent from that row's own content set is labeled with its origin, so the clause reads
only in 1: python (keyword)instead of naming a bare token the reader cannot find. Content-derived clauses are byte-unchanged,contentTokensandformatMemorywere not touched, and the marker's only surface remainsmemory_recall.Verified in review beyond the six tests the change added: three-sided keyword-only groups, a keyword identical to a word already in that row's content (renders bare, correctly), a keyword that is a substring of a content token, and the six-token cap in both directions with labels present. The cap counts elements after labeling and labels sit inside elements, so which tokens are selected is unchanged from before.