Repository navigation
fix(search): keep each ambiguous place its own choice - #119
Merged
Merged
Conversation
jm-rivera
marked this pull request as ready for review
October 24, 2026 16:42
jm-rivera
force-pushed
the
fix/post-113-findings
branch
from
October 25, 2026 07:50
84c4f2d to
5f28d91
Compare
jm-rivera
force-pushed
the
fix/post-113-findings
branch
from
October 25, 2026 14:46
5f28d91 to
53c6101
Compare
jm-rivera
force-pushed
the
fix/post-113-findings
branch
from
October 25, 2026 16:07
53c6101 to
a2e2a18
Compare
…er's words
Two extracted names written alike in the query ("aid from Congo to
Congo") stay two choices. An entity's identity is its dcid, else its
name, else its text (ParsedEntity.identity). text holds the request's
words and feeds the resolver; the optional name gives an unpinned row
an identity apart from its words. A name beside a dcid refuses
request_invalid, as does an unpinned row whose name or text is a dcid
another row pins. Binding, roles, pins, members and options key on the
identity, so a chosen row posts its words and dcid and two pins are two
entities, while a self-flow pinned twice stays one.
The raw-text door records each name's grounded span in
RegionResult.entity_surfaces, which resolution reads, and both doors
pass the request's words to the leg as entity_words, so a pinned row's
words are masked in the variable phrase. surface_resolution.is_surface
and the parsed door compare words through qualifier_match._normalize.
entity_checks.part_entities holds the parsed door's entity checks, and
an option the door would refuse is not offered.
Every user-facing quote of an entity reads its words (words_of):
warnings, departures, role-not-admitted and unresolved terms. Repeated
words in an entity_ambiguous message name each group by direction or
ordinal, and two untold places written alike carry their graph labels.
NoDataOption and SentenceToken carry entity_choice, the index of the
group an option settles and the slot asks, and Part.entity_refs has one
entry per restatement row. Conformance clauses C12, C50c, C50e and
C141a describe the rules.
Co-authored-by: Claude <noreply@anthropic.com>
jm-rivera
force-pushed
the
fix/post-113-findings
branch
from
October 25, 2026 16:32
a2e2a18 to
916ac26
Compare
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.
Two places written alike in one query merge into one choice on dev. "aid from Congo to Congo", read as the Democratic Republic of the Congo to the Republic of the Congo, offers options that pin both ends to one country, because an entity's text is its identity on the parsed door and the raw-text door renames an extracted name to its span.
An entity's identity is now its dcid, else its name, else its text (
ParsedEntity.identityinmodels/request.py).textholds the request's words and feeds the resolver. The optionalnamegives an unpinned row an identity apart from its words, so{text: "Congo", name: "Democratic Republic of the Congo"}and{text: "Congo", name: "Republic of the Congo"}ask two choices. A name beside a dcid refusesrequest_invalid, as does an unpinned row whose name or text is a dcid another row pins. Pins, roles, members, dedupe and per-part resolution key on the identity, so a chosen row posts its words and dcid with no name, two pins are two entities, and "aid from Kenya to Kenya" stays one entity on two axes. The raw-text door keeps extracted names as identities and records each name's grounded span inRegionResult.entity_surfaces, which resolution reads.Both doors pass the request's words to the leg (
ResolveState.entity_words), so a pinned row's words are masked in the variable phrase, and every leg call on both doors passes them, so every user-facing quote of an entity reads them throughwords_of: warnings, departures, role-not-admitted and unresolved terms.surface_resolution.is_surfaceand the parsed door compare words throughqualifier_match._normalize, so words differing only in case are one text.conjoin.pybuilds each option from the asked words and drops any the parsed door would refuse (entity_checks.part_entities).NoDataOption.entity_choiceandSentenceToken.entity_choicecarry the index intono_data.ambiguous_entitiesof the group an option settles and the slot asks, since two groups can share their words. Repeated words in an entity_ambiguous message name each group by direction,"Congo" (from) and "Congo" (to), or by ordinal; two untold places written alike carry their graph labels in a role_not_resolved refusal.Part.entity_refshas one entry per restatement row. Conformance clauses C12, C50c, C50e and C141a state the rules.dfo-website groups menus by
entity_choicewith a fallback to mention text in DevelopmentFinanceObservatory/website#66, so the site works before and after this deploys. The spec-kit capture and the dfo-ai mirror pick upname,entity_choiceand theentity_refsdescription after deploy.Testing: each new test fails without its change, including every option of "Congo to Congo" and of two pinned Congos answering 200, a dropped direction quoting "Kenya" for a pinned row, and the alike-words messages. Locally
tests/engine,render,models,contractandplatformpassed, as did ruff, format andty check.Co-authored-by: Claude noreply@anthropic.com