Repository navigation
Support internacia-db contract 5 and the trade agreements registry (0.6.0) - #19
Merged
Merged
Conversation
….6.0). internacia-db 5.0.0 adds trade_agreements, trade_agreement_parties and the country_trade_agreements view, and moves 34 two-party FTA intblocks (USKR, CETA, EUJP, ...) into the registry under the same id (intblocks_aliases reason "moved", new column target_dataset). No table, column or type the SDK reads changed, so SUPPORTED_CONTRACT_MAJORS becomes (3, 4, 5) and TESTED_CONTRACT (5, 0). - resolve_id/resolve_code report target_dataset, the table that holds the resolved id: trade_agreements for moved ids, otherwise the queried table (also on 3.x/4.x alias tables without the column). - client.trade_agreements: get_by_id, get_parties and get_by_country; None or [] on databases before 5.0. Its methods become LLM and MCP tools like every other client, and intblock_lookup returns the agreement for a moved id. - tests/contract checks the registry and moved ids on 5.x and the empty accessor on older databases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ivbeg
added a commit
to datenoio/internacia-db
that referenced
this pull request
Nov 22, 2026
INTERNACIA_SDK_REF moves to datenoio/internacia-python#19 head 527b391 (0.6.0, contracts 3 to 5), whose tests/contract suite passes against the 5.0.0 build; 74f9338 only accepts contracts 3 and 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ivbeg
added a commit
to datenoio/internacia-db
that referenced
this pull request
Nov 22, 2026
The squash merge of datenoio/internacia-python#19 has the same tree as the previously pinned PR head 527b391. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
internacia-db 5.0.0 (contract 5.0, release PR datenoio/internacia-db#206) fails its "Run the internacia SDK contract suite" step because this SDK only accepts contracts 3.x and 4.x. This PR adds support for contract 5.
What contract 5 changed
trade_agreementsandtrade_agreement_parties, and a new viewcountry_trade_agreements.USKR,CETA,EUJP,CHAFTA, …) moved out ofintblocks/membershipsintotrade_agreementsunder the same id.intblocks_aliasesgained atarget_datasetcolumn and the reasonmoved.USCRismergedintoCAFTADR.Changes
internacia/contract.py:SUPPORTED_CONTRACT_MAJORS = (3, 4, 5),TESTED_CONTRACT = (5, 0). Error messages now say "3.x, 4.x or 5.x".resolve_id/resolve_codereturn a newtarget_datasetfield: the table that holdsid. It istrade_agreementsformovedids, the queried table otherwise, and None when there is no id. On 3.x/4.x alias tables, which have no such column, status and id work as before.client.trade_agreements(internacia/trade_agreements.py):get_by_idget_parties(current_only=False)get_by_country(reads thecountry_trade_agreementsview)TradeAgreement,TradeAgreementParty,CountryTradeAgreement.[]on databases before 5.0.internacia.toolsand the MCP server make a tool from every client inTOOL_CLIENTS, sotrade_agreements_*tools come for free.intblock_lookupnow returns the trade agreement for a moved id.Tests
tests/contract: new checks for the registry and moved ids on 5.x databases, and for the empty accessor on older ones.tests/test_trade_agreements.py: unit tests on small 5.0-shaped and 4.4-shaped DuckDB files (moved/merged/retired aliases, the accessor,intblock_lookup).tests/internacia-db.json). The data-bump workflow will move the pin to 5.0.0 once that release is published.Ran locally (Python 3.13):
INTERNACIA_CONTRACT_DB_PATH=<5.0.0 build> pytest tests/contract -q: 30 passed (also 30 passed on 4.4.0).After this merges, or using this PR's head commit, internacia-db should point
INTERNACIA_SDK_REFinvalidate.ymlandrelease.ymlat it.🤖 Generated with Claude Code