Skip to content

fix(review): stop large-registry-PR false-closes across grounding, content-lane, and issue matching#7931

Merged
JSONbored merged 3 commits into
mainfrom
claude/orb-review-payload-edge-case-7697b4
Jul 21, 2026
Merged

fix(review): stop large-registry-PR false-closes across grounding, content-lane, and issue matching#7931
JSONbored merged 3 commits into
mainfrom
claude/orb-review-payload-edge-case-7697b4

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Never render an oversized grounded file as fully omitted; degrade to a real head+tail sample instead, and raise the downstream aggregate prompt budget that would otherwise silently drop grounding on a large PR.
  • Stop a truncated registry fetch (no size cap on the append-count check) from misreading a real registry submission as "zero surfaces appended"; also adds a TTL safety net on a related cache-key issue found while tracing this.
  • Catch a linked issue's registry deliverable even when only implied by its title, not a literal path in the body.

Each was root-caused against a real, reproduced incident (oversized diffs GitHub omits inline patches for, and a registry file's HEAD content exceeding the old fetch cap) rather than guessed at.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused (three related review/registry-gate correctness fixes; no UI/docs/dependency/deploy changes).
  • Follows CONTRIBUTING.md; no site/, CNAME, or Pages changes.
  • Linked issue — not applicable (maintainer-authored fix for a bug discovered directly, not a contributor PR).

Validation

  • git diff --check
  • npm run typecheck
  • npm run test:coverage locally — full unsharded suite green, 0 failures; 100% line+branch coverage on every changed line in this diff
  • npm audit --audit-level=moderate — clean
  • npm run actionlint / test:workers / build:mcp / test:mcp-pack / ui:* — not run individually this pass; none of this diff touches CI config, MCP packaging, or the UI workspace, and the full npm run test:coverage run already exercises the affected unit/integration suites
  • New/changed behavior has unit tests for the new branches and fallback paths (see per-commit test files)

Safety

  • No secrets, wallets, hotkeys, trust scores, or private data.
  • Public-comment sanitization untouched.
  • No auth/CORS/session changes.
  • No UI changes.

Notes

  • Second and third commits were found while investigating the first; all three are part of the same "large/growing registry PR gets wrongly auto-closed" investigation.

registry/subnets/eirel.json's 188KB post-change body overflowed the
flat 24k/60k grounding caps and GitHub omits the inline diff for a
change this large, so the reviewer got zero content for the file that
was the actual substance of the PR and the gate closed it as a
confirmed defect instead of an honest "can't verify this".

Raise the budgets with real headroom, and durably fix the underlying
gap: an oversized file now degrades to a real head+tail sample instead
of ever rendering as pure omitted content again, regardless of how
large it grows. Also raises the downstream aggregate prompt-budget cap
that would otherwise silently drop grounding on exactly this large-PR
case.
…faces

The registry append-count check fetched HEAD/BASE content with no size
cap (defaulting to 24,001 chars), silently truncating a larger
registry file into invalid JSON. That parsed as "surfaces: null",
misread as "nothing appended", and the existing safety net only
checked for a literal null fetch, not a truncated-but-non-null one.

Pass an explicit, generous cap and treat truncation as unreadable so
it routes through the existing defer-to-generic-gate guard instead of
a wrong close.

Also closes a related latent bug found while tracing this: the same
fetch path was using a PR's base BRANCH NAME as a cache key in a cache
built to assume immutable commit SHAs, which can serve indefinitely
stale content once written. Add a TTL safety net so that can't happen
regardless of what ref shape any caller passes.
The content-lane deliverable check only recognized a linked issue's
own ask when its body named a literal registry file path. An issue
whose body only carries a generic path placeholder (never the real
resolved filename) read as not-applicable, silently providing zero
protection against a PR that never delivers the registry change.

Add an opt-in, spec-level signal: when a linked issue's title matches
a known shape, a registry-file edit is required even without a
literal path in the body. Deterministic and narrowly scoped -- no
fuzzy slug inference, no AI call.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 21, 2026
@JSONbored
JSONbored merged commit 2367dbe into main Jul 21, 2026
10 checks passed
@JSONbored
JSONbored deleted the claude/orb-review-payload-edge-case-7697b4 branch July 21, 2026 19:06
JSONbored added a commit that referenced this pull request Jul 21, 2026
The fix commits just merged in #7931 warrant a patch bump per
scripts/orb-release-core.ts's own inferred-version logic, but the
manifest still targets 3.2.0 -- the version already promoted to
stable earlier today. Without this, orb-beta-release.yml's due check
short-circuits (targetAlreadyStable) and never cuts a beta containing
the fix.
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.43%. Comparing base (f27b9f0) to head (afe0978).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/queue/processors.ts 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7931      +/-   ##
==========================================
- Coverage   91.77%   90.43%   -1.34%     
==========================================
  Files         731       95     -636     
  Lines       74878    27510   -47368     
  Branches    22845     5898   -16947     
==========================================
- Hits        68717    24878   -43839     
+ Misses       5083     2296    -2787     
+ Partials     1078      336     -742     
Flag Coverage Δ
shard-1 71.34% <70.73%> (+16.07%) ⬆️
shard-2 53.20% <48.78%> (+1.19%) ⬆️
shard-3 52.58% <21.95%> (-1.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/db/repositories.ts 96.72% <100.00%> (+<0.01%) ⬆️
src/db/schema.ts 72.97% <ø> (ø)
src/review/content-lane-wire.ts 98.59% <100.00%> (+0.04%) ⬆️
src/review/content-lane/registry-logic.ts 100.00% <100.00%> (ø)
src/review/review-grounding.ts 99.02% <100.00%> (+0.21%) ⬆️
src/services/ai-review.ts 96.85% <100.00%> (ø)
src/queue/processors.ts 95.75% <0.00%> (-0.04%) ⬇️

... and 636 files with indirect coverage changes

JSONbored added a commit that referenced this pull request Jul 21, 2026
…eck (#7940)

* test(review): cover the null-issue-title branch in the deliverable check

processors.ts's runContentLaneDeliverableCheckForAdvisory passes
issueFetch.facts.title ?? undefined to checkContentLaneDeliverable, but
every existing test's stub always supplied a real title string, so the
nullish side of that fallback was never exercised -- codecov/patch
correctly flagged it as a partial branch on #7931.

Pins that a null/absent issue title degrades cleanly to undefined: the
literal-path-in-body signal alone still detects a missing deliverable,
and passing undefined never throws or wrongly suppresses it.

* docs(review): clarify the null-issue-title fallback in the deliverable check

Documents why facts.title's null case degrades to undefined at this
call site (see the accompanying test). Also broadens this PR's diff
beyond a single test file, which a pure test-only diff was tripping
in CI's scoped-test-selection coverage step.
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