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 8a2580d
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(move): extract the daemon-contracts zone into packages/daemon-contracts (#3395)
* refactor(move): extract the daemon-contracts zone into packages/daemon-contracts
The ten files of the daemon-contracts zone (the nine root modules declared by
ROOT_MODULE_ZONES plus src/daemon-contracts/daemon-diagnostics-scope.ts) move
behind a workspace-package boundary with narrow per-file subpath exports. The
shared daemon/client placement from #2559 and the #3288 zone declaration
become physical: R11 and the package manifest hold the boundary where the
per-file rows held it before. Consumers switch from relative specifiers to
@agent-device/daemon-contracts/<file>; the tests move with their sources.
Behavior is unchanged.
* chore(gates): retarget daemon-contracts path-keyed enforcement at the package
ROOT_MODULE_ZONES sheds its daemon-contracts rows (the package derives the
zone), the R78 guidance names the package as the shared-contract home, the
wire-compat manifest/ledger/mutation keys move with request-progress-protocol,
the mutation-lane exclusion pins the moved test path, and ADR 0033 records the
extraction with its rationale.
* test(daemon-contracts): own the daemon-registration fixture and export it as a subpath
publishDaemonRegistration was duplicated verbatim between
packages/daemon-contracts/src/daemon-registration.fixtures.ts and
src/__tests__/test-utils/device-claim-store.ts. Keep the package as the
single owner: export the fixture via ./daemon-registration-fixtures the
way capture-kit exports ./recording-artifact-fixtures, delete the root
copy, and point the six root tests at the subpath.
Co-authored-by: Copilot <2235562194+Copilot[bot]@users.noreply.github.com>
* docs(layering): name packages/daemon-contracts/ in the root-zone migration note
The example repeated src/command-runtime/ after the daemon-contracts
zone moved out of src/daemon-contracts/; name the package instead.
Co-authored-by: Copilot <2235562194+Copilot[bot]@users.noreply.github.com>
* fix(layering): place the two port files R81 found unlayered
#3391's manifest was cut before #3403 and #3404 landed, so
src/daemon/platform-services.ts (imported by daemon-core files, so core)
and src/daemon/device/claim-recovery-gateway.ts (imported only from
daemon-server, beside its device-claim siblings in resources) were the
only files R81 found unowned. This PR re-ran check:layering after
rebasing over them and assigns both.
Co-authored-by: Copilot <2235562194+Copilot[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot <2235562194+Copilot[bot]@users.noreply.github.com>
`request-progress-protocol.ts`) trace to #2559, which relocated the shared contracts **to the
135
-
process root** so the client stops importing `src/daemon/` at all; R78 keeps any client→daemon
130
+
The runtime assembly pair
131
+
`runtime-command-surface.ts` / `runtime-factory.ts` has moved into `src/command-runtime/`, and
132
+
the whole `daemon-contracts` zone has moved into `packages/daemon-contracts` — the folder and
133
+
package derive the zone, so every moved file's `ROOT_MODULE_ZONES` row is gone.
134
+
The daemon ⇄ client shared files that remain here (`provider-credential-fingerprint.ts`) trace
135
+
to #2559, which relocated the shared contracts **to the process root** so the client stops
136
+
importing `src/daemon/` at all; R78 keeps any client→daemon
136
137
edge at zero runtime and a five-line recorded type-only residue, and #3288's `daemon-contracts`
137
-
zone is the declaration of that shared-below-both ownership. Rows on path-keyed evidence alone
138
-
(the `platform-runtime-*` seams) say "retain for this batch": a guard's current path lists
139
-
constrain a relocation, they are not independent proof the placement is optimal.
138
+
zone was the declaration of that shared-below-both ownership — the extraction makes it
139
+
physical, with R11 and the package's dependency edges holding the same boundary. Rows on
140
+
path-keyed evidence alone (the `platform-runtime-*` seams) say "retain for this batch": a guard's
141
+
current path lists constrain a relocation, they are not independent proof the placement is
142
+
optimal.
140
143
141
144
| File | Decision | Reason |
142
145
| --- | --- | --- |
143
-
|`src/daemon-diagnostics-scope.ts`| moved → `src/daemon-contracts/daemon-diagnostics-scope.ts` ([#3297](https://github.com/callstack/agent-device/pull/3297)) | Physical move landed: the helper now lives under the folder that derives its `daemon-contracts` zone, so `topFolder` replaces the per-file `ROOT_MODULE_ZONES` row and an internal rename needs no ownership-table edit. |
144
-
|`src/daemon-policy-file.ts`|keep | 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. |
146
+
|`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. |
147
+
|`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. |
145
148
|`src/daemon.ts`| keep | Entry point (`internal/daemon` bundle entry); composition roots stay in root by umbrella §4. |
146
149
|`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. |
147
150
|`src/platform-runtime-daemon-lifecycle.ts`| retain for this batch | Same path-keyed R13/ADR 0022 seam: relocation is possible only with coordinated changes to those declarations. |
148
151
|`src/platform-runtime-device-boot.ts`| retain for this batch | Same path-keyed R13/ADR 0022 seam. |
149
152
|`src/platform-runtime-resource-cleanup.ts`| retain for this batch | Same path-keyed R13/ADR 0022 seam. |
150
153
|`src/provider-credential-fingerprint.ts`| keep | Daemon ⇄ client shared contract from the same #2559 decision as `daemon-policy-file.ts`; #3288 declares its zone beside the provider composition that reads the credentials it fingerprints. |
151
154
|`src/provider-limrun-runtime.ts`| keep | Proposed → provider-limrun, but there is no seam: the class's constructor self-builds the root dependency factory (`src/sdk/limrun-runtime-dependencies.ts`), which is the ADR 0019 composition seam — it loads the root's adb-host binder, core Android interactor, and platform-runtime app-state helpers that the package must not import. Moving the class means moving that composition, which is design, not a move. |
152
-
|`src/request-progress-protocol.ts`|keep | Daemon ⇄ client shared contract from the same #2559 decision — the client reads it statically (`daemon-client-progress.ts`) and the server through `src/daemon/server/`, so only #2559's shared-placement boundary and the wire-compat ledgers pin it; declared `daemon-contracts` by #3288. Contracts was considered and R18 keeps contracts free of envelope validation mechanics. |
155
+
|`src/request-progress-protocol.ts`|moved → `packages/daemon-contracts/src/request-progress-protocol.ts`| Daemon ⇄ client shared contract from the same #2559 decision — the client reads it statically (`daemon-client-progress.ts`) and the server through `src/daemon/server/`, so only #2559's shared-placement boundary and the wire-compat ledgers pin it; declared `daemon-contracts` by #3288 and now physically placed by the extraction. Contracts was considered and R18 keeps contracts free of envelope validation mechanics. The wire-ledger keys moved with the file. |
153
156
|`src/runtime-command-surface.ts`| moved → `src/command-runtime/runtime-command-surface.ts` ([#3299](https://github.com/callstack/agent-device/pull/3299)) | Physical move landed with `runtime-factory.ts` as one assembly group: the command-surface binding sits beside the factory it composes, under the folder that derives its `command-runtime` zone, so `topFolder` replaces the per-file `ROOT_MODULE_ZONES` row. |
154
157
|`src/runtime-factory.ts`| moved → `src/command-runtime/runtime-factory.ts` ([#3299](https://github.com/callstack/agent-device/pull/3299)) | Physical move landed: the runtime assembly now lives under the folder that derives its `command-runtime` zone, with the same row deletion through folder-derived ownership. |
155
158
@@ -173,12 +176,17 @@ files have no seam (published facade, public-type collision, root dependency fac
173
176
## Follow-ups (tracked on #3281)
174
177
175
178
- Physical root-pass moves under [#3294](https://github.com/callstack/agent-device/issues/3294)
176
-
(child of #3276): `daemon-diagnostics-scope.ts` has moved into `src/daemon-contracts/`
177
-
([#3297](https://github.com/callstack/agent-device/pull/3297)); the runtime assembly pair
179
+
(child of #3276): the runtime assembly pair
178
180
`runtime-command-surface.ts` / `runtime-factory.ts` is collocated in `src/command-runtime/`
179
181
([#3299](https://github.com/callstack/agent-device/pull/3299)). Each folder derives its zone,
180
182
replacing the moved files' `ROOT_MODULE_ZONES` rows; #3288's zone assignments alone were
181
-
classification, and each landed move completes its own file's collocation.
183
+
classification, and each landed move completes its own file's collocation. The
184
+
`daemon-contracts` side landed as a workspace package: the zone's ten files (`daemon-owner-cleanup`,
"description": "On-disk and wire contracts a daemon process shares with its clients (#2559): state-dir and transport resolution, registration and ownership, process liveness, shutdown reports, the repair tombstone, progress-envelope framing, the diagnostics scope, and owner-cleanup vocabulary. Internal workspace package bundled into the published agent-device artifact.",
0 commit comments