Skip to content

docs: add tutorials, host-comms walkthrough, one-line mcp install#295

Merged
plind-junior merged 1 commit into
vouchdev:testfrom
dripsmvcp:docs/tutorials-and-host-comms
Jun 30, 2026
Merged

docs: add tutorials, host-comms walkthrough, one-line mcp install#295
plind-junior merged 1 commit into
vouchdev:testfrom
dripsmvcp:docs/tutorials-and-host-comms

Conversation

@dripsmvcp

@dripsmvcp dripsmvcp commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What changed

adds a docs/tutorials/ set — an index plus four diátaxis walkthroughs
(build your first knowledge base, give a coding agent a reviewed memory,
share a kb via bundles, edit a kb in obsidian) — and features the native
one-line wire-up claude mcp add vouch -- vouch serve in getting-started
step 6. also adds a "how a host talks to vouch" section to
docs/transports.md describing the stdio mcp path end to end (spawn →
handshake → tool call → review gate → _meta sidebars → server-to-client
push), and corrects the read-sidebar note in CLAUDE.md.

Why

there was no learning-oriented on-ramp: getting-started is a reference
quickstart, not a walkthrough. the tutorials take a reader from zero to a
working outcome, and every command in them was run end-to-end against the
cli first, so they only document verified behaviour — including the real
forbidden_self_approval review gate and the actual proposal id shape.

the install docs led with vouch install-mcp claude-code (writes config
files) and never mentioned that vouch serve is already a stdio mcp
server, so claude mcp add vouch -- vouch serve works directly. that
one-liner is now the headline path, with install-mcp kept as the richer
option.

the CLAUDE.md fix is a correctness one: it told contributors that read
methods attach _meta.vouch_hot_memory from hot_memory.py. grep-verified
against the tree, the per-tool read sidebar is actually
_meta.vouch_salience (salience.py, attached by kb_context);
vouch_hot_memory is written only by the openclaw context engine's
assemble().

What might break

nothing. docs-only plus one comment-style correction in CLAUDE.md. no
file moves, no on-disk field changes, no kb.* behaviour changes. users
with an existing .vouch/ are unaffected.

VEP

not a surface change — no VEP needed.

Tests

  • docs-only: nothing under src/ changed, so the mypy/pytest gate is
    unaffected; every documented command was verified end-to-end against
    the live cli before it went in
  • new / changed behaviour has a test — n/a (no behaviour change)
  • CHANGELOG.md updated — skipped; docs-only, no user-facing surface
    change

Summary by CodeRabbit

  • Documentation
    • Refreshed “wire an agent” setup to clearly explain vouch serve as a stdio MCP server, including native registration via claude mcp add vouch -- vouch serve and agent attribution via VOUCH_AGENT.
    • Added an end-to-end MCP (stdio) transport section documenting the initialize/handshake flow, proposal→approval durability, and how approval gating affects outcomes.
    • Added and expanded tutorials for creating a first knowledge base, connecting a coding agent, syncing with Obsidian, and sharing KBs via portable bundles, with improved review-gate, provenance, troubleshooting, and next-step guidance.

@github-actions github-actions Bot added docs documentation, specs, examples, and repo guidance size: XS less than 50 changed non-doc lines labels Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds documentation for MCP transport and agent wiring, plus a tutorials landing page and four tutorial guides covering KB setup, agent integration, sharing, and Obsidian-based editing.

Changes

Documentation expansion

