feat(review): codebase-aware context beyond the diff (cross-file analysis)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- java
- Domain
- ai-infra-agents, backend-api-design
Research direction
The issue specifies deterministic reference extraction, a selection call, bounded file fetching, and context injection into review and verification, but names no source files or tests. Start by locating the contents client, prompt batching and escaping, and ReviewTokenLedger; trace how review context reaches the verifier. Done means selected related files are safely budgeted and included in both review and verification, with the stated fail-open behavior.
Written by the indexing model from the issue text.
Description
Sanitized 2026-08-13: the proposed solution originally offered two variants (fetch related files vs build a semantic/dependency index). It is now committed to the deterministic-first fetch design below; the index is recorded under Alternatives Considered. Part of the v0.8 phase of #669.
Problem Statement
Reviews see only the PR diff plus a base..head comparison, so the bot cannot reason about callers/callees outside the diff. The prompts have to legislate around unseen layers ("a sanitizer you cannot see is not a sanitizer"), and the verifier downgrades findings whose evidence lives outside the window. Cross-file bugs that diff-only review misses go uncaught, and correct findings get watered down.
Proposed Solution — deterministic extraction, one small selection call, bounded fetch
- Deterministic reference extraction (free). From the diff itself, extract candidate related paths: import/package statements touched or surrounding changed hunks, plus symbols referenced by added lines. No model call; language-aware only to the depth of import-line parsing.
- One small selection call (
concisebinding). Input: changed file list + extracted references + hunk headers — not diffs. Output: up to K paths worth fetching, each with a reason (caller/interface/sanitizer-or-validator/config-consumer). Ledger-gated (ReviewTokenLedger.ensureCallAllowed), counted in themaxAiCallsaccounting, fail-open — no selection means the review proceeds exactly as today. - Bounded fetch + injection. Fetch selected files via the existing contents client, clip to the relevant regions, inject per batch as a fenced
## Related context (read-only, not part of the change)section — wrapped byPromptTemplateEscaperlike every untrusted slot, capped at a fixed share ofperCallInputBudget()the wayPREVIOUS_FINDINGS_BUDGET_SHAREbounds the previous-findings block. - Feed the verifier too. Attach the fetched context to verification (per-finding via #668), turning "downgraded — not verifiable from the provided material" hedges into real confirm/reject verdicts.
Bounded by cost/latency and the per-PR spend cap (#42) by construction: one extra small call, and the injected context can never exceed its budget share.
Alternatives Considered
- Diff + base comparison only (current) — cheap and simple, but blind to cross-file impact.
- Lightweight semantic/dependency index of the repo — better recall on indirect relationships, but heavy for a small-footprint self-hosted bot (build, storage, invalidation per push). Revisit only if the fetch design measurably misses relationships that matter.
Priority
Important
Code of Conduct
- I have searched for existing issues and this is not a duplicate.
- Dominant language
- Java
- Stars
- 35
- Forks
- 7
- Avg merge
- 9h 32m
- Merged PRs (30d)
- 144
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from devops-thiago/ThrillhouseBot
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
devops-thiago/ThrillhouseBot#1093 ·
Maintainers usually reply within 1 day
-
documentation enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
devops-thiago/ThrillhouseBot#321 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
devops-thiago/ThrillhouseBot#46 ·
Maintainers usually reply within 1 day
-
fix(review): preserve tilde-fenced code during path screeningPossibly taken @devops-thiago claimed this today. Openbug java
Difficulty 4/5 1-2 days Newbie friendliness 35/100
devops-thiago/ThrillhouseBot#1111 · 1 comment ·
Maintainers usually reply within 1 day
-
fix(review): exclude TAP TODO and SKIP results from CI failuresPossibly taken @devops-thiago claimed this today. Openbug java
Difficulty 3/5 1-2 days Newbie friendliness 35/100
devops-thiago/ThrillhouseBot#1110 · 1 comment ·
Maintainers usually reply within 1 day
All issues in devops-thiago/ThrillhouseBot
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
wildfly/wildfly-launcher#99 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
traccar/traccar#6076 · 2 comments ·
Maintainers usually reply within 1 day
-
Flight SQL JDBC parses boolean properties case-sensitively, silently disabling TLS for useEncryption=TRUEPossibly taken @Arawoof06 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
apache/arrow-java#1357 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
apache/rocketmq-dashboard#6610 ·
Maintainers usually reply within 3 days