Import rules#
Keep the dependency direction between the Toolkit, the packs and the reference parts.
ci/import_rules.py checks it and fails the root migration_contract job when it breaks.
python3 ci/import_rules.py
The rules#
Tier |
May import |
|---|---|
|
Nothing else in the Toolkit |
|
|
|
|
|
|
|
Any Toolkit folder and the packs it requires |
Reference parts ( |
|
The Toolkit has no import statement for a pack or a reference part. Core loads parts by module name from the parts list, and MCP tool families from the MCP server’s family list; parts reach core through the part registry (Write a pack) and the contracts.
A pack’s required packs are its
geonemo-pack-*dependencies inpacks/<name>/pyproject.toml.Core’s router extension is the short list of core modules a reference part may import, under
[router_extension]inci/boundaries/tiers.toml.A folder’s
scripts/andtests/follow the folder’s rules forpacks/andreference/imports, including modules imported by name and paths in strings. They may import any required Toolkit folder.A missing optional part is skipped, so deleting
packs/andreference/leaves a Toolkit that checks, builds and passes its own tests.
Where the rules are#
File |
Holds |
|---|---|
|
A tier for every module, by longest matching path, and the |
|
Imports that break the rules today. It may only shrink |
|
The check |
When the check fails#
Failure |
Fix |
|---|---|
A module matches no rule |
Add a |
A new import breaks a rule |
Change the import: go through |
An allowlist entry no longer occurs |
Run |
The check reads only Python imports. It is standard-library only, so it runs before the environments are installed.