Repository navigation
Commit 8d280a2
refactor(request): move the device-inventory context out of core (#1993)
`device-inventory-context.ts` is an AsyncLocalStorage holder: it imports only
`node:async_hooks`, kernel errors, and contracts types, and nothing from `core`.
`daemon-modularity.ts` already describes `src/request/` as "request-global daemon
plumbing (progress sinks, cancellation, AsyncLocalStorage)", and `request/progress.ts`
is the same shape — a `withX`/accessor pair over one store.
Living in `core` (rank 2) made the platform-runtime composition root reach up to
rank 2 for `listLocalDeviceInventory`. Injecting the lookup would not have fixed
that: the only caller, `platform-runtime-operation-host.ts`, is in the same zone,
so the edge would move rather than disappear. Relocating the module does remove it,
and every other consumer — daemon (rank 4) and `core/dispatch-resolve.ts` (rank 2) —
now reaches down instead of sideways or up.
Pure rename; the module body is unchanged and 14 import specifiers are retargeted.
R17's `DEVICES_INVENTORY_IMPORT_SOURCES` pin follows the module: the rule still
asserts the devices handler imports the neutral gateway, does not shadow it, and
calls it.
This clears the last composition-root upward value edge that was not deliberate.
Confirmed with `pnpm depgraph`: those edges drop from 3 to 2, and the two that
remain are the documented ones — `provider-limrun-runtime.ts` (an in-file comment
marks it a deliberate static seam) and `runtime.ts -> commands/index.ts`
(`bindCommands` is the aggregate binder). Cycle, back-edge and R6 counts unchanged.
Claude-Session: https://claude.ai/code/session_01WWLBCBDBpdR8z1aCmDerXS
Co-authored-by: Claude <[email protected]>1 parent 777ded9 commit 8d280a2
13 files changed
Lines changed: 16 additions & 15 deletions
File tree
- scripts/layering
- src
- __tests__/test-utils
- core
- daemon
- handlers
- __tests__
- request
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
0 commit comments