Layer / File(s) Summary
CLAUDE.md and getting-started.md clarifications
CLAUDE.md, docs/getting-started.md
CLAUDE.md now references _meta.vouch_salience instead of _meta.vouch_hot_memory. getting-started.md expands the wire-an-agent section with stdio clarification, vouch install-mcp command, and VOUCH_AGENT attribution guidance.
MCP stdio end-to-end flow documentation
docs/transports.md
New subsection documents the full MCP stdio lifecycle: spawn, initialize/tools listing, kb_propose_claim/kb_approve calls, JSON-RPC framing, identity via VOUCH_AGENT, provenance metadata, server-push via kb_session_start, and error surfacing.
Tutorials landing README
docs/tutorials/README.md
Creates the tutorials index with format description, shipped tutorial listing, roadmap items, contribution guidance, and related documentation links.
Tutorial: first knowledge base
docs/tutorials/first-knowledge-base.md
Step-by-step tutorial covering install/init, source registration, claim proposal, review-gate approval, recall modes, provenance tracing, git commit, and lifecycle commands.
Tutorial: connect a coding agent
docs/tutorials/connect-coding-agent.md
Tutorial covering MCP wiring, connection verification, ambient capture into a pending queue, human review gate, optional session batching, habits summary, and troubleshooting.
Tutorial: share a knowledge base
docs/tutorials/share-a-knowledge-base.md
Tutorial covering export, integrity checks, preview/apply import, review gate metrics and stats, operational guidance, and troubleshooting.
Tutorial: edit in Obsidian
docs/tutorials/edit-in-obsidian.md
Tutorial covering vault mirroring, proposal generation from edits, review actions, and troubleshooting common sync mistakes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐇 Hop, hop — the docs grew bright and wide,
A map for every KB stride.
From stdio wires to vaults that sing,
Reviewed facts now take wing.
The rabbit nods: “Carry on,
with salience, sync, and tutorials on!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main docs additions: new tutorials, the host-comms walkthrough, and the one-line MCP install guidance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
docs/transports.md (1)

56-70: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a language specifier to the diagram code block.

The ASCII diagram block triggers a markdownlint warning (MD040) because it lacks a language tag. Add text to the fence:

- ```
+ ```text
  host (e.g. Claude Code)                     vouch serve (child process)
🤖 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 `@docs/transports.md` around lines 56 - 70, The diagram fence in the transport
documentation is missing a language tag, which triggers the markdownlint MD040
warning. Update the code block around the ASCII transport diagram to use the
same fence with a text specifier so the block is explicitly marked as plain
text. Keep the diagram content unchanged and ensure the fix is applied in the
documentation section containing the host/vouch serve flow.

Source: Linters/SAST tools

docs/getting-started.md (1)

104-113: 📐 Maintainability & Code Quality | 🔵 Trivial

Clarify where the -e VOUCH_AGENT flag belongs.

The instruction says to "Add -e VOUCH_AGENT=claude-code" but doesn't show the complete command. Readers may be unsure whether the flag goes on claude mcp add or on vouch serve itself.

Show the full command, e.g.:

claude mcp add vouch --env VOUCH_AGENT=claude-code -- vouch serve

Or, if -e is indeed the correct short flag for Claude's CLI:

claude mcp add -e VOUCH_AGENT=claude-code vouch -- vouch serve
🤖 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 `@docs/getting-started.md` around lines 104 - 113, The `vouch serve` setup
instructions are ambiguous about where the `VOUCH_AGENT` environment flag
belongs; update the getting-started command in the registration example so the
full `claude mcp add` invocation clearly shows the flag in the correct place
alongside `vouch serve`, and keep the surrounding explanation aligned with that
exact command.
docs/tutorials/edit-in-obsidian.md (1)

87-89: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Clarify why the proposer is vault-sync.

The tutorial states the proposal is "by vault-sync" without explaining where that actor name comes from. Consider adding a brief note that vouch sync sets VOUCH_AGENT=vault-sync (or however the actor is determined) so readers understand why the gate is satisfied by their approval.

  • 20260630-074121-a44eb574  [page]  by vault-sync
      Edit in Obsidian

+> vault-sync is the default actor for forward-sync proposals, so your human
+> approval satisfies the self-approval gate.


<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/tutorials/edit-in-obsidian.md around lines 87 - 89, Clarify the “by
vault-sync” proposer label in the Edit in Obsidian tutorial by explaining where
that actor name comes from and how the approval gate is satisfied. Update the
surrounding prose in the tutorial section that mentions the forward-sync
proposal so it references the actor selection used by vouch sync (for example,
that it sets VOUCH_AGENT to vault-sync or otherwise uses vault-sync as the
default actor), and keep the note near the proposal example so readers can
connect the label to their own approval.


</details>

