Skip to content

fix(review): contain untracked reads honestly - #9

Merged
ahmedragab20 merged 1 commit into
mainfrom
fix/hardening-containment
Sep 7, 2026
Merged

fix(review): contain untracked reads honestly#9
ahmedragab20 merged 1 commit into
mainfrom
fix/hardening-containment

Conversation

@ahmedragab20

Copy link
Copy Markdown
Owner

Summary

Follow-up after #8 and the native-file hardening slice. Untracked diffs and EditorConfig no longer walk the repo through Node fs. Denied, missing, or unavailable untracked files are omitted; the tracked patch is kept; /api/diff, inspect, MCP get_diff, and the web UI report complete: false instead of a full snapshot.

Also stops the browser UI from importing the Node GitHub client, and fails the Vite build if a Node builtin leaks into the client bundle.

What landed

  • Untracked file contents and EditorConfig are read through the native capability helper; Git path lists are NUL-delimited.
  • Helper-unavailable / denied symlink / listing failures keep the tracked diff and set complete / omittedPaths.
  • Tracked async git diff failures propagate instead of becoming an empty successful review.
  • getFileContent / resolveFileVersion honor staged, revision-range, and show-mode blob specs.
  • Inspect cache fingerprints include completeness, not just the patch.
  • Web banner when a review is incomplete.
  • classifyPrComments moved to src/lib/pr-comments.ts; Vite browserOnlyPlugin rejects Node builtins in the client bundle.

Verification

  • pnpm exec vitest run (targeted containment files): 6 files, 227 tests passed.
  • pnpm test:ts: 178 files, 1,849 tests passed.
  • pnpm exec vite build: passed (existing >500 kB chunk warning).

I did not re-run the waived #8 manual browser/latency matrix, and there is no browser MCP in this session to click the new incomplete banner. Data path is covered by useDiff / /api/diff tests.

Still deferred

This is not the rest of the hardening roadmap. Still open, in order:

  1. Git stage/revert, editor launch, search/fff, remaining Rust callers, OS matrix (A02 remainder).
  2. Full snapshot-correct previews and guarded mutations (A03/A04).
  3. Durable isolated review state (A08–A13).
  4. Headless contract, publishing/egress, typecheck/CI/perf (A14+).
  5. #8 waived items: cross-browser / edit-mode / navigation matrix, before/after latency, human verification of the original scroll/comment workflows.

No release.

Route untracked and EditorConfig reads through the native
capability helper. Omitted files keep the tracked patch and
set complete:false. Honor staged/revision/show blob specs,
propagate tracked git-diff failures, and keep Node GitHub
code out of the browser bundle.
@ahmedragab20
ahmedragab20 merged commit cd4c101 into main Sep 7, 2026
@ahmedragab20
ahmedragab20 deleted the fix/hardening-containment branch September 9, 2026 01:49
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.

1 participant