feat(boulder-state): add plan auto-archive functionality#2186
Open
imwxc wants to merge 4 commits intocode-yeongyu:devfrom
Open
feat(boulder-state): add plan auto-archive functionality#2186imwxc wants to merge 4 commits intocode-yeongyu:devfrom
imwxc wants to merge 4 commits intocode-yeongyu:devfrom
Conversation
There was a problem hiding this comment.
1 issue found across 5 files
Confidence score: 4/5
- This PR seems safe to merge; the only noted issue is medium severity and not a clear user-facing regression risk.
findCompletedPlansinsrc/features/boulder-state/storage.tshas duplicate logic and inefficient sorting, which could add avoidable overhead or maintenance cost but isn’t likely to break behavior.- Pay close attention to
src/features/boulder-state/storage.ts- duplicate logic and inefficient sorting infindCompletedPlans.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/features/boulder-state/storage.ts">
<violation number="1" location="src/features/boulder-state/storage.ts:259">
P2: Duplicate logic and inefficient sorting in `findCompletedPlans`</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
imwxc
added a commit
to imwxc/oh-my-opencode
that referenced
this pull request
Feb 28, 2026
- Extract findMdFilesSortedByMtime() helper function - Both findPrometheusPlans and findCompletedPlans now use shared helper - Optimize sorting: O(n) stat calls instead of O(n log n) Addresses AI review feedback on PR code-yeongyu#2186: - Fixed P2: Duplicate logic and inefficient sorting in findCompletedPlans
- Add archivePlan() and findCompletedPlans() functions - Auto-archive completed plans to .sisyphus/plans/completed/ - Handle name conflicts with -2, -3 suffix - Integrate with Atlas hook for automatic archival on completion - Add comprehensive test coverage
- Extract findMdFilesSortedByMtime() helper function - Both findPrometheusPlans and findCompletedPlans now use shared helper - Optimize sorting: O(n) stat calls instead of O(n log n) Addresses AI review feedback on PR code-yeongyu#2186: - Fixed P2: Duplicate logic and inefficient sorting in findCompletedPlans
- Move archive functionality to event-handler.ts (upstream's new module) - Reset index.ts to upstream's re-export only pattern - Archive auto-triggers when plan is complete in atlas hook
87afe9d to
a77693b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.sisyphus/plans/completed/Implementation
Core Functions (
src/features/boulder-state/storage.ts)archivePlan(directory, planName): Archive completed planfindCompletedPlans(directory): List archived plansAtlas Hook Integration (
src/hooks/atlas/index.ts)Test Coverage
archive.test.ts: 6 test cases covering:Files Changed
constants.tstypes.tsstorage.tsindex.ts(atlas hook)archive.test.tsTest Plan
bun run typecheckpassesbun run buildsucceedsSummary by cubic
Automatically archive completed plans and their notepads when Atlas marks all tasks done. Archives to .sisyphus/plans/completed and .sisyphus/notepads/completed, resolves name conflicts, and clears boulder state; also speeds up plan discovery with a shared sorter.
New Features
Refactors
Written for commit a77693b. Summary will update on new commits.