From d2ffc11f1eb2bcb2a84d15808779fe13b4d91e26 Mon Sep 17 00:00:00 2001 From: Jiri Puc Date: Mon, 14 Sep 2026 11:16:24 +0200 Subject: [PATCH] design: accept clear lean processing contracts and defer grouped application --- decisions.md | 71 ++++++++ design/README.md | 3 + design/proposals/grouped_fact_adjudication.md | 42 +++++ plan/README.md | 9 + plan/analysis/lean_processing_contracts.md | 97 +++++++++++ .../concise_adjudication_inputs_design.md | 92 ++++++++++ .../contextual_fact_nomination_design.md | 138 +++++++++++++++ .../document_reference_context_design.md | 157 ++++++++++++++++++ .../processing_prompt_clarity_design.md | 105 ++++++++++++ plan/handoffs/2026-09-14-d120-d121-grok.md | 55 ++++++ plan/handoffs/2026-09-14-d122-d123-grok.md | 64 +++++++ plan/plans/lean_processing_delivery.md | 64 +++++++ 12 files changed, 897 insertions(+) create mode 100644 design/proposals/grouped_fact_adjudication.md create mode 100644 plan/analysis/lean_processing_contracts.md create mode 100644 plan/designs/concise_adjudication_inputs_design.md create mode 100644 plan/designs/contextual_fact_nomination_design.md create mode 100644 plan/designs/document_reference_context_design.md create mode 100644 plan/designs/processing_prompt_clarity_design.md create mode 100644 plan/handoffs/2026-09-14-d120-d121-grok.md create mode 100644 plan/handoffs/2026-09-14-d122-d123-grok.md create mode 100644 plan/plans/lean_processing_delivery.md diff --git a/decisions.md b/decisions.md index a3f673c89..1b767ac05 100644 --- a/decisions.md +++ b/decisions.md @@ -5742,6 +5742,10 @@ absence-based closures indefinitely. ## D118. Immutable claims, mutable facts, one world-time window +> Processing amendments D120–D123 clarify assertion identity, project concise +> model inputs and add source-backed context nomination. D118's one world window, +> ordered application and validation/forget authority remain in force. + **Status:** accepted when merged; replacement runtime is not implemented by this amendment. **Date:** 2026-09-07. @@ -5787,3 +5791,70 @@ withdraws PR #384's incompatible unshipped framework and gates replacement code on concrete storage, consumer and deletion contracts. Already merged canonical SQL, extraction vocabulary and all evaluator variants remain intact. No schema upgrade, benchmark gain, runtime acceptance, merge or release is claimed here. + +## D120. Clear processing prompts preserve the assertion being made + +**Status:** accepted 2026-09-14, binding when merged. A shared person/event is +not a shared proposition. Processing prompts explain claims, assertions, facts, +source times and world dates plainly, with contrasting repetition, correction, +attribution and distinct-assertion examples. Preserve winning information when +the candidate says only participation or enjoyment. Keep existing writer +operations; no semantic checker call, new temporal class or human prompt-exam +ceremony. Roll affected inference generations and validate both false merges +and unnecessary duplication. Confidence thresholds alone were rejected because +the audited wrong assignment was already highly confident. + +**Authority:** [design](plan/designs/processing_prompt_clarity_design.md), +[analysis](plan/analysis/lean_processing_contracts.md), +[delivery](plan/plans/lean_processing_delivery.md). + +## D121. Present concise evidence while retaining full database validation + +**Status:** accepted 2026-09-14, binding when merged. Deterministically project +the prepared adjudication snapshot into complete semantic evidence with short +attempt-local handles and factored repeated text. Translate a closed model-facing +response through that exact attempt's typed mapping into the existing writer. +Retain hashes, ownership and generation bookkeeping internally. Preserve witness +membership, source distinctions, snapshot checks, source deletion and inference +outside locks. A smaller evidence set and a model-generated summary were rejected +as unnecessary correctness/cost risks. Measure input/schema/output tokens without +promising a fixed saving. + +**Authority:** [design](plan/designs/concise_adjudication_inputs_design.md), +[analysis](plan/analysis/lean_processing_contracts.md), +[delivery](plan/plans/lean_processing_delivery.md). + +## D122. Share frozen source reference context between extraction chunks + +**Status:** accepted 2026-09-14, binding when merged. Extend the existing +Selection response with exact-source-backed reference cards, freeze/reuse it, +then run Claimify after an idempotent representation Selection barrier. Supply +bounded preceding source context with explicit positive and negative reuse +dependencies. This amends D119 local context, D56 reuse inputs and D84 scheduling; +it preserves D119 occurrence spans, same-claim-ID reuse and existing entity +resolution authority. No new extraction model call or mutable alias registry. +A durable Selection intermediate and barrier are accepted costs. Timing-dependent +live hints, ungrounded summary inventories and whole-document prompt lists were +rejected; E3-only reuse would not help extraction understand distant introductions. + +**Authority:** [design](plan/designs/document_reference_context_design.md), +[analysis](plan/analysis/lean_processing_contracts.md), +[delivery](plan/plans/lean_processing_delivery.md). + +## D123. Use source-backed entity context to nominate fact candidates + +**Status:** accepted 2026-09-14, binding when merged. Existing normalization +emits bounded generic context references; existing resolution produces immutable +source-owned application bindings. Derive fact context from current supporting +applications. Preserve the baseline same-subject/same-plane nomination and union +bounded additional shared-context candidates. Context improves reach but never +proves fact identity or absence of matches. Keep attributed subjects, dates on +ordinary facts, profiles as derived descriptions, and D118 order/locking/forget. +No event table/type, fact event column, profile neighborhood retrieval or extra +model call. An event-only filter or smaller fallback was rejected without recall +evidence. Expanded candidates can add cost; D121 supplies independent compaction. + +**Authority:** [design](plan/designs/contextual_fact_nomination_design.md), +[analysis](plan/analysis/lean_processing_contracts.md), +[delivery](plan/plans/lean_processing_delivery.md). Grouped application is only +an [unchosen proposal](design/proposals/grouped_fact_adjudication.md). diff --git a/design/README.md b/design/README.md index d66002cd2..e408535b7 100644 --- a/design/README.md +++ b/design/README.md @@ -13,6 +13,9 @@ lost in chat. Analysis and research notes: [`../plan/analysis/`](../plan/analysis/). +Processing: [D120–D123 design and delivery map](../plan/plans/lean_processing_delivery.md). +Unchosen efficiency alternative: [grouped fact adjudication](proposals/grouped_fact_adjudication.md). + ## PostgreSQL 19 live-graph review evidence - [Design review round 1](reviews/postgres19_live_graph_design_review_round1.md) diff --git a/design/proposals/grouped_fact_adjudication.md b/design/proposals/grouped_fact_adjudication.md new file mode 100644 index 000000000..817786c65 --- /dev/null +++ b/design/proposals/grouped_fact_adjudication.md @@ -0,0 +1,42 @@ +# Group small ordered sets of fact assertions + +**Status:** proposal, explicitly not accepted for implementation. 2026-09-14. +**User direction:** record point 6 for a separate decision after the individual +processing improvements. No implementing agent may treat this file as a task. + +## Problem and proposed alternative + +Several pending assertions can share the same event/source evidence. After D121 +compacts each individual prompt, repetition between calls may remain. The +alternative is one call for a small contiguous prefix of already admitted work +on the same canonical subject, with shared evidence shown once and an ordered +outcome for every incoming assertion. + +Initial experimental group limits of four and eight are comparison points, not +accepted defaults. Do not wait to fill a group or skip queue heads to cherry-pick +all facts about one event. No event scheduler. If contexts do not overlap, a group +may cost more; measure its whole prompt, schema and output. + +## Contract changes requiring a future decision + +Each assertion retains its own meaning, provenance and receipt. A later item can +refer to an earlier item's new fact through a local handle. One coherent snapshot +is inferred outside locks, revalidated and applied sequentially in one transaction. +A stale or invalid plan retries/rolls back the bounded group, with no silent +partial completion. Source deletion, support moves and per-assertion repair jobs +must remain correct. These are application-boundary changes, not just prompt +formatting; they require binding design before code. + +## Adoption trigger and comparison + +Consider acceptance only after clear individual prompts, concise inputs, source +references and candidate nomination have measured validation results. First +measure context overlap without inference. Then compare total input/output cost, +call count, latency, retried work, candidate coverage, lost assertions and duplicate +facts. Reject a saving that depends on merging distinct propositions or ignoring +retry amplification. Provider-free tests are not model-semantic evidence. + +The retained alternative is ordinary one-assertion application with compact +inputs. It has simpler retries and already preserves ordered receipts. Grouping +must earn its additional coordination through measured end-to-end processing +benefit; it is not needed to deliver D119–D123. diff --git a/plan/README.md b/plan/README.md index ef5b29539..27d80ef82 100644 --- a/plan/README.md +++ b/plan/README.md @@ -11,6 +11,15 @@ and the [implementation sequence](plans/temporal_clocks.md). The and rejected alternatives. PR #384 withdraws the old incomplete implementation; this design does not claim that the replacement runtime ships. +For the processing improvements, see [D120 clear prompts](designs/processing_prompt_clarity_design.md), +[D121 concise evidence](designs/concise_adjudication_inputs_design.md), +[D122 document references](designs/document_reference_context_design.md) and +[D123 contextual nomination](designs/contextual_fact_nomination_design.md). +The [analysis](analysis/lean_processing_contracts.md) explains the costs and +alternatives; the [delivery plan](plans/lean_processing_delivery.md) coordinates +these with D119 multi-span extraction in PR #400. Grouped adjudication remains +an [unchosen proposal](../design/proposals/grouped_fact_adjudication.md). + D107's [canonical arithmetic and extraction](designs/temporal_clocks_design.md) remain applicable. Its other fact-time rules and the D110–D113 framework are superseded by D118's explicit authority map. Their documents and SQL remain diff --git a/plan/analysis/lean_processing_contracts.md b/plan/analysis/lean_processing_contracts.md new file mode 100644 index 000000000..7baeecb25 --- /dev/null +++ b/plan/analysis/lean_processing_contracts.md @@ -0,0 +1,97 @@ +# Lean processing: evidence behind D120–D123 + +**Status:** analysis, not authority. 2026-09-14. Scope is ingestion/processing; +retrieval and answering are excluded. The user authorized accepted designs and +Grok implementation for clear assertion-preserving prompts, concise adjudication +inputs, document references and event-based nomination. Grouped application is +an unchosen proposal. Multi-span extraction is the separate accepted D119 lane. + +## Observations, hypotheses and constraints + +The v28 conversation-42 run cost about $12.40 in processing, including $9.16 in +fact adjudication and about $0.04 in entity resolution. Adjudication inputs +averaged 26,561 tokens. These runs mistakenly used Luna high for processing; +future paid processing trials must verify Vertex/Gemma at each generation stage. +Changing provider rates alone does not meet the requested cost reduction. +No new paid trial is authorized by this implementation handoff. + +The audit found a winning assertion assigned to enjoyment, and another retained +only as participation. Same tournament does not mean same assertion. Some +specific tournament entities already exist; the entity mechanism itself is not +absent. Most stored facts are observations without structured event references. +Event nomination therefore needs a path from source referents through normalized +assertions, not merely a better entity-name prompt. + +Detailed source inventories and measured evidence, inspected 2026-09-14: + +- [Processing audit](https://github.com/writeitai/ultimate-memory-cloud/blob/a56f95bf/design/analysis/locomo-v28-processed-data-audit-20260914.md). +- [Cost evidence](https://github.com/writeitai/ultimate-memory-cloud/blob/a56f95bf/design/analysis/locomo-ingestion-cost-quality-20260914.md). +- [Independent exploration](https://github.com/writeitai/ultimate-memory-cloud/blob/a56f95bf/design/analysis/event-context-and-fact-adjudication.md). + +At engine baseline b2d32a5a, `spine/fact_adjudication.py` directly serializes the +prepared snapshot. Its phrase “same-event corrections normally attach to that +identity” is ambiguous about event versus fact identity. `fact_application_inputs.py` +nominates exact matches then full-text candidates, same subject and fact plane, +including zero-ranked fill. The source and support snapshots contain duplicate +text and administrative metadata. These observations justify semantic task +clarity and deterministic projection independently of event improvements. + +## Alternatives and economics + +Raising confidence thresholds would not address the observed 0.98-confidence +incorrect assignment. Another semantic checker/model call adds cost without +fixing an unclear primary task. A clear prompt with contrasting fixtures is the +selected correction; reference and operation validation remain deterministic, +but do not prove semantic equivalence. + +Deleting evidence to shorten prompts risks hiding corrections and contradictions. +Lossless presentation of semantic content is selected before changing nomination. +Keep full validation inputs internally; remove bookkeeping only from the model +view. Short handles need a response adapter tied to the exact attempt. This is +more precise than telling a UUID response schema to return F1 informally. + +Event-only nomination would make older unlinked observations and split event +identities unreachable. Event context is an additional priority signal with +broader nomination retained. No extra fact category, date authority or event +table is needed. Generic source-backed context references can also describe +companies, people and creative works without a classifier or regex taxonomy. + +Grouping pending assertions promises repeated-context savings but changes retry +and receipt contracts. It remains in `design/proposals/`; individual prompt +projection does not depend on accepting grouping. Holding locks during provider +inference, permanent prompt caches and a separate event scheduler are rejected. + +## Validation interpretation + +Provider-free fixtures prove grounding, reference mapping, retries, snapshot +invalidation, source deletion and invariants. They do not prove that a real model +chooses the right fact. Model-semantic claims must identify the actual model, +input corpus and results; no invented measured saving. Benchmark candidate +coverage separately from end-to-end fact assignments. Count input/output/schema +tokens, retries, total calls and repair work, not just the shortest prompt. + +The user does not require a separate human prompt-exam ceremony. Human-readable +instructions, documented contrasting examples and ordinary code/design review +are the accepted clarity standard. + +## Independent analyses and resolution + +Two independent read-only analyses inspected actual E2/E3 scheduling and candidate +contracts. The document-reference analysis found no existing pre-extraction +source-backed entity inventory: E0 summaries are not a safe substitute. The +selected D122 contract freezes existing Selection output, adds one barrier and +bounds preceding producer units. Its review required an explicit no-Claimify-call +path for zero kept propositions and empty-representation completion; incorporated. +E3-only reuse was rejected because it cannot inform chunk-7 extraction. + +The event-nomination analysis recommended generic source-owned application bindings +rather than fact event columns, and preserving the baseline 20 plus up to eight +additional context candidates. This is deliberately coverage-first, not evidence +of lower token cost. Its draft review clarified positive membership/current +testimony, canonical-subject exclusion, auxiliary overflow without assertion loss, +excluding baseline IDs before the extra limit, atomic staging and full binding/ +currency fingerprints. These were incorporated in D123. D121's review avoided a +new registry by putting the renderer version in the existing generation/fingerprint. + +These are design reviews, not implementation or real-model acceptance. All +semantic/cost hypotheses still require the evidence distinguished above. diff --git a/plan/designs/concise_adjudication_inputs_design.md b/plan/designs/concise_adjudication_inputs_design.md new file mode 100644 index 000000000..b0e3e3751 --- /dev/null +++ b/plan/designs/concise_adjudication_inputs_design.md @@ -0,0 +1,92 @@ +# Concise evidence presentation for ordinary adjudication + +**Status:** D121, accepted 2026-09-14; binding when merged. +**Analysis:** [lean processing evidence](../analysis/lean_processing_contracts.md). +**Related:** [D120 prompt clarity](processing_prompt_clarity_design.md). + +## Decision and boundary + +The database prepares a complete validation snapshot so a decision can be checked +after inference. The model needs its semantic evidence, not database bookkeeping. +Derive a deterministic, compact presentation from the same snapshot. Do not use +another model to summarize it. Preserve D118 locking, fingerprinting, compare-and- +swap publication, revalidation, atomic application and source-erasure inventory. + +For this projection change, candidate and witness membership are unchanged. +D123 nomination is a separately measured change. Input compaction must not hide +evidence by imposing a smaller token cap and silently dropping rows. + +## Model-visible information + +Present the incoming assertion; each candidate fact's complete meaning and chosen +world window; original source claims and supporting exact passages; source time +distinct from raw world dates; attribution and testimony currency; relevant +support/contradiction links; window-witness links; and original assertions and +their current assignment needed for any permitted support move. Preserve input +limits/truncation disclosures and existing confidence/evidence information that +can affect the decision. Context-only facts are identified as non-editable. + +Remove deployment IDs, generation strings, membership hashes, repeated structural +keys and database audit timestamps that provide no semantic authority. Do not +remove reporting dates or source identity: distinct sources with identical words +remain distinct testimony. Keep a documented field mapping from the full snapshot +to the presentation, with each omitted field's administrative purpose. + +Factor repeated text into a dictionary referenced by source/claim/assertion rows. +Exact text sharing is storage/presentation deduplication, not evidence identity +deduplication. Preserve each occurrence's source attribution, dates and provenance. +Do not paraphrase or discard qualifications. One source passage can support several +assertions without being copied into each row. + +## Short references and response translation + +Use deterministic attempt-local names such as F1 (fact), C1 (claim), A1 (assertion) +and E1 (entity). Build bijective typed mappings from the prepared snapshot's stable +ordered rows. New-fact handles occupy a separate namespace. Real deployment IDs +and UUIDs remain internal. These references have no cross-attempt meaning. + +Provide a closed model-facing response schema accepting those handles for every +existing operation, including window witnesses, support moves and contradictions. +Translate it through the exact prepared attempt's mapping into the existing +`FactApplicationDecision` and writer. Unknown handles, wrong kinds, ambiguous +names and context-only mutation targets fail validation; never recover by guessing. + +The renderer/response-adapter version is included in the adjudicator generation +and prepared-input fingerprint; no new registry is required. Deterministically +rebuild mappings from frozen inputs, or store them as part of the same prepared +payload if necessary; no independently mutable mapping table or second content +cache. A retry of an attempt preserves mappings. A new attempt cannot consume a +reply for an older attempt, even if both contain a name F1. Existing attempt/CAS +and snapshot checks remain authoritative. Publication stores the validated +translated decision under the existing source-existence checks. + +The ordinary no-candidate deterministic path continues using internal objects; +it need not round-trip through model handles. Invalid provider references follow +the existing failed-decision retry behavior with no partial writes. + +## Security, deletion and operational consequences + +The compact view is untrusted evidence inside trusted instructions. It grants no +new database access or operations. Do not expose or log secrets while measuring +inputs. Full prepared inputs and translated decisions remain under existing +forget ownership; the projection must not create an untracked durable copy. +If diagnostic fixtures retain source text, existing deletion and fixture policies +apply. No new data store, model call, lock spanning inference or scheduler. + +## Acceptance evidence + +- Round-trip every permitted response reference and reject wrong/stale handles. +- Compare semantic field membership before/after projection, including identical + text in different sources, attributed/withdrawn claims and correction witnesses. +- Exercise support moves, new handles, explicit date clearing, contradictions, + snapshot changes, source deletion and late provider answers under PostgreSQL. +- Measure complete rendered input plus schema tokens against the full snapshot + on representative small/large inputs. Label reconstructed fixtures honestly. +- Run D120 assertion-preservation scenarios. Mock outputs prove translation and + application, not real-model semantic quality. + +Roll adjudicator generation/protocol fingerprints where required. Public output +schemas need not change merely because internal prompt handles change. Report +measured reduction without promising a fixed ratio or total conversation price. +The alternative of fewer witnesses loses to correctness; the alternative of +model-generated summaries loses to added cost and possible semantic loss. diff --git a/plan/designs/contextual_fact_nomination_design.md b/plan/designs/contextual_fact_nomination_design.md new file mode 100644 index 000000000..c4807acfa --- /dev/null +++ b/plan/designs/contextual_fact_nomination_design.md @@ -0,0 +1,138 @@ +# Source-backed entity context for fact nomination + +**Status:** D123, accepted 2026-09-14; binding when merged. +**Analysis:** [lean processing](../analysis/lean_processing_contracts.md). +**Dependencies:** D120 assertion preservation, D121 concise inputs and D122 +source reference context. D118's fact application and temporal authority remain. + +## Problem and chosen representation + +Knowing which tournament a claim discusses can help find an earlier winning fact. +It cannot establish that winning and enjoying that tournament are the same fact. +Use ordinary resolved entities as nomination context, without an event taxonomy +or event ID column on every fact. The mechanism also supports a company, person +or creative work when it is a source-grounded referent of an assertion. + +Extend the existing normalization response for each assertion with a bounded +list of ordinary `EntityRef` context references. They must be explicit referents +in the grounded claim, not entities guessed from unrelated profiles. The existing +normalizer call emits them; no additional inference stage. Four additional +references is the initial generation-pinned bound. Deduplicate in emitted order, +retain the first four and record truncation; auxiliary overflow must not cause +schema rejection of the whole normalization response, discard an otherwise valid +assertion or prove novelty. Preserve original reference ordinals and document the +cap clearly in the provider schema. + +The subject remains the correct subject. “Joanna said Nate won Tournament A” +remains attributed to Joanna; Nate and Tournament A can be context. Relations' +object endpoints automatically contribute context and need not be duplicated. +No mandatory event type, bare-noun exception or name/date identity shortcut. + +## Frozen outputs and resolved bindings + +Freeze references with the existing normalization output. Resolve them through +the ordinary contextual resolver/D102 replay and persist source-owned resolved +bindings on the assertion application. Use one small application-to-entity +junction with stable reference ordinals and validating resolver decisions. Do not +introduce an independent mutable document alias registry. + +Stage an application only when its recorded context result is complete under +the pinned generation. Provider/retry failures follow the normal ledger policy; +do not silently publish a different subset depending on worker timing. A valid +empty list is allowed. The application and source claim supply ownership; +canonical redirects are read under existing identity coordination. +Publish the application, complete binding set and version staging rows atomically. +Published bindings are immutable and retries reuse the first complete set. No +application is admission-eligible with half-written bindings. Enforce same- +deployment ownership for application, entity and validating resolver decision. + +A fact's context set is derived from applied applications with supports stance +whose claims are current testimony, not +copied onto the fact. Support moves therefore change the association through +the existing support pointer. Contradiction-only applications do not establish +positive context membership. Source deletion removes its bindings and contribution. +Merge/unmerge and invalidation must not leave a stale canonical cache; re-read +bindings and canonical membership under the existing snapshot protocol. +Canonicalize and deduplicate context entities, excluding the fact/incoming +application's own canonical subject, including for self-relations. Withdrawal +removes positive context contribution; eligible history retains baseline reach. + +## Candidate selection and novelty + +Retain the current same-canonical-subject, same-fact-plane editable domain. +Compute the existing baseline nomination unchanged: up to 20 facts, exact +triple/statement first, then full-text rank, including zero-ranked fallback and +completed world intervals. Independently nominate up to eight additional facts +in that domain whose supporting applications share an incoming context entity. +Exclude all baseline IDs before applying the additional-eight limit. +Union and deduplicate; the maximum is 28. Rank shared-context candidates first +for presentation, with exact match, full-text rank and stable fact ID as ties. + +These initial bounds are generation-pinned and must be measured. Expansion is +deliberately conservative: it cannot displace a target the baseline would have +provided. It is a quality/coverage change, not a claimed token saving. D121 pays +for removing redundant prompt material. Reducing the fallback requires separate +measured candidate-recall evidence and a design amendment, not an undocumented +optimization by the implementer. + +An empty context search is not a new-fact authorization. The deterministic +novelty path is available only when the ordinary same-subject/same-plane domain +contains no eligible candidate. Dates and entity overlap are never hard identity +filters. Mistaken event splits and unlinked observations retain baseline reach. +No cross-plane targets, cross-subject writes or new event-based work ordering. + +## Model context and date authority + +Present context entities with their source-grounded names and the supplied claim +evidence. Use D121 handles/text factoring to avoid repeating event descriptions. +Do not pull an unrelated mutable profile or graph neighborhood outside the +prepared snapshot and use it as date evidence. This design adds no cross-subject +profile retrieval or opposite-plane editable/context facts. + +Events remain ordinary entities. If source testimony says a tournament ran +3–5 November, a supported observation that it took place can carry that existing +world window. A winning assertion can instead carry the final's date. Do not +fabricate a took-place observation solely to populate a profile and do not +automatically propagate event duration to every connected assertion. + +Profiles remain deterministic derived fact descriptions. Existing repair refreshes +them when their supporting facts change. They hold no independent chosen date. +Dates do not enter stable entity IDs. D120 examples explicitly separate shared +event identity from repetition/correction of a particular assertion. + +## Snapshot safety, deletion and recovery + +Include context binding values, canonical identities and relevant membership in +the full validation snapshot/fingerprint. Nomination is rerun after acquiring +ordered locks and before applying an answer. New supporting applications, support +moves, identity changes, withdrawal and forget can change the context set; stale +decisions retry under D118. Preserve existing global/identity/entity/claim/fact/ +application lock order and never hold these locks during provider inference. +The fingerprint includes binding values, resolved canonical membership, support +stance and the claim currency used for selection, not only selected fact IDs. + +Include every reference description actually shown in source-consumption and +forget inventories. New junction rows cascade or are explicitly deleted by +source-owned applications, with verification queries and pending input scrubbing. +No background fact-context repair service or permanent event evidence cache. + +## Acceptance and operational costs + +Test relation/observation parity; unchanged attributed subjects; same event with +different assertions; repeated wins; corrected dates; same-date distinct events; +mistaken event splits; zero-rank paraphrases; baseline target preservation; empty +context with nonempty baseline; support moves; contradiction-only support; merge/ +unmerge; deletion during inference; late responses and context membership changes. +Measure nomination recall and rendered total tokens separately, with observation +coverage explicit. Do not claim a semantic model improvement from mocked decisions. + +Use indexed application/context joins and bounded row payloads. Membership hashes +may stream relevant rows as D118 already does. Context resolution and expanded +candidates can add cost; measure them in the implementation report. Roll affected +normalizer/adjudicator generations and protocol artifacts coherently with D119–122. +Do not change provider defaults, evaluator settings or existing benchmark stores. + +Rejected alternatives are per-fact event columns requiring repair, moving facts +to event subjects, event-only nomination, unsupported smaller fallback, event +taxonomies and a model-generated profile call. All add authority or lose evidence +that the chosen generic source-backed application context can preserve. diff --git a/plan/designs/document_reference_context_design.md b/plan/designs/document_reference_context_design.md new file mode 100644 index 000000000..96d37bf0b --- /dev/null +++ b/plan/designs/document_reference_context_design.md @@ -0,0 +1,157 @@ +# Stable source references shared during document extraction + +**Status:** D122, accepted 2026-09-14; binding when merged. +**Analysis:** [lean processing](../analysis/lean_processing_contracts.md). +This explicitly amends D119's extraction-context boundary, D56 reuse inputs and +D84 extraction scheduling. It preserves D119 multi-span grounding and D102's +existing validated document-local entity-resolution replay. + +## Problem and decision + +A document can introduce a tournament in chunk 2 and discuss “that tournament” +in chunk 7. Independent extraction cannot see beyond its local neighbors, and +a shared list populated in worker-completion order would make results unstable. +Use the two existing extraction calls, Selection and Claimify, with a stable +boundary between them. Selection identifies useful propositions and source-backed +referents. Save its complete output once. After all required Selection results +are present for a representation, Claimify runs in parallel using a bounded set +of those references. There is no third extraction call or serial chunk pipeline. + +A reference identifies something the source discusses: a person, company, work +or particular event. It is not yet a globally resolved entity. No mandatory type +field, event registry, date authority or fuzzy alias shortcut is introduced. + +## Source reference cards + +Extend Selection's existing closed output with a bounded list of referents +introduced by selected or contextual source text it is permitted to see. Each +contains a short descriptive name and provided passage references supporting it. +Local aliases may be included only when the shown source establishes them. +The same grounding checks as D119 map these references to exact source ranges. +Generated summaries and section orientation cannot justify a reference. + +Only definitions with at least one target-chunk body passage are published by +that Selection unit; its allowed neighbor evidence may clarify them. This avoids +every neighbor publishing duplicate introductions. Do not merge cards by equal +name/date/participants. A particular unnamed tournament is eligible when source +context identifies it; a bare unqualified “tournament” is not an identity proof. +Ambiguous references may remain unresolved. + +The card shown to Claimify includes its descriptive label and exact supporting +passages. Labels are orientation, not evidence. Temporary card and passage IDs +are scoped to that request and never become entity IDs or claim text. Claimify +writes a self-contained human-readable claim, preserving the original attribution +and qualifiers, and cites every source passage required to establish its referent. + +## Bounded context policy + +Each target may receive cards whose owning Selection units lie within the previous +eight source chunks of the same representation, in addition to existing local +context. The region can cross section boundaries; this is an explicit D119 +amendment. Never cross document versions, representations or documents. + +Initial versioned bounds are four published cards per Selection result, eight +cards per Claimify request and 4,096 total characters of card text including +support passages. They are explicit operating bounds to measure, not an optimality +claim. Rank eligible cards by exact source/name-token overlap with target source +text, then nearest owning source chunk, then stable card ordinal. No extra model +or vector search. Zero overlap may still admit a nearby card needed for a pronoun. +Limit by whole cards; do not trim away evidence and retain its unsupported label. +Record cap/ambiguity losses through existing extraction diagnostics. No distant +introduction outside the region is promised to be available. + +The claim still belongs to a selected target proposition. A card may clarify +that proposition; it cannot resurrect a dropped proposition from another chunk +or smuggle an entire event profile into evidence. D119's total claim-span bound +still applies. If all needed support will not fit, do not drop a citation and +accept the claim; account for the failure. Multi-span provenance resolves each +range separately, never one bounding range across unrelated text. + +## Persistence, scheduling and retries + +Use one source-owned Selection-result store and the existing work ledger/barrier +pattern. Store the full validated response, including zero-proposition/zero-card +results, its generation and stable source-input basis. Normalize temporary labels +to validated source descriptors before persistence; preserve exact text and +range/origin information needed for occurrence remapping. + +Matching prior-version inputs reuse the frozen Selection output; retries never +regenerate a committed response. Uncommitted concurrent calls may race, but only +one accepted result becomes authoritative through existing transaction/CAS +patterns. Do not add a second queue or distributed cache. Associate results with +each consuming chunk occurrence so position changes do not corrupt evidence. + +The Selection barrier uses the expected chunks of the immutable representation +and pinned generations. Create Claimify work idempotently and transactionally +once all results exist. Reused results count as complete. A terminal missing or +invalid Selection result cannot be silently treated as zero references. Existing +failure/retry policy remains visible. Claim normalization begins only after the +existing extraction-completion barrier, now covering Claimify. +Successful Selection with no kept propositions may still publish grounded cards +for other chunks. Its own Claimify completes deterministically without a model +call. Empty representations follow the existing empty completion path. + +## Reuse, including negative dependencies + +Selection's stable reuse basis is its existing own/neighbor source context, +header and generation. Claimify's effective basis adds the ordered stable +Selection-input bases of every owning unit in its eligible preceding region, +including units that emitted no cards, and the reference-policy generation. +Those Selection bases include any neighbor source used to define their cards. + +Hashing only cited/admitted cards is incorrect: an edited chunk may introduce a +competing referent even though the old cited card is unchanged. Hashing the entire +document is unnecessarily broad. A fixed source region captures both positive +and negative dependencies while bounding the spread of invalidation. + +Do not include absolute offsets, document-version IDs, temporary labels or freshly +generated summaries in content identity. Identical stable inputs must reuse the +same frozen Selection decision, not call the model to obtain new cards. For each +new occurrence remap all selected evidence into its allowed source units, including +reference-card passages. Reject ambiguous repeated-text remapping; never take the +first global substring match. Existing D56 same-claim-ID reuse and D119 occurrence +evidence stay mandatory. Header timestamp changes retain their documented broader +invalidation; shifting chunk boundaries can also change actual input context. + +## Relationship to E3 and entity resolution + +The grounded, self-contained claim carries the referent into normalization. E3 +may emit the ordinary subject/object and D123's context references from that +claim. It resolves them through the current resolver, including D102's validated +same-document replay. Choosing a source-local card does not bypass resolution. +There is no new durable card-to-global-entity alias registry in this design. +Source-local card handles, global entity UUIDs and D121 prompt handles have +different scopes and cannot substitute for one another. + +## Deletion, rollout and acceptance + +Selection outputs/cards are source-owned content. Include them, their occurrence +links and pending work in hard-forget deletion and verification. Deletion and +publication must use existing forget coordination so a late Selection/Claimify +answer cannot resurrect erased text. Multi-version reuse does not exempt source +copies from erasure. No additional long-lived profile or quote cache. + +Coordinate schema/component generations with D119. Use the project's clean-store +upgrade refusal where populated stores cannot satisfy new generation contracts; +do not add a conversion framework or reset any existing store. Regenerate all +affected manifests/protocol pins and update shipped processing documentation. + +Required tests: worker-order permutations; a chunk-2 introduction used in chunk 7; +two similar/same-date tournaments; source-local aliases; no-reference results; +cross-section evidence; source reference forgery; changed/competing introductions; +an empty reference producer becoming nonempty; edits outside the eligible region; +pure offset movement; ambiguous repeated passages; 500-version claim reuse and +provider-call counts; barrier restart; forget during Selection/Claimify; and +unchanged attribution. Provider-free tests establish these invariants, not model +coreference quality. Measure added prompt tokens and source-to-ready latency. + +## Costs and rejected alternatives + +One durable intermediate and one barrier are necessary to share the existing +Selection output deterministically. Cards add prompt tokens and the barrier can +delay a fast chunk behind a slow Selection unit. Keep these costs visible. +An E3-only roster cannot help Claimify resolve the distant introduction. E0 +summary calls do not consistently see original source and would broaden unrelated +contracts. A mutable discovered-so-far list makes outcomes timing-dependent. +A whole-document list increases ambiguity, prompt size and reuse invalidation. +The bounded Selection-to-Claimify design is chosen over those alternatives. diff --git a/plan/designs/processing_prompt_clarity_design.md b/plan/designs/processing_prompt_clarity_design.md new file mode 100644 index 000000000..f0f6f6fb8 --- /dev/null +++ b/plan/designs/processing_prompt_clarity_design.md @@ -0,0 +1,105 @@ +# Clear processing instructions that preserve assertions + +**Status:** D120, accepted by the user on 2026-09-14; binding when merged. +**Analysis:** [lean processing evidence](../analysis/lean_processing_contracts.md). +This amends the processing-prompt portions of D118 and E2/E3 contracts. It does +not change the fact schema, adjudication writer operations or retrieval semantics. + +## Problem and decision + +Sources say things; extracted claims preserve them; normalized assertions express +one relation or observation; stored facts interpret supporting and contrary +testimony. A person or event is an entity. Those identities are distinct from +the identity of a proposition about them. Instructions must explain these +concepts in plain language before describing response fields. + +“Nate won Tournament A,” “Nate participated in Tournament A” and “Nate enjoyed +Tournament A” concern the same entities but assert different things. A win may +imply participation, but recording only participation loses the result. Attaching +testimony must preserve the substantive incoming assertion, including attribution, +negation, degree, dates and distinguishing qualifiers. + +## Adjudication contract + +The model decides one incoming assertion using supplied source evidence and +candidate facts. It distinguishes repetition of a proposition, a different +proposition about the same referent, contrary testimony and correction of an +existing proposition. These are explanations of existing operations, not new +stored categories or an extra classification call. + +| Incoming assertion and context | Existing fact | Required interpretation | +| --- | --- | --- | +| Took first place in the same tournament | Won that tournament | Compatible paraphrase can share the winning fact | +| Won that tournament | Enjoyed that tournament | Keep winning separately | +| Won that tournament | Participated in that tournament | Do not lose the stronger winning assertion | +| Corrects the same win's date from 5 November to 6 November | Won on 5 November | Reconsider that fact's window with cited evidence | +| Won another tournament | Won the earlier tournament | Distinct winning fact even if wording/dates match | +| Source says Nate claimed to win | Nate won | Preserve attribution; the statement of a claim is not automatically an unqualified win | +| Lost the same tournament | Won that tournament | Handle contrary testimony explicitly using supported contradiction/correction operations | + +An insufficient destination requires preserving the assertion separately through +the existing new-fact path. The current writer does not support arbitrary +rewriting of an existing fact's statement; the prompt must not promise it. +Neither equal text nor equal event/entity IDs authorizes automatic attachment. +The original assertions must be available for permitted support moves. Repeated +testimony for one result must not mint a new win merely because a source or date +spelling differs. All output operations retain D118 validation and receipts. + +## Date language and examples + +Prompts distinguish source reporting time, source-stated world dates, chosen fact +world dates and database belief timestamps. They never use “date” or “identity” +without a clear referent when more than one is present. + +- A source published on 10 November can report a win on 5 November. Publication + is not a fallback occurrence date when the world date is unknown. +- Raw source ends are inclusive. “3 November through 5 November,” day precision, + becomes a stored window `[3 November 00:00 UTC, 6 November 00:00 UTC)`. + Stored ends are already exclusive; do not advance 6 November again. +- A day represents a calendar day, not a precisely observed midnight instant. + Month/year precision must not invent a precise day. +- A missing end does not establish ongoing status. Only explicitly supported + `open` has that meaning. D118's partial-window shapes remain valid. +- Attaching evidence does not itself change chosen dates. Omitted replacement + preserves them; an explicit supported replacement changes or clears them. +- A claim containing a 2019 hiring and a 1990 company founding does not assign + the hiring window to both normalized assertions. `uses_claim_window` applies + only to the particular assertion for which that source window is evidence. + +Use existing canonical arithmetic and window validation; do not introduce a +parallel date parser or vocabulary. The exact enum/schema definitions are the +machine contract, with plain explanations next to their semantic use. + +## Prompt organization and safety + +Each affected prompt states purpose, inputs, decision rules, representative +contrasting examples and output requirements in that order where practical. +Use one consistent vocabulary; remove superseded/duplicated instructions instead +of accumulating exceptions. Extractor, normalizer and adjudicator definitions +must agree. Short input handles do not justify cryptic instructions. + +Source passages, claims, aliases and profiles are untrusted data, never commands. +Separate instruction text from the data envelope. Only supplied evidence and +references may authorize model decisions; source text cannot expand operations. +Extraction remains grounded under D119, and summaries remain orientation only. + +## Delivery, recovery and acceptance + +Change only affected E2/E3/adjudication prompts and necessary examples/schema +descriptions; answering and judging are outside scope. Roll the corresponding +component generations and protocol identity when inference semantics change; +frozen responses from an old generation must not be presented as new decisions. +Preserve ordinary retries, source deletion, inference outside locks and the +existing conservative fallback. No extra semantic judge or queue is introduced. + +Tests cover the table above, unknown/partial/open dates, inclusive conversion, +already-canonical dates and attribution. Include both false merges and duplicate +wins. Provider doubles verify output application and invariants, not real-model +comprehension. A separate human interpretation exam is not required. Ordinary +review must be able to understand the prompt without reconstructing this chat. +Report actual semantic evidence separately from mocked validation. + +Costs are prompt-token changes and generation rollout. The alternative of terse +jargon loses to explicit semantics; the alternative of a second checker loses +to cost and duplicated responsibility. No quality improvement is claimed merely +because wording is clearer. diff --git a/plan/handoffs/2026-09-14-d120-d121-grok.md b/plan/handoffs/2026-09-14-d120-d121-grok.md new file mode 100644 index 000000000..08ce9d376 --- /dev/null +++ b/plan/handoffs/2026-09-14-d120-d121-grok.md @@ -0,0 +1,55 @@ +# Grok implementation: clear prompts and concise adjudication inputs + +The user authorized implementation, Antigravity review, CLA assent, parent final +review/adjustments/merges and appropriate releases. You implement D120/D121 only; +the parent owns integration, merges and releases. Keep code simple, YAGNI, and all +instructions/prompts clear enough for a human to understand without this chat. +There is no separate human prompt-exam requirement. + +Read CLAUDE.md, the D120/D121 designs, their analysis and +`plan/plans/lean_processing_delivery.md`. D122/D123 and grouping are outside your +code scope. Do not change locks, candidate/evidence membership, provider defaults, +fact temporal schema or answering/judging. A formatter must not silently summarize +away semantic evidence. Implement an actual closed model response adapter for +short handles; an unchanged UUID schema with informal F1 prose is incorrect. + +Work in the isolated branch/worktree provided in your launcher prompt. D119 is +being implemented separately in PR #400 at +`/Users/jpuc/code/moje/ultimate_memory/ugm-multispan-claims`; read-only inspection is +allowed, but never edit it. Start independent adjudicator/normalizer work. Before +final review, fetch main and PR #400 status. Integrate/rebase onto completed D119 +when available; avoid overwriting its E2 source-span schema or generation pins. +If #400 remains active, commit your useful independent work and report the exact +remaining integration step rather than blocking all work on it. + +Test actual translation/application, stale attempts, identical text from distinct +sources, witness/currency/attribution preservation, support moves, contradictions, +date clearing, source forget and PostgreSQL retries. Include contrasting semantic +fixtures and deterministic token measurements on representative inputs. Mocked +answers do not prove real-model quality. Use isolated local databases and preserve +other processes. Never access/mutate remote v27/v28/v18 stores or launch paid LoCoMo +inference. Do not introduce a legacy conversion framework or reset existing data. + +Update affected generations, protocol identities, shipped docs and design details +in the same PR. Rebase onto current main before final review and regenerate pins +from source. Create/push a draft PR against main with a concrete description and +the repository's checked CLA text (user authorized). Do not merge or release. + +After implementation and meaningful checks, obtain an independent Antigravity +review using exactly: + +```text +agy --dangerously-skip-permissions --print-timeout 180m0s -p "" +``` + +Do not substitute another agent. Include exact head SHA, worktree/diff, designs, +test evidence and review focus: correctness, prompt clarity, date ambiguity, +semantic information retention, mapping/retry/forget safety and simplicity. The +reviewer must inspect read-only. Preserve its report, address material findings, +and request follow-up review of substantive fixes. Keep the multi-hour timeout. + +Write the final implementation report in `plan/implementation_evals/`, naming the +PR/head, actual behavior, field projection map, test commands/results, token +measurements, exact reviewed SHA/verdict, fixes and limitations. Parent reviews +your final diff and combined behavior. Do not end at an implementation plan or +claim completion while required work remains. diff --git a/plan/handoffs/2026-09-14-d122-d123-grok.md b/plan/handoffs/2026-09-14-d122-d123-grok.md new file mode 100644 index 000000000..d4e528f1f --- /dev/null +++ b/plan/handoffs/2026-09-14-d122-d123-grok.md @@ -0,0 +1,64 @@ +# Grok implementation: document references and contextual fact nomination + +The user authorized D122/D123 implementation, Antigravity review and parent final +review/adjustments/merges. The parent owns merges and releases. Keep the solution +simple, YAGNI, with clear human-readable instructions and prompts. Read CLAUDE.md, +D122/D123, D120/D121, their analysis and the lean processing delivery plan. + +Use your isolated provided worktree. D119 multi-span extraction is PR #400; +D120/D121 is a separate concurrent lane. Inspect both read-only. Begin useful +mapping, fixtures and independent context-binding work; integrate D119's completed +source-span implementation before changing E2 scheduling. Before final review, +rebase onto completed D119 and D120/D121. Do not cherry-pick uncommitted work, edit +another lane's files or invent a parallel multi-span implementation. Parent will +provide PR/head integration updates in the supervisor note path in your launcher. + +Implement the accepted complete contracts: persisted/reused Selection results, +idempotent Selection barrier, bounded preceding exact-source cards, explicit +negative reuse dependencies, zero-proposition no-call completion, D119 full-span +remapping and 500-version same-claim-ID reuse. Implement generic source-backed +normalizer context references, ordinary entity resolution, immutable application +junction bindings with atomic staging, positive current-testimony membership, +canonical-subject exclusion and baseline-preserving additional nomination. + +Do not add an event type/table, per-fact event column, new date window, local alias +registry, extra model call, grouped adjudication, event scheduler or profile +neighborhood fetch. Dates remain on supported facts; profile descriptions are +derived. Existing inference-outside-locks and source deletion contracts apply. +Do not drop assertions for auxiliary context overflow. Same event never means +same proposition; D120 remains the semantic rule. Context-empty is not novelty. + +Meaningful tests include source-grounded references, changed/competing/zero-to-new +introductions, bounded negative dependencies, offset shifts, ambiguous remapping, +worker-order permutations, barrier restart and empty documents, 500-version reuse, +attribution, relation/observation parity, baseline candidate preservation, support +moves, withdrawal, merge/unmerge, stale snapshots and source erasure during both +extraction and adjudication. Run affected PostgreSQL integration and ordinary CI +lanes, with isolated local DBs; do not reset another lane's database. + +Record exact token/candidate coverage evidence without claiming model-semantic +quality from provider doubles. No paid LoCoMo run, remote benchmark changes, +provider-default changes, answering/judging changes or legacy-store conversion. +Never wipe an existing store. Clean-store migration refusal remains explicit. + +Create/push a draft PR with checked repository CLA text (authorized), precise +behavior, source contracts, tests and limitations. Rebase to latest main and +regenerate all migration/generation/manifest/protocol artifacts from final source. +Update shipped documentation in the same PR. Do not merge or release yourself. + +Obtain review with exactly: + +```text +agy --dangerously-skip-permissions --print-timeout 180m0s -p "" +``` + +Include exact SHA/worktree/diff, binding designs and relevant test evidence. +Request read-only correctness, simplicity, grounding/reuse, ordering/atomicity, +forget, prompt/date clarity and nomination review. Keep the multi-hour timeout. +Address material findings and obtain follow-up review on substantive fixes. + +Finish with a durable `plan/implementation_evals/` report and final output naming +PR/head, complete behavior, tests/results, coverage/token measurements, review +SHA/verdict/fixes, remaining risks and integration needs. Parent independently +reviews the code and combined result. Do not stop at a plan when implementation +work remains possible. diff --git a/plan/plans/lean_processing_delivery.md b/plan/plans/lean_processing_delivery.md new file mode 100644 index 000000000..7f8a3060b --- /dev/null +++ b/plan/plans/lean_processing_delivery.md @@ -0,0 +1,64 @@ +# Delivery and supervision: D119–D123 + +**Status:** execution plan, 2026-09-14. Designs own contracts; this file owns +sequence. The user authorized Grok implementation, Antigravity review, parent +final review/adjustments/merges, CLA assent and appropriate releases. No separate +human prompt-exam exercise. Keep instructions understandable and the code simple. + +## Lanes and merge sequence + +1. **D119 extraction**, PR #400, `feat/multi-span-claim-extraction`: finish the + already running Grok implementation, meaningful unit/PostgreSQL checks, + Antigravity and originally requested Cursor reviews, then parent code and + evidence review. This lane does not absorb D122 scheduling/context changes. +2. **D120/D121 clear prompts and concise inputs**: a separate Grok lane can work + while D119 completes. It must preserve candidate/evidence membership, implement + the typed prompt-reference adapter and write a complete field projection map. + Rebase onto merged D119 before its final review; coordinate E2 wording against + that implementation rather than overwriting its source-span schema. +3. **D122/D123 document references and context nomination**: another Grok lane + starts from the committed designs, reviews/maps the implementation, then bases + runtime edits on the completed D119 and D120/D121 branches. No parallel edits + in shared worktrees. It implements Selection persistence/barrier, bounded + negative dependencies and generic application context together so the source + references actually reach observations and candidate nomination. +4. Parent checks the combined main branch and releases only a validated coherent + set of runtime changes. Generation numbers/migration IDs/protocol fingerprints + are reconciled during rebases and regenerated from final source. Never reuse + a protocol identity for changed semantics. Follow existing release automation + and do not bypass CI or publish a tag for an unvalidated snapshot. + +Each implementation PR has an Antigravity review against its exact final commit: + +```text +agy --dangerously-skip-permissions --print-timeout 180m0s -p "" +``` + +Grok is invoked as: + +```text +grok --always-approve --model grok-4.6 -p "" +``` + +Reviewers inspect read-only. Record findings, fixes, validation commands and exact +reviewed SHAs in `plan/implementation_evals/`. Re-review material fixes and rebases. +Only the parent merges/releases; implementers finish with reviewable PRs and reports. + +## Acceptance and limits + +Parent review checks factual assertion preservation, all date meanings, real +provider/schema wiring, deterministic retries, source ownership/forget, 500-version +reuse, candidate fallback/novelty, generation pins and shipped docs. CI integration +lanes must run on runtime changes. A mocked provider's chosen answer is not +evidence of model comprehension. Separate measured token arithmetic from real +inference cost/quality and distinguish tests from benchmark results. + +Use isolated local test databases; do not modify the existing remote v27/v28/v18 +benchmark stores, start paid LoCoMo runs, add provider fallbacks or change answering/ +judging. Vertex/Gemma bindings are required before any later authorized paid +processing experiment. Do not add legacy store conversion. The clean-store +refusal policy never authorizes wiping an existing store. + +Grouped assertions remain the [unchosen proposal](../../design/proposals/grouped_fact_adjudication.md). +No implementation work for grouping, new temporal types/windows, model judges, +event registries or locks during inference is included.