Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Terminal editor + headless CLI for AI agent orchestration. Rust 2024.
### Memory + MCP + write path

- [`MemoryStores`](crates/gaviero-core/src/memory/stores.rs) + [`WriterHandle`](crates/gaviero-core/src/memory/writer.rs) — multi-DB; single writer task.
- [`GavieroMcpServer`](crates/gaviero-core/src/mcp/server.rs) — ten tools over [`McpEndpoint`](crates/gaviero-core/src/mcp/transport.rs) (stdio shim) plus a loopback streamable-HTTP listener ([`mcp/http.rs`](crates/gaviero-core/src/mcp/http.rs)). Nine read-only (including `memory_ping` and the function-level `symbol_refs`) plus write-adjacent `memory_flag`. Nested-agent reach is probed (`--mcp-reach-probe`) and recorded in `.gaviero/mcp_reach.json`. `gaviero-mcp-shim --resolve` walks up for `mcp-endpoint.json`. User-scope MCP registration: `--mcp-register-user`. Lean tool list: `mcp.gavieroServer.exposedTools`. DeepSeek `deepseek:` does not use the shim; `dsh:` mounts gaviero MCP on `session/new`.
- [`GavieroMcpServer`](crates/gaviero-core/src/mcp/server.rs) — eleven tools over [`McpEndpoint`](crates/gaviero-core/src/mcp/transport.rs) (stdio shim) plus a loopback streamable-HTTP listener ([`mcp/http.rs`](crates/gaviero-core/src/mcp/http.rs)). Nine read-only (including `memory_ping` and the function-level `symbol_refs`) plus write-adjacent `memory_flag`, plus the interactive `ask_user_question` — that last one exists only on a connection that names its chat conversation with `x-gaviero-conversation` (the `dsh:` path) and parks the TUI's question overlay. Nested-agent reach is probed (`--mcp-reach-probe`) and recorded in `.gaviero/mcp_reach.json`. `gaviero-mcp-shim --resolve` walks up for `mcp-endpoint.json`. User-scope MCP registration: `--mcp-register-user`. Lean tool list: `mcp.gavieroServer.exposedTools`. DeepSeek `deepseek:` does not use the shim; `dsh:` mounts gaviero MCP on `session/new`.
- [`WriteGatePipeline`](crates/gaviero-core/src/write_gate.rs) — every agent file change.

