feat(config): Phase 2 Configurable Output — vestige.toml + output profiles (v2.1.24)

Add an optional, local-first `vestige.toml` config file (loaded from the active
data directory alongside vestige.db) that lets users control the default shape
and size of high-traffic MCP responses without recompiling and without a cloud
service.

- New `vestige-core::config` module: `VestigeConfig` / `OutputConfig` /
  `OutputProfile` with a dependency-free, lenient minimal-TOML parser for the
  `[defaults]` table (detail_level, limit, profile).
- Output profiles: lean | default | audit | research. `default` reproduces
  pre-2.1.24 behavior byte-for-byte so existing users see no change.
- Precedence (per call): explicit MCP param > config file > built-in default.
- Wired into search, memory_timeline, codebase (get_context), session_context.
  Each echoes the active `profile`; `lean` masks scores/timestamps via a shared
  `apply_output_masks` helper.
- McpServer loads config once at construction from storage.data_dir().
- Tests: config precedence/profile unit tests in core (10) + per-tool precedence
  and lean-masking tests. Full workspace suite green, clippy -D warnings clean,
  dashboard check + build green.
- Docs: new "Output Configuration (vestige.toml)" section in docs/CONFIGURATION.md
  and CHANGELOG 2.1.24 entry. Version bumped 2.1.23 -> 2.1.24.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sam Valladares 2026-06-11 16:04:41 -05:00
parent 274c6c265f
commit 0474c6aafa
18 changed files with 925 additions and 120 deletions

View file

@ -50,6 +50,93 @@ Qwen3 currently uses Hugging Face Hub's Candle loader directly, so use the stand
---
## Output Configuration (`vestige.toml`)
> Added in **v2.1.24** (Roadmap Phase 2: Configurable Output).
You can control the default shape and size of high-traffic MCP responses with an
optional config file. It is **local-first** — no cloud service is involved — and
**fully backward-compatible**: with no file present, Vestige behaves exactly as
it did before.
### Location
The config file lives in the active Vestige data directory, alongside the
database:
```
<data_dir>/vestige.toml # e.g. ~/Library/Application Support/com.vestige.core/vestige.toml
```
The data directory is resolved with the same precedence as storage
(`--data-dir` > `VESTIGE_DATA_DIR` > OS per-user data dir). A missing file, or a
file with no recognized keys, falls back to built-in defaults. The parser is
lenient: unknown keys and unknown sections are ignored, so the file can grow in
future releases without breaking older binaries.
### `[defaults]` table
```toml
[defaults]
# Detail level for high-traffic tools: "brief" | "summary" | "full"
detail_level = "summary"
# Default result count for high-traffic tools (positive integer)
limit = 10
# Output profile: "lean" | "default" | "audit" | "research"
profile = "default"
```
All three keys are optional. `detail_level` and `limit`, when set, override the
selected profile's presets.
### Output profiles
A profile presets a coherent bundle of detail level, default limit, and whether
scores and timestamps are included:
| Profile | Detail | Default limit | Scores | Timestamps | Use when |
|---------|--------|---------------|--------|------------|----------|
| `lean` | `brief` | 5 | dropped | dropped | Context budget matters most |
| `default` | `summary` | tool default | shown | shown | **Historical behavior (unchanged)** |
| `audit` | `full` | tool default | shown | shown | Reviewing or debugging memory state |
| `research` | `full` | 25 | shown | shown | Wide, detailed result sets |
### Precedence
Resolved per call, highest to lowest:
1. **Explicit MCP parameter** (e.g. `detail_level` / `limit` on a `search`
call) — always wins.
2. **`vestige.toml`** — the `[defaults]` keys and the selected profile.
3. **Built-in default** — the `default` profile, identical to pre-v2.1.24
behavior.
### Affected tools
`search`, `memory_timeline`, `codebase` (`get_context`), and `session_context`
resolve their default detail level and result limit through this config. Each of
these tools also echoes the active `profile` in its response so you can confirm
what was applied. Tools that take no `detail_level`/`limit` are unaffected.
### Example: minimize context cost
```toml
[defaults]
profile = "lean"
```
### Example: detailed audits without changing the profile
```toml
[defaults]
detail_level = "full"
limit = 50
```
---
## Command-Line Options
```bash