CARD-20 (FPRD-001c), issue #125, decision D16 (accepted 2026-10-22: fix it in the teacup).
A teacup resolved HEAD on a remote buffered GET through the implicit-HEAD fallback, and OPTIONS advertised HEAD. But the remote route handler in spliceRemoteScopes forwarded req.method, so the teapot got a HEAD envelope. resolveRoute on the teapot found no HEAD plan and answered 404.
The fix is one line in the teacup's remote route handler: a HEAD that matched a remote GET is forwarded as GET. dispatch already drops the body for HEAD, so the client gets the GET's status and headers and no body, the same as a local route. An explicit remote HEAD route is matched first and is still forwarded as HEAD. The teapot and the wire protocol don't change, so a new teacup works against an older teapot during a rolling deploy.
Commits
fix(mesh): answer HEAD on a remote GET route (CARD-20, #125): the fix, tests, and the CHANGELOG ### Fixed entry.
test(router-parity): HEAD on a remote GET answers 200 for CARD-20 (owner approval required): needs owner approval (CARD-08 rule). In test/router-parity/frozen/owner-mesh-allow.json, the two HEAD /api/x entries (fetch and node) go from status 404 to 200. Headers and the empty body are unchanged. The fixture comment in owner.test.ts that described the old behaviour is updated to match. Commit 1 alone fails that frozen test, so review the two commits together.
Tests (card cases)
test/mesh/remote-head.test.ts:
T1 app.fetch: 200, same content-type as the GET (application/json), empty body
T2 Node listener: same
OPTIONS still GET, HEAD, OPTIONS (both adapters)
T3 explicit remote HEAD + GET: the explicit HEAD handler runs and is reached as HEAD
T4 remote GET throws NotFound: HEAD → 404, empty body, and the teapot handler did run
remote GET throws: HEAD → 500, empty body
T5 one HEAD calls the teapot handler once, with method GET
T6: new cases in test/deno/mesh.test.ts and test/bun/mesh.test.ts (HEAD over a real socket → 200, JSON content-type, empty body)
Evidence (local, Node 22, after rebasing on develop)
npm audit --audit-level=moderate: found 0 vulnerabilities (rebased on origin/develop after #134 and #135 merged)
Unsure / notes
The condition is req.method === 'HEAD' && route.method === 'GET', not simply route.method. It is narrower and makes the intent explicit.
The scope-step envelope (envelopeFrom) still carries HEAD for a local HEAD route that needs a remote step. Teapot scope resolution doesn't look up by method, so it works, and the card doesn't cover it. I left it alone.
No public API change, so no JSDoc changes.
Docs follow-up (CARD-12)
guides/mesh.md: if it describes remote routes and methods, add that HEAD on a remote GET answers like a local one (the GET's status and headers, no body), and that the teacup forwards it to the teapot as GET.
## What and why
CARD-20 (FPRD-001c), issue #125, decision **D16** (accepted 2026-10-22: fix it in the teacup).
A teacup resolved `HEAD` on a remote buffered `GET` through the implicit-HEAD fallback, and `OPTIONS` advertised `HEAD`. But the remote route handler in `spliceRemoteScopes` forwarded `req.method`, so the teapot got a `HEAD` envelope. `resolveRoute` on the teapot found no `HEAD` plan and answered `404`.
The fix is one line in the teacup's remote route handler: a `HEAD` that matched a remote `GET` is forwarded as `GET`. `dispatch` already drops the body for `HEAD`, so the client gets the GET's status and headers and no body, the same as a local route. An explicit remote `HEAD` route is matched first and is still forwarded as `HEAD`. The teapot and the wire protocol don't change, so a new teacup works against an older teapot during a rolling deploy.
## Commits
1. `fix(mesh): answer HEAD on a remote GET route (CARD-20, #125)`: the fix, tests, and the CHANGELOG `### Fixed` entry.
2. `test(router-parity): HEAD on a remote GET answers 200 for CARD-20 (owner approval required)`: **needs owner approval (CARD-08 rule).** In `test/router-parity/frozen/owner-mesh-allow.json`, the two `HEAD /api/x` entries (fetch and node) go from status `404` to `200`. Headers and the empty body are unchanged. The fixture comment in `owner.test.ts` that described the old behaviour is updated to match. Commit 1 alone fails that frozen test, so review the two commits together.
## Tests (card cases)
`test/mesh/remote-head.test.ts`:
- T1 app.fetch: `200`, same `content-type` as the GET (`application/json`), empty body
- T2 Node listener: same
- `OPTIONS` still `GET, HEAD, OPTIONS` (both adapters)
- T3 explicit remote `HEAD` + `GET`: the explicit HEAD handler runs and is reached as HEAD
- T4 remote GET throws `NotFound`: `HEAD` → `404`, empty body, and the teapot handler did run
- remote GET throws: `HEAD` → `500`, empty body
- T5 one HEAD calls the teapot handler once, with method `GET`
- T6: new cases in `test/deno/mesh.test.ts` and `test/bun/mesh.test.ts` (HEAD over a real socket → 200, JSON content-type, empty body)
## Evidence (local, Node 22, after rebasing on develop)
- `npm run lint`: 0 errors, 50 warnings (all pre-existing `no-explicit-any`, none added)
- `npm run format:check`: clean
- `npm run typecheck`: clean
- `npm test`: 922 passed
- `npm run build`: ok
- `npm run complexity:check`: every function ≤ 25
- `npm run test:deno`: 37 passed, 0 failed
- `npm run test:bun`: 27 pass, 0 fail
- `npm run test:edge`: PASS (1158 matcher cases + 55 app.fetch cases)
- `npm audit --audit-level=moderate`: found 0 vulnerabilities (rebased on `origin/develop` after #134 and #135 merged)
## Unsure / notes
- The condition is `req.method === 'HEAD' && route.method === 'GET'`, not simply `route.method`. It is narrower and makes the intent explicit.
- The scope-step envelope (`envelopeFrom`) still carries `HEAD` for a local HEAD route that needs a remote step. Teapot scope resolution doesn't look up by method, so it works, and the card doesn't cover it. I left it alone.
- No public API change, so no JSDoc changes.
## Docs follow-up (CARD-12)
- `guides/mesh.md`: if it describes remote routes and methods, add that `HEAD` on a remote `GET` answers like a local one (the GET's status and headers, no body), and that the teacup forwards it to the teapot as `GET`.
Owner decision (2026-10-23): frozen capture change in 3b124fb (owner-mesh-allow.json, HEAD /api/x 404 → 200) approved. Not merging yet: an implementation review of the 1c sprint comes first.
Owner decision (2026-10-23): frozen capture change in 3b124fb (`owner-mesh-allow.json`, `HEAD /api/x` 404 → 200) **approved**. Not merging yet: an implementation review of the 1c sprint comes first.
Implementation review done on 2026-10-23: a Codex review of all 12 sprint PRs, with each finding verified. The P1s in #142 and the P3 in #149 are fixed. The owner (Chrnx) authorized merging in order, each one rebased on develop with CI green. This supersedes the earlier "not merging yet" note.
Implementation review done on 2026-10-23: a Codex review of all 12 sprint PRs, with each finding verified. The P1s in #142 and the P3 in #149 are fixed. The owner (Chrnx) authorized merging in order, each one rebased on develop with CI green. This supersedes the earlier "not merging yet" note.
The teacup's router resolves HEAD to a remote buffered GET through the
implicit-HEAD fallback, and OPTIONS advertises HEAD. But the remote
route handler forwarded req.method, so the teapot got a HEAD envelope,
found no HEAD plan in resolveRoute, and answered 404.
Forward a HEAD that matched a remote GET as GET. dispatch already drops
the body for HEAD, so the client gets the GET's status and headers and
no body, the same as a local route. An explicit remote HEAD route is
matched first and is still forwarded as HEAD.
The fix is teacup-side (D16, accepted 2026-10-22): the teapot and the
wire protocol are unchanged, so a new teacup works against an older
teapot during a rolling deploy.
Tests cover app.fetch and the Node listener (200 + GET headers + empty
body, OPTIONS, explicit HEAD precedence, 404/500 kept with no body, the
teapot handler called once as GET) and Deno and Bun.
The frozen owner-mesh-allow.json capture changes in the next commit.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
owner-mesh-allow.json froze HEAD /api/x at 404 on both adapters: the
teacup forwarded HEAD to the teapot, which has no HEAD plan for the
route. CARD-20 (#125, D16) fixes that, so HEAD now answers 200 with the
GET's headers and an empty body, like a local route.
Only those two entries change (fetch and node), status 404 -> 200.
Headers and the empty body are identical. The fixture comment in
owner.test.ts that described the old behaviour is updated to match.
Owner approval required (CARD-08 rule): this edits a frozen file under
test/router-parity/.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
CARD-20 (FPRD-001c), issue #125, decision D16 (accepted 2026-10-22: fix it in the teacup).
A teacup resolved
HEADon a remote bufferedGETthrough the implicit-HEAD fallback, andOPTIONSadvertisedHEAD. But the remote route handler inspliceRemoteScopesforwardedreq.method, so the teapot got aHEADenvelope.resolveRouteon the teapot found noHEADplan and answered404.The fix is one line in the teacup's remote route handler: a
HEADthat matched a remoteGETis forwarded asGET.dispatchalready drops the body forHEAD, so the client gets the GET's status and headers and no body, the same as a local route. An explicit remoteHEADroute is matched first and is still forwarded asHEAD. The teapot and the wire protocol don't change, so a new teacup works against an older teapot during a rolling deploy.Commits
fix(mesh): answer HEAD on a remote GET route (CARD-20, #125): the fix, tests, and the CHANGELOG### Fixedentry.test(router-parity): HEAD on a remote GET answers 200 for CARD-20 (owner approval required): needs owner approval (CARD-08 rule). Intest/router-parity/frozen/owner-mesh-allow.json, the twoHEAD /api/xentries (fetch and node) go from status404to200. Headers and the empty body are unchanged. The fixture comment inowner.test.tsthat described the old behaviour is updated to match. Commit 1 alone fails that frozen test, so review the two commits together.Tests (card cases)
test/mesh/remote-head.test.ts:200, samecontent-typeas the GET (application/json), empty bodyOPTIONSstillGET, HEAD, OPTIONS(both adapters)HEAD+GET: the explicit HEAD handler runs and is reached as HEADNotFound:HEAD→404, empty body, and the teapot handler did runHEAD→500, empty bodyGETtest/deno/mesh.test.tsandtest/bun/mesh.test.ts(HEAD over a real socket → 200, JSON content-type, empty body)Evidence (local, Node 22, after rebasing on develop)
npm run lint: 0 errors, 50 warnings (all pre-existingno-explicit-any, none added)npm run format:check: cleannpm run typecheck: cleannpm test: 922 passednpm run build: oknpm run complexity:check: every function ≤ 25npm run test:deno: 37 passed, 0 failednpm run test:bun: 27 pass, 0 failnpm run test:edge: PASS (1158 matcher cases + 55 app.fetch cases)npm audit --audit-level=moderate: found 0 vulnerabilities (rebased onorigin/developafter #134 and #135 merged)Unsure / notes
req.method === 'HEAD' && route.method === 'GET', not simplyroute.method. It is narrower and makes the intent explicit.envelopeFrom) still carriesHEADfor a local HEAD route that needs a remote step. Teapot scope resolution doesn't look up by method, so it works, and the card doesn't cover it. I left it alone.Docs follow-up (CARD-12)
guides/mesh.md: if it describes remote routes and methods, add thatHEADon a remoteGETanswers like a local one (the GET's status and headers, no body), and that the teacup forwards it to the teapot asGET.c865c2a418tod9b0fe09d6d9b0fe09d6to3b124fb05bOwner decision (2026-10-23): frozen capture change in
3b124fb(owner-mesh-allow.json,HEAD /api/x404 → 200) approved. Not merging yet: an implementation review of the 1c sprint comes first.Implementation review done on 2026-10-23: a Codex review of all 12 sprint PRs, with each finding verified. The P1s in #142 and the P3 in #149 are fixed. The owner (Chrnx) authorized merging in order, each one rebased on develop with CI green. This supersedes the earlier "not merging yet" note.
3b124fb05btoae9e5529e8