Skip to main content

Architecture

The plugin is written in Rust using nvim-oxi for typed bindings to Neovim's C API. The codebase is split into two crates:

arbiter-core

Pure-logic library with no Neovim dependency. All domain types, configuration, prompt formatting, diff parsing, thread data model, persistence, and revision building live here. This crate is testable on any platform without a Neovim runtime.

ModulePurpose
typesShared domain types (review status, thread status, backend ops)
configConfiguration deserialization with per-workspace overrides
diffUnified diff parser, hunk extraction, and patch building
threadsThread CRUD, anchoring, filtering, and projection
promptsPrompt formatting for reviews, replies, self-review, and rule extraction
rulesScenario-scoped rule system with glob matching and TOML frontmatter
stateJSON persistence of review state, threads, and sessions
revisionRevision snapshot building and unified diff generation

arbiter

cdylib plugin loaded by Neovim. Contains all UI code, nvim-oxi bindings, and process management. Depends on arbiter-core for domain logic.

ModulePurpose
backend/CLI adapter shim (Cursor, Claude) with FIFO queue, streaming, and process lifecycle
review/Review workbench: lifecycle, keymaps, navigation, hunk acceptance, thread UI, and revision view
commands/User command registration and self-review orchestration
diff/renderDiff buffer rendering and syntax highlighting
file_panel/File panel implementations (builtin tree, nvim-tree adapter)
prompt_panelLong-lived prompt conversations in a floating window
panelShared rendering utilities (timestamps, streaming, status lines)
dispatchSafe cross-thread callback dispatch via libuv::AsyncHandle
gitAsync git operations (merge-base, diff, show, stash) and staging/unstaging
pollPeriodic file and file-list refresh via libuv timers
activityBackend busy/idle tracking for statusline display
highlightCustom highlight groups and sign definitions