Skip to content

feat(processing): source-backed document references and contextual nomination (D122/D123) - #403

Merged
fazpu merged 14 commits into
mainfrom
feat/document-reference-context
Sep 14, 2026
Merged

fazpu merged 14 commits into
mainfrom
feat/document-reference-context

Conversation

@fazpu

@fazpu fazpu commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

A document can introduce a tournament in chunk 2 and discuss “that tournament” in chunk 7. Independent chunk extraction misses that connection; fact nomination can also miss relevant existing assertions even after the event is identified. This implements D122/D123 using source-backed references and ordinary entity resolution.

What changes

Selection saves its complete response once, including empty results and references with exact source passages. After every chunk has finished Selection, Claimify runs through the existing ground_claims work stage. It can use references from the previous eight chunks, including across section boundaries. The limits are four published references per Selection and eight references / 4,096 rendered characters per Claimify request. The source quotations must be cited; descriptive reference names are navigation hints.

Version reuse includes the source inputs of every eligible earlier producer, even one that emitted no references. Unchanged inputs reuse decisions and claim IDs, with every evidence range remapped to the new occurrence. The normal extraction barrier, readiness and connector finalization wait for Claimify. Late responses cannot republish forgotten sources; the new source-owned stores are scrubbed and verified by hard forget.

Normalization may identify up to four other entities discussed in an assertion, including a particular unnamed event with a descriptive name. Existing resolution remains authoritative. Fact nomination retains the same-subject 20-fact baseline and may add up to eight context matches. Sharing an event is not a decision that two propositions are the same: a win, participation and enjoyment remain different assertions. Context names and aliases enter the compact model presentation linked to their source assertion; database validation stays in the full internal snapshot.

The clean-store migration refuses populated prior stores. Full-v31 pins the combined generations, including the new Claimify work stage. No event type, extra date window, third extraction model call, grouping algorithm, provider default change or conversion framework is introduced.

Sources and validation

Binding: plan/designs/document_reference_context_design.md, contextual_fact_nomination_design.md, D119–D121, and plan/analysis/lean_processing_contracts.md. Detailed evidence and limitations: plan/implementation_evals/d122_d123_document_reference_context_20260914.md.

  • Actual 500-version E0–E3 proof: passed in 1,258.64 seconds; same claim ID, two exact ranges per occurrence, no repeated target extraction, distinct-source fact recount stays one.
  • PostgreSQL: 5 Selection/barrier/offset tests, 3 cross-section/alias/citation/negative-dependency tests, 16 readiness tests, 15 contextual nomination and forget tests, and 30 worker chain/reuse cases passed.
  • Unit checks: 59 core/profile, 46 extraction, and 184 benchmark tests passed. Test inventory and all import-boundary contracts passed.
  • Antigravity's runtime review verified the mechanics and required type corrections, which are applied. Final exact-head review and CI are running on the rebased head.

Rebased onto main 6205fe09, after PR400 and PR402 merged. No paid quality or cost result is claimed. A separately identified conv-42 processing experiment with explicit Gemma/Vertex routing follows merge; the standard Gemma benchmark variant remains reader-only. No answering or judging is part of that requested experiment.

Contributor agreement

Signing on behalf of a legal entity (leave blank if accepting individually):

Final review: Antigravity approved runtime e7553a1 with no material findings; its report and 81 independent PostgreSQL checks are recorded in plan/implementation_evals/d122_d123_agy_review_e7553a1a.md. Parent corrected the old retrieval fixture to run GROUND_CLAIMS; all 14 direct retrieval tests pass. Final head 7e64bed changes only tests/review evidence beyond the reviewed runtime. Exact-head CI is being collected before merge.

Preserve distinct cards that share a passage, measure Claimify bounds on
the rendered block, require merged status on identity redirects, and pin
the observed catalog constraint counts. Record the implementation eval.
The review found no blockers or material findings. Optional nits are
left unfixed so the reviewed code SHA remains the contract head.
Replace the temporary PassageSupport stand-in with the shared catalog
descriptor and PassageRegion. Card publication still requires a target
body passage, not keep-origin eligibility.
EXTRACT_CLAIMS now publishes one frozen Selection result per chunk, including
zero-candidate/zero-card outcomes and remapped same-input reuse. GROUND_CLAIMS
requires the target freeze and every previous-eight producer, hashes Claimify
inputs from those source bases, remaps occurrences through target-9..+1 windows,
and completes no-keep chunks without a provider call.
Pin RS-LoCoMo-Full-v31 to D122/D123 generations and the ground_claims E2
split. Extractor assertion-clarity-4:d122-source-references-1, normalizer
d123-context-refs-2, adjudicators d123-context-nom-2, concise renderer
concise-handles-2. GemmaVertex stays reader-only. Fingerprint regenerated
from prepare. Question manifests unchanged.
Adapt existing worker tests to the D122 two-stage contract: Selection
freezes on extract_claims, Claimify runs on ground_claims with the same
handler, and normalize waits for ground completion. Catalog stubs expose
selections and chunks_for_references.
@fazpu
fazpu force-pushed the feat/document-reference-context branch from 93f3acf to e7553a1 Compare September 14, 2026 13:12
@fazpu
fazpu marked this pull request as ready for review September 14, 2026 13:55
@fazpu
fazpu merged commit 01aabe5 into main Sep 14, 2026
16 checks passed
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