test(sweep): call the exported report builder, not a name that never landed - #1282
Merged
Conversation
…landed human-gated-ageing.test.ts calls buildHumanGatedAgeingReport at two sites. That symbol does not exist: it is not imported (the import block pulls selectAgedHumanGatedIssues), it is not defined in the file, and it is not exported anywhere in the repo. Both tests throw 'ReferenceError: buildHumanGatedAgeingReport is not defined' on every run. The intended function is selectAgedHumanGatedIssues, which is already imported at line 12, already used with the identical call shape at lines 65 and 71, and has the matching signature (issues, options) -> HumanGatedAgeingReport with the .scanned field both tests read. This is merge-blocking, not a flake. It landed on master at 19:34:33Z and every merge-queue batch built on d63bbc6 since has failed 'General tests (server 1/4)' on it -- confirmed on the queue branches for pr-1201, pr-1189 and pr-1089, three unrelated PRs ejected by the same ReferenceError. The queue has grown to 14 entries. Verified: 35/35 pass with the fix; negative control at base reproduces exactly 2 failures with the same ReferenceError.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 9908ccf
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
selectAgedHumanGatedIssuesis already imported and is used with the same arguments elsewhere in this test file.- The replacement returns
HumanGatedAgeingReport, so.scannedcontinues to supply the exact population asserted by both histogram-validation tests. - The patch is intentionally scoped to the two nonexistent references; it restores execution of the existing assertions without changing production behavior or weakening the bucket-bound checks.
Recommended Action
- Merge when the remaining repository checks complete.
allyblockcast
approved these changes
Aug 10, 2026
allyblockcast
left a comment
Collaborator
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 9908ccf
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
selectAgedHumanGatedIssuesis already imported and is used with the same arguments elsewhere in this test file.- The replacement returns
HumanGatedAgeingReport, so.scannedcontinues to supply the exact population asserted by both histogram-validation tests. - The patch is intentionally scoped to the two nonexistent references; it restores execution of the existing assertions without changing production behavior or weakening the bucket-bound checks.
Recommended Action
- Merge when the remaining repository checks complete.
|
Hey @kkroo! Before this PR can be reviewed, a few things need attention: Missing or incomplete:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thinking Path
I was investigating why my own PR #1201 had fallen from merge-queue position 1 to position 10, expecting a flake. It wasn't one.
The failing shard reported
ReferenceError: buildHumanGatedAgeingReport is not defined. That is a missing symbol, not a flaky assertion, so the first question was whose it is. #1201 is CI-only (workflows plus two test files) and touches nothing near this code, which ruled it out. A repo-wide code search forbuildHumanGatedAgeingReportreturned zero matches — the function exists nowhere.Checking the file on master:
human-gated-ageing.test.tscalls it at lines 611 and 622, the import block at lines 2–14 does not import it, and it is not defined locally. So both tests throw on every run.Then the important question — is this only my PR, or everything? Every merge-queue branch built on
d63bbc66fails the same shard: pr-1201, pr-1189 and pr-1089, three unrelated PRs, all ejected. I pulled the log for pr-1089's queue run and found the identical ReferenceError four times. The queue has grown to 14 entries. Nothing can merge.For the intended API,
selectAgedHumanGatedIssuesis exported athuman-gated-ageing.ts:360returningHumanGatedAgeingReport, is already imported by this test at line 12, and is already called with the identical shape at lines 65 and 71.HumanGatedAgeingReport.scannedis the field both broken tests read. So the two call sites simply carry a stale name from an earlier draft of the module.I checked whether the missing half was in flight before writing anything. My own #1241 (
feat(sweep): add human-gated ageing escalation) is a DIRTY draft that adds the same file set and exports the same symbols — it does not definebuildHumanGatedAgeingReporteither. Nothing open supplies it.What Changed
Two call sites in
server/src/__tests__/human-gated-ageing.test.tsrenamed frombuildHumanGatedAgeingReporttoselectAgedHumanGatedIssues. No import change — it was already imported. No production code touched.Risks
Low. Test-only, two identifiers, and the replacement is the function the rest of the file already uses for exactly this purpose with exactly these arguments.
The one thing worth a reviewer's eye: I assumed the two tests intended to build a report the same way lines 65 and 71 do. If instead a genuinely distinct
buildHumanGatedAgeingReportwas meant to land — a different builder with different semantics — then this makes the tests pass while quietly weakening what they assert. I looked for that function in the open PR set and in the module and found nothing, but I cannot prove intent from a name that never existed. Both tests are abouthumanGatedAgeHistogramrejecting bad bucket bounds, and they only use the report to obtain.scanned, so the builder choice is incidental to what they verify.Verification
Ran locally in a clean worktree off
origin/master(d63bbc669):Test Files 1 passed (1),Tests 35 passed (35).Tests 2 failed | 33 passed (35), both failuresReferenceError: buildHumanGatedAgeingReport is not defined. Restored after.So the two failures are precisely the ones this fixes, and nothing else in the file changes behaviour.
CI evidence that this is repo-wide rather than local: queue-branch runs for pr-1201, pr-1189 and pr-1089 all on base
d63bbc66, all failingGeneral tests (server 1/4), with the identical error confirmed in pr-1089's log.Model Used
Claude Opus 5 (1M context)