From ca9a09fef45ffe0ee9b3e742e387b33398c821bb Mon Sep 17 00:00:00 2001 From: opencode Date: Tue, 10 Nov 2026 08:18:56 -0600 Subject: [PATCH 1/2] fix(aggregator): typecheck the four drifted test files (#8133) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bunx tsc --noEmit in pm-stack/aggregator reported 8 errors on main, all in test files, after the RepoCoverage census fields (staleOpenIssues, staleIssuesCollectedAt, staleIssuesError) and RoadmapAnnotation.kind were narrowed without updating their fixtures: - coverage.test.ts: annotate the row/report/goodFile fixtures as RepoCoverage/CoverageReport/CoverageSnapshotFile and give the row the three census fields, so toEqual() no longer infers a wider object. - feed.test.ts: drop the duplicated feedSectionStatus import. - roadmap-annotations.test.ts: declare the restored fixture as RoadmapAnnotation so kind is the RoadmapAnnotationKind union. - saas-extract-surrogate-7743.test.ts: usageNote is optional on the service (a missing note is legitimate); assert with ! like its paygNote/paygEstimate siblings. Type-only change: bun test in pm-stack/aggregator stays at 1845 pass / 18 fail, byte-identical to origin/main (the 18 failures — including the pre-existing renderProgramProject dezren39/nix card failure also noted in #8133 — are unrelated and tracked separately). --- pm-stack/aggregator/test/coverage.test.ts | 15 ++++++++++++--- pm-stack/aggregator/test/feed.test.ts | 1 - .../aggregator/test/roadmap-annotations.test.ts | 3 ++- .../test/saas-extract-surrogate-7743.test.ts | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pm-stack/aggregator/test/coverage.test.ts b/pm-stack/aggregator/test/coverage.test.ts index d2715bb980..df4e16425e 100644 --- a/pm-stack/aggregator/test/coverage.test.ts +++ b/pm-stack/aggregator/test/coverage.test.ts @@ -14,6 +14,7 @@ import { type CoverageReport, type CoverageSnapshotFile, type RepoCensus, + type RepoCoverage, } from "../src/coverage.ts"; import { coverageFromFeed } from "../src/feed.ts"; import type { ProjectPoolItem } from "../src/model.ts"; @@ -373,17 +374,25 @@ describe("CoverageSnapshotStore writes (PR #3309 Codex)", () => { }); }); describe("CoverageSnapshotStore reads (#4140)", () => { - const row = { + const row: RepoCoverage = { repo: "developing-today/code", openIssues: 10, gateNow: 1, gateNext: 2, + staleOpenIssues: null, + staleIssuesCollectedAt: null, + staleIssuesError: null, poolItems: 3, poolUnsetStatus: 1, poolUnsetArea: 0, }; - const report = { generatedAt: "2026-11-01T00:00:00Z", repos: [row] }; - const goodFile = { baseline: report, current: report, weekly: report, anchorAt: "2026-11-01T00:00:00Z" }; + const report: CoverageReport = { generatedAt: "2026-11-01T00:00:00Z", repos: [row] }; + const goodFile: CoverageSnapshotFile = { + baseline: report, + current: report, + weekly: report, + anchorAt: "2026-11-01T00:00:00Z", + }; async function readRaw(raw: unknown): Promise { const dir = await mkdtemp(join(tmpdir(), "coverage-store-read-")); diff --git a/pm-stack/aggregator/test/feed.test.ts b/pm-stack/aggregator/test/feed.test.ts index a781312b58..9aa6cf7d7d 100644 --- a/pm-stack/aggregator/test/feed.test.ts +++ b/pm-stack/aggregator/test/feed.test.ts @@ -2,7 +2,6 @@ import { describe, expect, test } from "bun:test"; import { feedSectionStatus, coverageFromFeed, - feedSectionStatus, isBurnSegment, isChargeRow, isFleetFeed, diff --git a/pm-stack/aggregator/test/roadmap-annotations.test.ts b/pm-stack/aggregator/test/roadmap-annotations.test.ts index 7e43074a5c..d2ccc8151a 100644 --- a/pm-stack/aggregator/test/roadmap-annotations.test.ts +++ b/pm-stack/aggregator/test/roadmap-annotations.test.ts @@ -6,6 +6,7 @@ import { RoadmapAnnotationsStore, validateNewRoadmapAnnotation, type NewRoadmapAnnotation, + type RoadmapAnnotation, } from "../src/roadmap-annotations.ts"; const author = { kind: "drew" as const, id: "drew", label: "Drew" }; @@ -72,7 +73,7 @@ describe("roadmap annotations (#1284)", () => { expect(statSync(join(dir, quarantined[0])).isDirectory()).toBe(true); expect(existsSync(file)).toBe(false); - const restored = { + const restored: RoadmapAnnotation = { id: "ra-restored", stableRef: "grist:doc/Roadmap/restored", kind: "decision", diff --git a/pm-stack/aggregator/test/saas-extract-surrogate-7743.test.ts b/pm-stack/aggregator/test/saas-extract-surrogate-7743.test.ts index aa9cb2e6a0..c4ad399cb3 100644 --- a/pm-stack/aggregator/test/saas-extract-surrogate-7743.test.ts +++ b/pm-stack/aggregator/test/saas-extract-surrogate-7743.test.ts @@ -76,7 +76,7 @@ describe("#7743 extractSaasServices caps are surrogate-pair-safe", () => { test("usageNote straddling the 600 cap is dropped whole", () => { const svc = bitwarden([usageStraddle]); - const note = svc.usageNote; + const note = svc.usageNote!; expect(note.length).toBe(599); expect(loneHighAtEnd(note)).toBe(false); expect(roundTrips(note)).toBe(true); From 9e2bba356153d1b9f39bafc6e5f67dbccdb0aeef Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Sat, 14 Nov 2026 15:08:29 -0600 Subject: [PATCH 2/2] fix(aggregator): give the snapshot-rotation coverage fixture the stale-census fields Shepherd completion of PR #8159 (task 17245): main gained a second RepoCoverage literal (the snapshot-rotation mk fixture) after this branch forked, missing the same three stale-census fields this PR adds to the row fixture \u2014 TS2739 on current main. Add them as null (census unavailable), matching the fixture null-census semantics; no assertion changes. Also merges current main into the branch: the feed.test.ts duplicate-import fix from this PR already landed on main independently, so that hunk is dropped. Verified in the worktree: bunx tsc --noEmit reports zero errors in all four of this PR files (total on main 22 -> 14, the rest is newer drift outside this PR scope); bun test on the four files: 126 pass, 0 fail. --- pm-stack/aggregator/test/coverage.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pm-stack/aggregator/test/coverage.test.ts b/pm-stack/aggregator/test/coverage.test.ts index 8a555aa0e5..f93d7e5656 100644 --- a/pm-stack/aggregator/test/coverage.test.ts +++ b/pm-stack/aggregator/test/coverage.test.ts @@ -336,6 +336,9 @@ describe("snapshot rotation — poisoned anchorAt (#5196)", () => { poolItems: 10, poolUnsetStatus: 3, poolUnsetArea: 4, + staleOpenIssues: null, + staleIssuesCollectedAt: null, + staleIssuesError: null, }, ], });