### Observers
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ All interactive coding providers — Claude Code, Codex, Cursor, Ollama, DeepSee
- **File edits never bypass review.** In TUI chat the host captures the turn, not the tools: [`turn_capture`](crates/gaviero-core/src/turn_capture/mod.rs) snapshots the workspace folders before the agent starts and diffs them after the session closes (no git — `.gitignore` is read as a plain pattern file, plus `files.exclude`; `.gaviero/` and `.git/` skipped; `.gaviero/settings.json`, `.gaviero/dsl/`, `.gaviero/skills/`, sensitive paths and the gitignored folders listed in `turnReview.includeIgnored` always scanned). Every provider writes freely during the turn (`AgentOptions::host_capture` skips their own snapshot/revert/propose paths and pre-approves `Write`/`Edit`/`MultiEdit`); Bash keeps `ToolPolicy`. Whatever changed — edit tools, Bash, formatters, deletes, renames — becomes a `TurnChangeSet`, sensitive paths are auto-reverted, and the conversation is blocked until the TURN REVIEW is done (accept or reject each file, or the whole turn; reject = back to the pre-prompt version). If the baseline cannot be taken, the turn falls back to the provider-side Write Gate path. Swarm and `gaviero-cli` keep the Write Gate: native tools write inside their worktree, `dsh:` reconciles out-of-band writes via git dirty-set, Ollama's `<file path="relative/path">…</file>` blocks are extracted by [crates/gaviero-core/src/acp/protocol.rs](crates/gaviero-core/src/acp/protocol.rs).
- **One review path per entry point.** TUI chat: the turn change set ([crates/gaviero-tui/src/app/turn_review.rs](crates/gaviero-tui/src/app/turn_review.rs)). Swarm (CLI or the TUI SWARM panel) / CLI: `write_gate::WriteGatePipeline` ([crates/gaviero-core/src/write_gate.rs](crates/gaviero-core/src/write_gate.rs)).
- **Scope enforcement.** Proposals are checked against the active `FileScope` ([crates/gaviero-core/src/scope_enforcer.rs](crates/gaviero-core/src/scope_enforcer.rs)) before they leave the gate.
- **MCP routes every effect through the writer task.** Ten tools ([crates/gaviero-core/src/mcp/tools.rs](crates/gaviero-core/src/mcp/tools.rs)). Nine read-only: `memory_search`, `memory_get`, `memory_ping`, `blast_radius`, `node_doc`, `repo_outline`, `symbol_refs`, plus `symbol_search` / `symbol_doc` behind `repoMap.symbolEnrichment.enabled`. `memory_ping` writes only to an in-memory probe ledger. One write-adjacent: `memory_flag` (`mcp.flag.enabled`, default true) demotes a stale memory's trust — it creates and deletes nothing, refuses user-authored and History rows, is idempotent, and every applied flag writes a reversible audit row. It reaches the writer through the narrow [`MemorySignalSink`](crates/gaviero-core/src/mcp/signal.rs), so `mcp/server.rs` still holds no `WriterHandle`.
- **MCP routes every effect through the writer task.** Eleven tools ([crates/gaviero-core/src/mcp/tools.rs](crates/gaviero-core/src/mcp/tools.rs)). Nine read-only: `memory_search`, `memory_get`, `memory_ping`, `blast_radius`, `node_doc`, `repo_outline`, `symbol_refs`, plus `symbol_search` / `symbol_doc` behind `repoMap.symbolEnrichment.enabled`. `memory_ping` writes only to an in-memory probe ledger. One write-adjacent: `memory_flag` (`mcp.flag.enabled`, default true) demotes a stale memory's trust — it creates and deletes nothing, refuses user-authored and History rows, is idempotent, and every applied flag writes a reversible audit row. It reaches the writer through the narrow [`MemorySignalSink`](crates/gaviero-core/src/mcp/signal.rs), so `mcp/server.rs` still holds no `WriterHandle`. One interactive: `ask_user_question` ([`mcp/ask.rs`](crates/gaviero-core/src/mcp/ask.rs)) — listed **only** for a loopback-HTTP connection whose requests carry `x-gaviero-conversation` (the `dsh:` session's MCP entry adds it) and only when the TUI installed a sink; it parks the same conversation overlay as Claude's `AskUserQuestion`, returns the answers as text, touches no store, and is exempt from `exposedTools` (but hidden and rejected by `mcp.permissions`).

## Conventions

- **Model spec is `provider:model`.** Bare names are rejected at dispatch (`validate_model_spec`, [crates/gaviero-core/src/swarm/backend/shared.rs](crates/gaviero-core/src/swarm/backend/shared.rs)). Prefixes: `claude:`, `codex:`, `cursor:`, `ollama:`, `local:`, `deepseek:`, `dsh:`.
- **Lock discipline.** Never hold a `Mutex` across I/O, parsing, or embedding. The memory `writer` task is the single owner of SQLite writes.
- **Two-layer graph context.** The pre-prompt assembler injects `<repo_topology>` (shallow filesystem-only folder map, [crates/gaviero-core/src/repo_map/topology.rs](crates/gaviero-core/src/repo_map/topology.rs)) plus `<repo_outline>` (PageRank-ranked code outline). The TUI `/lite` chat command drops `<repo_outline>` + memory + impact and keeps only topology.
- **Plan production.** When drafting implementation plans for other agents, assume Claude Code (`claude:fable` / `claude:opus`) or Codex (`codex:gpt-5.6-sol`) unless the user will implement themselves. Plans must be agent-executable: concrete work units, ownership boundaries, expected files/modules, verification steps, sequencing constraints. Example model profile (clients per tier): [crates/gaviero-dsl/examples/profiles/default.gaviero](crates/gaviero-dsl/examples/profiles/default.gaviero). Drafting is separate from *consuming*: a stored plan binds only while it is being executed — see the `plans/` rule under Rules.
- **Plan production.** When drafting implementation plans for other agents, assume Claude Code (`claude:fable` / `claude:opus`) or Codex (`codex:gpt-6.1-sol`) unless the user will implement themselves. Plans must be agent-executable: concrete work units, ownership boundaries, expected files/modules, verification steps, sequencing constraints. Example model profile (clients per tier): [crates/gaviero-dsl/examples/profiles/default.gaviero](crates/gaviero-dsl/examples/profiles/default.gaviero). Drafting is separate from *consuming*: a stored plan binds only while it is being executed — see the `plans/` rule under Rules.

