Skip to content

feat(localize): ground task literals in ranked primary evidence - #602

Merged
zzet merged 105 commits into
mainfrom
feat/localization-literal-grounding
Aug 17, 2026
Merged

feat(localize): ground task literals in ranked primary evidence#602
zzet merged 105 commits into
mainfrom
feat/localization-literal-grounding

Conversation

@zzet

@zzet zzet commented Aug 17, 2026

Copy link
Copy Markdown
Owner

What

Localization pages now ground the literals a task carries — quoted strings, backticked spans, and distinctive unquoted identifier-shaped tokens — in ranked PRIMARY evidence, the way a caller running a text search and reading the results would.

Retrieval

  • The bounded source-literal (trigram) lane runs for every admitted task literal whose value is not visible in a ranked declaration's own text; previously a single ranked candidate that the task happened to name suppressed the lane entirely.
  • Up to four literals are searched per page (longest first), with per-file owner diversity raised to three; previously all admitted terms collapsed to one search.
  • Distinctive unquoted tokens (camel-case, dotted, underscore, digit-bearing) are mined from task prose and fed behind quoted terms in the same budget. A dotted citation also contributes its final segment. Pages whose task quotes nothing are no longer blind to source bodies.
  • Ambiguity is now evidence quality, not company: a complete search that settles a handful of owners proves each of them; only saturation or owner-cap overflow leaves owners unproven.

Seating

  • PRIMARY eligibility is per-row for caller-quoted literals; the page-level anchor kill switch now governs only the inferred bare-literal lane.
  • Rows the task names as whole words (case-sensitive, immediate declaring owner only) may extend the PRIMARY block by up to two extra seats — never displacing a ranked seat.
  • Merged re-observations keep the strongest provenance label instead of first-write-wins.
  • The literal reserve grants a second PRIMARY seat only for a second proven file.
  • Task-named declarations from page files are promoted into evidence with their own provenance and full seating rights; body-scan mentions remain supporting-only.

Terminality

Two settled production registration sites now terminal-claim with both presented, instead of holding the session open as advisory.

Notes for review

  • internal/mcp/overlay_view.go merges this branch's bounded overlay extraction with main's ExtractBuffer admission lifecycle: bounded extractors keep their budgeted path, legacy extractors now go through the lifecycle for crash isolation.

zzet added 30 commits August 13, 2026 10:18
zzet added 28 commits August 14, 2026 05:38
The bounded/scoped localization rework left four helpers without callers:

- buildFileSymbolIndexForOrderedPathsContext: callers moved to the
  scoped variant that threads request/session scope into the projection.
- hasFreshSearch: the freshness gate is now folded into the graph-free
  attributedFileConsumption lookup that replaced it.
- enrichTextMatches: every caller passes a request context and scope
  through enrichTextMatchesContext.
- lowerRanges: every caller lowers through lowerRangesContext.

Fold the surviving doc comments onto the functions that kept the
callers, and reach the embedded reader through the promoted selector in
the bounded fault test.
…mission lanes

The final-response primary block previously filled from graph rank after at
most two single-seat task passes, and a row admitted through leading-file
completeness or a body mention could never claim a seat at all. A declaration
the task names now competes for the open seats in score order regardless of
its admission lane, on a substantive identifier match only; adjacency
neighbors stay supporting and the ranked order keeps the final seat.

Merged re-observations also keep the strongest provenance label instead of
first-write-wins, so a literal observation survives a later graph-hop merge.
…ask-named declarations

Round-two replay showed the substring predicate reseating rows on shared
prose words while the golds it was built for sat outside evidence entirely.
Naming now means the raw task carries the row's identifier or owner as a
case-sensitive whole word, and the same predicate promotes a task-named
declaration from a page file into evidence with its own task_mention
provenance — the page may not show a declaration in an outline while the
caller's own report names it and evidence stays silent.
Qualified names carry namespace and package chains, and the repository's own
name sits in almost every namespace and almost every task, so matching any
segment named the whole page on namespace-bearing languages. Only the
immediate declaring owner now counts, and a segment equal to the repository
identifier never does.
…f displacing ranked seats

