-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Statusnone420 edited this page Jun 12, 2026
·
3 revisions
This page is for contributors and AI agents getting oriented in the codebase.
- Desktop shell: Tauri 2
- Backend: Rust
- Frontend: React, TypeScript, Vite
- Parsers: tree-sitter grammars for TypeScript/JavaScript, Rust, Go, Python, Java, C#, Kotlin, and Swift
- Git access:
git2 - Watcher:
notifyandnotify-debouncer-full - Tests: Rust unit tests, Playwright web E2E, Playwright native Tauri E2E; CI runs cargo test + clippy (Windows) and tsc + web E2E (Ubuntu)
-
src-tauri/src/lib.rsexposes Tauri commands;main.rsroutescheckto the headless CLI first. -
git.rsdiscovers repo roots, branch names, changed files (vsHEADor any baseline commit), and file contents at any rev. -
session.rsresolves the per-repo baseline (resolve_baseline), orchestrates file analysis, and assemblesSessionData(including per-node review marking). -
parse.rsparses supported source languages (Lang) into a smallParsedtree. -
diff.rscompares before/after parsed trees and assigns stable node IDs. -
rules.rsevaluates security heuristics;heuristics.rswalks nodes and attaches flags. -
deps_diff.rsrenders a drifted package.json's dependency/script sections as drift nodes with lockfile-aware rules. -
watcher.rskeeps a debounced live session cache, re-resolves the baseline on git-state changes, and emitsdrift://updated. -
store.rspersists per repo: dismissed flags, reviewed fingerprint, baseline choice, trust point, and per-node review hashes. -
report.rsrenders Markdown or JSON exports. -
cli.rsimplementsdiff-drift check— read-only headless analysis with severity exit codes.
-
src/lib/session.tswraps Tauri commands and provides browser-mode mock behavior. -
src/App.tsxowns app state, repo opening, live updates, selection, triage, review, and export. -
src/components/Toolbar.tsxrenders repo, branch, counts, and review actions. -
src/components/Sidebar.tsxrenders session counts and analyzed files. -
src/components/Center.tsxrenders the selected file's node tree. -
src/components/NodeCard.tsxrenders node state, diff body, and flag chips. -
src/components/RightPanel.tsxrenders active and dismissed flags.
The shared TypeScript shape is in src/types.ts; the Rust mirror is in src-tauri/src/model.rs.
Important objects:
-
SessionData: full payload sent to React; carriesschemaVersion(currently 4 — bump it when the shape changes in ways consumers could misread). -
Session: repo, branch, baseline (spec/label/trust point), counts, review progress, reviewed state. -
FileEntry: analyzed file metadata, review progress, and node tree. -
AstNode: parsed structure, before/after lines, and per-nodereviewedstate. -
Flag: heuristic finding attached to a node.
Keep these contracts in sync. If a field changes in Rust, update TypeScript, mock data, reports, tests — and SCHEMA_VERSION in model.rs when the change is breaking.
- Stay local-only. Do not add telemetry, model calls, or remote repo uploads.
- Prefer focused heuristics over broad static-analysis claims.
- Keep docs and UI honest about scope: structural drift for supported source languages plus package.json dependency drift; heuristic flags are strongest for JS/TS and package drift.
- The headless
checkcommand stays read-only: it must never mutate triage state. - Make surgical changes. Avoid large rewrites unless a specific bug requires them.