Skip to content

A bound statement becomes a typed fact - #752

Merged
WaylandYang merged 3 commits into
devfrom
feat/a-bound-statement-becomes-a-typed-fact
Sep 17, 2026
Merged

WaylandYang merged 3 commits into
devfrom
feat/a-bound-statement-becomes-a-typed-fact

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

0044 cut 2, second slice: the typed graph is computed from the open graph through the phrase bindings of #751 (decision 3: "typed rows carrying from_statement_id; materialisation and recomputation of the typed graph"). Pitfall 19 of docs/design/prior-work.md (a pipeline that cannot be re-run drifts).

What lands

Migration 0067: facts.from_statement_id (a typed row's source statement; checked to be typed-only; partial index), cascading with the statement.

utopia_store::materialize: one set operation per base, run at the end of every align_phrases job. Every live open statement under a bound signature becomes one layer = 'typed' row: predicate = the bound property, ends by the binding's direction (reverse swaps them), value, world-axis interval (valid_* as 0045 resolved it on the statement), attestation and confidence copied; the statement's evidence rows and role-word qualifiers are copied to the new row; from_statement_id points back. A statement with a mood qualifier is never materialised. Recomputation is the same operation: rows whose source no longer holds (the statement invalidated, the signature no longer bound, the property or direction changed, a mood added) are invalidated, rows that are due and missing are added, rows whose binding is unchanged keep their id, evidence and recorded time. Idempotent: a second run changes nothing. Ids are v7 from Rust (Postgres 17 has no uuidv7()), so rows are inserted one by one after one selecting query.

Test (a_bound_statement_becomes_a_typed_fact, database-backed, skipped without UTOPIA_DATABASE_URL): a statement under a forward binding gives one typed row with the property, copied interval, one evidence row and the since qualifier; the statement with a mood gives none; a second run is a no-op; flipping the binding to reverse retires the row and adds one with the ends swapped, the old row kept as invalidated; setting the binding to none retires it and adds nothing.

Measured

No model call. On the two bases of #751 after a run under the strict rule:

base bound signatures typed rows with evidence with role-word qualifiers with a world-axis interval
25-document batch (#743 extraction) 36 184 184 65 3 (that base predates the time resolution of #740)
NVDA four releases (#748 extraction) 29 125 125 70 0 (table rows carry their period as time words, resolved per document; none of these carried a resolved interval)

By property on the batch: value 106, change_from_prior_period 35, votes_for / votes_against / abstentions 10 each, officer_of 6, participated_in 4, filed 2, issued_by 1. On NVDA: earnings_per_share 21, operating_income 20, net_income 18, change_from_prior_period 12, gross_margin 11, the three vote counts 10 each, revenue 5, officer_of 4, partnered_with 2, invested_in 1. A second run on each base retired 0 and added 0.

The judge of #751 already read these typed facts against their chunks (95% stated on the batch, 76% on the NVDA releases); the rows are the same statements under the same bindings, now in the ledger where the timeline, the conflict detector and the signature checks read layer = 'typed'.

Not in this change

Merging the typed rows that several statements produce for one triple (the timeline's refinement in insert_fact_inner is not applied; one row per statement for now); implication rules and readings; typed qualifiers (fact_qualifiers by declared attribute) from role words; the alignment queue (#725).

🤖 Generated with Claude Code

WaylandYang and others added 3 commits September 18, 2026 04:49
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
@WaylandYang
WaylandYang merged commit 68e3bdd into dev Sep 17, 2026
4 checks passed
@WaylandYang
WaylandYang deleted the feat/a-bound-statement-becomes-a-typed-fact branch September 17, 2026 20:57
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