<!-- cr-comment:v1:e9698ca3fc0175d72cfc346b -->

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @docs/getting-started.md:

  • Around line 104-113: The vouch serve setup instructions are ambiguous about
    where the VOUCH_AGENT environment flag belongs; update the getting-started
    command in the registration example so the full claude mcp add invocation
    clearly shows the flag in the correct place alongside vouch serve, and keep
    the surrounding explanation aligned with that exact command.

In @docs/transports.md:

  • Around line 56-70: The diagram fence in the transport documentation is missing
    a language tag, which triggers the markdownlint MD040 warning. Update the code
    block around the ASCII transport diagram to use the same fence with a text
    specifier so the block is explicitly marked as plain text. Keep the diagram
    content unchanged and ensure the fix is applied in the documentation section
    containing the host/vouch serve flow.

In @docs/tutorials/edit-in-obsidian.md:

  • Around line 87-89: Clarify the “by vault-sync” proposer label in the Edit in
    Obsidian tutorial by explaining where that actor name comes from and how the
    approval gate is satisfied. Update the surrounding prose in the tutorial section
    that mentions the forward-sync proposal so it references the actor selection
    used by vouch sync (for example, that it sets VOUCH_AGENT to vault-sync or
    otherwise uses vault-sync as the default actor), and keep the note near the
    proposal example so readers can connect the label to their own approval.

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: defaults

**Review profile**: CHILL

**Plan**: Pro Plus

**Run ID**: `d9d74cc7-11fd-44a0-91f2-af53f0d2c6f8`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 94e84b145aa4b1764b720fe1583cd2804a3ddd3a and 0dca8bb2778a992d66ffaf942bba0b3b922c6645.

</details>

<details>
<summary>📒 Files selected for processing (8)</summary>

* `CLAUDE.md`
* `docs/getting-started.md`
* `docs/transports.md`
* `docs/tutorials/README.md`
* `docs/tutorials/connect-coding-agent.md`
* `docs/tutorials/edit-in-obsidian.md`
* `docs/tutorials/first-knowledge-base.md`
* `docs/tutorials/share-a-knowledge-base.md`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

add docs/tutorials/ — an index plus four diátaxis walkthroughs (build your
first knowledge base, give a coding agent a reviewed memory, share a kb via
bundles, edit a kb in obsidian). every command was run end-to-end against
the cli before it went in, so the walkthroughs only cover verified
behaviour (including the real forbidden_self_approval review gate).

feature the native one-line wire-up `claude mcp add vouch -- vouch serve`
in getting-started step 6, and add a "how a host talks to vouch" section to
docs/transports.md describing the stdio mcp path end to end — spawn,
handshake, tool call, review gate, _meta sidebars, server-to-client push.

fix the read-sidebar guidance in claude.md: the per-tool read sidebar is
_meta.vouch_salience (salience.py, attached by kb_context), not
vouch_hot_memory — that key is written only by the openclaw context
engine's assemble().
@dripsmvcp dripsmvcp force-pushed the docs/tutorials-and-host-comms branch from 0dca8bb to 8ac0775 Compare June 30, 2026 09:21
@dripsmvcp dripsmvcp changed the base branch from main to test June 30, 2026 09:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with 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.

Inline comments:
In `@docs/tutorials/first-knowledge-base.md`:
- Around line 186-245: The `vouch context` and `vouch synthesize` examples in
`first-knowledge-base` are out of date, so update the tutorial to match the
current CLI schema. In the `context` walkthrough, adjust the example output to
include the current `query` and `quality` fields and add each item’s `type`,
`score`, and `freshness`; in the `synthesize` section, either show the current
full answer structure or clearly label the snippet as intentionally abbreviated.
Use the existing `vouch context` and `vouch synthesize` headings to locate the
affected examples and keep the surrounding narrative consistent with the updated
response shapes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6af1b40c-61d5-4a3c-940c-356d51f1de99

📥 Commits

Reviewing files that changed from the base of the PR and between 0dca8bb and 8ac0775.

📒 Files selected for processing (8)
  • CLAUDE.md
  • docs/getting-started.md
  • docs/transports.md
  • docs/tutorials/README.md
  • docs/tutorials/connect-coding-agent.md
  • docs/tutorials/edit-in-obsidian.md
  • docs/tutorials/first-knowledge-base.md
  • docs/tutorials/share-a-knowledge-base.md
