Skip to content

fix(review): close 5 real pre-existing regressions on main - #9276

Merged
JSONbored merged 1 commit into
mainfrom
fix/main-regressions-batch-2026-07-27
Jul 27, 2026
Merged

fix(review): close 5 real pre-existing regressions on main#9276
JSONbored merged 1 commit into
mainfrom
fix/main-regressions-batch-2026-07-27

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Confirmed via a clean origin/main checkout that 8 test files (12 test cases) were failing independently of any in-flight PR — a real, pre-existing regression, not caused by any branch. Root causes, all genuine bugs or stale test assertions from very recent merges in today's heavy churn:

  1. linked-issue-label-propagation-fetch.ts: a merge-conflict resolution's fix (the direct-ownership-match exemption from the reward-label satisfaction-verdict check, orb(rewards): a contributor who authored the linked issue inherits every label on it, bypassing the reward-label trust gate and its opt-in flag #9161/orb(rewards): the Gittensor reward multiplier is chosen by contributor-authored PR title text #9077) was verified locally but never actually committed before its branch was pushed — silently lost. Re-applied.
  2. config-lint.ts's mergeReadinessCompositeWarnings fired even when gate.mergeReadiness is explicitly "off", which is a genuine no-op and never worth warning about — only null/unset and "off" should both short-circuit.
  3. predicted-gate-engine.test.ts asserted gateMode(undefined) === "advisory", the pre-orb(config): mergeReadiness:advisory silently demotes three explicitly-blocking gates at once, and unknown gate modes coerce toward merge #9167 fallback; orb(config): mergeReadiness:advisory silently demotes three explicitly-blocking gates at once, and unknown gate modes coerce toward merge #9167 intentionally made this fail closed ("block") for a malformed value. Test updated to match.
  4. loopover-engine-scaffold.test.ts asserted a stale package.json "files" shape; orb(testing): engine package tests contribute zero coverage evidence, and two v8-ignore directives are malformed #9064's engine-coverage work legitimately changed it to source-map-friendly glob patterns. Test updated to match.
  5. The merge-readiness-composite-preserves-explicit-block engine-parity fixture encoded a "composite only fills in an unset sub-gate" semantic that was deliberately reverted (see applyMergeReadinessGate's own doc comment: unreachable in practice, since every sub-gate mode is already a concrete DB-defaulted value by the time it reaches GateCheckPolicy). Renamed and corrected to assert the actual (override) behavior, with a fresh golden recorded via scripts/record-engine-parity-goldens.ts. queue-5.test.ts's REGRESSION (#4528) test hit the same reward-label gate from a different angle and needed the same two assertions corrected.
  6. reputation-wiring.test.ts's seedReviewTarget helper still wrote into review_targets, frozen by the 2026-06-22 convergence cutover (orb(observability): the orphaned review_targets table silently disables the anomaly alerter, the reputation quality signal, and the AMS bridge — and the reputation half expires to empty around 2026-09-20 #9136 repointed getSubmitterReputation/getSubmitterReputationAcrossInstall onto the live review_audit ledger, but this test helper was never updated to match). Rewritten to seed review_audit + pull_requests directly, mirroring submitter-reputation.ts's own query shape; also registered the synthetic repos an install-wide test needs (the cross-repo query joins on repositories.installation_id), and repointed a stale review_targets backdating UPDATE at pull_requests (orb(security): reputation burst-downgrade fails OPEN — suspected abusers get LESS review (LIVE in prod) #9015 already repointed the cadence query itself).

Test plan

  • npx tsc --noEmit -p tsconfig.json --incremental false — clean
  • All 8 originally-failing files, 376 tests — now green (test/unit/reputation-wiring.test.ts, test/unit/queue-5.test.ts, test/unit/linked-issue-label-propagation-fetch.test.ts, test/unit/predicted-gate-engine.test.ts, test/unit/config-templates.test.ts, test/unit/loopover-engine-scaffold.test.ts, test/contract/engine-parity.test.ts, test/unit/engine-parity-fixtures.test.ts)
  • npm run db:migrations:check / npm run cf-typegen / npm run selfhost:env-reference — clean, no drift
  • Rebased onto latest origin/main, re-verified after rebase

Not run locally: the full npm run test:coverage/test:ci gate (this repo's other workspace packages — mcp/miner/ui-kit — weren't built in this worktree, which produces unrelated ENOENT/missing-dist noise on an unscoped vitest run; CI builds everything properly).

Confirmed via a clean origin/main checkout that 8 test files (12 test cases)
were failing independently of any in-flight PR. Root causes, all real bugs
or stale test assertions from recent merges:

1. linked-issue-label-propagation-fetch.ts: a merge-conflict resolution's
   fix (the direct-ownership-match exemption from the reward-label
   satisfaction-verdict check, #9161/#9077) was verified locally but never
   actually committed before its branch was pushed -- silently lost.
   Re-applied.

2. config-lint.ts's mergeReadinessCompositeWarnings fired even when
   gate.mergeReadiness is explicitly "off", which is a genuine no-op and
   never worth warning about -- only null/unset and off should both
   short-circuit.

3. predicted-gate-engine.test.ts asserted gateMode(undefined) === "advisory",
   the pre-#9167 fallback; #9167 intentionally made this fail closed
   ("block") for a malformed value. Test updated to match.

4. loopover-engine-scaffold.test.ts asserted a stale package.json "files"
   shape; #9064's engine-coverage work legitimately changed it to
   source-map-friendly glob patterns. Test updated to match.

5. The "merge-readiness-composite-preserves-explicit-block" engine-parity
   fixture encoded a "composite only fills in an unset sub-gate" semantic
   that was deliberately reverted (see applyMergeReadinessGate's own doc
   comment: unreachable in practice, since every sub-gate mode is already a
   concrete DB-defaulted value by the time it reaches GateCheckPolicy).
   Renamed and corrected to assert the actual (override) behavior, with a
   fresh golden recorded via scripts/record-engine-parity-goldens.ts.
   queue-5.test.ts's REGRESSION (#4528) test hit the same reward-label gate
   from a different angle and needed the same two assertions corrected.

6. reputation-wiring.test.ts's seedReviewTarget helper still wrote into
   review_targets, frozen by the 2026-06-22 convergence cutover (#9136
   repointed getSubmitterReputation/getSubmitterReputationAcrossInstall
   onto the live review_audit ledger, but this test helper was never
   updated to match). Rewritten to seed review_audit + pull_requests
   directly, mirroring submitter-reputation.ts's own query shape; also
   registered the synthetic repos an install-wide test needs (the
   cross-repo query joins on repositories.installation_id) and repointed
   a stale review_targets backdating UPDATE at pull_requests (#9015
   already repointed the cadence query itself).
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui bc9ed2a Commit Preview URL

Branch Preview URL
Jul 27 2026, 11:02 AM

@JSONbored JSONbored self-assigned this Jul 27, 2026
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
23103 5 23098 21
View the top 3 failed test(s) by shortest run time
test/unit/selfhost-pg-retention.test.ts > runRetentionPrune + processJob on the Postgres backend (#977) > processJob prune-retention deletes eligible rows and records a success audit event on Postgres
Stack Traces | 0.00467s run time
AssertionError: expected 3 to be +0 // Object.is equality

- Expected
+ Received

- 0
+ 3

 ❯ test/unit/selfhost-pg-retention.test.ts:119:44
test/unit/selfhost-pg-retention.test.ts > pruneExpiredRecords on the Postgres backend (#977) > deletes across multiple bounded batches and stops at the per-table cap, same as the SQLite path
Stack Traces | 0.0114s run time
AssertionError: expected +0 to be 4 // Object.is equality

- Expected
+ Received

- 4
+ 0

 ❯ test/unit/selfhost-pg-retention.test.ts:76:33
test/unit/selfhost-metrics.test.ts > DEFAULT_METRIC_META completeness (drift guard, 2026-07 fix) > every literal metric name emitted anywhere in src/ has a registered DEFAULT_METRIC_META entry
Stack Traces | 0.192s run time
AssertionError: expected [ …(2) ] to deeply equal []

- Expected
+ Received

- []
+ [
+   "loopover_orb_relay_multiple_live_enrollments_total",
+   "loopover_private_manifest_warnings_total",
+ ]

 ❯ test/unit/selfhost-metrics.test.ts:498:21
test/unit/worker-entry-boundary.test.ts > worker entry boundary > does not reference pixelmatch, pngjs, visual-diff, gifenc, or sharp in worker-reachable source
Stack Traces | 0.503s run time
AssertionError: worker-reachable files must not mention Node-only visual diff/GIF/image deps: .../review/visual/visual-findings.ts: expected [ Array(1) ] to deeply equal []

- Expected
+ Received

- []
+ [
+   ".../review/visual/visual-findings.ts",
+ ]

 ❯ test/unit/worker-entry-boundary.test.ts:82:118
View the full list of 1 ❄️ flaky test(s)
test/unit/salvageability.test.ts > resolveAiReviewSalvageableHold > defaults: no configured floor uses the gate default, and a confidence-less blocker counts as certainty (at/above floor)

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0.00671s run time
AssertionError: expected undefined to be defined
 ❯ test/unit/salvageability.test.ts:88:18

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@JSONbored
JSONbored merged commit b7720b3 into main Jul 27, 2026
5 of 7 checks passed
@JSONbored
JSONbored deleted the fix/main-regressions-batch-2026-07-27 branch July 27, 2026 11:12
philluiz2323 pushed a commit to philluiz2323/gittensory that referenced this pull request Jul 27, 2026
Follows JSONbored#9276, which fixed 8 files / 12 cases and left these 4 files / 5 cases
still red on main (and therefore red on every open PR). Each diagnosed to its
introducing commit; two are real source gaps, two are stale sibling tests a
deliberate behavior change never updated.

SOURCE fixes:
- selfhost/metrics.ts: register two counters emitted since JSONbored#9243 and JSONbored#9245 but
  never added to DEFAULT_METRIC_META, so renderMetrics() emitted them as bare
  undocumented samples with no HELP/TYPE — exactly what that drift guard exists
  to catch. Both commits even name the counter in their own body text; a pure
  registration miss, not a behavior decision.

TEST fixes (source verified correct in both cases):
- selfhost-pg-retention: the fake Postgres still matched the pre-JSONbored#9083 ctid
  semi-join, so every DELETE fell through to rowCount 0. JSONbored#9083 deliberately
  moved retention to an index-backed PK range delete with ORDER BY (the fix for
  prune-retention blowing its timeout and stalling permanently); it updated the
  SQLite twin but not the Postgres one. Regex now captures whichever key column
  is in play, keeping BOTH the mapped-PK and ctid-fallback paths exercised.
- salvageability: JSONbored#9085 made an absent blocker confidence degrade to
  CONFIDENCE_WHEN_UNSTATED (0.5) instead of 1.0, so it is sub-floor against the
  0.93 default and the low-confidence hold owns the case. It renamed both
  sibling assertions in rules.test.ts but missed this third consumption site.
  Both calls kept — they are the only coverage of the default-floor arm and the
  nullish-confidence arm respectively.
- worker-entry-boundary: false positive, not a real dependency leak. The check
  grepped whole-file text, so JSONbored#9230's user-facing string "crossed the
  visual-diff threshold" failed a green tree over a sentence, in a file
  worker-reachable since JSONbored#4120 that imports none of these deps. Narrowed to scan
  module specifiers (reusing the file's own parseImportSpecifiers) — the only
  way a Node-only dep can actually reach the bundle. Added a discriminating test
  so it cannot pass vacuously; verified by injecting a real `import sharp` and
  confirming it fails, naming the file and specifier.
JSONbored added a commit that referenced this pull request Jul 27, 2026
Follows #9276, which fixed 8 files / 12 cases and left these 4 files / 5 cases
still red on main (and therefore red on every open PR). Each diagnosed to its
introducing commit; two are real source gaps, two are stale sibling tests a
deliberate behavior change never updated.

SOURCE fixes:
- selfhost/metrics.ts: register two counters emitted since #9243 and #9245 but
  never added to DEFAULT_METRIC_META, so renderMetrics() emitted them as bare
  undocumented samples with no HELP/TYPE — exactly what that drift guard exists
  to catch. Both commits even name the counter in their own body text; a pure
  registration miss, not a behavior decision.

TEST fixes (source verified correct in both cases):
- selfhost-pg-retention: the fake Postgres still matched the pre-#9083 ctid
  semi-join, so every DELETE fell through to rowCount 0. #9083 deliberately
  moved retention to an index-backed PK range delete with ORDER BY (the fix for
  prune-retention blowing its timeout and stalling permanently); it updated the
  SQLite twin but not the Postgres one. Regex now captures whichever key column
  is in play, keeping BOTH the mapped-PK and ctid-fallback paths exercised.
- salvageability: #9085 made an absent blocker confidence degrade to
  CONFIDENCE_WHEN_UNSTATED (0.5) instead of 1.0, so it is sub-floor against the
  0.93 default and the low-confidence hold owns the case. It renamed both
  sibling assertions in rules.test.ts but missed this third consumption site.
  Both calls kept — they are the only coverage of the default-floor arm and the
  nullish-confidence arm respectively.
- worker-entry-boundary: false positive, not a real dependency leak. The check
  grepped whole-file text, so #9230's user-facing string "crossed the
  visual-diff threshold" failed a green tree over a sentence, in a file
  worker-reachable since #4120 that imports none of these deps. Narrowed to scan
  module specifiers (reusing the file's own parseImportSpecifiers) — the only
  way a Node-only dep can actually reach the bundle. Added a discriminating test
  so it cannot pass vacuously; verified by injecting a real `import sharp` and
  confirming it fails, naming the file and specifier.
JSONbored added a commit that referenced this pull request Jul 27, 2026
)

* fix: close the remaining 5 pre-existing test failures on main

Follows #9276, which fixed 8 files / 12 cases and left these 4 files / 5 cases
still red on main (and therefore red on every open PR). Each diagnosed to its
introducing commit; two are real source gaps, two are stale sibling tests a
deliberate behavior change never updated.

SOURCE fixes:
- selfhost/metrics.ts: register two counters emitted since #9243 and #9245 but
  never added to DEFAULT_METRIC_META, so renderMetrics() emitted them as bare
  undocumented samples with no HELP/TYPE — exactly what that drift guard exists
  to catch. Both commits even name the counter in their own body text; a pure
  registration miss, not a behavior decision.

TEST fixes (source verified correct in both cases):
- selfhost-pg-retention: the fake Postgres still matched the pre-#9083 ctid
  semi-join, so every DELETE fell through to rowCount 0. #9083 deliberately
  moved retention to an index-backed PK range delete with ORDER BY (the fix for
  prune-retention blowing its timeout and stalling permanently); it updated the
  SQLite twin but not the Postgres one. Regex now captures whichever key column
  is in play, keeping BOTH the mapped-PK and ctid-fallback paths exercised.
- salvageability: #9085 made an absent blocker confidence degrade to
  CONFIDENCE_WHEN_UNSTATED (0.5) instead of 1.0, so it is sub-floor against the
  0.93 default and the low-confidence hold owns the case. It renamed both
  sibling assertions in rules.test.ts but missed this third consumption site.
  Both calls kept — they are the only coverage of the default-floor arm and the
  nullish-confidence arm respectively.
- worker-entry-boundary: false positive, not a real dependency leak. The check
  grepped whole-file text, so #9230's user-facing string "crossed the
  visual-diff threshold" failed a green tree over a sentence, in a file
  worker-reachable since #4120 that imports none of these deps. Narrowed to scan
  module specifiers (reusing the file's own parseImportSpecifiers) — the only
  way a Node-only dep can actually reach the bundle. Added a discriminating test
  so it cannot pass vacuously; verified by injecting a real `import sharp` and
  confirming it fails, naming the file and specifier.

* fix(github): guard backfill GraphQL helpers' repoFullName parsing

fetchLiveCiAggregateViaGraphQl, fetchLivePullRequestReviewDecision, and
fetchLiveReviewThreadBlockers parsed repoFullName with a bare split/truthiness
check, so extra segments and whitespace-padded slugs reached GraphQL queries.
Add a local parseBackfillRepoFullName helper mirroring #8311's segment-count and
whitespace guard, preserving each call site's fail-soft return contract.

Closes #9317

---------

Co-authored-by: JSONbored <49853598+JSONbored@users.noreply.github.com>
JSONbored added a commit that referenced this pull request Jul 27, 2026
…locked (#9375)

* fix: close the remaining 5 pre-existing test failures on main

Follows #9276, which fixed 8 files / 12 cases and left these 4 files / 5 cases
still red on main (and therefore red on every open PR). Each diagnosed to its
introducing commit; two are real source gaps, two are stale sibling tests a
deliberate behavior change never updated.

SOURCE fixes:
- selfhost/metrics.ts: register two counters emitted since #9243 and #9245 but
  never added to DEFAULT_METRIC_META, so renderMetrics() emitted them as bare
  undocumented samples with no HELP/TYPE — exactly what that drift guard exists
  to catch. Both commits even name the counter in their own body text; a pure
  registration miss, not a behavior decision.

TEST fixes (source verified correct in both cases):
- selfhost-pg-retention: the fake Postgres still matched the pre-#9083 ctid
  semi-join, so every DELETE fell through to rowCount 0. #9083 deliberately
  moved retention to an index-backed PK range delete with ORDER BY (the fix for
  prune-retention blowing its timeout and stalling permanently); it updated the
  SQLite twin but not the Postgres one. Regex now captures whichever key column
  is in play, keeping BOTH the mapped-PK and ctid-fallback paths exercised.
- salvageability: #9085 made an absent blocker confidence degrade to
  CONFIDENCE_WHEN_UNSTATED (0.5) instead of 1.0, so it is sub-floor against the
  0.93 default and the low-confidence hold owns the case. It renamed both
  sibling assertions in rules.test.ts but missed this third consumption site.
  Both calls kept — they are the only coverage of the default-floor arm and the
  nullish-confidence arm respectively.
- worker-entry-boundary: false positive, not a real dependency leak. The check
  grepped whole-file text, so #9230's user-facing string "crossed the
  visual-diff threshold" failed a green tree over a sentence, in a file
  worker-reachable since #4120 that imports none of these deps. Narrowed to scan
  module specifiers (reusing the file's own parseImportSpecifiers) — the only
  way a Node-only dep can actually reach the bundle. Added a discriminating test
  so it cannot pass vacuously; verified by injecting a real `import sharp` and
  confirming it fails, naming the file and specifier.

* fix(review): honor autoCloseExemptLogins in closeDraftDodgeAttemptIfBlocked

closeDraftDodgeAttemptIfBlocked was the one remaining review-evasion auto-close
guard that skipped isProtectedAutomationAuthor and isAutoCloseExempt, so authors
on the operator allowlist or protected automation bots were still draft-dodge
closed despite every sibling guard honoring those exemptions (#6165 pattern).

Closes #9294

---------

Co-authored-by: JSONbored <49853598+JSONbored@users.noreply.github.com>
Co-authored-by: loopover-orb[bot] <296761690+loopover-orb[bot]@users.noreply.github.com>
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.

1 participant