Skip to content

nexum-runtime: reject colliding extension claims at boot#529

Merged
mfw78 merged 1 commit into
dev/m1from
feat/517-extension-collision-reject
Jul 23, 2026
Merged

nexum-runtime: reject colliding extension claims at boot#529
mfw78 merged 1 commit into
dev/m1from
feat/517-extension-collision-reject

Conversation

@mfw78

@mfw78 mfw78 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What

Add a single boot-time uniqueness pass, enforce_extension_uniqueness (crates/nexum-runtime/src/supervisor.rs), that fails fast when two wired extensions both claim any string in one of three collision classes: service namespace, subscription kind, or manifest section. The pass runs as the first statement of both boot paths, Supervisor::boot and Supervisor::boot_single, before capability_registry and HostServices::from_extensions. The pre-existing duplicate-namespace bail in HostServices::from_extensions is left in place. A new test, supervisor::tests::extension_claims_must_be_unique, boots a non-colliding set and then asserts a rejection on a duplicate subscription kind and on a duplicate manifest section.

Why

Each of the three classes dedupes silently downstream: namespace via a map, subscription kind via a BTreeSet, manifest section via an .any() scan. An unchecked collision therefore routes to whichever extension the map or scan hits first, rather than surfacing the misconfiguration. Enforcing uniqueness up front turns that silent mis-route into a fail-fast boot error. Scope is held to the minimal fix; the richer enum-seam / sha256 integrity-tag design and a second consumer are deferred to #528 and not built here.

Testing

All commands run from the worktree root inside nix develop --command, against the shared warm /code/nxm/runtime/target.

  • cargo fmt --all -- --check — clean, no diff.
  • cargo clean -p nexum-runtime then cargo clippy -p nexum-runtime --all-targets --all-features -- -D warnings — clean from a cold crate, no warnings.
  • cargo test -p nexum-runtime --all-features — 309 passed, 0 failed, plus 1 doctest passed. The new supervisor::tests::extension_claims_must_be_unique and the pre-existing extension_sections_must_be_claimed both pass.

AI Assistance

Implemented, reviewed and verified with Claude Code (Opus).

Closes #517

One boot-time uniqueness pass fails fast on a service namespace,
subscription kind, or manifest section two wired extensions both claim,
each of which silently dedupes downstream.
@mfw78
mfw78 force-pushed the feat/517-extension-collision-reject branch from 136c365 to b3a0e57 Compare July 23, 2026 14:15
@mfw78
mfw78 changed the base branch from feat/m5-pre-carve-runbook to dev/m1 July 23, 2026 14:15
@mfw78
mfw78 merged commit 149ee80 into dev/m1 Jul 23, 2026
@mfw78
mfw78 deleted the feat/517-extension-collision-reject branch July 23, 2026 14:42
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