Skip to content

An amount outlives adoption - #602

Merged
WaylandYang merged 2 commits into
devfrom
feat/an-amount-outlives-adoption
Sep 10, 2026
Merged

WaylandYang merged 2 commits into
devfrom
feat/an-amount-outlives-adoption

Conversation

@WaylandYang

@WaylandYang WaylandYang commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What

A qualifier written on an edge no longer depends on the relation being adopted first, and nothing about an edge is dropped for want of a definition.

  • Adoption carries the edge's attributes. adopt() copies fact_qualifiers from the invalidated row to the new one inside the same transaction and declares those qualifier types on the adopted relation (relation_type_qualifiers, additive). Before this, a relation that was unknown at extraction time came out of adoption with its amount gone.
  • An unknown predicate still takes a qualifier. When predicate_id is null (0010: the wording sits on the evidence) the qualifier binds to an attribute the base already defines and is written on the fact. No ontology changes here, so the auto_extend_ontology switch is not consulted; declaration happens at adoption.
  • A qualifier that binds to nothing is kept as a literal. If the base has no such attribute (in schema.org amount is an object property, not an attribute) or the ontology is frozen, the figure is written as a literal fact on the subject, worded relation.key on its evidence and recorded in ontology_misses — the shape rule 8a already gives an unlisted figure. Previously this went to the drop report with an example value and left the graph.
  • Prompt rule 8c now says a relation named after the text carries its figure the same way, keyed by the listed attribute that fits or by the plainest word when none does.
  • Recall bench flattens fact_qualifiers into the searchable row; since 0037 a value carried on an edge was invisible to the scorer.
  • An attribute on an entity reads its unit the way an edge does. The entity path stamped the declared unit unconditionally, so 500 兆瓦 filed under 金额 came out as ¥500; both paths now go through one unit_for (text first, sibling currency, the declared unit when the text spells it, never the default over an unread token). Unit-tested.
  • 0037's open question on unadopted relations is answered in the record.

Tests

  • crates/utopia-store/tests/an_amount_outlives_adoption.rs: a fact with a null predicate, invested_in on its evidence and amount = 1.5e9 $ on the edge; after adopt_proposed_predicates exactly one live row carries the qualifier and the relation declares amount.
  • Existing qualifier and extract tests pass; clippy clean.

Measured

Recall bench (scripts/bench/recall.mjs, 52 truth items, one round each, σ≈2.7):

build score note
dev (before #600) 40/52 oh-invest ($1.5 billion) missed
#600 41/52 oh-invest missed
#600 + this PR 40/52 oh-invest recovered: NVIDIA ⟨invested_in.amount⟩ "$1.5 billion" is in the graph; the exhibit's other figures (10 GW, $4.2 billion, $40 million) were not extracted this round, as in the dev round

The three scores sit inside one σ of each other; the change is not measurable as a total on this bench, only as which items land. The bench KB is a schema.org base with the ontology frozen for the round, so every edge qualifier goes through the literal fallback there (invested_in.amount, credit_support.initial_capacity, lease.duration).

Demo rehearsal (Chinese corpus, 12 documents, declared ontology, three runs on this stack): 21 edges carry 32 attributes, ¥ and $ as written, no quantity entities, no split names, no qualifier drops. An edge whose relation failed its range check (北辰云 ⟨founded⟩ 绿色算力中心, a facility) still carries its ¥2 billion — the unadopted path in action.

Stacked on #600.

Base automatically changed from fix/a-unit-is-read-not-assumed to dev September 10, 2026 23:43
WaylandYang and others added 2 commits September 11, 2026 07:44
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 force-pushed the feat/an-amount-outlives-adoption branch from f138a23 to 04c143c Compare September 10, 2026 23:44
@WaylandYang
WaylandYang merged commit 367e95c into dev Sep 10, 2026
4 checks passed
@WaylandYang
WaylandYang deleted the feat/an-amount-outlives-adoption branch September 10, 2026 23:47
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