|
| 1 | +# Pipeline Refactor TODO |
| 2 | + |
| 3 | +## Goals |
| 4 | + |
| 5 | +- [x] Split `src/review/pipeline/helpers.rs` into focused modules with clearer ownership. |
| 6 | +- [x] Introduce shared pipeline session/services types so preparation, execution, and post-processing stop threading long parameter lists. |
| 7 | +- [x] Extract post-processing and verification orchestration into a dedicated pipeline submodule. |
| 8 | +- [x] Move pipeline tests out of `src/review/pipeline.rs` and colocate them with the modules that own the behavior. |
| 9 | +- [x] Keep the refactor behavior-preserving and validate with `cargo fmt`, `cargo clippy --all-targets --all-features -- -D warnings`, and `cargo test`. |
| 10 | + |
| 11 | +## Planned module split |
| 12 | + |
| 13 | +### 1. Shared pipeline state |
| 14 | + |
| 15 | +- [x] Create `src/review/pipeline/types.rs` for shared pipeline result/progress types. |
| 16 | +- [x] Create `src/review/pipeline/session.rs` for `PipelineServices` and `ReviewSession` plus runtime/repo helpers: |
| 17 | + - local-model optimization detection |
| 18 | + - diff chunking |
| 19 | + - instruction file detection |
| 20 | + - git log gathering |
| 21 | + - convention store path resolution and saving |
| 22 | + |
| 23 | +### 2. Context and guidance |
| 24 | + |
| 25 | +- [x] Create `src/review/pipeline/context.rs` for: |
| 26 | + - symbol extraction from diffs |
| 27 | + - symbol index construction |
| 28 | + - related-file context gathering |
| 29 | + - test-file discovery helper |
| 30 | +- [x] Create `src/review/pipeline/guidance.rs` for review guidance assembly. |
| 31 | + |
| 32 | +### 3. Comment preparation and execution support |
| 33 | + |
| 34 | +- [x] Create `src/review/pipeline/comments.rs` for: |
| 35 | + - analyzer finding synthesis |
| 36 | + - diff-line filtering |
| 37 | + - analyzer comment detection |
| 38 | +- [x] Keep execution-specific validation and metric aggregation near `execution.rs`. |
| 39 | + |
| 40 | +### 4. Dedicated post-processing stage |
| 41 | + |
| 42 | +- [x] Create `src/review/pipeline/postprocess.rs` for: |
| 43 | + - specialized-pass deduplication |
| 44 | + - plugin post-processing orchestration |
| 45 | + - verification pass orchestration |
| 46 | + - semantic feedback confidence adjustment |
| 47 | + - enhanced feedback adjustment |
| 48 | + - review filtering, enhanced filters, and convention suppression |
| 49 | + |
| 50 | +### 5. Test relocation |
| 51 | + |
| 52 | +- [x] Move symbol/context tests into `context.rs`. |
| 53 | +- [x] Move guidance tests into `guidance.rs`. |
| 54 | +- [x] Move diff chunking tests into `session.rs`. |
| 55 | +- [x] Move response validation tests into `execution.rs`. |
| 56 | +- [x] Move comment filtering/dedup tests into `comments.rs` and `postprocess.rs`. |
| 57 | +- [x] Move prompt/config ownership tests to `src/core/prompt.rs` and `src/config.rs`. |
| 58 | + |
| 59 | +## Execution checklist |
| 60 | + |
| 61 | +- [x] Rewire `src/review/pipeline.rs` into a thin orchestration facade over the new modules. |
| 62 | +- [x] Run validators. |
| 63 | +- [x] Review git diff for scope and sensitive data. |
| 64 | +- [x] Commit and push the refactor. |
0 commit comments