A value keeps its undeclared object as part of the predicate - #686
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
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.
Fixes #685.
What was wrong
A fact can carry both a
valueand anobjectthat the model never declared as an entity:{"subject_ref": "k2", "predicate": "build", "object": "new energy generation", "object_ref": null, "value": "at least 10 GW", "quote": "SB Energy and SoftBank will build at least 10 GW of new energy generation"}None of the literal branches in
extraction.rsaccepted(value, undeclared non-literal object). The fact went down the relation path, where span verification marked the object as a description. It then landed as a literal whose value was the object phrase ("new energy generation"), with anobject_undeclareddrop, and the number was thrown away. Written value-only, the same sentence keeps its figure. So whether "at least 10 GW", "at least $4.2 billion" and "incremental $40 million" reach the graph depended on which of two equally reasonable shapes the model chose. This explains the SB Energy exhibit losing all three in one recall round tonight (15/15 → 10/15 on that document). The shape appears in 0–1.5% of facts per round, on builds from before #637 through current dev.What changed
A new literal branch, structure only: when a value is present and the object has no handle and isn't a name declared in the response or earlier in the document (case-insensitive), the fact is a value fact. The object phrase goes into the surface predicate (
build new energy generation), so it is kept, not discarded, and the quote stays as evidence. A referenced or declared object still takes the relation path. The existing branches (value only, a quantity as object, an undeclared literal under an unknown predicate) are unchanged; they now also return the surface predicate, which is the model's predicate.Verification
a_phrase_beside_a_value_is_not_an_entitycovers the helper: no handle and undeclared → value; handle, declared name (any case) or blank → not.buildfact"new energy generation", surfacebuild(the figure is lost)object_undeclared"at least 10 GW", surfacebuild new energy generationIn both builds the second fact in the reply, whose object
SoftBankis declared (object_ref: e2), is an edge.utopia-serverandutopia-extracttests: 323 passed on a migrated database. Clippy-D warningsand fmt are clean.🤖 Generated with Claude Code