feat(ui): add plan editor types, approval queue foundation, and REST endpoints#39
Open
AkshatRaj00 wants to merge 6 commits into
Open
feat(ui): add plan editor types, approval queue foundation, and REST endpoints#39AkshatRaj00 wants to merge 6 commits into
AkshatRaj00 wants to merge 6 commits into
Conversation
…endpoint stubs (hoangsonww#8) - Add PlanEditRequest, PlanApprovalAction, ApprovalQueueEntry types to src/types/index.ts - Add src/core/plan-approval.ts: approval queue manager with enqueue/dequeue/update - Add REST endpoint stubs in src/ui/plan-editor-routes.ts for GET/PATCH/POST plan approval - Closes hoangsonww#8 (partial — MVP foundation for interactive plan editor dashboard flow)"
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces an in-memory approval queue system for plan management, featuring a core manager, REST API endpoints, and comprehensive unit tests. The implementation supports enqueuing plans, editing pending steps, and recording reviewer decisions. Feedback focused on improving efficiency by moving static constants outside of function scopes to avoid redundant allocations and enhancing state integrity by restricting decision recording to entries currently in a 'pending' state.
…t & format issues
Owner
|
pls ensure CI passes |
…typecheck/format issues
…xpress dep), fix let->const in plan-approval, fix all format/lint/typecheck errors
…to fix format check
Owner
|
btw if you can include a demo/screenshot of how this works that'd be great. ty! |
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.
This pull request introduces a complete MVP implementation of an approval queue system for plan review, including its core logic, REST API endpoints, and unit tests. The new system allows generated plans to be held for user approval, rejection, or revision before execution, and exposes endpoints for UI integration. The implementation is fully in-memory for simplicity and MVP purposes.
The most important changes are:
Approval Queue Core Logic
src/core/plan-approval.ts, implementing an in-memory approval queue manager with functions to enqueue plans, list and retrieve entries, apply step edits, record reviewer decisions (approve/reject/request revision), and dequeue entries. Defines all relevant types for queue entries, step updates, and approval actions.REST API Endpoints
src/ui/plan-editor-routes.ts, providing Express route handlers for listing the approval queue, retrieving an entry, patching plan steps, and posting approval decisions. All endpoints return a consistent response format and include validation.Unit Testing
test/plan-approval.test.tswith comprehensive unit tests covering enqueueing, listing, editing, decision recording, and dequeueing of approval queue entries, ensuring correctness of the queue manager logic.