Repository navigation
0.4.11 — Topic-aware retrieval ranking and per-occurrence tool binding
Release 0.4.11 — Topic-aware retrieval ranking and per-occurrence tool binding
Coordinated packages: ds4-context-core, ds4-context-reference-adapter, and ds4-context-engine 0.4.11.
Changes
- Stops treating generic workflow vocabulary as a historical query.
devi,procedi,allora,aggiungi,continua,considerare,ovvero,quelli,fix,pleaseand similar words no longer become keywords, symbols or query terms. Evidence that is explicitly present in the request — backticked spans, qualified identifiers, file paths, flags, error codes and quoted phrases — stays searchable even when its text is otherwise a stopword, so a legitimate topic namedContinueordeviis still found. A bare acknowledgement now producesno-queryinstead of retrieving earlier approvals. - Adds a bounded distinct-topic bonus of 40 per additional matched query term, capped at 80. FTS order, source role, recency and token length combined can no longer outweigh a candidate that matches one more topic term, while literal identifier and literal phrase tiers stay strictly ahead of numeric score.
- Counts matches with word boundaries and Latin accent folding consistent with the canonical
unicode61 remove_diacritics 2index. A keyword prefix inside an unrelated larger word no longer earns an extra match, and accented evidence matches its unaccented query term. Quoted evidence text is unchanged. - Binds each tool result to the latest preceding occurrence of its tool-call ID. When a completion reuses an ID, independent turns are no longer merged into one oversized atomic group, an incomplete call can no longer be validated by a later reuse, and orphan results never bind to a future call.
containsToolExchangeis derived from completed call indices rather than rescanning every relation per group. - Adds synthetic unit and integration regressions for acknowledgement queries, Italian topic extraction, stopword-named identifiers, workflow-only versus two-topic ranking, duplicate rows with a longer lower-ranked candidate, prefix and accent match accounting, reused IDs across independent turns, incomplete and orphan exchanges, a real exchange spanning a user boundary, a 200-exchange reused-ID sequence, a long native context with a 64k tail and an oversized immediate predecessor with input headroom. Each fails on the prior implementation and passes with the patch.
Implementation commit: c0298ab. Decision: ADR 071.
Scope and limitations
Both defects were reproduced locally from the code and its tests. Neither is confirmed to have occurred in a reported live session, and no live session, database or session JSONL was inspected for this patch.
No retrieval budget, result limit, token ceiling, recent-tail policy, recurrence ceiling, rescueImmediatePredecessor behavior, deduplication, branch isolation, evidence rendering, privacy handling or provider-facing default changed. context.recentTailTokens keeps its model-dependent automatic ceiling; the 64k ceiling applies only from a 1,050,000-token context window, not at 262,144. A genuine older oversized turn can still be excluded even when the whole native input alone would fit the global budget.
The ranking bonus is lexical, not semantic: it changes which historical evidence reaches the provider for a given request and cannot guarantee relevance. No live provider calls, real compactions or BPE/auto-tuning verification were performed, and the separate real-context objective remains open. Full real-context BPE/auto-tuning verification remains a separate objective.
Compaction validation, exact-value downgrading, compaction transport retries, graph atomicity, JSONL authority, persistence schemas and opt-in BPE/auto-tuning defaults are unchanged. Core and the reference adapter receive only the coordinated version bump.
Validation
On the final 0.4.11 source, version and dependency state, using Node 26.5.1 / npm 11.17.0:
npm cicompleted successfully.- The approved
jev_verify allgate passednpm run typecheck,npm testandgit diff --check: workspace builds, strict TypeScript and the full Vitest suite, 103 files / 717 tests, including compatibility, privacy and integration tests. During development the new regressions were confirmed to fail on the unpatched implementation before passing with it. These are the build/typecheck/test scopes ofnpm run check, executed through the acquired verification policy rather than claiming a separate execution of that command. npm run quality:compare: candidate quality 0.9875 versus baseline 0.808156 on the packaged synthetic corpus.npm run schema:context-persistence:passed: true, 1,266 bytes / 317 estimated tokens, within the 320-token relative gate.npm run pack:check: verified core 251 files, reference adapter 7 files and engine 120 files in a clean consumer, including packaged exports, reference conformance and isolated offline Pi RPC.npm audit --omit=dev --json: no production findings.npm cireports development-inclusive audit findings; the lockfile diff changes only coordinated versions and exact internal dependencies, not third-party package versions. These warnings are not hidden or fixed by this patch.
No live-provider, live-session or Windows-host confirmation is claimed.
Publication and registry verification
- Published manually to npm in dependency order:
ds4-context-core@0.4.11→ds4-context-reference-adapter@0.4.11→ds4-context-engine@0.4.11, all public withlatest. - Annotated tag
v0.4.11and the GitHub Release were created after successful registry verification. - CI remains validation-only; no publishing credentials, provider calls or session data were added.