## Rules

Expand Down
13 changes: 7 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resolver = "2"
# built from. To release: bump it, then run `./scripts/release.ps1`, which tags
# v<version> and pushes the tag (.github/workflows/release.yml takes it from
# there). gaviero-relay and tree-sitter-gaviero keep their own versions.
version = "0.1.0"
version = "0.1.1"
license = "Apache-2.0"
repository = "https://github.com/neich/gaviero"
homepage = "https://github.com/neich/gaviero"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ gaviero-cli --script review.gaviero --prompt "the auth module" --tier fixer=high
gaviero-cli --script review.gaviero --prompt "the auth module" --profile codex # every model at once
```

**Skills** — turn-scoped instruction templates under `.gaviero/skills/<name>/SKILL.md`, invoked in chat with `$skill-name`. They are found in each folder's `.gaviero/skills/`, in the workspace's — the `.gaviero/skills/` beside the `.gaviero-workspace` file, also for a one-folder workspace or a member folder opened on its own — and in the global `$GAVIERO_ROOT/.gaviero/skills/` (folder beats workspace beats global). Adding or removing a skill is picked up while gaviero runs, even when the `skills/` directory is created after launch. Use `/skills` to list or `/skills search <query>` for semantic discovery; `/skills` also lists every folder it scanned and each skill it could not load, with the reason (a missing `description`, a frontmatter `name` that differs from the folder name, a folder name outside `A-Za-z0-9_-`). `SKILL.md` may be any letter case, start with a BOM, and use YAML block values (`description: >`). Optional `skills.extraRoots` (array of paths, default `[]`, `~` expanded) adds foreign roots such as `~/.claude/skills` or `~/.codex/skills`; a missing configured root is a chat warning, not a silent skip.
**Skills** — turn-scoped instruction templates under `.gaviero/skills/<name>/SKILL.md`, invoked in chat with `$skill-name`. They are found in each folder's `.gaviero/skills/`, in the workspace's — the `.gaviero/skills/` beside the `.gaviero-workspace` file, also for a one-folder workspace or a member folder opened on its own — and in the global `$GAVIERO_ROOT/.gaviero/skills/` (folder beats workspace beats global). Adding or removing a skill is picked up while gaviero runs, even when the `skills/` directory is created after launch. Use `/skills` to list or `/skills search <query>` for semantic discovery; `/skills` also lists every folder it scanned and each skill it could not load, with the reason (a missing `description`, a frontmatter `name` that differs from the folder name, a folder name outside `A-Za-z0-9_-`). `SKILL.md` may be any letter case, start with a BOM, and use YAML block values (`description: >`). Optional `skills.extraRoots` (array of paths, default `[]`, `~` expanded) adds foreign roots such as `~/.claude/skills` or `~/.codex/skills`; a missing configured root is a chat warning, not a silent skip. Chat resolves `$skill-name` for every provider (the rendered body rides the prompt as a `<skill>` block); for `dsh:` the same folders — every workspace member plus the `$GAVIERO_ROOT/.gaviero/skills/` global root, `~/.gaviero/skills/` only when `GAVIERO_ROOT` is unset — are also added to dsh's own skill catalog (`skill-filesystem.customSkillDirs`, through gaviero's launch patch), so the model's `skill` tool and available-skills list know them by name too.

## Configuration

Expand Down
2 changes: 1 addition & 1 deletion crates/gaviero-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ gaviero-cli --work-units '[{"id":"design","description":"Plan","scope":{"owned_p
| Provider | Examples |
|---|---|
| Claude | `claude:fable`, `claude:sonnet`, `claude:opus`, `claude:claude-fable-5-2`, `claude:claude-opus-5-5` |
| Codex | `codex:gpt-6.1-sol`, `codex:gpt-6-astra`, `codex:gpt-6.1-terra`, `codex:gpt-6-sol`, `codex:gpt-6-luna`, `codex:gpt-5.6-sol`, `codex:gpt-5.6-terra`, `codex:gpt-5.6-luna` |
| Codex | `codex:gpt-6.1-sol`, `codex:gpt-6-astra`, `codex:gpt-6-sol`, `codex:gpt-6-luna`, `codex:gpt-5.6-sol`, `codex:gpt-6.1-terra`, `codex:gpt-5.6-terra`, `codex:gpt-5.6-luna`, `codex:gpt-5.5` |
| Cursor | `cursor:composer-2.5`, `cursor:grok-4.7-high` (ids embed effort — see `agent --list-models`) |
| Ollama / local | `ollama:qwen2.5-coder:7b`, `local:qwen2.5-coder:14b` |
| DeepSeek | `deepseek:deepseek-flash`, `deepseek:deepseek-v4-pro` (legacy: `deepseek:deepseek-v4-flash`) |
Expand Down
2 changes: 1 addition & 1 deletion crates/gaviero-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct Cli {

/// Model spec to use for synthetic task execution and as the default runtime model.
/// Canonical form is `provider:model` — e.g. `claude:sonnet`, `claude:opus`,
/// `codex:gpt-5.5`, `ollama:qwen2.5-coder:7b`. Defaults to workspace agent.model,
/// `codex:gpt-6.1-sol`, `ollama:qwen2.5-coder:7b`. Defaults to workspace agent.model,
/// then `claude:sonnet`.
#[arg(long)]
model: Option<String>,
Expand Down
4 changes: 2 additions & 2 deletions crates/gaviero-core/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ gaviero-core/src/
├─ mcp/ In-process MCP server
│ ├─ server.rs spawn_mcp_server, GavieroMcpServer
│ ├─ signal.rs MemorySignalSink — the one write-adjacent seam
│ ├─ tools.rs Ten tools (see MCP below)
│ ├─ tools.rs Eleven tools (see MCP below)
│ ├─ probe.rs ProbeLedger + memory_ping receipts
│ ├─ transport.rs McpEndpoint (Unix socket / Windows named pipe)
│ ├─ http.rs Loopback streamable-HTTP listener
Expand Down Expand Up @@ -168,7 +168,7 @@ Writes, TUI chat: every provider writes during the turn (`AgentOptions::host_cap
### Memory / MCP / observers

