Skip to content

Introduces in-memory approval queue system to support interactive plan approval workflows#41

Open
AkshatRaj00 wants to merge 4 commits into
masterfrom
feat/enhance-repl-cli-ui
Open

Introduces in-memory approval queue system to support interactive plan approval workflows#41
AkshatRaj00 wants to merge 4 commits into
masterfrom
feat/enhance-repl-cli-ui

Conversation

@AkshatRaj00
Copy link
Copy Markdown
Collaborator

@AkshatRaj00 AkshatRaj00 commented May 17, 2026

This pull request introduces an in-memory approval queue system to support interactive plan approval workflows, along with REST API endpoints and comprehensive unit tests. The main changes add a queue manager for tracking and updating plan approval entries, expose REST endpoints for UI integration, and provide tests to ensure correct behavior.

Core plan approval queue implementation:

  • Added src/core/plan-approval.ts containing the approval queue manager, including types for approval status, queue entries, plan edit requests, and actions. Exposes functions to enqueue, list, retrieve, edit, approve/reject, and dequeue plan entries, all managed in-memory for MVP purposes.

REST API endpoints:

  • Added src/ui/plan-editor-routes.ts with Express route handlers to list all queue entries, fetch a single entry, apply plan edits, and record approval decisions. These endpoints are designed for easy integration with the UI and return consistent JSON responses.

Testing:

  • Added test/plan-approval.test.ts with unit tests covering all major queue operations: enqueue, list, edit, approve/reject, and dequeue. Ensures correct queue behavior and edge case handling.

…endpoint stubs (#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 #8 (partial — MVP foundation for interactive plan editor dashboard flow)"
feat(ui): plan editor approval queue — MVP foundation for Issue #8
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an in-memory Approval Queue Manager and associated REST endpoints to handle plan approvals, step edits, and reviewer decisions. Key feedback includes a critical issue where Express-specific APIs were used despite the project employing a custom HTTP server, which will cause runtime errors. Additionally, improvements were suggested for applyPlanEdit to distinguish between 'not found' and 'invalid state' errors and to avoid redundant metadata updates. Finally, the reviewer recommended implementing state transition validation in recordDecision to prevent race conditions and ensure data consistency.

Comment thread src/ui/plan-editor-routes.ts Outdated
Comment thread src/core/plan-approval.ts Outdated
Comment thread src/core/plan-approval.ts
Comment thread src/core/plan-approval.ts Outdated
@AkshatRaj00 AkshatRaj00 reopened this May 17, 2026
@hoangsonww
Copy link
Copy Markdown
Owner

pls ensure CI passes. next time pls also write a good title for the PR and good PR body...

@hoangsonww hoangsonww added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers question Further information is requested feature Feature request labels May 20, 2026
@hoangsonww hoangsonww changed the title Feat/enhance repl cli UI Introduces in-memory approval queue system to support interactive plan approval workflows May 20, 2026
- plan-editor-routes.ts: replace Express-based handlers with native
  http.IncomingMessage + http.ServerResponse to fix TS7016 (@types/express
  not installed). Removes all no-non-null-assertion and no-explicit-any
  ESLint violations that came from Express typings.
- plan-approval.ts: add discriminated result types (PlanEditResult,
  DecisionResult) for applyPlanEdit and recordDecision — eliminates
  implicit null returns that caused lint warnings. Fix Prettier formatting.
- Both files now pass: prettier --check, tsc --noEmit, eslint

Closes format / typecheck / lint / pipeline-status CI failures on PR #41
- applyPlanEdit and recordDecision now return { ok, entry } | { ok, reason }
  instead of ApprovalQueueEntry | null — update all test assertions to
  unwrap .entry and check .ok instead of null comparisons / non-null !
- Removes all non-null assertion (!) operators from test file which were
  causing @typescript-eslint/no-non-null-assertion lint errors
- plan-editor-routes.ts: fix lint — remove unused 'URL' import (already
  available as global in Node 10+), fix no-unused-vars warning

Fixes: lint / test (ubuntu node 20+22, macos node 20+22) CI failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request feature Feature request good first issue Good for newcomers question Further information is requested

Development

Successfully merging this pull request may close these issues.

2 participants