refactor(runtime): own provider-device admission behind a typed capability - #2556
Merged
thymikee merged 1 commit intoSep 13, 2026
Merged
Conversation
…ility Ten daemon files imported isActiveProviderDevice from src/provider-device-runtime.ts, so the daemon read provider runtime ownership mechanics directly from twelve sites (ten daemon, one daemon runtime composition, one src/core). The daemon now consumes a named capability: src/daemon/provider-device-admission.ts declares ProviderDeviceAdmission with the one fact the daemon decides on, defaults to the no-provider state every un-composed process already sees, and is installed by root composition where the provider request providers are already composed. The ten leaf call sites change only their import specifier; the predicate keeps its name, its per-call read, and the request-scoped ALS behaviour underneath it. src/core/interactors.ts keeps its edge: it also needs getProviderDeviceInteractor and sits below the daemon, so it cannot consume the daemon's seam. Part of #2541
thymikee
added this pull request to stack #2558
September 13, 2026 12:29
Size Report
Startup median (7 runs, lower is better):
|
Member
Author
|
No actionable findings on 32266c4. The composed delegate preserves per-call request-scoped ownership, and the router-level provider test covers the affected behavior. The remaining interactor seam is explicitly deferred to #2555. Current checks pass and there are no conflicts; ready for human review, with #2548 first in the merge order. |
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.
What
Gives the daemon its own typed capability for the one provider-runtime fact it decides on, so the daemon zone stops importing
src/provider-device-runtime.tsfrom ten sites (#2541).src/daemon/provider-device-admission.tsdeclaresProviderDeviceAdmission— one method,isActive(device)— defaults to the no-provider state every un-composed process already sees, and is installed by root composition at the site that already composes the provider request providers (src/daemon/server/daemon-runtime.ts). The predicate keeps its name, its per-call read, and the request-scoped ALS behaviour underneath it; the ten leaf call sites change only their import specifier.Why a capability and not a re-export
A re-export would keep the same edge under a different filename. The seam is the point: the daemon names the fact it needs, root names where it comes from, and R76 now has exactly one daemon edge to that hub to classify (see the stacked gate PR).
Measured
src/provider-device-runtime.tssrc/**production edges into that hubThe two remaining pairs are
src/daemon/server/daemon-runtime.ts -> src/provider-device-runtime.ts(root composition, now classified in the R76 inventory) andsrc/core/interactors.ts -> src/provider-device-runtime.ts.src/core/interactors.tskeeps its edge: it also needsgetProviderDeviceInteractorand sits below the daemon, so it cannot consume the daemon's seam. It is reached from the daemon only through the dynamic interactor lookup, which is now visible and classified with its own deepening issue (#2555).Test seams
Nine daemon test files and the provider-scenario integration harness drive provider ownership through the root ambient scope. They now compose the admission the way
daemon-runtime.tsdoes — oneinstallProviderDeviceAdmission({ isActive: isActiveProviderDevice })— instead of relying on the daemon reading root internals. Twovi.mockcall sites retarget to the daemon module.Validation
pnpm test:unit— 1,282 files, 9,872 tests passedpnpm check:layering— OK (R76 inventory with the widened predicate on the stacked tip)npx vitest run test/integration/provider-scenarios— 66 files, 209 tests passedpnpm check:affected --run— all slices pass exceptmutation-model, whosescripts/mutation/ownership.test.ts"a kernel is owned by tests that reach it indirectly" failure reproduces identically on unmodifiedorigin/main(3394d5b)Part of #2541 (the
src/core/interactors.tsedge and the interactor seam remain).