- [`MemoryStores`](src/memory/stores.rs) + [`WriterHandle`](src/memory/writer.rs) — multi-DB; single writer task.
- [`GavieroMcpServer`](src/mcp/server.rs) — ten tools (nine read-only including `memory_ping` and `symbol_refs` + write-adjacent `memory_flag`); **no `WriterHandle`** — `memory_flag` signals through [`mcp/signal.rs`](src/mcp/signal.rs) into the writer task. `memory_ping` records only on an in-memory [`ProbeLedger`](src/mcp/probe.rs). Loopback HTTP: [`mcp/http.rs`](src/mcp/http.rs). Shim lookup: [`mcp/endpoint_file.rs`](src/mcp/endpoint_file.rs). Lean surface: `mcp.gavieroServer.exposedTools` (default all ten; lean preset `memory_search`/`memory_get`/`memory_ping`).
- [`GavieroMcpServer`](src/mcp/server.rs) — eleven tools (nine read-only including `memory_ping` and `symbol_refs` + write-adjacent `memory_flag` + interactive `ask_user_question`, listed only for a loopback-HTTP connection that names its conversation with `x-gaviero-conversation`, and parking the TUI question overlay); **no `WriterHandle`** — `memory_flag` signals through [`mcp/signal.rs`](src/mcp/signal.rs) into the writer task. `memory_ping` records only on an in-memory [`ProbeLedger`](src/mcp/probe.rs). Loopback HTTP: [`mcp/http.rs`](src/mcp/http.rs). Shim lookup: [`mcp/endpoint_file.rs`](src/mcp/endpoint_file.rs). Lean surface: `mcp.gavieroServer.exposedTools` (default all ten routed; lean preset `memory_search`/`memory_get`/`memory_ping`).
- Observers in [`observer.rs`](src/observer.rs) / [`memory/observer.rs`](src/memory/observer.rs) / [`mcp/observer.rs`](src/mcp/observer.rs).

---
Expand Down
Loading
Loading