feat: align sweep with Phase 2 naming, add aggregate sweep summary#55
Conversation
- Rename prompts/sweep.md → prompts/phase-2-sweep.md
- Add prompts/phase-2-sweep-summary.md (aggregate sweep rollup)
- Per-file sweeps write runs/phase-2-summary-sweep-<slug>-*.md
- Aggregate rollup writes runs/sweep-summary-*.md
- find_latest_summary('2') excludes per-file sweep summaries
- Add find_latest_sweep_summary() for sweep-summary-*.md
- Update codecome hints: Phase 2 uses filtered lookup, Sweep block uses rollup
- run-sweep.py invokes aggregate summary after all per-file sweeps succeed
- Update README and docs for new artifact names
- Add tests for sweep exclusion, find_latest_sweep_summary, aggregate summary
|
Warning Review limit reached
More reviews will be available in 7 minutes and 40 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report
Generated by pytest-cov on |
There was a problem hiding this comment.
Pull request overview
This PR aligns the file-risk sweep workflow with Phase 2 naming conventions and adds an aggregate “sweep rollup” step so operators can review one consolidated summary after per-file sweeps complete.
Changes:
- Renames/updates sweep prompt to Phase 2 sweep mode and switches per-file sweep summaries to
runs/phase-2-summary-sweep-<slug>-*.md(so Phase 2 completion gates are satisfied). - Adds an aggregate sweep summary prompt (
prompts/phase-2-sweep-summary.md) and runner orchestration to produceruns/sweep-summary-*.mdafter successful per-file sweeps. - Updates
codecome hintsand summary lookup helpers/tests so broad Phase 2 summaries exclude per-file sweep summaries, while Sweep uses the aggregate rollup.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/run-sweep.py | Uses Phase 2 sweep prompt and runs an aggregate sweep rollup step after per-file sweeps. |
| tools/codecome/run_summary_questions.py | Adds Phase 2 sweep-summary exclusion to broad summary lookup + adds find_latest_sweep_summary(). |
| tools/codecome.py | Updates codecome hints to show Sweep from aggregate sweep-summary-*.md only. |
| tests/test_run_sweep.py | Adds tests for new prompt paths and aggregate sweep summary prompt generation. |
| tests/test_run_summary_questions.py | Adds tests for Phase 2 sweep exclusion + find_latest_sweep_summary(). |
| tests/test_phases_completion.py | Adds completion-gate tests verifying sweep uses Phase 2-style summary artifacts. |
| README.md | Updates sweep docs to reflect new prompt paths and artifact naming. |
| prompts/phase-2-sweep.md | Updates sweep prompt to Phase 2 naming and per-file sweep summary path. |
| prompts/phase-2-sweep-summary.md | New aggregate sweep rollup prompt (consolidation-only, no new findings). |
| docs/file-risk-sweeps.md | Updates sweep docs for Phase 2 sweep mode + aggregate rollup behavior and artifacts. |
| .project/phase-2-sweep-alignment-plan.md | Adds design/implementation plan documenting the sweep alignment approach. |
Comments suppressed due to low confidence (1)
prompts/phase-2-sweep.md:162
- The example sweep summary filename uses
upload-php(dot replaced with a hyphen), but the sweep runner’sslugify()preserves dots (e.g.,upload.php). This mismatch can confuse operators/models about the expected<slug>format.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR aligns the file-risk sweep tooling with Phase 2 naming conventions and adds an aggregate sweep summary step that consolidates per-file results into a single rollup after all sweeps complete.
Confidence Score: 5/5Safe to merge; the naming alignment, lookup helpers, and docs are all internally consistent, and the test coverage is solid. The core logic is correct and well-tested. The two flagged items are edge-case defensive-coding gaps: the missing runs/ existence check in the fresh_summaries comprehension (inconsistent with every other helper in the file) and the lack of a guard that skips the rollup when no fresh summaries are collected. Neither can cause data loss or incorrect findings; the worst outcome is a confusing empty rollup or a version-dependent OSError on Python less than 3.12. tools/run-sweep.py — the fresh_summaries collection and the unconditional run_sweep_summary call. Important Files Changed
Sequence DiagramsequenceDiagram
participant Op as Operator
participant RS as run-sweep.py
participant RA as run-agent.py
participant OC as opencode run
participant FS as runs/ (filesystem)
Op->>RS: "make sweep FILE=..."
RS->>RS: select files, build per-file prompts
loop Each selected file
RS->>RA: --phase 2 --prompt-file sweep-slug.md
RA->>OC: opencode run auditor agent
OC-->>FS: phase-2-summary-sweep-slug-TIMESTAMP.md
OC-->>RA: exit code
RA-->>RS: exit code Phase 2 completion gate checked
end
RS->>RS: collect fresh_summaries mtime filter
RS->>OC: opencode run --agent auditor sweep-summary prompt
OC-->>FS: sweep-summary-TIMESTAMP.md
OC-->>RS: exit code
RS-->>Op: done aggregate rollup printed to screen
note over Op: make hints
Op->>RS: codecome hints
RS->>FS: find_latest_summary 2 excludes sweep files
RS->>FS: find_latest_sweep_summary returns sweep-summary files
RS-->>Op: Phase 2 block plus Sweep block no duplicates
Reviews (2): Last reviewed commit: "fix: address PR #55 review comments" | Re-trigger Greptile |
- Docstring: 'override or extend' → 'extend' (exclude_patterns cannot override the implicit Phase 2 sweep exclusion) - Use fnmatch for exclude_patterns matching instead of Path.match - Rename test: overrides_default → extends_default - Remove deprecated CODECOME_USE_WRAPPER branch from run-sweep.py; per-file sweeps always use the wrapper path - Document why aggregate rollup uses raw opencode run - Simplify aggregate-summary guard: drop redundant len(files) >= 1 - Capture sweep_start_time; only feed fresh per-file summaries to the aggregate prompt (avoid stale summary contamination) - Use timestamped aggregate prompt path instead of fixed name - Update aggregate prompt to read only injected summary paths - Fix slug example: upload-php → upload.php - Clean CODECOME_USE_WRAPPER references from README.md and docs/workflow.md
|
Thanks for the reviews. All feedback has been addressed in commit Copilot: docstring says "override" but implementation cannot overrideFixed. Docstring now says "extend" instead of "override". The implicit Greptile: aggregate summary bypasses CODECOME_USE_WRAPPER
Greptile: redundant guards in aggregate-summary callFixed. The Additional fixes in
|
|
@greptile-apps: your summary analysis and the two inline comments on
Thank you for the review. |
|
@copilot-pull-request-reviewer: your docstring concern on |
|
All the changes look correct and address the feedback precisely:
Everything checks out. The stale-summary filtering via Tip: You can customize Greptile's behavior for this repo with |
Summary
Aligns the file-risk sweep tooling with Phase 2 naming conventions and adds an aggregate sweep summary step.
Changes
prompts/sweep.md→prompts/phase-2-sweep.mdprompts/phase-2-sweep-summary.md— aggregate sweep rollup prompt (consolidates per-file summaries, forbids new findings/hunting, writesruns/sweep-summary-*.md, prints to screen)runs/phase-2-summary-sweep-<slug>-*.md(satisfies Phase 2 completion gate)find_latest_summary("2")now unconditionally excludes per-file sweep summaries from broad Phase 2 lookupfind_latest_sweep_summary()added forruns/sweep-summary-*.mdlookupcodecome hints: Phase 2 uses filtered lookup; Sweep block surfaces aggregate rollup; removed old per-file sweep scantools/run-sweep.py: invokes aggregate summary viaopencode runafter all per-file sweeps succeed (skipped on dry-run); only feeds fresh per-file summaries to the aggregate promptCODECOME_USE_WRAPPERreferencesfind_latest_sweep_summary, aggregate summary prompt generation, stale-summary filteringFollow-up commit (
2cc850b) addresses review feedbackexclude_patternsmatching usesfnmatchfor clarityCODECOME_USE_WRAPPERbranch from per-file sweeps; per-file runs always use the wrapper pathopencode run(not a phase-mode run,run-agent.pylacks non-phase utility support)phase-2-summary-sweep-*.md)slugify()outputCODECOME_USE_WRAPPERfrom README.md and docs/workflow.mdArtifact naming
runs/phase-2-summary-*.mdmake phase-2runs/phase-2-summary-sweep-<slug>-*.mdruns/sweep-summary-*.mdcodecome hintsSweep block)tmp/file-sweep-prompts/sweep-summary-YYYYMMDD-HHMMSS.md