Skip to content

A phrase binds to a property - #751

Merged
WaylandYang merged 5 commits into
devfrom
feat/a-phrase-binds-to-a-property
Sep 17, 2026
Merged

WaylandYang merged 5 commits into
devfrom
feat/a-phrase-binds-to-a-property

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

0044 cut 2, first slice: a relation phrase binds to a property per signature (decision 3), the twin of the kind-word binding of #741. Pitfall 11 of docs/design/prior-work.md (arguments before relations; the (class, class) signature is part of the key).

What lands

Migration 0066: phrase_bindings (phrase × subject class × object class or value → property, direction, status bound / none / undecided, the votes, the statement count and three examples at decision time, decided by agent or person; UNIQUE NULLS NOT DISTINCT so an unbound side is its own signature) and relation_types.updated_at, touched on every update, which is what marks a binding stale.

utopia_store::phrase_bindings: the signature query (live open statements grouped by normalised phrase, the two ends' type_id and whether the object is a value, with three rendered statements and their quotes from fact_evidence), bindings, stale, and decide (upsert; a person's decision is never overwritten by the agent).

utopia_extract::phrase_align: the contract. One item per signature with its statements and quotes and the candidate properties (key, label, definition, kind, domain, range); the model answers [id, key | null, forward | reverse | null]. The rules are the kind-word rules turned to phrases: the property may be broader than the phrase, never narrower or merely related; judge by definition and sentences; null for a phrase that only reports or evaluates, for one whose sentences show different meanings, and for a value that is not what the attribute measures; direction follows the definition. Parsing is per item and tolerant, as in align.

utopia_server::phrase_alignment: the job align_phrases, per base under an advisory lock, enqueued when kind-word alignment finishes and when a property is created or updated. Candidates are the properties whose declared domain and range admit the signature's ends in either direction; an undeclared end admits anything, and an end whose kind word is bound to no class is admitted only by an undeclared end (the measurement below is why). More than 60 fitting candidates means the signature is skipped rather than guessed. Two votes with the candidates reversed; agreement binds, disagreement is undecided, null is none.

Both alignment jobs look for new work when they end. A run now re-enqueues itself when a batch failed (three 502s at the start of a kind-word run had left the 60 most frequent words undecided until the next document), when signatures or kind words appeared while it ran, or when bindings it made went stale while it ran (a property edited mid-run). A run that finds the lock held just returns: an earlier version of this branch had it queue itself behind the running one, which made the two kick each other in a 15 ms loop.

Nothing is materialised: facts.from_statement_id and the typed rows are the next slice.

Measured

A hand-written ontology of 14 classes and 28 properties (FDA, statistics, filings, notices) seeded into two bases; kind words aligned first by #741's job (60 of 400 bind on the batch, 15 of 230 on the NVDA releases: "financial measure", "line item", "trademark" fit none of the 14 classes).

25-document batch (extracted under #743, so its tables are pre-#744): 423 signatures over 861 statements.

binder bound signatures (statements) none / undecided / no candidate judge on the typed facts
proto, every property offered 90 (311, 36%) 305 / 28 / — stated 80.5%, misworded 16.8%, not stated 2.7% (150)
server, domain and range filter, unbound ends admitted 85 (311, 36%) 278 / 11 / 27 stated 87.3%, misworded 12.0%, not stated 0.7% (150)
server, this branch: an unbound end admitted only by an undeclared end 36 (184, 21%) 110 / 1 / 276 stated 94.9%, misworded 3.8%, not stated 1.3% (79)

NVDA four releases (#748 run), 334 signatures over 910 statements, most with an unbound subject: the proto offering every property bound 73 signatures (291 statements) at 59% stated, the generic value attribute having swallowed every cash-flow row ("NVIDIA —value→ (1,894)"); this branch binds 22 (70 statements, 8%) at 76% stated on 38, the nine wrong ones all one cash-flow section ("changes in operating assets and liabilities › accounts payable") bound to the change property.

Coverage follows the kind-word bindings and the ontology's size, not the binder: with a 14-class ontology most ends are unbound and 276 of the batch's signatures have no admissible property. Statements under those stay in the open graph and count toward the workbench's suggestions.

What still goes wrong: a phrase that carries part of the value ("下降 3.4%" bound to the change property loses its sign, which wants an implication rule with a reading); "granted → participated_in"; tense ("files" bound to filed).

Run-to-run: the proto's binding pass ran twice on the batch and bound 103 then 90 signatures, with 14 and 28 undecided. Two votes per signature narrow the variance, they do not remove it; the undecided ones are the queue's.

Not in this change

Materialisation (from_statement_id, typed rows, recomputation); implication rules and readings; a signature that tells a figure from words on the value side; the alignment queue page (#725); a debounce for bulk property creation (each creation queues a run; the lock serialises them and the end-of-run check catches the rest).

🤖 Generated with Claude Code

WaylandYang and others added 5 commits September 18, 2026 03:27
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
…behind the running one

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>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
@WaylandYang
WaylandYang merged commit f760c76 into dev Sep 17, 2026
4 checks passed
@WaylandYang
WaylandYang deleted the feat/a-phrase-binds-to-a-property branch September 17, 2026 20:38
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