-
Notifications
You must be signed in to change notification settings - Fork 60
docs(contributing): document running vouch and the webapp in dev mode #462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| ```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: | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
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_PATHselects a kb; it does not create one.As written, the parenthetical makes
VOUCH_KB_PATHsound like an alternative to initializing a scratch KB. Point it at an existing initialized.vouchdirectory instead.proposed wording
📝 Committable suggestion
🤖 Prompt for AI Agents