✅ Files skipped from review due to trivial changes (2)
  • docs/getting-started.md
  • CLAUDE.md

Comment on lines +186 to +245
```bash
vouch context "how does auth work"
```

```json
{
"backend": "fts5",
"items": [
{
"id": "auth-uses-jwts-in-the-authorization-header",
"summary": "Auth uses JWTs in the Authorization header.",
"citations": ["532e2b4d95c9dd17aa1c0feed366746ca47e40e4cb8e8582f3677b0931b55d70"]
}
]
}
```

**A cited synthesis** — a direct answer built only from approved claims, with
inline citation markers:

```bash
vouch synthesize "how does auth work"
```

```json
{
"answer": "Auth uses JWTs in the Authorization header [auth-uses-jwts-in-the-authorization-header].",
"claims": ["auth-uses-jwts-in-the-authorization-header"]
}
```

`synthesize` never invents — if the KB doesn't have it, the answer says so.
Every sentence traces back to a claim that went through the gate.

## 7. Trace the provenance

Because every write is an event, you can always answer "why does this claim
exist, and who put it there?"

```bash
vouch why auth-uses-jwts-in-the-authorization-header
```

```
why auth-uses-jwts-in-the-authorization-header (claim)
approvedBy -> … (event) [2026-06-30T07:39:17Z]
cites -> 532e2b4d… (source) [2026-06-30T07:39:17Z]
```

```bash
vouch audit
```

```
… proposal.claim.create by a objects=['20260630-073841-d722ac24']
… proposal.claim.approve by alice-reviewer objects=['20260630-073841-d722ac24', 'auth-uses-jwts-…']
```

The audit log is the authoritative history: who proposed, who approved, when,
and citing what. It's append-only and committed alongside the claims.

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# This requires a vouch KB with approved claims; run in a test environment with KB
vouch context --help 2>/dev/null | head -5
vouch synthesize --help 2>/dev/null | head -5
vouch why --help 2>/dev/null | head -5
vouch audit --help 2>/dev/null | head -5

Repository: vouchdev/vouch

Length of output: 152


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== shell log =="
sed -n '1,200p' /tmp/coderabbit-shell-logs/shell-output-odKE9Z

echo
echo "== docs/tutorials/first-knowledge-base.md around cited lines =="
nl -ba docs/tutorials/first-knowledge-base.md | sed -n '170,260p'

echo
echo "== search for command names and output format docs =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/.git/**' \
  'vouch (context|synthesize|why|audit)|approvedBy ->|proposal\.claim\.approve|backend": "fts5"|claims": \[' \
  .

Repository: vouchdev/vouch

Length of output: 273


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== log file =="
sed -n '1,200p' /tmp/coderabbit-shell-logs/shell-output-SwOLzK

echo
echo "== docs slice =="
awk 'NR>=170 && NR<=260 {printf "%5d  %s\n", NR, $0}' docs/tutorials/first-knowledge-base.md

echo
echo "== command/search hits =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/.git/**' \
  'vouch (context|synthesize|why|audit)|approvedBy ->|proposal\.claim\.approve|backend": "fts5"|claims": \[' \
  .

Repository: vouchdev/vouch

Length of output: 13993


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== log file =="
sed -n '1,200p' /tmp/coderabbit-shell-logs/shell-output-SwOLzK || true

echo
echo "== docs slice =="
python3 - <<'PY'
from pathlib import Path
p = Path("docs/tutorials/first-knowledge-base.md")
for i, line in enumerate(p.read_text().splitlines(), 1):
    if 170 <= i <= 260:
        print(f"{i:5d}  {line}")
PY

echo
echo "== command/search hits =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/.git/**' \
  'vouch (context|synthesize|why|audit)|approvedBy ->|proposal\.claim\.approve|backend": "fts5"|claims": \[' \
  .

Repository: vouchdev/vouch

