Skip to content

fix(pm-aggregator): type searchContext hit timings as SearchTimings (#16901) - #16902

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
xaltha/16901-cache-stats
Nov 29, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
xaltha/16901-cache-stats

Conversation

@dezren39

@dezren39 dezren39 commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Closes #16901.

searchContext (src/server-contexts.ts) returned timings: 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 --noEmit over 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-bot with what you need.

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.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 694e4668-65e0-4d0e-87c6-a2eb01f0b861
Commits

Reviewing files that changed from the base of the PR and between c72158f and 5bd5606.

Files selected for processing: 1

  • pm-stack/aggregator/src/server-contexts.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@dezren39

Copy link
Copy Markdown
Member Author

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.

@developing-today-fleet

Copy link
Copy Markdown
Contributor

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

@developing-today-fleet
developing-today-fleet Bot merged commit 0e08437 into main Nov 29, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the xaltha/16901-cache-stats branch November 29, 2026 17:25
@developing-today-fleet

Copy link
Copy Markdown
Contributor

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

@dezren39

Copy link
Copy Markdown
Member Author

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.

@developing-today-fleet

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pm-aggregator typecheck red on main: server.ts TS2339 'total' does not exist on cache stats type (2 sites)

1 participant