You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 66029dd
Browse filesBrowse the repository at this point in the historyBrowse files
chore(gates): rank every root module and reject zone-level value cycles (#3280)
R5 could not see through the unranked (root) zone: nine zones formed one value cycle through
it, and src/sdk/index.ts and src/ai-sdk/index.ts (rank 4) reached daemon-client (rank 5)
through src/agent-device-client.ts.
- scripts/layering/root-module-zones.ts declares the zone of every src/*.ts module, and
targetDagZone reads it. (root) ranks above the spine (9) and holds only bin.ts, cli.ts and
daemon.ts, so a ranked import of any undeclared root module is an R5 back-edge. New zones:
daemon-contracts (2), command-runtime (3), platform-runtime (4, now including its private
src/platform-runtime/ submodule) and platform-runtime-host (8: every spine zone reaches
it only through loadHost's import(), so a static import of the lazy host is a back-edge
from any of them; its facets read daemon session artifacts). core takes the two root
modules it imports; daemon-client takes agent-device-client.ts.
- With that declaration and the old ranks, the gate reports exactly the two known inversions
(sdk -> daemon-client, ai-sdk -> daemon-client). The published SDK entries must export a
client that reaches the daemon with no injected transport, so no code change removes that
dependency: sdk and ai-sdk move to rank 6 above daemon-client, cli to 7.
- R80 zone-value-dag projects static value imports onto zones and rejects any cycle, which
catches same-rank pairs R5 cannot order.
- Dynamic imports stay out of R5 and R80; the reason is recorded at R5 in check.ts.
R6 now measures seven type-only inversions the unranked root hid (commands -> daemon-client,
core -> platform-runtime, core -> platform-runtime-host, plugins -> sdk, and three
platform-runtime -> platform-runtime-host types of lazily loaded host modules), ratcheted
equally at the merge-base.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copy file name to clipboardExpand all lines: docs/dependency-graph-findings.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,8 +74,8 @@ type-only inversions, R7 pins SessionState field ownership, and the shared selec
74
74
(`daemon/interaction/internal/interaction-common.ts`, step 3) and the recorder boundary
75
75
(`session-action-recorder.ts`, step 4). The two-pass structure is two call sites, not a scattered
76
76
concern.
77
-
- Still outside every rule: **dynamic** import direction (0 inversions today, nothing watching),
78
-
and anything inside a zone.
77
+
- Still outside every rule: **dynamic** import direction, out of scope by decision with the reason
78
+
recorded at R5 in `scripts/layering/check.ts` (#3280), and anything inside a zone.
79
79
80
80
## 0. Where the inversions ended up (and why 5 is the floor for now)
81
81
@@ -263,6 +263,16 @@ moving `DaemonRequest` is most of what §1's second cluster needs.
263
263
264
264
## 3. `(root)`: what is left is there for a reason
265
265
266
+
> **Status after #3280:** the section below is historical. Every root module now declares its zone
267
+
> in `scripts/layering/root-module-zones.ts`, `(root)` ranks above the spine and holds only
268
+
> `bin.ts`, `cli.ts` and `daemon.ts`, and R80 asserts that the zone graph of static value imports is
269
+
> acyclic. That reduces `(root)` in the logical graph only: the modules still live directly under
270
+
> `src/`, and the declaration is a bridge whose rows go as groups move into zone folders or
271
+
> packages. The physical moves remain outstanding, starting with #3294. Ranking the composition roots did not weaken R2: it still rejects a direct `daemon/` ->
272
+
> `commands/` import, and the daemon reaches the command surface through the ranked
273
+
> `command-runtime` zone, which the zone graph now shows instead of hiding. The SDK entries rank
274
+
> above `daemon-client`, because the typed client they publish reaches the daemon through it.
275
+
266
276
13 files: 11 published `package.json` entrypoints, the three executables (`bin.ts`, `cli.ts`,
267
277
`daemon.ts`), and the composition roots — `runtime.ts`, `agent-device-client.ts`,
0 commit comments