Length of output: 13993


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n --hidden --glob '!**/node_modules/**' --glob '!**/.git/**' \
  'context|synthesize|why|audit|approvedBy|proposal\.claim\.approve|proposal\.claim\.create|backend' \
  cmd internal pkg docs .

Repository: vouchdev/vouch

Length of output: 50371


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== docs/example-session.md relevant slice =="
python3 - <<'PY'
from pathlib import Path
p = Path("docs/example-session.md")
for i, line in enumerate(p.read_text().splitlines(), 1):
    if 120 <= i <= 170:
        print(f"{i:5d}  {line}")
PY

echo
echo "== docs/retrieval.md relevant slice =="
python3 - <<'PY'
from pathlib import Path
p = Path("docs/retrieval.md")
for i, line in enumerate(p.read_text().splitlines(), 1):
    if 35 <= i <= 110:
        print(f"{i:5d}  {line}")
PY

echo
echo "== docs/provenance.md relevant slice =="
python3 - <<'PY'
from pathlib import Path
p = Path("docs/provenance.md")
for i, line in enumerate(p.read_text().splitlines(), 1):
    if 35 <= i <= 60:
        print(f"{i:5d}  {line}")
PY

echo
echo "== CLI/doc references for why/audit/context formatting =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/.git/**' \
  'ContextPack dict|always emit JSON|vouch context|vouch synthesize|vouch why|vouch audit|returns: "Dict \{backend|print.*audit|tree grouped by edge' \
  src docs examples desktop/src/shared/methods.gen.ts

Repository: vouchdev/vouch

Length of output: 11366


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== docs/example-session.md relevant slice =="
python3 - <<'PY'
from pathlib import Path
p = Path("docs/example-session.md")
for i, line in enumerate(p.read_text().splitlines(), 1):
    if 120 <= i <= 170:
        print(f"{i:5d}  {line}")
PY

echo
echo "== docs/retrieval.md relevant slice =="
python3 - <<'PY'
from pathlib import Path
p = Path("docs/retrieval.md")
for i, line in enumerate(p.read_text().splitlines(), 1):
    if 35 <= i <= 110:
        print(f"{i:5d}  {line}")
PY

echo
echo "== docs/provenance.md relevant slice =="
python3 - <<'PY'
from pathlib import Path
p = Path("docs/provenance.md")
for i, line in enumerate(p.read_text().splitlines(), 1):
    if 35 <= i <= 60:
        print(f"{i:5d}  {line}")
PY

echo
echo "== CLI/doc references for why/audit/context formatting =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/.git/**' \
  'ContextPack dict|always emit JSON|vouch context|vouch synthesize|vouch why|vouch audit|returns: "Dict \{backend|tree grouped by edge' \
  src docs examples desktop/src/shared/methods.gen.ts

Repository: vouchdev/vouch

Length of output: 11225


Align the vouch context and vouch synthesize examples with the current CLI schema

The tutorial’s context output is stale: current results include query and quality, and each item carries type, score, and freshness. The synthesize example should also match the current answer format, or be labeled as intentionally abbreviated.

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 229-229: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 239-239: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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 `@docs/tutorials/first-knowledge-base.md` around lines 186 - 245, The `vouch
context` and `vouch synthesize` examples in `first-knowledge-base` are out of
date, so update the tutorial to match the current CLI schema. In the `context`
walkthrough, adjust the example output to include the current `query` and
`quality` fields and add each item’s `type`, `score`, and `freshness`; in the
`synthesize` section, either show the current full answer structure or clearly
label the snippet as intentionally abbreviated. Use the existing `vouch context`
and `vouch synthesize` headings to locate the affected examples and keep the
surrounding narrative consistent with the updated response shapes.

@dripsmvcp

Copy link
Copy Markdown
Contributor Author

@plind-junior Would you review this PR? I confirmed all the features working

@plind-junior plind-junior added enhancement New feature or request refactor labels Jun 30, 2026
@plind-junior

plind-junior commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Love it! Did you also check if desktop version is fully compatible with vouch?

@plind-junior plind-junior merged commit 3e8df7e into vouchdev:test Jun 30, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs documentation, specs, examples, and repo guidance enhancement New feature or request refactor size: XS less than 50 changed non-doc lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants