You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Batch packing is size-based only: DiffBudgetPlanner orders files by additions+deletions descending and packs First-Fit-Decreasing (DiffBudgetPlanner.java:609-736). Importance never enters the picture, so when the spend ceiling (REVIEW_MAX_TOKENS_PER_REVIEW), the call cap, or a batch failure forces degradation, what gets skipped is whatever happened to pack last — possibly the auth change, while a giant generated file got a full-budget batch.
Proposed Solution
Add a triage stage between diff load and budget planning that classifies every changed file:
Deterministic first (free): category from path/content signals — source / test / config / IaC / docs / generated / lockfile — plus coarse risk signals (security-sensitive paths, public API surface, migration files). Most files classify without any model call.
Optional cheap LLM call (concise binding, ledger-gated, counted in maxAiCalls accounting): rank only the ambiguous remainder by review priority. One small call with file paths + hunk headers, not diffs — predictable, tiny prompt. Config-gated, default off.
Consumers of the classification:
Packing order: importance-first (risk tier, then size) instead of size-only, so degradation always sheds the lowest-value files. The existing disclosure machinery (omittedFiles, spendCeilingSkippedFiles, withheld-material notice) keeps reporting honestly.
Dimension routing input: batch composition by category makes per-batch dimension selection (the v0.7 routing issue) sharper — e.g. pack config/IaC files together so only those batches carry IaC rules.
Lightweight lane: docs/generated/lockfile tiers can share a minimal sanity-check prompt or be summarized-only, rather than consuming full-prompt budget.
New review/FileTriage collaborator; review/DiffBudgetPlanner.java (ordering + lane assignment), review/FindingPipeline.java, config/ThrillhouseConfig.java (gate + tier globs, extensible via .github/thrillhousebot.yml like review.ignored-files).
Acceptance criteria
Deterministic classifier covered by unit tests over representative path sets; LLM ranking optional and fail-open (falls back to deterministic order).
Under a forced spend ceiling, high-risk files are demonstrably reviewed before low-risk ones (test via DiffBudgetPlanner plan inspection).
No change in behavior when the feature gate is off.
Alternatives Considered
Pure LLM classification — unpredictable cost and an extra call on every review; deterministic-first keeps the common case free.
Problem Statement
Batch packing is size-based only:
DiffBudgetPlannerorders files byadditions+deletionsdescending and packs First-Fit-Decreasing (DiffBudgetPlanner.java:609-736). Importance never enters the picture, so when the spend ceiling (REVIEW_MAX_TOKENS_PER_REVIEW), the call cap, or a batch failure forces degradation, what gets skipped is whatever happened to pack last — possibly the auth change, while a giant generated file got a full-budget batch.Proposed Solution
Add a triage stage between diff load and budget planning that classifies every changed file:
concisebinding, ledger-gated, counted inmaxAiCallsaccounting): rank only the ambiguous remainder by review priority. One small call with file paths + hunk headers, not diffs — predictable, tiny prompt. Config-gated, default off.Consumers of the classification:
omittedFiles,spendCeilingSkippedFiles, withheld-material notice) keeps reporting honestly.Touchpoints
New
review/FileTriagecollaborator;review/DiffBudgetPlanner.java(ordering + lane assignment),review/FindingPipeline.java,config/ThrillhouseConfig.java(gate + tier globs, extensible via.github/thrillhousebot.ymllikereview.ignored-files).Acceptance criteria
DiffBudgetPlannerplan inspection).Alternatives Considered