Skip to content

docs(plans): add improve plans 005–009 for export, UI, and git listing - #39

Merged
cursor[bot] merged 1 commit into
mainfrom
prax/improve-architecture-and-plans-3d82
Aug 30, 2026
Merged

docs(plans): add improve plans 005–009 for export, UI, and git listing#39
cursor[bot] merged 1 commit into
mainfrom
prax/improve-architecture-and-plans-3d82

Conversation

@praxstack

Copy link
Copy Markdown
Owner

📋 Description

Advisor-only /improve plans. No application code in this PR.

Reconciles the existing 001–004 index and adds 005–009 for the highest-leverage new findings (unified export dropping comments, stacked file-header markup, Git listing copied in routes, dead cache middleware, CLI git execFileSync).

The /improve-codebase-architecture HTML report is not in git. It lives at /tmp/architecture-review-20260829-143802.html (artifact copy /opt/cursor/artifacts/architecture-review.html). Top recommendation: deepen the AI review export module (services/ReviewGenerator.js).

🔗 Related Issue

No issue.

🔄 Type of Change

  • 📝 Documentation update

✅ Checklist

  • Plans are self-contained for a separate executor
  • Numbering is monotonic; 001–004 not duplicated
  • Plans are not executed in this PR

📝 Additional Notes

Do not implement from this PR unless you run /improve execute <plan>. Architecture grilling has not started — pick a candidate first.

Open in Web Open in Cursor 

Reconcile the second standard improve pass at 37ac800. Keep 001–004 TODO.
New plans cover unified-export comments, file-header markup, GitService listing,
dead GET cache, and CLI listing through the same Git module.

Co-authored-by: Prax Lannister <praxstack@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c4ad6f02-9e8b-4a95-ba84-8ae34d41b03b


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T14:56:38.787490Z 0ca91a9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ca91a9400

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

In `services/ReviewGenerator.js`:

1. Destructure `comments = {}` and `lineComments = {}` next to `includedFiles`.
2. Inside the per-file `includedFiles.map` callback, after status/type markdown and **before** the diff block, insert the same comment + line-comment markdown as `generateFileContent` (same headings: `## 💭 Review Comment` and `## 🔍 Line Comments`). Use `comments[file]` and the same `lineId.includes(file.replace(/[^a-zA-Z0-9]/g, '_'))` filter.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Match each line comment to its exact file

When staged filenames overlap after normalization, this includes filter assigns comments to the wrong file. For example, the UI builds a foo.js.map line ID such as foo_js_map_0_0, which also includes normalized foo.js (foo_js), so the unified export duplicates that note under both files. Carry or compare the exact owning filename and add an overlapping-filename regression test rather than copying the split-export bug.

Useful? React with 👍 / 👎.


Replace inline listing as follows. Keep `handleAsyncRoute` and existing HTTP status codes.

1. **`GET /api/health`**: `const stagedFiles = await GitService.getStagedFiles()` for `stagedCount` (`.length`). Keep unstaged count from porcelain **or** add `getUnstagedModifiedCount` if you can do it in ≤15 lines in `GitService`. Prefer a small `getPorcelainLines()` private-to-file helper rather than a fourth copy of `execute('status-porcelain')` in the route. Minimum bar: `stagedCount` comes from `getStagedFiles().length`. If you still parse porcelain in health for unstaged ` M` / `??`, put that parse in `GitService.getUnstagedChangeCount()` rather than the route.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the health route's Git failure fallback

When Git is unavailable, the instructed direct await GitService.getStagedFiles() rejects and handleAsyncRoute turns /api/health into a 500. The current route uses Promise.allSettled and returns 200 with default counts even when either subprocess fails; this is required by the Docker image, which starts the server without installing Git or copying a repository and then probes this endpoint. Explicitly retain independent catches/defaults around the named service calls.

Useful? React with 👍 / 👎.

Comment on lines +130 to +134
- `onclick="toggleFile(this.getAttribute('data-file'), this.getAttribute('data-file-id'))"`
- `onkeydown="handleFileHeaderKeydown(event, this.getAttribute('data-file'), this.getAttribute('data-file-id'))"`
- One `div.file-path` containing expand icon `id="icon-${escapeHtml(fileId)}"`, icon text, `escapeHtml(file)`.
- One include checkbox: **one** `id="select-${escapeHtml(fileId)}"`, `data-filename`, `data-file-id`, `onchange` via `getAttribute` only, `onclick="event.stopPropagation();"` on the label.
- One comment button: `data-file` / `data-file-id`, `showCommentModal` via `getAttribute`, `aria-label="Add comment for ${escapeHtml(file)}"`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Exclude nested controls from the header key handler

When a keyboard user presses Space or Enter on the include checkbox or comment button, the event bubbles to this header handler; the existing handleFileHeaderKeydown unconditionally calls preventDefault() and toggleFile, suppressing the child control's normal activation and opening the diff instead. Guard for event.target === event.currentTarget, stop keydown propagation on the controls, or move the controls outside the element acting as a button.

Useful? React with 👍 / 👎.

Add a method that:

1. `execute('status-porcelain')`
2. Keeps lines whose first two characters include a working-tree `D` in the same way the staged-files route does today: `line.startsWith(' D') || line.startsWith('AD')`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Detect every worktree-side deletion

When a tracked file is staged as modified and then removed from the worktree, porcelain reports MD path, so neither prescribed prefix matches even though the second status character is D. Local verification showed git status --porcelain=v1 returning MD mod while the current CLI's git ls-files --deleted returned mod; git ls-files -h documents --deleted as “show deleted files in the output.” Plan 009 therefore loses an existing deletion warning after adopting this method. Check the worktree status character and add controlled MD/RD parser cases.

Useful? React with 👍 / 👎.

Comment on lines +220 to +221
- [ ] No files outside the in-scope list are modified (`git status`)
- [ ] `plans/README.md` status row for 005 is DONE

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Permit mandatory plan-index bookkeeping

For the default executor, these adjacent completion criteria are mutually exclusive: the plan requires changing the plans/README.md status row, but that file is absent from the in-scope list and all out-of-scope modifications are forbidden. Plans 006–009 repeat the same contradiction, so an executor following the strict stop/do-not-improvise instructions cannot declare any of them complete. Add plans/README.md as an explicit bookkeeping exception or in-scope file in each plan.

Useful? React with 👍 / 👎.

In `services/ReviewGenerator.js`:

1. Destructure `comments = {}` and `lineComments = {}` next to `includedFiles`.
2. Inside the per-file `includedFiles.map` callback, after status/type markdown and **before** the diff block, insert the same comment + line-comment markdown as `generateFileContent` (same headings: `## 💭 Review Comment` and `## 🔍 Line Comments`). Use `comments[file]` and the same `lineId.includes(file.replace(/[^a-zA-Z0-9]/g, '_'))` filter.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve comments when a file diff fails

When getDiffForFile rejects for a non-deleted file because of a Git timeout, command failure, or index race, the existing inner catch rethrows and the outer per-file catch returns a failure result; the final builder then emits only the generic diff error and discards the accumulated fileContent, including the newly inserted reviewer comments. Split export catches the diff failure in place and preserves those notes. Add a rejection-path test and retain the comment markdown when emitting the per-file error.

Useful? React with 👍 / 👎.

@cursor
cursor Bot merged commit 0939ae8 into main Aug 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants