Skip to content

feat(review): add a combined "Copy for AI agents" block to the PR comment#5387

Merged
JSONbored merged 1 commit into
mainfrom
claude/copy-for-ai-agents
Jul 12, 2026
Merged

feat(review): add a combined "Copy for AI agents" block to the PR comment#5387
JSONbored merged 1 commit into
mainfrom
claude/copy-for-ai-agents

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Researched CodeRabbit's actual "Prompt for AI Agents" feature design (their own blog/docs + third-party extraction tooling) and adapted the pattern to gittensory's existing panel structure:

  • Right after "Why this is blocked" / "Concerns raised", the comment now renders one collapsible titled "📋 Copy for AI agents" containing every blocker rewritten as a numbered instruction inside a single fenced plain-text code block.
  • GitHub renders a copy icon on every fenced code block natively — no custom JS/UI needed.
  • Matches CodeRabbit's newer design specifically (their own docs: they moved from one prompt per finding to ONE combined prompt per review, "to cut the repeated copy-paste this produced").
  • Uses the full (pre-display-truncation) blocker set, not the human-facing capped subset shown in the bullets above it — an AI agent benefits from complete context even when the human-readable list is capped for scannability.
  • Not gated by comment_verbosity: quiet — it's an extension of the blockers themselves (which are never gated), not decorative detail like Nits.

Test plan

  • npm run typecheck — clean
  • New dedicated test suite ('Copy for AI agents' block describe block in unified-comment.test.ts): omitted with no blockers, renders every blocker as a numbered item, uses the full (not truncated) blocker set, survives quiet verbosity, renders pre-expanded under detailed verbosity, escapes angle brackets consistently with every other public field
  • Updated 5 pre-existing tests that asserted a blocker's text appears "exactly once" — now legitimately twice (once in "Why this is blocked", once in the new block); each updated assertion still separately confirms the text is never also restated under "Suggested Action" (the actual feat(miner): add schema-version migration runner across local stores #5347 regression this file already guards)
  • npx vitest run across all 14 affected test files (unified-comment*, every *-collapsible.test.ts, all 5 queue*.test.ts) — 940/940 passing
  • npm run test:engine-parity — clean
  • Coverage: src/review/unified-comment.ts diff is 100% lines / 100% branches (verified via lcov; the two remaining uncovered items in this file are pre-existing, outside this diff's changed lines)

…ment

Mirrors CodeRabbit's combined "Prompt for AI agents" feature (per
their own docs: gathers every fix prompt from a review into ONE
structured instruction instead of one per finding, specifically to
cut the repeated copy-paste that produced). Right after "Why this is
blocked" / "Concerns raised", render one collapsible containing every
blocker as a numbered plain-text instruction inside a fenced code
block -- GitHub renders a copy icon on the fence for free, no custom
JS needed.

Uses the FULL (pre-display-truncation) blocker set, not the human-
facing capped subset shown above it, since an agent benefits from
complete context. Never gated by comment_verbosity: quiet -- it
extends the never-gated blockers themselves, not decorative detail
like Nits.
@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 12, 2026
@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.40%. Comparing base (56d901d) to head (d82c449).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5387      +/-   ##
==========================================
- Coverage   94.43%   94.40%   -0.04%     
==========================================
  Files         551      551              
  Lines       44223    44227       +4     
  Branches    14654    14654              
==========================================
- Hits        41764    41751      -13     
- Misses       1784     1801      +17     
  Partials      675      675              
Flag Coverage Δ
shard-1 43.80% <100.00%> (-0.37%) ⬇️
shard-2 34.08% <100.00%> (-0.50%) ⬇️
shard-3 32.18% <0.00%> (+0.64%) ⬆️
shard-4 31.30% <100.00%> (+0.02%) ⬆️
shard-5 33.12% <0.00%> (-0.21%) ⬇️
shard-6 43.58% <0.00%> (+0.20%) ⬆️

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%> (+<0.01%) ⬆️

... 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
JSONbored merged commit 1da48c9 into main Jul 12, 2026
17 checks passed
@JSONbored
JSONbored deleted the claude/copy-for-ai-agents branch July 12, 2026 16:11
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
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