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 3ce8ac0
Browse filesBrowse the repository at this point in the historyBrowse files
chore(gates): ban the CLI process from reaching daemon modules (R78)
R78 walks static and dynamic edges from src/bin.ts and src/cli.ts and fails
on any reached module outside the client-side roots that imports the daemon
package, naming the chain. R82 and R78 share one walker, process-reach.ts.
The client-side policy in LOGICAL_MODULE_POLICIES now covers the CLI, typed
client, remote transports and daemon client. The two moved entries that carry
the durable-capture machinery and the claim fixtures entry are approved over
the new-entry ceiling, and the ADRs say what the rules do now.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
| R14 non-TS file under `src/utils`| flag | ✓ | ✗ | ✗ |
86
86
| R71 file under `src/replay`| flag | ✓ | ✓ | ✓ generic |
87
87
88
+
_R78 no longer records edges: the client's direct imports are a flat ban in `LOGICAL_MODULE_POLICIES` (R10), and R78 now walks reachability from the CLI entries, so the "unrecorded" and "stale" rows describe the spike at its date, not the rules as shipped._
89
+
88
90
Custom prints `file:line`, rule id and hint (`report()` in `scripts/layering/check.ts`); depcruise
89
91
the rule name and an authored comment, without a line. "Generic" means a fallow zone pair
90
92
(`core → cli`) and a docs link, with no rule id or hint; R14 and R71 surface as "matches no zone".
Copy file name to clipboardExpand all lines: docs/adr/0033-collocation-decision-table.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ already owns the operations behind the vocabulary.
79
79
|`src/diagnostics.ts`| keep | The diagnostics seam every zone imports (AGENTS.md mandates it); highest fan-in in the repo is what a substrate looks like, not misplacement. |
80
80
|`src/internal/request-cancel.ts`| keep | Request-cancellation mechanics AGENTS.md routes to `host-kit/request`; internal beside its facade is already the collocation. |
81
81
|`src/request.ts`| keep | Cross-layer request contracts AGENTS.md names as a host-kit seam; consumers span every zone. |
82
-
|`src/session-paths.ts`| keep | Session-artifact path grammar the daemon, cli, and platforms all resolve; AGENTS.md keeps the path *policy* in `packages/daemon/src/core/session-artifact-paths.ts`, which consumes this. |
82
+
|`src/session-paths.ts`| keep | Session-artifact path grammar the daemon, cli, and platforms all resolve; AGENTS.md keeps the path *policy* in `packages/daemon-contracts/src/session-artifact-paths.ts`, which consumes this. |
83
83
84
84
### kernel
85
85
@@ -118,7 +118,7 @@ already owns the operations behind the vocabulary.
118
118
119
119
| File | Decision | Reason |
120
120
| --- | --- | --- |
121
-
|`src/cli/commands/device-release.ts`|keep|Command surface belongs in `cli` by the folder spine; the daemon device-claim modules it reuses are already extracted, so what remains is thin daemonless-CLI composition. |
121
+
|`src/cli/commands/device-release.ts`|moved|Now `src/platform-runtime-claim-recovery.ts`: the daemonless stale release composes the shared reconciler with the root gateway, and the CLI process may reach no daemon module (R78), so it sits beside the claim-recovery gateway in the platform-runtime composition. |
122
122
123
123
### (root)
124
124
@@ -133,8 +133,9 @@ the whole `daemon-contracts` zone has moved into `packages/daemon-contracts` —
133
133
package derive the zone, so every moved file's `ROOT_MODULE_ZONES` row is gone.
134
134
The daemon ⇄ client shared files that remain here (`provider-credential-fingerprint.ts`) trace
135
135
to #2559, which relocated the shared contracts **to the process root** so the client stops
136
-
importing `packages/daemon/src/` at all; the `daemon-client` logical-module policy bans every edge from `src/daemon-client/` into
137
-
`packages/daemon/src/`, and #3288's `daemon-contracts`
136
+
importing `packages/daemon/src/` at all; the `client-side` logical-module policy bans every edge from the CLI, typed client, remote transports and
137
+
`src/daemon-client/` into `packages/daemon/src/`, R78 bans the hop through any root module the CLI
138
+
process reaches, and #3288's `daemon-contracts`
138
139
zone was the declaration of that shared-below-both ownership — the extraction makes it
139
140
physical, with R11 and the package's dependency edges holding the same boundary. Rows on
140
141
path-keyed evidence alone (the `platform-runtime-*` seams) say "retain for this batch": a guard's
@@ -144,6 +145,7 @@ optimal.
144
145
| File | Decision | Reason |
145
146
| --- | --- | --- |
146
147
|`src/daemon-diagnostics-scope.ts`| moved → `packages/daemon-contracts/src/daemon-diagnostics-scope.ts` ([#3297](https://github.com/callstack/agent-device/pull/3297) into `src/daemon-contracts/`, then the package extraction) | The whole `daemon-contracts` zone now lives as `packages/daemon-contracts`, so the package directory derives the zone and the per-file `ROOT_MODULE_ZONES` row stays deleted; an internal rename needs no ownership-table edit. |
148
+
|`packages/daemon-contracts/src/device-claim-recovery.ts`| keep (shared-below-both) | The owner-scoped claim reconciler runs durable-resource recovery for a dead owner's state dir; the daemon runs it at `open` and startup and the daemonless `device release --stale` runs it too, so it lives below both. Runtime recovery may live in `daemon-contracts` only when both sides run it and root composition supplies just the gateway (ADR 0019 section 1); the package depends on `capture-kit`, which cannot depend back on it (a project-reference cycle through `selectors`). |
147
149
|`src/daemon-policy-file.ts`| moved → `packages/daemon-contracts/src/daemon-policy-file.ts`| Daemon ⇄ client shared contract from #2559, declared `daemon-contracts` by #3288 — the shared-below-both ownership the spine needs, since daemon-client (rank 5) dynamically imports it. The extraction makes that placement physical: the package sits below both sides and its manifest exports own the boundary. |
148
150
|`src/daemon.ts`| keep | Entry point (`internal/daemon` bundle entry); composition roots stay in root by umbrella §4. |
149
151
|`src/platform-runtime-apple-runner-owner.ts`| retain for this batch |`platform-runtime-*` composition seam: R13's exact-importer rule and the ADR 0022 R76 inventory key on its path, so relocation requires coordinated ownership changes to both declarations — the rules constrain the move, they do not independently prove the placement. |
'Moved verbatim out of the daemon app-log session resource so the claim reconciler no longer imports the daemon; the closure is the durable-capture machinery every capture resource carries, and no consumer gains modules.',
'Test-only entry for daemon tests that drive the claim reconciler directly; it loads the same closure as device-claim-recovery.ts and no production module imports it.',
'Moved verbatim out of the daemon so the CLI release path and the daemon share one reconciler without the CLI importing the daemon; only the daemon and the lazily loaded stale-release path import it.',
152
+
owner: 'daemon single-entry stack (L1b)',
153
+
},
154
+
});
136
155
137
156
/** The category is a function of the path, never a hand-written column. */
0 commit comments