Skip to content

test(sweep): call the exported report builder, not a name that never landed - #1282

Merged
kkroo merged 2 commits into
masterfrom
kkroo/fix-hga-missing-builder
Aug 11, 2026
Merged

test(sweep): call the exported report builder, not a name that never landed#1282
kkroo merged 2 commits into
masterfrom
kkroo/fix-hga-missing-builder

Conversation

@kkroo

@kkroo kkroo commented Aug 10, 2026

Copy link
Copy Markdown

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 for buildHumanGatedAgeingReport returned zero matches — the function exists nowhere.

Checking the file on master: human-gated-ageing.test.ts calls 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 d63bbc66 fails 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, selectAgedHumanGatedIssues is exported at human-gated-ageing.ts:360 returning HumanGatedAgeingReport, is already imported by this test at line 12, and is already called with the identical shape at lines 65 and 71. HumanGatedAgeingReport.scanned is 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 define buildHumanGatedAgeingReport either. Nothing open supplies it.

What Changed

Two call sites in server/src/__tests__/human-gated-ageing.test.ts renamed from buildHumanGatedAgeingReport to selectAgedHumanGatedIssues. 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 buildHumanGatedAgeingReport was 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 about humanGatedAgeHistogram rejecting 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):

  • With the fix: Test Files 1 passed (1), Tests 35 passed (35).
  • Negative control — stashed the fix, same command at base: Tests 2 failed | 33 passed (35), both failures ReferenceError: 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 failing General tests (server 1/4), with the identical error confirmed in pr-1089's log.

Model Used

Claude Opus 5 (1M context)

…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.
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

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.

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • selectAgedHumanGatedIssues is already imported and is used with the same arguments elsewhere in this test file.
  • The replacement returns HumanGatedAgeingReport, so .scanned continues 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

  1. Merge when the remaining repository checks complete.

@allyblockcast allyblockcast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • selectAgedHumanGatedIssues is already imported and is used with the same arguments elsewhere in this test file.
  • The replacement returns HumanGatedAgeingReport, so .scanned continues 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

  1. Merge when the remaining repository checks complete.

@kkroo
kkroo merged commit e249009 into master Aug 11, 2026
1 of 2 checks passed
@kkroo
kkroo deleted the kkroo/fix-hga-missing-builder branch August 11, 2026 00:23
@allyblockcast

allyblockcast Bot commented Aug 11, 2026

Copy link
Copy Markdown

Hey @kkroo! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • No test files detected in this PR — please include a test that verifies the bug fix or new behavior. If this PR genuinely doesn't need a test (e.g. a refactor), please retitle with refactor: prefix.

Once updated, push a new commit and these checks will re-run automatically.

— commitperclip

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.

2 participants