Skip to content
Open
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
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ make check
For the embedding-heavy tests (separate job in CI): `pip install
-e '.[embeddings]'` then drop the `--ignore=tests/embeddings` flag.

To *run* the thing you're hacking on (dev mode): the editable install's
`vouch` runs straight from `src/`. Init a scratch KB (`vouch init` in a
temp dir, or `VOUCH_KB_PATH=/abs/path/.vouch`) — the repo root's own
`.vouch/` is real and committed, don't experiment against it. `make
console` runs the HTTP backend + vouch-ui dev server as a pair. Full
walkthrough: "Running vouch in dev mode" in
[`CONTRIBUTING.md`](./CONTRIBUTING.md).
Comment on lines +88 to +94

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

clarify that VOUCH_KB_PATH selects a kb; it does not create one.

As written, the parenthetical makes VOUCH_KB_PATH sound like an alternative to initializing a scratch KB. Point it at an existing initialized .vouch directory instead.

proposed wording
- Init a scratch KB (`vouch init` in a
- temp dir, or `VOUCH_KB_PATH=/abs/path/.vouch`) — the repo root's own
+ Init a scratch KB with `vouch init` in a
+ temp dir. To use an existing initialized KB elsewhere, set
+ `VOUCH_KB_PATH=/abs/path/.vouch`. The repo root's own
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
To *run* the thing you're hacking on (dev mode): the editable install's
`vouch` runs straight from `src/`. Init a scratch KB (`vouch init` in a
temp dir, or `VOUCH_KB_PATH=/abs/path/.vouch`) — the repo root's own
`.vouch/` is real and committed, don't experiment against it. `make
console` runs the HTTP backend + vouch-ui dev server as a pair. Full
walkthrough: "Running vouch in dev mode" in
[`CONTRIBUTING.md`](./CONTRIBUTING.md).
To *run* the thing you're hacking on (dev mode): the editable install's
`vouch` runs straight from `src/`. Init a scratch KB with `vouch init` in a
temp dir. To use an existing initialized KB elsewhere, set
`VOUCH_KB_PATH=/abs/path/.vouch`. The repo root's own
`.vouch/` is real and committed, don't experiment against it. `make
console` runs the HTTP backend + vouch-ui dev server as a pair. Full
walkthrough: "Running vouch in dev mode" in
[`CONTRIBUTING.md`](./CONTRIBUTING.md).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CLAUDE.md` around lines 88 - 94, Clarify the development-mode instructions
around VOUCH_KB_PATH: state that it selects an existing initialized .vouch
knowledge-base directory and does not create one. Keep the scratch-KB
initialization guidance separate, while preserving the warning not to use the
repository root’s committed .vouch directory.


## Ship a feature branch

```bash
Expand Down
72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,85 @@ touch behavior.

## Dev setup

The Python package:

```bash
git clone https://github.com/vouchdev/vouch
cd vouch
python -m venv .venv && source .venv/bin/activate
pip install -e '.[dev]'
```

The web console under `webapp/` is a separate npm package (React +
Vite) and needs Node.js + npm:

```bash
cd webapp && npm install
```

You only need the npm step if you work on (or run) the console —
`make console` performs it automatically on first run.

## Running vouch in dev mode

The editable install puts a `vouch` entry point in `.venv/bin/` that runs
straight from `src/` — edit, re-run, no reinstall (`python -m vouch` is
equivalent).

vouch locates its KB the way git locates a repo: it walks up from the
current directory looking for `.vouch/`. Mind that this repo's root has a
**real, committed** `.vouch/` (vouch dogfoods itself) and every command
appends to its audit log, so point experiments at a scratch KB instead:
Comment on lines +93 to +96

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

limit the audit-log warning to writes.

“Every command appends to its audit log” overstates the documented invariant and may incorrectly suggest that read-only commands mutate history. Please describe writes or mutating commands instead.

proposed wording
- and every command appends to its audit log, so point experiments at a scratch KB instead:
+ and writes are recorded in its audit log, so point experiments at a scratch KB instead:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
vouch locates its KB the way git locates a repo: it walks up from the
current directory looking for `.vouch/`. Mind that this repo's root has a
**real, committed** `.vouch/` (vouch dogfoods itself) and every command
appends to its audit log, so point experiments at a scratch KB instead:
vouch locates its kb the way git locates a repo: it walks up from the
current directory looking for `.vouch/`. mind that this repo's root has a
**real, committed** `.vouch/` (vouch dogfoods itself) and writes are recorded
in its audit log, so point experiments at a scratch kb instead:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CONTRIBUTING.md` around lines 93 - 96, Update the audit-log statement in the
vouch knowledge-base guidance to say that writes or mutating commands append to
the audit log, rather than claiming every command does. Keep the surrounding
`.vouch/` discovery and scratch-KB warning unchanged.


```bash
mkdir /tmp/vouch-scratch && cd /tmp/vouch-scratch
vouch init # creates ./.vouch/ with a seeded starter KB
vouch status
```

`VOUCH_KB_PATH=/abs/path/.vouch` skips the walk and pins the KB
explicitly, wherever you run from.

Then pick the surface you're working on:

- **CLI** — run commands from the scratch dir; `vouch --help` lists them.
- **JSONL server** — the quickest way to hit the `kb.*` surface without
an agent host (see [docs/transports.md](docs/transports.md)):

```bash
echo '{"id":"r1","method":"kb.capabilities"}' \
| vouch serve --transport jsonl | jq '.result.methods | length'
```

- **MCP against a real agent** — register the venv binary so the agent
exercises your working tree:

```bash
claude mcp add vouch-dev -- /path/to/vouch/.venv/bin/vouch serve
```

- **HTTP + web console** — `make console` starts `vouch serve
--transport http` (127.0.0.1:8731) and the vouch-ui Vite dev server
(http://localhost:5173) as a pair; Ctrl-C stops both. Edits under
`webapp/src/` hot-reload. The backend serves the `.vouch/` discovered
from the cwd — set `VOUCH_KB_PATH` to serve a scratch KB instead of
the repo's own. To run the console alone against a backend you
started yourself: `cd webapp && npm run dev`, then enter the endpoint
in the connect dialog. `npm test` runs the vitest suite; `npm run
e2e` runs the playwright smoke test (needs `vouch` on PATH). See
[webapp/README.md](webapp/README.md) for the full script list.

Useful knobs while iterating:

- `VOUCH_AGENT=alice-example` — set the actor identity, e.g. two shells
with different values to exercise the proposer ≠ approver rule.
- `VOUCH_LOG_LEVEL=DEBUG` — verbose logs; see the environment-variable
table below for the other logging knobs.
- `make smoke-capture` / `make smoke-recall` — end-to-end checks of the
session capture and recall flows.

The dockerized end-to-end demo lives in [demo/](demo/README.md).

## The gate

`make check` is the same gate CI runs. The individual pieces:
Expand Down
Loading