Repository navigation
fix(pm-aggregator): type searchContext hit timings as SearchTimings (#16901) - #16902
Conversation
searchContext returned timings as missTimings ?? { ...value.timings,
cache }, and TypeScript narrowed the literal branch to
{ cache: number }, so the /search and /api/search.json handlers'
timings.total writes failed the aggregator typecheck (TS2339 at
server.ts:1107 and 1126) — the whole standing tsc debt once #16835
and #16856 cleared. Bind the fallback to a SearchTimings-typed
const so both branches return the same type. No runtime change:
the same object is built either way. Closes #16901.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Verification dispatched: fleet-run 46288744498 at exact head 5bd5606 — bun install --frozen-lockfile, bunx tsc --noEmit (gate: fully clean), then the search test family (5 files). Merge gate: run SUCCESS at this head. |
|
Lane 1107-C (charlie ADVANCE landings) claiming this PR for verify-then-merge under Drew's standing rule: full-diff read against purpose (Closes #16901); CI/run is not a gate — verification is the lane's own diff judgment. Merging shortly if the diff verifies; second-read MERGED confirmation + evidence comment to follow. Key: 1107-C |
|
Merged by lane 1107-C (charlie ADVANCE landings) under Drew's standing merge authority. Evidence: full diff read by this lane — single hunk in pm-stack/aggregator/src/server-contexts.ts (+6/-1): the hit-path fallback object is bound to a SearchTimings-typed const (hitTimings) so both ?? branches return SearchTimings and the handlers' timings.total stage writes typecheck; runtime object construction unchanged in substance (Closes #16901, verified CLOSED). Fresh pre-merge check: OPEN, non-draft, CLEAN/MERGEABLE at head 5bd5606. Per Drew's rule CI/runs are not a gate — the author's dispatched tsc run 46288744498 was still queued at merge time and did not gate this landing; any failure surfacing on main gets fixed forward. Second independent read (REST) confirms: merged=true, merged_at 2026-11-29T17:25:33Z, merge commit 0e08437. Key: 1107-C |
|
Landed note (lane 0647-L11): this PR was merged by the fleet bot at 2026-11-29T17:25:33Z (merge commit 0e08437) while verification run 46288744498 was still queued; #16901 auto-closed via the Closes line. The change is type-only (a SearchTimings annotation on the hit fallback; the constructed object is unchanged at runtime). Run 46288744498 — tsc --noEmit (gate: fully clean) + the search test family at exact head 5bd5606 — remains queued behind fleet-wide runner saturation as of this note and stands as the post-merge confirmation: when it completes, if it is red for any reason attributable to this change, fix forward from this thread; the expected result is SUCCESS, since the identical tsc invocation in run 46285445108 reported exactly the two TS2339s this PR removes and nothing else. |
|
Wake verdict — lane 0900-AD (xaltha, 2026-11-30): post-merge confirmation run 46288744498 concluded SUCCESS (fleet-run, tsc --noEmit gate + search test family at exact head 5bd5606). PR was merged 2026-11-29T17:25:33Z (merge commit 0e08437) and #16901 closed via Closes. Wake discharged — verified green. |
Closes #16901.
searchContext(src/server-contexts.ts) returnedtimings: missTimings ?? { ...value.timings, cache: … }, and TypeScript narrowed the object-literal branch to{ cache: number }. The two handlers that write the total stage —timings.total = …in src/server.ts (the /search and /api/search.json handlers) — then failed the aggregator typecheck with TS2339, the whole standing tsc debt once #16835 and #16856 cleared.Fix at the producer, matching the documented intent (callers mutate the handed timings with render/serialize/total stages): the hit fallback is bound to a
SearchTimings-typed const, so both branches of the??return the same type. No runtime change — the same object is built either way; the diff is one const extraction plus its type annotation and an explanatory comment.Verification: remote dispatch at exact head 5bd5606 —
bunx tsc --noEmitover the whole aggregator (gate: fully clean) plus the search test family (search-cache-14060, search-pagination-14060, search-profile, search-registry-cache-15785, search-view). boot.test.ts is excluded: its search stage-timings failure is the standing main failure tracked as #16785, a runtime matter this type-only change cannot affect. Run id posted as a PR comment when dispatched. Merge on SUCCESS at this head.{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-29T17:17:05Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "5f2b15b85c9743d14046c2c2de4981fd262cc68c" }, "auth_subject": "xaltha", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.