Skip to content

Commit 751fb67

Browse files
committed
chore(gates): move wire-surface and fallow baselines onto the split HTTP modules
The daemon RPC wire manifest, ledger keys, and mutation probes now name http-rpc-envelope.ts / http-rpc-methods.ts / http-authorization.ts where the declarations moved. All 28 declaration digests are unchanged, so the released-surface comparison reads them as moves, not wire changes. The fallow health baseline entry for http-server.ts splits to match: the two parse* findings move with their code, the dispatcher keeps its own.
1 parent 0e651e7 commit 751fb67

5 files changed

Lines changed: 53 additions & 46 deletions

File tree

‎fallow-baselines/health.json‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,11 @@
295295
"complexity_critical": {
296296
"count": 1
297297
},
298-
"complexity_high": {
299-
"count": 1
300-
},
301298
"crap_critical": {
302299
"count": 1
303300
},
304-
"crap_high": {
305-
"count": 1
306-
},
307301
"crap_moderate": {
308-
"count": 2
302+
"count": 1
309303
}
310304
},
311305
"src/daemon/session-selector.ts": {
@@ -537,6 +531,17 @@
537531
"crap_critical": {
538532
"count": 2
539533
}
534+
},
535+
"src/daemon/server/http-rpc-methods.ts": {
536+
"complexity_high": {
537+
"count": 1
538+
},
539+
"crap_high": {
540+
"count": 1
541+
},
542+
"crap_moderate": {
543+
"count": 1
544+
}
540545
}
541546
},
542547
"runtime_coverage_findings": [],

