Skip to content

Commit 655faf6

Browse files
committed
chore(gates): re-key the daemon-client gate paths onto src/daemon-client
Path-keyed enforcement follows the relocated files: the fallow health baseline entries, the oxlint per-file override, the wire-compat surface/ledger/mutation paths, and the layering zone derivation (the `src/daemon/client/` prefix is dead now that the folder itself names the zone). R10's external daemon request/session-state importer list gains the five client modules. The edges are unchanged by this PR — the client has always built `DaemonRequest` and read `DaemonResponse`; it sat inside `src/daemon/` and so fell under the prefix skip. Naming the files keeps the dependency enumerated and shrink-only, so a new `src/daemon-client/` module reaching `session-state` still fails. Its size assertion now reads the recorded list instead of a literal. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CZkJjeEhLmyGpGtcwY8pqc
1 parent 707d985 commit 655faf6

9 files changed

Lines changed: 58 additions & 38 deletions

File tree

‎fallow-baselines/health.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,25 +107,25 @@
107107
"count": 1
108108
}
109109
},
110-
"src/daemon/client/daemon-client-lifecycle.ts": {
110+
"src/daemon-client/daemon-client-lifecycle.ts": {
111111
"complexity_high": {
112112
"count": 1
113113
},
114114
"crap_high": {
115115
"count": 1
116116
}
117117
},
118-
"src/daemon/client/daemon-client-metadata.ts": {
118+
"src/daemon-client/daemon-client-metadata.ts": {
119119
"complexity_moderate": {
120120
"count": 1
121121
}
122122
},
123-
"src/daemon/client/daemon-client-rpc.ts": {
123+
"src/daemon-client/daemon-client-rpc.ts": {
124124
"crap_moderate": {
125125
"count": 1
126126
}
127127
},
128-
"src/daemon/client/daemon-client.ts": {
128+
"src/daemon-client/daemon-client.ts": {
129129
"complexity_moderate": {
130130
"count": 1
131131
}
@@ -533,7 +533,7 @@
533533
},
534534
"runtime_coverage_findings": [],
535535
"target_keys": [
536-
"src/daemon/client/daemon-client.ts:high impact",
536+
"src/daemon-client/daemon-client.ts:high impact",
537537
"src/cli/parser/args.ts:high impact",
538538
"src/daemon/lease-context.ts:high impact",
539539
"src/daemon/replay/internal/session-replay-heal.ts:high impact",
@@ -584,7 +584,7 @@
584584
"src/daemon/server/http-server.ts:complexity",
585585
"packages/platform-android/src/ui-hierarchy.ts:high impact",
586586
"packages/platform-android/src/sdk.ts:high impact",
587-
"src/daemon/client/daemon-client-lifecycle.ts:complexity",
587+
"src/daemon-client/daemon-client-lifecycle.ts:complexity",
588588
"src/client/client-companion-tunnel-worker.ts:complexity"
589589
]
590590
}

‎oxlint.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default defineConfig({
122122
},
123123
{
124124
files: [
125-
'src/daemon/client/daemon-client-rpc.ts',
125+
'src/daemon-client/daemon-client-rpc.ts',
126126
'src/daemon/downloadable-artifact-http.ts',
127127
'src/remote/remote-request-diagnostics.ts',
128128
'src/remote/upload-stream.ts',

‎scripts/layering/daemon-modularity.test.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,14 @@ test('external daemon request/session-state importer membership changes require
122122
REFERENCE,
123123
);
124124
assert.equal(violations.length, 1);
125-
assert.match(violations[0]!.message, /may only shrink from the recorded 2/);
125+
// The recorded list owns its own size (#2342 relocated five client files into it), so the
126+
// message assertion reads it rather than pinning a literal that the baseline would outgrow.
127+
assert.match(
128+
violations[0]!.message,
129+
new RegExp(
130+
`may only shrink from the recorded ${DAEMON_MODULARITY_BASELINE.externalDaemonTypesImporters.length}`,
131+
),
132+
);
126133

127134
const removed = checkDaemonModularityRatchets(
128135
baselineDaemonTypesEdges().slice(1),

‎scripts/layering/daemon-modularity.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ import type { LayeringRatchets } from './ratchet-reference.ts';
1717
export const DAEMON_MODULARITY_BASELINE = {
1818
externalDaemonTypesImporters: [
1919
'src/client/client-normalizers.ts',
20+
// #2342 relocated the daemon client to `src/daemon-client/`. These five edges are unchanged
21+
// by that move — the client has always built `DaemonRequest` and read `DaemonResponse`, it
22+
// simply sat inside `src/daemon/` and so fell under the prefix skip below. Naming the files
23+
// is stronger than letting a folder prefix hide them: the set can only shrink, so a new
24+
// `src/daemon-client/` module reaching `session-state.ts` or the daemon-private request half
25+
// still fails this gate. Reducing these five means giving the client a neutral request
26+
// contract, which is a type change, not a relocation.
27+
'src/daemon-client/daemon-client-lifecycle.ts',
28+
'src/daemon-client/daemon-client-progress.ts',
29+
'src/daemon-client/daemon-client-rpc.ts',
30+
'src/daemon-client/daemon-client-transport.ts',
31+
'src/daemon-client/daemon-client.ts',
2032
'src/remote/daemon-artifacts.ts',
2133
],
2234
} as const;

‎scripts/layering/model.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ export function topFolder(file: string): string {
266266
}
267267

268268
export function targetDagZone(file: string): string {
269-
if (file.startsWith('src/daemon/client/')) return 'daemon-client';
269+
// #2342 relocated the daemon client to its own `src/daemon-client/` folder, so the
270+
// client zone now falls out of the folder itself; `src/daemon/` is server-only.
270271
if (file.startsWith('src/daemon/')) return 'daemon-server';
271272
return topFolder(file);
272273
}

‎test/wire-compat/closure-policy.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const WIRE_CLOSURE_WAIVERS: Readonly<Record<string, string>> = {
4141
'Error-code vocabulary is carried as a plain string in DaemonError.code; adding a code cannot change the envelope a peer parses.',
4242
'packages/kernel/src/errors.ts#AppErrorDetails':
4343
'Local detail bag behind AppError; the wire form is DaemonError.details, typed as Record<string, unknown> and listed.',
44-
'src/daemon/client/daemon-client-metadata.ts#DaemonInfo':
44+
'src/daemon-client/daemon-client-metadata.ts#DaemonInfo':
4545
'Client-side record of where a daemon is listening (pid, ports, state dir). Never serialized into a request or response.',
4646
'src/daemon/daemon-request.ts#DaemonRequest':
4747
'Server-side narrowing of the listed kernel DaemonRequest; the declaration that fixes the shape is packages/kernel/src/contracts.ts#DaemonRequest.',

‎test/wire-compat/ledger.json‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,23 @@
4848
"packages/kernel/src/errors.ts#readDiagnosticsRecordRef": "sha256:3a210f401221c0a15eb75d488450034885c7b73be39f5e93424c72874d14c395",
4949
"src/commands/cli-grammar/types.ts#DaemonCommandRequest": "sha256:ea3f4118244711f0eaec0e471f62b0de42ca97181c085df165d37b63301a4619",
5050
"src/core/lease-scope.ts#LeaseRpcCommand": "sha256:714f66efa725a5d0654e492a76daeb4059caad31b79562cfc9133029ea95bfe5",
51-
"src/daemon/client/daemon-client-progress.ts#ProgressResponseFormat": "sha256:6d7a99ac13fd422671fd86f8fe093efa40ca369f4ae1f97c98d40a7132543637",
52-
"src/daemon/client/daemon-client-progress.ts#createInvalidDaemonResponseError": "sha256:0af812346b667a23fdfef641b242cd86d07edaa05eb928c4c531628c09a4031b",
53-
"src/daemon/client/daemon-client-progress.ts#shouldReadDaemonProgressStream": "sha256:6811404f41d8db3fa6fc751332c7186a2399ec7ecbc4e9c547d9cb9f14dbb350",
54-
"src/daemon/client/daemon-client-rpc.ts#appErrorFromDaemonError": "sha256:ac4761006c71d93ccba9f8e37cbd4cf48283dbb22737c163dc9c1a878e154eea",
55-
"src/daemon/client/daemon-client-rpc.ts#buildHttpRpcPayload": "sha256:efa9a5da4c7288cceae5656b468946ad3a2af0f0f0fb940f8a37987f922aa4b8",
56-
"src/daemon/client/daemon-client-rpc.ts#buildLeaseRpcParams": "sha256:1755f46be8c62e7a8eb409e9a94d61781c96ccbef3306702121aa94264d63267",
57-
"src/daemon/client/daemon-client-rpc.ts#handleDaemonHttpResponseBody": "sha256:8f1c4bba1918545db6296ad29b95f0baa9f949e7c23bc04d59e261130f14611e",
58-
"src/daemon/client/daemon-client-rpc.ts#isLeaseRpcCommand": "sha256:955dc1b73462d40593e5728dbcbaeec1307944b08262a22627e84cc5dc507e8f",
59-
"src/daemon/client/daemon-client-rpc.ts#leaseRpcMethodForCommand": "sha256:3613555c6002c23ab5bec4b98bc1b4d6947014b52fa100176177f955cf762881",
60-
"src/daemon/client/daemon-client-rpc.ts#parseDaemonHttpResponseBody": "sha256:0cbe39dbd09e321ec00854a1626a7d89b6344e59c6faabe2fe02504268b2d886",
61-
"src/daemon/client/daemon-client-rpc.ts#rejectDaemonHttpRpcError": "sha256:83b0312fe88bc3b3497de799e23d8d14455f665b7cf880f4617cd62b181351cd",
62-
"src/daemon/client/daemon-client-rpc.ts#resolveDaemonHttpResult": "sha256:296f9d376ce67c8cb20209bdf1c59c2423ffcfa35b5565a99e70271263149048",
63-
"src/daemon/client/daemon-client-rpc.ts#toDaemonHttpRpcError": "sha256:888246763c48670e7da893054d025744654f8715c3b4906312617a2b5028316b",
64-
"src/daemon/client/daemon-client-transport.ts#RemoteDaemonHealth": "sha256:38fe712390d247de59a74b9dc209fdf407ff5f9b1e32b698ae71ebc57569b66d",
65-
"src/daemon/client/daemon-client-transport.ts#readDaemonHttpHealth": "sha256:5e75af39e96045ce7faba986c900744cee76cdaa1e0df360ea38f3c020520711",
66-
"src/daemon/client/daemon-client-transport.ts#readHealthPayload": "sha256:5b15e14319b16aebf32d07336986a7f1f2a6b13cec1823ca9aa7c9f01bf1b0b6",
67-
"src/daemon/client/daemon-client-transport.ts#readRemoteDaemonHealth": "sha256:b22111f693ecb65705195a66bce617e58441483ebfd67cf264d6900ba1dcb401",
51+
"src/daemon-client/daemon-client-progress.ts#ProgressResponseFormat": "sha256:6d7a99ac13fd422671fd86f8fe093efa40ca369f4ae1f97c98d40a7132543637",
52+
"src/daemon-client/daemon-client-progress.ts#createInvalidDaemonResponseError": "sha256:0af812346b667a23fdfef641b242cd86d07edaa05eb928c4c531628c09a4031b",
53+
"src/daemon-client/daemon-client-progress.ts#shouldReadDaemonProgressStream": "sha256:6811404f41d8db3fa6fc751332c7186a2399ec7ecbc4e9c547d9cb9f14dbb350",
54+
"src/daemon-client/daemon-client-rpc.ts#appErrorFromDaemonError": "sha256:ac4761006c71d93ccba9f8e37cbd4cf48283dbb22737c163dc9c1a878e154eea",
55+
"src/daemon-client/daemon-client-rpc.ts#buildHttpRpcPayload": "sha256:efa9a5da4c7288cceae5656b468946ad3a2af0f0f0fb940f8a37987f922aa4b8",
56+
"src/daemon-client/daemon-client-rpc.ts#buildLeaseRpcParams": "sha256:1755f46be8c62e7a8eb409e9a94d61781c96ccbef3306702121aa94264d63267",
57+
"src/daemon-client/daemon-client-rpc.ts#handleDaemonHttpResponseBody": "sha256:8f1c4bba1918545db6296ad29b95f0baa9f949e7c23bc04d59e261130f14611e",
58+
"src/daemon-client/daemon-client-rpc.ts#isLeaseRpcCommand": "sha256:955dc1b73462d40593e5728dbcbaeec1307944b08262a22627e84cc5dc507e8f",
59+
"src/daemon-client/daemon-client-rpc.ts#leaseRpcMethodForCommand": "sha256:3613555c6002c23ab5bec4b98bc1b4d6947014b52fa100176177f955cf762881",
60+
"src/daemon-client/daemon-client-rpc.ts#parseDaemonHttpResponseBody": "sha256:0cbe39dbd09e321ec00854a1626a7d89b6344e59c6faabe2fe02504268b2d886",
61+
"src/daemon-client/daemon-client-rpc.ts#rejectDaemonHttpRpcError": "sha256:83b0312fe88bc3b3497de799e23d8d14455f665b7cf880f4617cd62b181351cd",
62+
"src/daemon-client/daemon-client-rpc.ts#resolveDaemonHttpResult": "sha256:296f9d376ce67c8cb20209bdf1c59c2423ffcfa35b5565a99e70271263149048",
63+
"src/daemon-client/daemon-client-rpc.ts#toDaemonHttpRpcError": "sha256:888246763c48670e7da893054d025744654f8715c3b4906312617a2b5028316b",
64+
"src/daemon-client/daemon-client-transport.ts#RemoteDaemonHealth": "sha256:38fe712390d247de59a74b9dc209fdf407ff5f9b1e32b698ae71ebc57569b66d",
65+
"src/daemon-client/daemon-client-transport.ts#readDaemonHttpHealth": "sha256:5e75af39e96045ce7faba986c900744cee76cdaa1e0df360ea38f3c020520711",
66+
"src/daemon-client/daemon-client-transport.ts#readHealthPayload": "sha256:5b15e14319b16aebf32d07336986a7f1f2a6b13cec1823ca9aa7c9f01bf1b0b6",
67+
"src/daemon-client/daemon-client-transport.ts#readRemoteDaemonHealth": "sha256:b22111f693ecb65705195a66bce617e58441483ebfd67cf264d6900ba1dcb401",
6868
"src/daemon/downloadable-artifact-http.ts#DownloadableArtifactHttpAuthorizer": "sha256:1b2702a929ca9170db2ca97c08e3ab67e17edb3ee75325a576c4c1b9cdbebb44",
6969
"src/daemon/downloadable-artifact-http.ts#DownloadableArtifactHttpRoute": "sha256:e63c4581ccde668913914149c9092d16ecf8a5cbd7ab33c6eb8617e77fc1015e",
7070
"src/daemon/downloadable-artifact-http.ts#handleArtifactDownload": "sha256:7f96d17b7c605230fb3cc21ceaa5b2e515d7445653ff95b2b0f6f15fa6214d4e",
@@ -201,7 +201,7 @@
201201
"rationale": "#2246 passes isDirectory only for the new test-artifacts type and uses the exact path the client materializer published. Existing screenshot and recording artifacts still report their requested file path; only the new directory response gains its suite-invocation segment."
202202
},
203203
{
204-
"declaration": "src/daemon/client/daemon-client-rpc.ts#buildHttpRpcPayload",
204+
"declaration": "src/daemon-client/daemon-client-rpc.ts#buildHttpRpcPayload",
205205
"digest": "sha256:efa9a5da4c7288cceae5656b468946ad3a2af0f0f0fb940f8a37987f922aa4b8",
206206
"rationale": "#2110 adds the optional providerApp parameter to lease allocation. A released protocol-2 daemon ignores unknown JSON-RPC parameters, while requests without an initial app retain the previous payload exactly."
207207
},
@@ -226,12 +226,12 @@
226226
"rationale": "#1801 and #1862 add optional fields to the normalized error the daemon serializes, most recently `cause`; they are omitted unless set, and a released client ignores them otherwise."
227227
},
228228
{
229-
"declaration": "src/daemon/client/daemon-client-rpc.ts#handleDaemonHttpResponseBody",
229+
"declaration": "src/daemon-client/daemon-client-rpc.ts#handleDaemonHttpResponseBody",
230230
"digest": "sha256:8f1c4bba1918545db6296ad29b95f0baa9f949e7c23bc04d59e261130f14611e",
231231
"rationale": "#1801 client-side only: the RPC error branch now runs through `rejectDaemonHttpRpcError`, which reads a superset of the fields it read before and, for a remote daemon, replaces the daemon-host `logPath` with a caller-local copy. Every field a released daemon sends is still accepted; nothing new is required of the daemon."
232232
},
233233
{
234-
"declaration": "src/daemon/client/daemon-client-rpc.ts#toDaemonHttpRpcError",
234+
"declaration": "src/daemon-client/daemon-client-rpc.ts#toDaemonHttpRpcError",
235235
"digest": "sha256:888246763c48670e7da893054d025744654f8715c3b4906312617a2b5028316b",
236236
"rationale": "#1801 and #1862 client-side only: this reads optional daemon error metadata, most recently the structured `cause`. Parsing of every previously read field is unchanged, so a released daemon's error payload is accepted exactly as before."
237237
},
@@ -251,7 +251,7 @@
251251
"rationale": "#1801 and #1862 lift optional metadata onto the normalized error, most recently a redacted structured `cause`. No previously emitted field changes shape or value, and peers that do not know the field ignore it."
252252
},
253253
{
254-
"declaration": "src/daemon/client/daemon-client-rpc.ts#appErrorFromDaemonError",
254+
"declaration": "src/daemon-client/daemon-client-rpc.ts#appErrorFromDaemonError",
255255
"digest": "sha256:ac4761006c71d93ccba9f8e37cbd4cf48283dbb22737c163dc9c1a878e154eea",
256256
"rationale": "#1862 client-side only: this rehydrates the new optional structured `cause` when present. Released daemons that omit it follow the unchanged path, and no request field or existing response field is narrowed."
257257
}

‎test/wire-compat/surface.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ const REQUEST_DIAGNOSTICS_HTTP = 'src/daemon/request-diagnostics-http.ts';
5151
const HTTP_REQUEST_TARGET = 'src/daemon/http-request-target.ts';
5252
const REMOTE_REQUEST_DIAGNOSTICS = 'src/remote/remote-request-diagnostics.ts';
5353
const PROGRESS_PROTOCOL = 'src/daemon/request-progress-protocol.ts';
54-
const CLIENT_RPC = 'src/daemon/client/daemon-client-rpc.ts';
55-
const CLIENT_PROGRESS = 'src/daemon/client/daemon-client-progress.ts';
56-
const CLIENT_TRANSPORT = 'src/daemon/client/daemon-client-transport.ts';
54+
const CLIENT_RPC = 'src/daemon-client/daemon-client-rpc.ts';
55+
const CLIENT_PROGRESS = 'src/daemon-client/daemon-client-progress.ts';
56+
const CLIENT_TRANSPORT = 'src/daemon-client/daemon-client-transport.ts';
5757
const UPLOAD_CLIENT = 'src/remote/upload-client.ts';
5858
const REMOTE_ARTIFACTS = 'src/remote/daemon-artifacts.ts';
5959
const ARTIFACT_DOWNLOAD = 'src/remote/artifact-download.ts';

‎test/wire-compat/wire-mutations.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const MUTATIONS: readonly WireMutation[] = [
7272
},
7373
{
7474
breakClass: 'response parsing: the client narrows what a daemon may return',
75-
file: 'src/daemon/client/daemon-client-rpc.ts',
75+
file: 'src/daemon-client/daemon-client-rpc.ts',
7676
name: 'parseDaemonHttpResponseBody',
7777
from: 'error?: { message?: string; data?: Record<string, unknown> }',
7878
to: 'error?: { message: string }',
@@ -145,21 +145,21 @@ const MUTATIONS: readonly WireMutation[] = [
145145
// why claiming "both sides" required these to be listed and proved.
146146
{
147147
breakClass: 'health consumer: the client stops reading the advertised protocol version',
148-
file: 'src/daemon/client/daemon-client-transport.ts',
148+
file: 'src/daemon-client/daemon-client-transport.ts',
149149
name: 'readHealthPayload',
150150
from: "typeof parsed.rpcProtocolVersion === 'number' ? parsed.rpcProtocolVersion : undefined",
151151
to: 'undefined',
152152
},
153153
{
154154
breakClass: 'health consumer: the mismatch refusal ADR 0006 built is weakened',
155-
file: 'src/daemon/client/daemon-client-transport.ts',
155+
file: 'src/daemon-client/daemon-client-transport.ts',
156156
name: 'readRemoteDaemonHealth',
157157
from: 'health.rpcProtocolVersion !== DAEMON_RPC_PROTOCOL_VERSION',
158158
to: 'false',
159159
},
160160
{
161161
breakClass: 'health consumer: the parsed health shape drops a released field',
162-
file: 'src/daemon/client/daemon-client-transport.ts',
162+
file: 'src/daemon-client/daemon-client-transport.ts',
163163
name: 'RemoteDaemonHealth',
164164
from: 'rpcProtocolVersion?: number;',
165165
to: '',

0 commit comments

Comments
 (0)