A kind word binds to a class - #741
Merged
Merged
Conversation
WaylandYang
force-pushed
the
feat/a-time-mention-is-resolved-against-its-document
branch
from
September 17, 2026 13:54
caa8ae2 to
db2682c
Compare
Base automatically changed from
feat/a-time-mention-is-resolved-against-its-document
to
dev
September 17, 2026 14:02
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
force-pushed
the
feat/a-kind-word-binds-to-a-class
branch
from
September 17, 2026 14:02
7975cf3 to
7733b07
Compare
This was referenced Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #740. The first slice of alignment (0044 decisions 3 and 4): a kind word binds to a class, once per base, and every entity of that kind gets the class. Extraction keeps writing only the document's kind word; classes stay the ontology's; the binding is the view between them.
What lands
Ledger (migration 0065):
type_bindings(base, normalised kind word, spellings seen, class or none, statusbound|none|undecided, the two votes,decided_at,decided_byagent | person, unique per base and word);entity_types.updated_atso a binding can be told stale;type_source = 'aligned'. Store:signatures(each kind word with count, spellings, example names and the relation phrases its things take part in),stale(bound to a class edited since, or none/undecided decided before a newer class),decide(a person's decision is never overwritten by the agent),apply/unapply(only rows a person has not typed),bound_map,propose(a kind word with no class is offered through the existing proposed-type flow).Contract (
utopia_extract::align): one call over a batch of kind words with candidate classes and definitions; choose a class only when every thing of this kind is an instance of it by its definition, else null.Job
align_types(per base; enqueued after each document's extraction and after a class is created or edited; one run per base at a time under an advisory lock): candidates by ontology embedding when the base has one, else the whole class list when it is small; two votes per word with the candidate order reversed on the second; agreement binds or records none, disagreement records undecided for the alignment queue (#725). Bound classes are written to the entities;run_openpasses a bound class into identity resolution so namesakes of different kinds separate again.Nothing is dropped for a word with no class: the entity keeps its kind word and its statements in the open graph; the only extra is a passive "add a class" suggestion on the ontology page.
Measured on the 25-document batch (14 hand-seeded classes, no embedding model)
180 kind words: 81 bound, 94 none, 5 undecided (two votes disagreed: builders, business, business segment, department, people). 338 of 802 live entities typed (42%); the untyped ones are mostly described things whose word names no kind ("capacity", "changes", "impact"). Bindings read well across domains: company / agency / government → organization; act / reports / application → document; asset / debt / line item / cash flow → financial_metric; disease / condition / side effect → medical_condition; study / trials → clinical_trial; 指标 → statistic; 汽车 / 工业产品 → product; patients / director nominee → person. One doubtful: warning → document.
The first run, triggered fourteen times by fourteen class creations, ran fourteen jobs in parallel and hit the model endpoint with 502s; the lock fixes that, and the serialised run completed with no failures.
Not in this change
Splitting long descriptions into a short head plus the statements folded into them; binding relation phrases to properties and materialising typed facts (the next slices of cut 2); the alignment review queue cards (#725).
🤖 Generated with Claude Code