A ranked seat is a proven conversion; a task-named row is a hoped-for one.
The task-aligned pass now runs after the ranked fill and may only extend the
block by two bounded extra seats, never claim a ranked one. The two writers
of supportingOnly are separated: a leading-file-depth row may still earn a
task-named seat, while a post-terminal supplemental row stays supporting no
matter how well it matches the task.
The quoted-recall lane tuned so far feeds a document index and can never
find a string inside a function body; the trigram lane can, but eight
independent gates kept it from running or from being seated. This change
lets the body lane do its job end to end:

- a ranked candidate no longer marks a quoted term covered just because the
  task also names that candidate; coverage means the term is visible in the
  candidate's own declaration text
- every admitted literal competes for the bounded grep budget, longest
  first, instead of collapsing to a single term; the wall grows with the
  term count and per-file diversity rises to three
- ambiguity is evidence quality, not company: a complete search settling a
  handful of owners proves each of them, and only saturation or owner-cap
  overflow leaves them unproven
- primary eligibility is per-row for caller-quoted literals; the page-level
  anchor kill switch now governs only the inferred bare-literal lane
- settled content-exact rows on code definitions earn the same final-cut
  reservation as grep-lane owners, and a lone extra settled site may take
  the second slot while a crowded field may not
- the primary block reserves two literal seats when the second brings a
  second proven file

Two settled registration sites now terminal-claim with both presented,
matching what a caller reading the grep output would conclude.
…ral recall

An issue names its subject far more often than it quotes it: measured over
the sealed-miss population, a distinctive identifier-shaped prose token
reaches the gold file three times as often as a quoted literal does. Mined
camel-case, underscore, dotted, and digit-bearing tokens — plus long plain
words — now feed the same bounded source-literal recall as quoted terms,
behind them in the term budget and under the same declaration-coverage
test. A dotted citation also contributes its final segment, since a member
written as owner.method is greppable only by the method name. Pages whose
task quotes nothing are no longer blind to source bodies.
Long plain words reach gold files too, but they are hub vocabulary: their
grep pages map to dozens of owners and the admitted rows displace real
evidence under the bounded page. Camel-case, dotted, underscore, and
digit-bearing tokens carry the citation signal without the noise.
…se-grep-gap

* origin/main: (142 commits)
  Exempt Python dunders from dead-code analysis
  store_sqlite: normalize native separators in generated dir columns
  store_sqlite: space WAL auto-checkpoints at 8k pages for index-write bursts
  store_sqlite: three-phase seeded reindex benchmark
  Update internal/semantic/tstypes/fact_spool.go
  ci(deps): bump github/codeql-action/upload-sarif
  store_sqlite: guard the json transport against unmarshalable payloads
  resolver: scope page_load to the pass clock
  resolver: split commit_apply interior timings
  store_sqlite: bind resolved-conversion updates as one json_each relation
  resolver: attribute pass interior time and churn shapes
  tstypes: true up spool capacity hints and page-cap/deadline comments
  resolver: note razor marker removals; make retention counters mean what they log
  fix(indexer): use incremental contract cleanup on untrack
  fix(mcp): cache index health scans
  fix(agents): register the OpenCode MCP server at user scope
  feat(agents): install the Gortex sub-agents for Codex CLI
  style: gofmt the init wizard test
  test(agents): regenerate the render goldens for the widened fence
  fix(uninstall): remove Claude Code's per-community skills too
  ...

# Conflicts:
#	docs/agents.md
#	internal/mcp/overlay_view.go
…ve Stop hooks on uninstall

The stricter linter set that landed on main flags row iteration without an
Err check, unchecked rollbacks and flushes, an unused helper, a per-loop
regexp compile, and a nil context; each gets the explicit form. The codex
render golden reflects the widened hook matchers this branch installs, and
the uninstall recogniser map gains the Stop event so the hooks this branch
writes are the hooks removal can find again.
The store_sqlite package under race and coverage sits just under the old
twenty-minute wall on Linux runners, and the localization projection tests
this branch adds push it past. Thirty minutes matches how long the suite
actually needs; the per-test alarms still catch a genuine hang early.
@zzet
zzet merged commit cd085c9 into main Aug 17, 2026
12 checks passed
@zzet
zzet deleted the feat/localization-literal-grounding branch August 20, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant