Skip to content

plwslpld-arch/vouch

Repository files navigation

Vouch

Vouch

Your AI work-twin, living in your team chat. Vouch watches your IM group (Feishu · DingTalk · WeCom), picks up the tasks meant for you, turns them into finished work or ready-to-send drafts, and speaks in your voice — nothing goes out without your nod. When the task is code, every file, symbol, and line it hands you is verified against your real repo, so it never cites something that doesn't exist. BYO-key, read-only, human-in-the-loop.

License Node npm Runtime deps

English · 简体中文

What it does for you

It lives in your team chat and takes the busywork off your plate. You stay in control; it does the legwork.

  • Spots the tasks meant for you. Someone drops a "hey, can you…" in the group, it catches it and puts it in a confirm queue. It never acts on its own.
  • Actually does them. A task turns into something real — a code work order with references checked against your repo, or a requirements doc, design, API doc, or test plan.
  • Replies in your voice. It drafts in a range of tones (from 正经 to 含蓄阴阳), learned from how you actually write and what you've already decided. You tweak, approve, and it goes out as you.
  • Gets to know you. The more you use it, the better its read on your preferences, positions, and voice.
  • Sends you the digest. Timed summaries of what got done and what's still open.
  • Watches your machine, if you let it. An optional local daemon sees what you and your coding agents actually shipped, so work orders close themselves.

Nothing leaves the building — no key spent, no message sent, no branch pushed — until you say so.

Two ways to run it: the self-hosted assistant (web panel + your IM) for the full work-twin, or the vouch CLI for the code half — turn a task into a verified work order from your terminal.

Trust the code, not the docs. For code tasks the reference verifier is deterministic — no LLM, no API key. Every path/symbol/line is checked against the real repo, so nothing hallucinated ships.

Quickstart — the 30-second demo (no API key)

# Check the code references in a work order (or any {path,symbol,line} list) against a real repo.
npx @lapland/vouch verify ./work-order.md --repo .
# → ✓ src/upload.ts#handleUpload:42   ✓ src/limits.ts#RateLimiter:9
#   ✗ src/upload.ts#throttle  — symbol not DEFINED here (call site or wrong name)
#   ± src/queue.ts#drain:80   — wrong line — real definition is at line 58
#   3/5 references verified (60%)     ← exits non-zero, so it fails hallucinated docs in CI

verify and scope need no key — they're deterministic. plan uses your own LLM endpoint:

# Deterministic retrieval preview: what files/symbols/callers would ground the analysis?
npx @lapland/vouch scope "add a concurrency cap to the uploader" --repo .

# Full work order: retrieve → synthesize → verify → patch. BYO OpenAI-compatible key.
export VOUCH_BASE_URL=https://your-endpoint/v1  VOUCH_API_KEY=sk-...  VOUCH_MODEL=your-model
npx @lapland/vouch plan "add a concurrency cap to the uploader" --repo .

Needs Node ≥24 and git. ripgrep is used if present; otherwise Vouch falls back to git grep, then a pure-Node scan — it works anywhere.

How the engine works (fast and grounded)

  1. Deterministic retrieval (scope, no LLM): expands task concepts across Chinese/English synonyms → searches the repo → pulls whole function bodies + cross-file call sites + negative evidence ("searched the whole repo, this mechanism doesn't exist yet → must be built").
  2. Single-shot synthesis: one call to your model produces the work order (SPEC/BRIEF/STEPS), bounded so it stays fast even on slow reasoning models.
  3. Deterministic verify → patch: every cited {path, symbol, line} is checked against the real code; only the failures are re-fetched for one corrective pass. Worst case ≤ 2 model calls.
  4. Cite-or-abstain: references that still don't verify are surfaced inside the doc, never silently shipped.

The full agent (optional, self-hosted)

Beyond the CLI, Vouch is a complete, self-hosted, single-operator agent with a web panel:

  • Work orders — dry-run → detail (reference check / tokens / latency) → refine → export / send.
  • Confirm queue — tasks spotted from your team chat queue for your confirmation before any analysis.
  • Replies — draft replies in your voice across tones; you edit/approve; edits feed voice-learning.
  • Memory — learned preferences (with provenance), positions/standards distillation.
  • Summary — last 7/30 days: work orders, verify scores, spend/tokens/latency.
  • Executor (opt-in, advanced) — a network-denied sandbox proves a diff before any human-approved push.

Every outward action — spending your key, sending a message, pushing a branch — is gated behind an explicit click. The chat platform is a pluggable provider:

Provider "Send as you" Notes
local (default) generate-only No external service; you feed tasks in and copy drafts out
feishu (Lark) as you Per-user identity — replies truly go out authored by you
dingtalk (钉钉) on-behalf OAuth binds your account; the platform is app/robot-attributed, so sends are labeled 代你发
wecom (企业微信) on-behalf Same — OAuth identity, app-attributed send, clearly labeled on your behalf

The honest ceiling: only Feishu exposes true user-attributed send. On DingTalk/WeCom, even with a user OAuth token, the platforms don't let an app post as an arbitrary employee — so Vouch delivers on your behalf (clearly labeled), never faked as literally you. Adding a platform is one adapter behind the IMProvider interface; the engine doesn't change.

git clone https://github.com/plwslpld-arch/vouch && cd vouch
npm install
npm run build                      # compiles packages/* to dist/
cd web && npm install && npm run build && cd ..   # build the panel
cp .env.example .env               # edit PORT / VOUCH_PANEL_URL / VOUCH_IM_PROVIDER
npm run serve                      # serves the API + panel on $PORT

Open the panel, log in, paste your own LLM key (Vouch detects the models), pick a model, point it at the repos you want it to read, and go. To run it in production behind HTTPS and wire up DingTalk/WeCom OAuth, see DEPLOY.md.

Principles (hard constraints)

  • BYO key — every LLM call uses your key. Zero built-in keys. Keys are encrypted at rest.
  • Read-only — analysis reads from isolated, commit-pinned checkouts and never writes back.
  • Trust the code, not the docs — every reference passes the deterministic verifier.
  • Human-in-the-loop — no key is spent and no message is sent without an explicit approval.
  • Universal — no ripgrep required, no Feishu required, no native build (uses Node's built-in SQLite).

Architecture

packages/core       the code-aware engine — retrieve → synthesize → verify. Zero runtime deps.
packages/cli        `vouch` — verify / scope / plan
packages/providers  pluggable chat layer: local (default) + Feishu · DingTalk · WeCom
packages/agent      the full self-hosted app (SQLite via node:sqlite, Express API)
packages/executor   opt-in sandbox (bwrap → docker → refuse) + Ed25519 job envelopes
packages/daemon     optional local observer/executor daemon
web/                React + Vite + Tailwind panel

License

Apache-2.0. See PROVENANCE.md for the clean-room statement.

About

An AI teammate for your team chat (Feishu/DingTalk/WeCom): it picks up tasks, gets them done, and drafts replies in your voice — with a deterministic code-reference verifier as the trust layer. BYO-key, read-only, human-in-the-loop, self-hosted.

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages