Repository navigation
core: add the language-neutral extension-resolution plan contract - #1124
Merged
Merged
Conversation
Add `dirsql::extension_resolution` with the plan/select contract and its unit tests, implementations stubbed. Pushed on its own so CI is observed red before the implementation lands. The shape follows #1078: the core reads the configs and decides which entries need a host package lookup, the launcher answers only "where is package X installed", and the core turns that answer into a concrete path. The loadable suffix list is a parameter because it differs per host (`.pyd` vs `.node`).
`plan_config_extensions` parses each config's `[[dirsql.extension]]` array, returns `None` when no entry names a package, and otherwise plans every entry: literals joined onto their own config's directory, bare names as a package lookup the host performs. `select_loadable` turns the host's answer into the one loadable file, or the not-found / ambiguous error. Nothing calls it yet; the SDK migrations are #1120 and #1121.
This was referenced Sep 17, 2026
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 #1119. Slice A of #1111, under epic #1072.
Adds
dirsql::extension_resolution, the language-neutral half of theextension-resolution cluster the Python and TypeScript launchers each carry a
port of today. Nothing calls it yet — the SDK migrations are #1120 and #1121,
and #1122 deletes the duplicates.
Shape
Per #1078: the core owns everything except "where is package
Xinstalled onthis host".
plan_config_extensions(configs, suffixes) -> Option<Vec<PlanEntry>>parseseach config's
[[dirsql.extension]]array, returnsNonewhen no entrynames a package (so the core's own loading and error reporting stay
untouched), and otherwise plans every entry — literals resolved against
their own config's directory, bare names as a
Packagethe host must locate.select_loadable(name, dirs, candidates, suffixes)picks the single loadablefile out of the listing the host walked. Zero and more than one are both
errors.
is_bare_name(path, suffixes)is the classification both of the above use.The suffix list is a parameter rather than a constant because it genuinely
differs per host: Python counts
.pyd, Node counts.node.Two deliberate normalizations, both landing in the migration slices
is_bare_nametreats\as a separator on every platform. Python'sos.altsepisNoneon posix, soa\b.sois classified as a package namethere today. That is a bug, not a contract.
*.so, matching Python. TheTypeScript message currently reads
(.so); #1111 Slice C: migrate TypeScript extension resolution to Rust plan #1121 brings it in line.Neither is observable until an SDK migrates onto this module, so neither needs
a migration fragment here.
Red/green
The contract and its 14 unit tests were pushed first, on 3739490, with the
implementations
todo!(). CI was observed red on that commit before theimplementation was written: the
Unit testsjob failed with exactly those 14tests and nothing else, each panicking at the stub it exercises
(job).
The implementation is 9f049fb.
Manual run
Built a scratch crate against this one and drove the public API over a real
config and a real package directory:
The literal resolved against the config's own directory with its entrypoint
intact, the bare name planned a package lookup with the correct shadow probe,
and
select_loadablepickedvec0.soout of a directory also holding__init__.py— matching whatdirsql/resolve_extension.pydoes today.Gates
just preflight --conventions .github/workflows/dirsql-rust-ci.yml: 0 failingpairs (colocated-test, unit-lint, integration-lint, mutation; packaging skipped
— needs a built artifact).
unit mutation: 15 mutants tested, 0 survivors.cargo llvm-cov --lib --features cli --branch: regions 93.65 / functions 93.15/ lines 94.50 / branch 79.94, all above the floors (91 / 91 / 92 / 72).
cargo test --workspace --features cli: all green, 882 lib tests.PARITY.md
Not updated: no SDK's public API surface moves in this slice.
PARITY.mdgetsits update in #1120 / #1121, where behavior actually crosses into the SDKs.
E2E Verification
packages/python/e2e-attestations/<branch>.jsonreceipt writtenpackages/ts/e2e-attestations/<branch>.jsonreceipt writtenjust e2e-attest-python,just e2e-attest-ts,cargo test --workspace --features clithe implemented tree, not just the red commit.
Changelog / Migrations
packages/rust/changelog.d/