Skip to content

feat(review-tutor): analyze Dart and Rust, read neighbours, and ask from evidence - #73

Merged
ElbertePlinio merged 2 commits into
mainfrom
feat/review-tutor-structure-languages
Aug 25, 2026
Merged

feat(review-tutor): analyze Dart and Rust, read neighbours, and ask from evidence#73
ElbertePlinio merged 2 commits into
mainfrom
feat/review-tutor-structure-languages

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

Refs #62 — PR 4 of 4 (analyzer extensions and tutor integration). Stacked on #72; the final link of the batched Review Tutor chain (#67#69#71#72 → this). Closes the #62 PR plan once merged.

What changed

Analyzer (src/structure-languages.ts, src/structure-neighbours.ts, src/structure.ts)

  • Dart (import / export / part / part of, package: mapping through a pubspec found by walking up from the importing file, dart: and other packages aggregated as external) and Rust (mod from crate roots and nested files, #[path] as an exact override read from masked source, use crate::… longest-prefix with brace-group expansion, pub use as re-export, super/self, include!) as private language tables with language-aware masking (nested comments, raw/triple strings, char literals).
  • One-hop neighbours, default off: unchanged files that changed files import are read only through Git objects (git cat-file -s then blob; index for worktree/staged, the commit or range target otherwise; never for PR or pasted sources), outgoing only, with caps applied before work (50 files, 256 KiB each, 2 MiB total, 400 probes, 5 s with an abortable deadline) and every cap or refusal recorded as an explicit omission. Paths are validated before any Git call (.., absolute, -, :, control characters rejected).
  • inputs.ts pins --src-prefix=a/ --dst-prefix=b/ for every local Git read, fixing wrong snapshot paths under diff.mnemonicPrefix; InputSnapshot gains revision / rangeTo.
  • Protocol additions are additive: kinds part part-of mod use include, file status context, snapshot.neighbours, GET /api/structure?neighbours=1 (cache keyed by input + flag).

UI (src/page.ts, src/page-script.ts, src/page-styles.ts)

  • One Include unchanged neighbours checkbox in the Structure header (always visible once a snapshot exists; unchecked and disabled with the reason in the partial note when unavailable; remembered per tab).
  • Context files render muted (CONTEXT on the target where a neighbour appears, and as ordinary groups when they have their own rows); the new kinds render as text chips.
  • Ask the tutor beside Open in Diff on evidence rows (list and graph): switches to Diff, selects the exact evidence line (the added line for modified edges) through the existing selection path, opens the inline composer with an empty question, and refuses while this tab's question is still running.

Tested

  • 69 analyzer tests incl. all Dart/Rust fixtures, every neighbour cap and read path through a fake ExecFile, path rejection, determinism with reversed discovery order; real-Git end-to-end run against this repository. Page tests for the control's states, caching, persistence, focus restore, announcements, context rendering, the Ask flow on desktop and ≤860, modified-edge resolution, and the running-question guard. Rendered proof at 1440 / 390.
  • bun run check: 552 passed | 25 skipped, 83.07% statements.

Not tested

  • Real Dart/Rust repositories at scale (fixture-driven); package: resolution for packages outside the repo is by design external.

Local review: serious-backend panel + verification on the analyzer half; serious-user-facing panel + verification on the UI half. Human gate: merge only on Elberte's authorization.

@ElbertePlinio
ElbertePlinio force-pushed the feat/review-tutor-structure-languages branch from 2afcb52 to 7869a39 Compare August 25, 2026 00:15
@ElbertePlinio

Copy link
Copy Markdown
Member Author

Ready for human review at 7869a39. Panels + verification clean; deferred low-severity items on #62.

Add Dart and Rust language tables with language-aware masking, read
bounded one-hop neighbour files through Git objects behind a default-off
query flag, and pin diff path prefixes so user Git config cannot change
snapshot paths.
…ighbours

Add an Include unchanged neighbours control, render context files and
the Dart and Rust connection kinds in the list and graph, and let an
evidence row open the tutor composer on its exact diff line.
@ElbertePlinio
ElbertePlinio force-pushed the feat/review-tutor-structure-languages branch from 7869a39 to 3af52d0 Compare August 25, 2026 19:18
@ElbertePlinio
ElbertePlinio merged commit bdc0f24 into main Aug 25, 2026
4 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.

1 participant