Skip to content

feat(client-contract): add entity_choice and per-row entity_refs, re-record at apis 99e62038c - #26

Merged
jm-rivera merged 1 commit into
devfrom
feat/entity-choice
Oct 25, 2026
Merged

jm-rivera merged 1 commit into
devfrom
feat/entity-choice

Conversation

@jm-rivera

@jm-rivera jm-rivera commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The served document and every recorded scenario now come from dfo-apis 99e62038c, the dev deploy of DevelopmentFinanceObservatory/apis#119. NoDataOption.entity_choice and SentenceToken.entity_choice give the index into no_data.ambiguous_entities of the group an entity_ambiguous option settles or a slot token asks, so a client groups each place menu by it when two groups share one text. ParsedEntity gains an optional name, an unpinned row's identity apart from its words; an entity's identity is its dcid, else its name, else its text, and a name beside a dcid refuses request_invalid. Part.entity_refs has one entry per restatement.entities row.

The new search-place-ambiguous-twice scenario records "aid from Congo to Congo": one no_data part with two "Congo" groups, options carrying entity_choice 0, 0, 1 and 1, and slot tokens carrying 0 on the origin and 1 on the destination.

Three recorded answers changed beyond the new fields, from dfo-apis changes since the last capture at 0ba344270, chiefly DevelopmentFinanceObservatory/apis#132, which binds a constraint slot a reply leaves open. fetch-spec-narrowed, fetch-spec-entity-rebound and fetch-spec-entity-dropped now bind one cooperation modality and one finance type, so their shape label names "core support to non-governmental organisations, ..., standard grant". resubmit-candidates-sibling holds emittedThing at "Carbon Dioxide (CO2)". The slot labels "FinancialActivities" and "CarbonDioxide" read "Financial activities" and "Carbon Dioxide (CO2)", and three scenarios' slot filter provenance reads binder where it read measure_elected.

tools/capture_client_contract.py moves the long-build questions to 1964 and 1965, since dev had built the earlier years and answered 200 where the scenarios need a 202. _pacing_changes derives fetch-spec-poll-pacing-changes from any recorded build of three or more running polls, cycling 2,500, 4,000 and 1,000 ms over them, because a live build's poll count varies with load.

Testing: tools/validate_client_contract.py reports the contract valid with 121 scenarios. The client-contract tests passed (78), pytest tools/tests passed (526), and ruff check and format are clean.

Co-authored-by: Claude noreply@anthropic.com

…record at apis 99e62038c

served/openapi.json and SOURCE.json come from dfo-apis 99e62038c.
NoDataOption and SentenceToken carry entity_choice, the index into
no_data.ambiguous_entities of the group an option settles or a slot
asks, ParsedEntity carries an optional name, and Part.entity_refs has
one entry per restatement row. The 32 recorded scenarios are recorded
at that commit, including search-place-ambiguous-twice, two
entity_ambiguous groups of one text. The long-build questions move to
1964 and 1965, which dev had not built, and the poll-pacing derivation
cycles its waits over any recorded build of three or more running
polls.

Co-authored-by: Claude <noreply@anthropic.com>
@jm-rivera
jm-rivera marked this pull request as ready for review October 25, 2026 17:45
@jm-rivera
jm-rivera merged commit 98e53ee into dev Oct 25, 2026
22 checks passed
@jm-rivera
jm-rivera deleted the feat/entity-choice branch October 26, 2026 14:24
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