|
42 | 42 | - [x] Keep `ReviewSession` focused on per-review state in `session.rs`. |
43 | 43 | - [x] Update imports in `pipeline.rs`, `prepare.rs`, and `postprocess.rs`. |
44 | 44 | - [x] Validate, commit, and push. |
| 45 | + |
| 46 | +## Wave 3+ — ongoing carving backlog |
| 47 | + |
| 48 | +### Working rules |
| 49 | + |
| 50 | +- [x] Keep refactors behavior-preserving. |
| 51 | +- [x] Validate every checkpoint with `cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`, `cargo test`, and `bash scripts/check-workflows.sh`. |
| 52 | +- [x] Commit and push after each validated slice. |
| 53 | +- [ ] Prefer files that still mix orchestration + parsing/formatting + persistence. |
| 54 | +- [ ] Prefer files that remain large after the first round of carving or that keep attracting unrelated edits. |
| 55 | + |
| 56 | +### Recently completed checkpoints |
| 57 | + |
| 58 | +- [x] Split `src/commands/eval/report.rs`. |
| 59 | +- [x] Split `src/commands/misc/lsp_check.rs`. |
| 60 | +- [x] Split `src/commands/smart_review.rs`. |
| 61 | +- [x] Split `src/commands/eval/thresholds/evaluation.rs`. |
| 62 | +- [x] Split `src/commands/eval/runner/execute.rs`. |
| 63 | +- [x] Split `src/commands/feedback_eval/report/build/aggregate.rs`. |
| 64 | + |
| 65 | +### Immediate queue |
| 66 | + |
| 67 | +- [x] `src/commands/eval/pattern/matching.rs`: split normalized rule-id helpers, matcher predicates, and focused matcher tests. |
| 68 | +- [ ] `src/commands/eval/metrics/rules.rs`: separate aggregate math, rule counting, and summary reduction helpers. |
| 69 | +- [ ] `src/commands/doctor/endpoint/inference.rs`: split request building, HTTP execution/error handling, and response parsing. |
| 70 | +- [ ] `src/commands/feedback_eval/report/build/stats.rs`: split threshold confusion-matrix scoring from bucket primitives. |
| 71 | +- [ ] `src/commands/doctor/command/display.rs`: separate header/config output, endpoint listing, and inference result rendering. |
| 72 | +- [ ] `src/commands/doctor/command/run.rs`: separate endpoint discovery, recommendation flow, and test helpers. |
| 73 | +- [ ] `src/commands/eval/runner/matching.rs`: split required-match search, unexpected-match detection, and rule metric assembly. |
| 74 | +- [ ] `src/commands/eval/runner/execute/loading.rs`: separate diff resolution from repo-path resolution if it grows again. |
| 75 | +- [ ] `src/commands/feedback_eval/report/examples.rs`: split ranking helpers from example builders. |
| 76 | +- [ ] `src/commands/doctor/system.rs`: carve environment probes vs output helpers. |
| 77 | + |
| 78 | +### Commands backlog |
| 79 | + |
| 80 | +- [ ] `src/commands/eval/types.rs`: split fixture, pattern, report, and run-option types if churn keeps touching unrelated structs. |
| 81 | +- [ ] `src/commands/feedback_eval/types.rs`: separate input payload types from report/output types. |
| 82 | +- [ ] `src/commands/feedback_eval/input/loading.rs`: split format detection from JSON parsing/loading. |
| 83 | +- [ ] `src/commands/feedback_eval/input/conversion.rs`: split review-session conversion from label normalization helpers. |
| 84 | +- [ ] `src/commands/pr.rs`: separate summary-only flow, full review flow, and comment-posting orchestration. |
| 85 | +- [ ] `src/commands/pr/gh.rs`: carve PR resolution, diff fetching, and metadata fetching. |
| 86 | +- [ ] `src/commands/git/suggest.rs`: split commit-message prompting from PR-title prompting and response extraction. |
| 87 | +- [ ] `src/commands/review/command.rs`: split review/check/compare entrypoints if they keep diverging. |
| 88 | +- [ ] `src/commands/misc/feedback/command.rs`: separate file loading/ID normalization from store persistence. |
| 89 | +- [ ] `src/commands/misc/feedback/apply.rs`: split acceptance/rejection counters from store mutation helpers. |
| 90 | +- [ ] `src/commands/misc/discussion/command.rs`: separate the interactive loop from single-shot execution. |
| 91 | +- [ ] `src/commands/misc/discussion/selection.rs`: split file loading/ID repair from selection rules. |
| 92 | +- [ ] `src/commands/misc/changelog.rs`: evaluate splitting changelog collection from output formatting. |
| 93 | +- [ ] `src/commands/eval/command.rs`: separate CLI option prep, fixture execution, and report lifecycle. |
| 94 | +- [ ] `src/commands/feedback_eval/command.rs`: separate input loading from report/output orchestration. |
| 95 | + |
| 96 | +### Review pipeline backlog |
| 97 | + |
| 98 | +- [ ] `src/review/pipeline/execution/responses/processing.rs`: split raw response normalization, comment extraction, and merge logic. |
| 99 | +- [ ] `src/review/pipeline/execution/responses/validation.rs`: separate schema validation from per-comment sanitization. |
| 100 | +- [ ] `src/review/pipeline/prepare/runner.rs`: split per-diff orchestration, pre-analysis/triage decisions, and progress updates. |
| 101 | +- [ ] `src/review/pipeline/context/symbols.rs`: split symbol search, snippet selection, and fallback behavior. |
| 102 | +- [ ] `src/review/pipeline/context/related.rs`: separate related-file discovery from ranking/selection. |
| 103 | +- [ ] `src/review/pipeline/guidance.rs`: carve guidance assembly, repo-support guidance, and prompt-facing formatting. |
| 104 | +- [ ] `src/review/pipeline/session.rs`: split session construction from runtime state transitions. |
| 105 | +- [ ] `src/review/pipeline/services.rs`: separate service wiring from optional feature initialization. |
| 106 | +- [ ] `src/review/pipeline/file_context/sources.rs`: split repo sources, symbol sources, and supplemental context sources. |
| 107 | +- [ ] `src/review/pipeline/comments.rs`: separate comment assembly, filtering, and metadata stamping. |
| 108 | +- [ ] `src/review/pipeline/postprocess/dedup.rs`: split duplicate detection, scoring, and merge/rewrite behavior. |
| 109 | +- [ ] `src/review/pipeline/postprocess/feedback.rs`: separate store lookups from suppression/annotation decisions. |
| 110 | +- [ ] `src/review/pipeline/execution/dispatcher.rs`: carve request scheduling, concurrency control, and result collection. |
| 111 | +- [ ] `src/review/pipeline.rs`: keep trimming top-level orchestration as helpers mature. |
| 112 | + |
| 113 | +### Review helper backlog |
| 114 | + |
| 115 | +- [ ] `src/review/rule_helpers/reporting.rs`: separate rendering/formatting from score/rationale helpers. |
| 116 | +- [ ] `src/review/rule_helpers/runtime.rs`: split runtime state, caching, and dispatch helpers. |
| 117 | +- [ ] `src/review/context_helpers/ranking.rs`: separate scoring inputs from final ranking/selection. |
| 118 | +- [ ] `src/review/context_helpers/pattern_repositories.rs`: split pattern loading, matching, and repo fallback logic. |
| 119 | +- [ ] `src/review/filters.rs`: carve severity/category filters, suppression filters, and dedup-like passes. |
| 120 | +- [ ] `src/review/feedback.rs`: split persistence, semantic examples, and suppression statistics. |
| 121 | +- [ ] `src/review/triage.rs`: separate heuristics, explanations, and scoring/reporting. |
| 122 | +- [ ] `src/review/compression.rs`: split chunking, summarization, and token-budget planning. |
| 123 | +- [ ] `src/review/verification/parser.rs`: separate parser stages and error handling. |
| 124 | +- [ ] `src/review/verification/prompt.rs`: split prompt assembly from example selection. |
| 125 | + |
| 126 | +### Core backlog |
| 127 | + |
| 128 | +- [ ] `src/config.rs`: split defaulting, loading, validation, migration, and path-resolution logic. |
| 129 | +- [ ] `src/core/comment.rs`: separate model types, ID generation, formatting helpers, and feedback-related transforms. |
| 130 | +- [ ] `src/core/symbol_index.rs`: carve command detection, indexing, retrieval, and language-map handling. |
| 131 | +- [ ] `src/core/symbol_graph.rs`: separate graph construction, traversal, and serialization helpers. |
| 132 | +- [ ] `src/core/semantic.rs`: split semantic extraction, matching, and persistence boundaries. |
| 133 | +- [ ] `src/core/pr_summary.rs`: carve stats calculation, prompt generation, response parsing, and diagram support. |
| 134 | +- [ ] `src/core/enhanced_review.rs`: split orchestration, prompt building, and response handling. |
| 135 | +- [ ] `src/core/eval_benchmarks.rs`: separate benchmark fixtures, thresholds, scoring, and aggregation. |
| 136 | +- [ ] `src/core/prompt.rs`: split prompt fragments, model-specific tuning, and reusable builders. |
| 137 | +- [ ] `src/core/context.rs`: separate context assembly, provenance handling, and formatting. |
| 138 | +- [ ] `src/core/offline.rs`: split endpoint/model probing, metadata parsing, and recommendation helpers. |
| 139 | +- [ ] `src/core/function_chunker.rs`: separate parsing, chunk planning, and scoring heuristics. |
| 140 | +- [ ] `src/core/agent_tools.rs`: carve tool registry, schema building, and execution adapters. |
| 141 | +- [ ] `src/core/agent_loop.rs`: separate loop orchestration, state transitions, and tool/result handling. |
| 142 | +- [ ] `src/core/code_summary.rs`: split summary planning, extraction, and formatting. |
| 143 | +- [ ] `src/core/changelog.rs`: separate git/history ingestion from final changelog rendering. |
| 144 | +- [ ] `src/core/multi_pass.rs`: split pass planning, execution, and result merging. |
| 145 | +- [ ] `src/core/composable_pipeline.rs`: separate stage wiring from execution semantics. |
| 146 | +- [ ] `src/core/convention_learner.rs`: split store persistence, scoring, and feedback ingestion. |
| 147 | +- [ ] `src/core/git_history.rs`: carve log collection, parsing, and summarization. |
| 148 | +- [ ] `src/core/diff_parser.rs`: separate unified/text diff parsing, hunk tracking, and post-processing. |
| 149 | +- [ ] `src/core/interactive.rs`: split REPL/input loop, commands, and output formatting. |
| 150 | + |
| 151 | +### Server and storage backlog |
| 152 | + |
| 153 | +- [ ] `src/server/api.rs`: split route handlers by domain plus shared request/response helpers. |
| 154 | +- [ ] `src/server/state.rs`: separate session state, queueing, and persistence coordination. |
| 155 | +- [ ] `src/server/storage_json.rs`: carve file I/O, indexing, migrations, and query helpers. |
| 156 | +- [ ] `src/server/storage_pg.rs`: separate SQL-backed persistence domains and query grouping. |
| 157 | +- [ ] `src/server/github.rs`: split webhook parsing, API interactions, and review-session orchestration. |
| 158 | +- [ ] `src/server/metrics.rs`: separate metric registration from event emission helpers. |
| 159 | +- [ ] `src/server/mod.rs`: keep top-level wiring thin as submodules mature. |
| 160 | + |
| 161 | +### Adapters, parsing, and plugins backlog |
| 162 | + |
| 163 | +- [ ] `src/adapters/llm.rs`: split request shaping, retry/policy logic, and response normalization. |
| 164 | +- [ ] `src/adapters/openai.rs`: carve request builders, streaming handling, and schema/response parsing. |
| 165 | +- [ ] `src/adapters/anthropic.rs`: carve request conversion, retries, and response parsing. |
| 166 | +- [ ] `src/adapters/ollama.rs`: separate local model capabilities, request building, and response parsing. |
| 167 | +- [ ] `src/adapters/common.rs`: split shared retry/auth/http helpers. |
| 168 | +- [ ] `src/parsing/llm_response.rs`: separate fenced-block parsing, comment extraction, and validation. |
| 169 | +- [ ] `src/parsing/smart_response.rs`: split structured smart-review parsing from fallbacks. |
| 170 | +- [ ] `src/plugins/builtin/secret_scanner.rs`: carve rule loading, scanning, and finding shaping. |
| 171 | +- [ ] `src/plugins/builtin/supply_chain.rs`: separate manifest parsing, registry lookups, and finding generation. |
| 172 | +- [ ] `src/plugins/builtin/eslint.rs`: split command execution, parser helpers, and finding conversion. |
| 173 | +- [ ] `src/plugins/builtin/semgrep.rs`: split command assembly, result parsing, and finding mapping. |
| 174 | +- [ ] `src/plugins/builtin/duplicate_filter.rs`: separate fingerprinting from suppression heuristics. |
| 175 | +- [ ] `src/plugins/plugin.rs`: split plugin traits/types from execution helpers. |
| 176 | + |
| 177 | +### Output and entrypoint backlog |
| 178 | + |
| 179 | +- [ ] `src/output/format.rs`: separate smart review formatting, patch output, and walkthrough generation. |
| 180 | +- [ ] `src/main.rs`: carve CLI wiring by command group and shared config/bootstrap helpers. |
| 181 | +- [ ] `src/vault.rs`: split vault discovery, parsing, and maintenance operations. |
| 182 | + |
| 183 | +### Nice-to-have / monitor |
| 184 | + |
| 185 | +- [ ] Revisit freshly split files once they cross roughly 150 LOC again, especially `src/commands/eval/pattern/matching.rs`, `src/commands/eval/metrics/rules.rs`, `src/commands/doctor/endpoint/inference.rs`, and `src/commands/feedback_eval/report/build/stats.rs`. |
| 186 | +- [ ] Keep module roots thin: if a root file only re-exports helpers, leave it alone until child files grow again. |
| 187 | +- [ ] Favor extracting pure helpers and test-only builders before moving async orchestration. |
0 commit comments