‎scripts/wire-compat/model.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ test('a move that changes the shape is a change, acked at the path it moved to',
171171
// the name at its own path, a same-named declaration elsewhere cannot be
172172
// identified as a move of this one, so the baseline key stays a removal.
173173
test('a name still owned by the baseline is not a move, so it remains a removal', () => {
174-
const serverSendJson = 'src/daemon/server/http-server.ts#sendJson';
174+
const serverSendJson = 'src/daemon/server/http-rpc-envelope.ts#sendJson';
175175
const uploadSendJson = 'src/daemon/upload-http.ts#sendJson';
176176
const released = ledger({
177177
declarations: { [serverSendJson]: 'sha256:old', [uploadSendJson]: 'sha256:eee' },

‎test/wire-compat/ledger.json‎

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -97,34 +97,34 @@
9797
"src/request-progress-protocol.ts#serializeDaemonRpcResponseEnvelope": "sha256:e244291bef44cedfb59ad07c45337bb8e5fdde00b712ebdf5ca9627f6355f111",
9898
"src/request-progress-protocol.ts#shouldStreamRequestProgress": "sha256:cf7b26ccea9cd5c33c93477f783a3bdb9a1b0ce629da8b77fef0d49d6c6f4112",
9999
"src/daemon/resumable-upload.ts#BeginResumableUploadOptions": "sha256:ef804e321b8cd1f23a51566919fc0cda79c1b0ef82aeceed54ce3f2a398d8457",
100-
"src/daemon/server/http-server.ts#COMMAND_RPC_METHODS": "sha256:4b675a84ef475c2fe0e864457c254c2e888de942e4ae428d5b3e1fa72101e97b",
101-
"src/daemon/server/http-server.ts#HttpAuthDecision": "sha256:a7fc2a91f998ce62b107b14dd9b6fcf1f4ca5abe2e30d4df5a0896d56a0a52f8",
102-
"src/daemon/server/http-server.ts#HttpAuthHook": "sha256:1ed0ba84708f040787d81d7f546c8b6e0cb8c319625d6c654ece3819be2de8e6",
103-
"src/daemon/server/http-server.ts#HttpAuthHookContext": "sha256:c555532dcc31c106d893445d2cff01ad6c5e5b3390b86fad982385059ec69663",
104-
"src/daemon/server/http-server.ts#HttpAuthHookResult": "sha256:d52c3f14ff05da925a8efc53b9eac4538826ba615ab9fc073eeed4f3df678086",
105-
"src/daemon/server/http-server.ts#INSTALL_FROM_SOURCE_RPC_METHODS": "sha256:d0dc3f3d872e7384343e28aaaf2b57e0da822e654a2e345fb108d160f520c16d",
106-
"src/daemon/server/http-server.ts#JsonRpcRequest": "sha256:7c299fe17818993a0bacbb48e12dcd1fd28b3595cf8efcae3484acbec383ce22",
107-
"src/daemon/server/http-server.ts#JsonRpcResponse": "sha256:13b36c1e2b9eae9437fdac982efde142fd4abba947e11011fa22191675b6e4ba",
108-
"src/daemon/server/http-server.ts#LEASE_RPC_METHOD_TO_COMMAND": "sha256:ff52d6c6040080973d51c572ea09b0e23eaa07c7f7b813061599d404dfc811ca",
100+
"src/daemon/server/http-rpc-methods.ts#COMMAND_RPC_METHODS": "sha256:4b675a84ef475c2fe0e864457c254c2e888de942e4ae428d5b3e1fa72101e97b",
101+
"src/daemon/server/http-authorization.ts#HttpAuthDecision": "sha256:a7fc2a91f998ce62b107b14dd9b6fcf1f4ca5abe2e30d4df5a0896d56a0a52f8",
102+
"src/daemon/server/http-authorization.ts#HttpAuthHook": "sha256:1ed0ba84708f040787d81d7f546c8b6e0cb8c319625d6c654ece3819be2de8e6",
103+
"src/daemon/server/http-authorization.ts#HttpAuthHookContext": "sha256:c555532dcc31c106d893445d2cff01ad6c5e5b3390b86fad982385059ec69663",
104+
"src/daemon/server/http-authorization.ts#HttpAuthHookResult": "sha256:d52c3f14ff05da925a8efc53b9eac4538826ba615ab9fc073eeed4f3df678086",
105+
"src/daemon/server/http-rpc-methods.ts#INSTALL_FROM_SOURCE_RPC_METHODS": "sha256:d0dc3f3d872e7384343e28aaaf2b57e0da822e654a2e345fb108d160f520c16d",
106+
"src/daemon/server/http-rpc-envelope.ts#JsonRpcRequest": "sha256:7c299fe17818993a0bacbb48e12dcd1fd28b3595cf8efcae3484acbec383ce22",
107+
"src/daemon/server/http-rpc-envelope.ts#JsonRpcResponse": "sha256:13b36c1e2b9eae9437fdac982efde142fd4abba947e11011fa22191675b6e4ba",
108+
"src/daemon/server/http-rpc-methods.ts#LEASE_RPC_METHOD_TO_COMMAND": "sha256:ff52d6c6040080973d51c572ea09b0e23eaa07c7f7b813061599d404dfc811ca",
109109
"src/daemon/server/http-server.ts#MAX_HTTP_RPC_BODY_BYTES": "sha256:3cb06e12b3110fa27e390d5c6473578b3f13c93b9f2b571e0e8e42d7ce29d48a",
110-
"src/daemon/server/http-server.ts#RELEASE_MATERIALIZED_PATHS_RPC_METHODS": "sha256:75a18d3496894309dd6042b16c4dcc241c16ec6336783e6310eddd6db7437ccb",
111-
"src/daemon/server/http-server.ts#SUPPORTED_RPC_METHODS": "sha256:4d5ed730dcb669b0dacca3bb4977f35686bab9b7fb464c0590fd50f838e6c243",
112-
"src/daemon/server/http-server.ts#authorizeAuxiliaryHttpRequest": "sha256:1c323f97c3cefec8f95633b6abd127342bf75494bfb109d1cc6eadf3ceacaeae",
113-
"src/daemon/server/http-server.ts#createRpcError": "sha256:1921762129636afc7772937d48e8afb8f09047b343e3a27d18b49c1c4385bbe8",
114-
"src/daemon/server/http-server.ts#enforceDaemonToken": "sha256:60036cffc34388b33fc0dad39c905d9cb3fc18c9ed0cf24255bb7105f5d444c7",
115-
"src/daemon/server/http-server.ts#isCommandRpcMethod": "sha256:9922102ba9c72c3032f205717d772ab7c3506c6f3012f55b8e7e5636b672ed7e",
116-
"src/daemon/server/http-server.ts#jsonRpcCodeForNormalizedError": "sha256:27f397cf1a36254602d1df2ae2c0edcb45bb210d595a76890816c841bf152458",
117-
"src/daemon/server/http-server.ts#methodToDaemonRequest": "sha256:9c0ef19695f1a4aabf355565925a5deb3fbd832997c089f11918b8c4750bb03f",
118-
"src/daemon/server/http-server.ts#parseCommandRpcParams": "sha256:303b9b596c6c5fff13bc8e16dfa32ea816f41e0988832ce795157937cb38ae79",
119-
"src/daemon/server/http-server.ts#readHeaderValue": "sha256:0ec16993e5d9b460ba02deb4a43bbc4c248f9697eaed9aa64003eec7d5dce6bf",
120-
"src/daemon/server/http-server.ts#resolveToken": "sha256:3abcb019e1325317618045b7138e41845990af10953dd937571997cd6ec35981",
121-
"src/daemon/server/http-server.ts#sendJson": "sha256:a1de00da3f1db8c98e69a85dfe2e11b626a4d2ce472840e3b8f519aa8a207a8f",
122-
"src/daemon/server/http-server.ts#toDaemonRequest": "sha256:f3861d2d4f67f66e83800616926f6bbb0595de4ecbb0072b5b78971ebeb0705b",
123-
"src/daemon/server/http-server.ts#toInstallFromSourceDaemonRequest": "sha256:dff093758b433043816dfc1e2e9658078875e46b887fdc530fb9380158d629f5",
124-
"src/daemon/server/http-server.ts#toLeaseDaemonRequest": "sha256:3018984aeace4054767875f5eb6e6ad5d38bfcb71c15d1a56ccf9b53e0a419ec",
125-
"src/daemon/server/http-server.ts#toReleaseMaterializedPathsDaemonRequest": "sha256:708736ca03d6a3fc449bb408382dbd509e490de1f84ecc8771fd77d4adda0154",
126-
"src/daemon/server/http-server.ts#writeProgressEnvelope": "sha256:7be778b3902c72d7aa6282c16dc7106fdd64e99c0b5daf9f413ff5dd3fb044f1",
127-
"src/daemon/server/http-server.ts#writeRpcResponseEnvelope": "sha256:7a8155e9fcbb53485489728250a85109b5dab0d96cdd4aa8b7e7eb87a4898ddb",
110+
"src/daemon/server/http-rpc-methods.ts#RELEASE_MATERIALIZED_PATHS_RPC_METHODS": "sha256:75a18d3496894309dd6042b16c4dcc241c16ec6336783e6310eddd6db7437ccb",
111+
"src/daemon/server/http-rpc-methods.ts#SUPPORTED_RPC_METHODS": "sha256:4d5ed730dcb669b0dacca3bb4977f35686bab9b7fb464c0590fd50f838e6c243",
112+
"src/daemon/server/http-authorization.ts#authorizeAuxiliaryHttpRequest": "sha256:1c323f97c3cefec8f95633b6abd127342bf75494bfb109d1cc6eadf3ceacaeae",
113+
"src/daemon/server/http-rpc-envelope.ts#createRpcError": "sha256:1921762129636afc7772937d48e8afb8f09047b343e3a27d18b49c1c4385bbe8",
114+
"src/daemon/server/http-authorization.ts#enforceDaemonToken": "sha256:60036cffc34388b33fc0dad39c905d9cb3fc18c9ed0cf24255bb7105f5d444c7",
115+
"src/daemon/server/http-rpc-methods.ts#isCommandRpcMethod": "sha256:9922102ba9c72c3032f205717d772ab7c3506c6f3012f55b8e7e5636b672ed7e",
116+
"src/daemon/server/http-rpc-envelope.ts#jsonRpcCodeForNormalizedError": "sha256:27f397cf1a36254602d1df2ae2c0edcb45bb210d595a76890816c841bf152458",
117+
"src/daemon/server/http-rpc-methods.ts#methodToDaemonRequest": "sha256:9c0ef19695f1a4aabf355565925a5deb3fbd832997c089f11918b8c4750bb03f",
118+
"src/daemon/server/http-rpc-methods.ts#parseCommandRpcParams": "sha256:303b9b596c6c5fff13bc8e16dfa32ea816f41e0988832ce795157937cb38ae79",
119+
"src/daemon/server/http-authorization.ts#readHeaderValue": "sha256:0ec16993e5d9b460ba02deb4a43bbc4c248f9697eaed9aa64003eec7d5dce6bf",
120+
"src/daemon/server/http-authorization.ts#resolveToken": "sha256:3abcb019e1325317618045b7138e41845990af10953dd937571997cd6ec35981",
121+
"src/daemon/server/http-rpc-envelope.ts#sendJson": "sha256:a1de00da3f1db8c98e69a85dfe2e11b626a4d2ce472840e3b8f519aa8a207a8f",
122+
"src/daemon/server/http-rpc-methods.ts#toDaemonRequest": "sha256:f3861d2d4f67f66e83800616926f6bbb0595de4ecbb0072b5b78971ebeb0705b",
123+
"src/daemon/server/http-rpc-methods.ts#toInstallFromSourceDaemonRequest": "sha256:dff093758b433043816dfc1e2e9658078875e46b887fdc530fb9380158d629f5",
124+
"src/daemon/server/http-rpc-methods.ts#toLeaseDaemonRequest": "sha256:3018984aeace4054767875f5eb6e6ad5d38bfcb71c15d1a56ccf9b53e0a419ec",
125+
"src/daemon/server/http-rpc-methods.ts#toReleaseMaterializedPathsDaemonRequest": "sha256:708736ca03d6a3fc449bb408382dbd509e490de1f84ecc8771fd77d4adda0154",
126+
"src/daemon/server/http-rpc-envelope.ts#writeProgressEnvelope": "sha256:7be778b3902c72d7aa6282c16dc7106fdd64e99c0b5daf9f413ff5dd3fb044f1",
127+
"src/daemon/server/http-rpc-envelope.ts#writeRpcResponseEnvelope": "sha256:7a8155e9fcbb53485489728250a85109b5dab0d96cdd4aa8b7e7eb87a4898ddb",
128128
"src/daemon/session-tenant-scope.ts#TenantSessionNamespace": "sha256:a6613d22933caa053e479f05b7f016664f6be8d0afdbbf81e578ff497fc1b13d",
129129
"src/daemon/session-tenant-scope.ts#isTenantAddressableSessionName": "sha256:cc8ae18094b7f57d4bb694678f84ba767637b1087fd28058ffd6a3c92c79f05d",
130130
"src/daemon/session-tenant-scope.ts#isTenantOwnedSessionName": "sha256:c3cff883507d462548846554b89779cb815ceb265714575e57bee022b57c4bd1",
@@ -225,7 +225,7 @@
225225
"rationale": "Adds the optional providerCredentialFingerprint parameter to agent_device.lease.allocate, forwarded only when the request meta carries one, which the client sets only for a local daemon. A released protocol-2 daemon ignores unknown JSON-RPC parameters, and a request without a fingerprint keeps the previous payload byte-for-byte."
226226
},
227227
{
228-
"declaration": "src/daemon/server/http-server.ts#toLeaseDaemonRequest",
228+
"declaration": "src/daemon/server/http-rpc-methods.ts#toLeaseDaemonRequest",
229229
"digest": "sha256:3018984aeace4054767875f5eb6e6ad5d38bfcb71c15d1a56ccf9b53e0a419ec",
230230
"rationale": "#2110 read the optional providerApp lease-allocation parameter into the existing flags bag; #2494 reads the full provider-allocation flag set into that same bag through the shared readLeaseAllocateProviderFlags projection, so the reconstructed req.flags handed to prepareSession match what the line transport forwards for free. Released protocol-2 clients omit these and follow the unchanged allocation path; no existing field is required or reinterpreted. The optional retainOnClose boolean parameter is read into meta.leaseRetainOnClose; a released daemon ignores it and keeps releasing on session close. Reads the optional providerCredentialFingerprint lease-allocation parameter into request meta, so a local caller over HTTP gets the same credential check as over the socket. A daemon with an auth hook treats every HTTP caller as remote and strips it, as it does developerDir. Released protocol-2 clients omit it and follow the unchanged allocation path; no existing field is required or reinterpreted."
231231
},
@@ -280,7 +280,7 @@
280280
"rationale": "#2198 checks every link a command RPC crosses for protocol skew. #2650 caps a retry health probe at the request's remaining deadline. Health payload parsing and protocol mismatch refusal are unchanged; released peers still receive the same RPCs. #3178 threads the caller's optional AbortSignal through so a canceled call cuts a probe already in flight instead of waiting it out: the signal is client-local, never serialized, and the GET /health request and payload are unchanged."
281281
},
282282
{
283-
"declaration": "src/daemon/server/http-server.ts#authorizeAuxiliaryHttpRequest",
283+
"declaration": "src/daemon/server/http-authorization.ts#authorizeAuxiliaryHttpRequest",
284284
"digest": "sha256:1c323f97c3cefec8f95633b6abd127342bf75494bfb109d1cc6eadf3ceacaeae",
285285
"rationale": "#2198 context: adds one optional field to the value this DAEMON-INTERNAL gate hands its own route handlers — sessionNamespace, the caller's tenant plus whether the daemon partitioned that caller's session names. Nothing about it is serialized: no request header is read that was not read before, no response field is added, and a refusal keeps the same 401 {ok:false,error,code} REST body sendRestJsonError already sent. What it enables is a refusal DROPPED, never one added — an unattested (client-declared) tenant no longer has the <tenant>: prefix rule applied to it, because scopeRequestSession never applied that prefix to its sessions either. A released peer that now gets 200 where it got 401 is getting the ndjson record it asked for and already parses."
286286
},
@@ -310,7 +310,7 @@
310310
"rationale": "#2266 broadens runtime-hint validation to accept the additive HarmonyOS platform value; existing protocol-2 runtime hints remain valid and unchanged."
311311
},
312312
{
313-
"declaration": "src/daemon/server/http-server.ts#writeProgressEnvelope",
313+
"declaration": "src/daemon/server/http-rpc-envelope.ts#writeProgressEnvelope",
314314
"digest": "sha256:7be778b3902c72d7aa6282c16dc7106fdd64e99c0b5daf9f413ff5dd3fb044f1",
315315
"rationale": "#2894 lets an iOS runner start outlive the caller whose deadline gave up on it, so a progress event can arrive after the response ended. The sink now also skips a response whose writable side has ended, next to the destroyed check it already had. No byte written to a live response changes: the envelope framing and payload are untouched, and a released client never sees an event it could not have received before."
316316
},

‎test/wire-compat/surface.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ const REQUEST_PROGRESS = 'packages/contracts/src/request-progress.ts';
4545
const DAEMON_HTTP = 'packages/contracts/src/daemon-http.ts';
4646
const HTTP_ERRORS = 'src/daemon/http-errors.ts';
4747
const HTTP_SERVER = 'src/daemon/server/http-server.ts';
48+
const HTTP_RPC_ENVELOPE = 'src/daemon/server/http-rpc-envelope.ts';
49+
const HTTP_RPC_METHODS = 'src/daemon/server/http-rpc-methods.ts';
50+
const HTTP_AUTHORIZATION = 'src/daemon/server/http-authorization.ts';
4851
const HTTP_INSTANCE_PRECONDITION = 'src/daemon/server/http-instance-precondition.ts';
4952
const UPLOAD_HTTP = 'src/daemon/upload-http.ts';
5053
const ARTIFACT_HTTP = 'src/daemon/downloadable-artifact-http.ts';
@@ -165,7 +168,7 @@ export const WIRE_SURFACE: readonly WireSurfaceGroup[] = [
165168
'buildDaemonHttpTenantHeaders',
166169
),
167170
...from(
168-
HTTP_SERVER,
171+
HTTP_AUTHORIZATION,
169172
'HttpAuthHookContext',
170173
'HttpAuthHookResult',
171174
'HttpAuthHook',
@@ -228,10 +231,9 @@ export const WIRE_SURFACE: readonly WireSurfaceGroup[] = [
228231
...from('packages/contracts/src/lease-scope.ts', 'LeaseRpcCommand'),
229232
// Producer side: the method vocabulary a released client sends, and the
230233
// projections that turn each method's params into a DaemonRequest.
234+
...from(HTTP_RPC_ENVELOPE, 'JsonRpcRequest', 'JsonRpcResponse'),
231235
...from(
232-
HTTP_SERVER,
233-
'JsonRpcRequest',
234-
'JsonRpcResponse',
236+
HTTP_RPC_METHODS,
235237
'COMMAND_RPC_METHODS',
236238
'INSTALL_FROM_SOURCE_RPC_METHODS',
237239
'RELEASE_MATERIALIZED_PATHS_RPC_METHODS',
@@ -299,7 +301,7 @@ export const WIRE_SURFACE: readonly WireSurfaceGroup[] = [
299301
'serializeDaemonRpcResponseEnvelope',
300302
),
301303
...from(
302-
HTTP_SERVER,
304+
HTTP_RPC_ENVELOPE,
303305
'createRpcError',
304306
'sendJson',
305307
'writeProgressEnvelope',

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ const MUTATIONS: readonly WireMutation[] = [
7272
},
7373
{
7474
breakClass: 'method naming: a released client keeps sending the old method name',
75-
file: 'src/daemon/server/http-server.ts',
75+
file: 'src/daemon/server/http-rpc-methods.ts',
7676
name: 'COMMAND_RPC_METHODS',
7777
from: "'agent-device.command'",
7878
to: "'agent-device.cmd'",
7979
},
8080
{
8181
breakClass: 'method naming: the lease method table drops a released alias',
82-
file: 'src/daemon/server/http-server.ts',
82+
file: 'src/daemon/server/http-rpc-methods.ts',
8383
name: 'LEASE_RPC_METHOD_TO_COMMAND',
8484
from: "'agent-device.lease.allocate': 'lease_allocate',",
8585
to: '',
@@ -100,7 +100,7 @@ const MUTATIONS: readonly WireMutation[] = [
100100
},
101101
{
102102
breakClass: 'auth projection: the header a released client authenticates with is dropped',
103-
file: 'src/daemon/server/http-server.ts',
103+
file: 'src/daemon/server/http-authorization.ts',
104104
name: 'resolveToken',
105105
from: "typeof headers['x-agent-device-token'] === 'string'",
106106
to: 'false',

0 commit comments

Comments
 (0)