Skip to content

fix(review): cap AI copy blocker text - #5492

Closed
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-security-vulnerability-in-blocker-display
Closed

fix(review): cap AI copy blocker text#5492
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-security-vulnerability-in-blocker-display

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent the public comment from re-exposing blocker text that was intentionally hidden by review.max_findings.blockers display caps.
  • The previously-added AI copy block rendered the full pre-truncation blocker set and bypassed the configured public display bound.

Description

  • Limit the 📋 Copy for AI agents fenced block to the same truncated blocker list used for the human-facing section (blockersTrunc.shown) and skip the AI block when the cap results in zero shown items (maxFindingsCaps.blockers = 0).
  • Update unit tests to assert the AI copy block respects the blocker cap and to cover the zero-cap case (regression tests added/adjusted in test/unit/unified-comment.test.ts).
  • Regenerate Cloudflare worker runtime types so the repo’s typegen check (cf-typegen) is up-to-date.
  • Files changed: src/review/unified-comment.ts, test/unit/unified-comment.test.ts, and regenerated worker-configuration.d.ts.

Testing

  • Ran npx vitest run test/unit/unified-comment.test.ts test/unit/unified-comment-bridge.test.ts and the targeted suites passed (167 tests total).
  • Ran npm run cf-typegen:check after regenerating types and the typegen check passed.
  • Attempted full gate (npm run test:ci / full npm run test:coverage) in this environment but the global coverage/long-running unrelated suites caused the full coverage gate to fail here; the targeted unit suites and typegen verification above demonstrate the fix and its regression coverage.

Codex Task

@JSONbored JSONbored self-assigned this Jul 12, 2026
@JSONbored
JSONbored marked this pull request as draft July 12, 2026 23:08
@superagent-security

Copy link
Copy Markdown
Contributor

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

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-12 23:23:10 UTC

3 files · 2 blockers · readiness 89/100 · CI failing · blocked

🛑 Suggested Action - Manual Review

Why this is blocked

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.

2. Maintainer requires a linked issue — Link the relevant issue (for example `Closes #123`) before opening the PR.

CI checks failing

  • validate
  • validate-code
Signal Result Evidence
Code review ❌ 2 blockers No AI review summary
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (draft PR; no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 44 registered-repo PR(s), 36 merged, 424 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 44 PR(s), 424 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 44 PR(s), 424 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Mark ready when done.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.67%. Comparing base (09b155e) to head (f364c90).
⚠️ Report is 17 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5492      +/-   ##
==========================================
- Coverage   94.71%   94.67%   -0.04%     
==========================================
  Files         556      556              
  Lines       44576    44576              
  Branches    14664    14665       +1     
==========================================
- Hits        42220    42203      -17     
- Misses       1621     1638      +17     
  Partials      735      735              
Flag Coverage Δ
shard-1 43.84% <0.00%> (-0.14%) ⬇️
shard-2 35.29% <0.00%> (+0.07%) ⬆️
shard-3 32.00% <0.00%> (-0.03%) ⬇️
shard-4 31.36% <100.00%> (-0.69%) ⬇️
shard-5 33.12% <0.00%> (+0.39%) ⬆️
shard-6 43.78% <0.00%> (+0.27%) ⬆️

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

Files with missing lines Coverage Δ
src/review/unified-comment.ts 99.58% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored

Copy link
Copy Markdown
Owner Author

Closing as a regression, not a fix.

review.max_findings is documented repo-wide as a purely cosmetic display cap — "never removes a blocker from the gate decision" — and the "Copy for AI agents" block already renders from the exact same already-public, already-scrubbed blockers array as the human bullet list. Nothing sensitive or non-public is exposed by leaving it uncapped; unified-comment.ts's own module doc states the renderer is "public-safe-by-construction" with the redactor already applied before either section is built.

This reverses a deliberate, same-day design: 1da48c9f2 (#5387, "add a combined 'Copy for AI agents' block to the PR comment") explicitly built the AI block to carry the full blocker set, with the code comment right at the call site:

The FULL (pre-display-truncation) blocker set, not blockersTrunc.shown — an AI agent benefits from every blocker, not just the human-scannable capped subset shown above. Never gated by verbosity: this is an extension of the blockers themselves (never gated), not decorative detail like Nits.

A matching test asserted this by name ("uses the FULL blocker set, not the display-truncated one, when maxFindingsCaps.blockers is set"). This PR rewrites that exact test to assert the opposite.

Independent of the design question, CI's validate-code job is also failing for real: the committed worker-configuration.d.ts was regenerated against a newer workerd runtime than the repo's pinned toolchain produces, and it's unrelated scope creep anyway since this PR makes no wrangler binding/var changes.

No action needed; flagging for visibility.

@JSONbored JSONbored closed this Jul 12, 2026
@JSONbored
JSONbored deleted the codex/fix-security-vulnerability-in-blocker-display branch July 19, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant