Repository navigation
refactor(daemon): keep the request router under the line cap - #5001
Conversation
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
|
This PR is ready at cb138bc: the review found no problems in the code. CI shows only two cancelled Body rules jobs, which check the PR body and not code, and the diff does not overlap them, so please re-run them before merge. There are no conflicts. Not verified here: lint, typecheck and tests were not re-run locally; this relies on the reported check:affected run and the green CI lanes. Not blocking, take or leave: request-finalization.ts:252 builds the same commit-failure teardown message and replay guidance as |
The router's error half — the repair and idle-expiry tombstone answers and the typed-signal graft — now lives in `request-finalization.ts`, the module that already owns the reply a request leaves with. The moved code is verbatim; only the three router-facing helpers gained `export`. `request-finalization.ts` is already in the eager closure of every entry that reaches the router, so the split loads no new module anywhere, and the file's top-level statement weight is unchanged.
cb138bc to
de71c28
Compare
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
The change at de71c28 is clean. The request router now stays under the line cap, and the earlier review of cb138bc found no problems; nothing from that review remains open. The Smoke Tests failure looks unrelated to this PR. The log excerpt shows it failing in the Install Linux desktop dependencies step (apt-get), before any repository code runs, and this diff only touches daemon request finalization and a comment. Body rules was cancelled and checks the PR body, not code. Not verified here: lint, typecheck and tests were not run locally, and the Smoke Tests attribution comes from that install-step excerpt alone. Re-run the cancelled Body rules and Smoke Tests jobs before merge. |
|
Merging with only Linux Smoke Tests failing, on |
…ck#5001) The router's error half — the repair and idle-expiry tombstone answers and the typed-signal graft — now lives in `request-finalization.ts`, the module that already owns the reply a request leaves with. The moved code is verbatim; only the three router-facing helpers gained `export`. `request-finalization.ts` is already in the eager closure of every entry that reaches the router, so the split loads no new module anywhere, and the file's top-level statement weight is unchanged.
The router's error half — the repair and idle-expiry tombstone answers and the typed-signal graft — now lives in `request-finalization.ts`, the module that already owns the reply a request leaves with. The moved code is verbatim; only the three router-facing helpers gained `export`. `request-finalization.ts` is already in the eager closure of every entry that reaches the router, so the split loads no new module anywhere, and the file's top-level statement weight is unchanged.
Summary
packages/daemon/src/server/request-router.tssits at 998 lines against the 1000-linemax-linescap, so the next small PR to the router re-tripspnpm lint.The router's error half —
repairExpiredIfTombstoned,idleExpiredIfTombstoned, and theenrichDaemonErrorretriable graft — moves torequest-finalization.ts, the module that already owns the reply a request leaves with (finalizeDaemonResponse). Same final-answer decisions, one owner. The move is verbatim: only those three functions gainexport; no behavior, wire shape, or error text changes.packages/daemon-client/src/daemon-client-lifecycle.tsupdates its cross-package pointer to the new home.request-finalization.tsis already in the eager closure of both entries that reach the router (packages/daemon/src/index.ts,src/daemon.ts), so no new eager module is introduced — the ADR-0019 eager-closure gate is untouched, and nomax-lineswaiver is added.Value
request-router.ts: 998 -> 889 lines (cap 1000; 111 lines of headroom)request-finalization.ts: 216 -> 331 linesValidation
Head
de71c28bd9, baseorigin/0.22(e02e1f7dc2).pnpm check:affected --run --base origin/0.22 --head HEAD: all selected runnable checks passed (format, lint, typecheck, layering, fallow, build, vitest-related, unit). The eager-closure budgets suite passes standalone (955 tests), as do the 1164 tests underpackages/daemon/src/server. CI obligations: the0.22Lint and Typecheck lanes. No device-facing dispatch, capture, or lifecycle code changed, so no device run applies.