-
Notifications
You must be signed in to change notification settings - Fork 64
Feat/compile #362
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
Merged
Merged
Feat/compile #362
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b675a0f
feat(compile): review-gated llm-wiki ingest pass with review-ui button
plind-junior 60a00b9
feat(compile): expose kb.compile on the mcp and jsonl surfaces
plind-junior dff7691
docs(readme): add the how-it-works demo video
plind-junior 8ace535
Merge remote-tracking branch 'origin/test' into feat/compile
plind-junior d19efce
fix(tests): freeze the proposal clock in the digest fixture
plind-junior File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # vouch compile — the llm-wiki ingest pass | ||
|
|
||
| `vouch compile` turns approved, cited claims into drafted **topic pages** and | ||
| files them as pending proposals. It is the "compile" in *stop re-deriving, | ||
| start compiling*: sessions and sources feed claims through the review gate; | ||
| compile distills those claims into the small, durable wiki a future agent (or | ||
| human) reads first. | ||
|
|
||
| ``` | ||
| sessions / sources claims topic pages | ||
| ───────────────────▶ gate ───────────▶ compile ───────────▶ gate ──▶ wiki | ||
| (capture) (approve) (LLM drafts) (approve) | ||
| ``` | ||
|
|
||
| ## Setup | ||
|
|
||
| Compile needs a deployment-configured LLM command in `.vouch/config.yaml`: | ||
|
|
||
| ```yaml | ||
| compile: | ||
| llm_cmd: "claude -p --model sonnet" # reads prompt on stdin, prints JSON | ||
| max_pages: 5 # optional, default 5 | ||
| timeout_seconds: 180 # optional, default 180 | ||
| ``` | ||
|
|
||
| vouch ships no model dependency; any command that reads a prompt on stdin and | ||
| prints JSON on stdout works. | ||
|
|
||
| ## Run it | ||
|
|
||
| ```bash | ||
| vouch compile # draft pages, file as pending proposals | ||
| vouch compile --dry-run # show what would be drafted, file nothing | ||
| vouch compile --json # machine-readable report | ||
| vouch review # the human half: approve / reject each draft | ||
| ``` | ||
|
|
||
| Or click **compile wiki** in the review UI (`vouch review-ui`) — the button | ||
| appears once `compile.llm_cmd` is configured, and the drafts land in the same | ||
| queue, marked `by wiki-compiler`. | ||
|
|
||
| ## What the validator enforces | ||
|
|
||
| Drafts are LLM prose, so every citation is verified mechanically before a | ||
| proposal is filed. A draft is dropped (and reported) when: | ||
|
|
||
| - it lists a claim id that doesn't exist or is retracted, | ||
| - its body cites `[claim: x]` for a claim it doesn't list, | ||
| - it cites no claims at all, | ||
| - a `[[wikilink]]` doesn't resolve to an existing page or a *surviving* page | ||
| in the same batch (drops cascade: if a linked sibling is dropped, the | ||
| linking draft drops too rather than shipping a dangling link), | ||
| - its title collides with an existing page or a page draft already pending | ||
| review (`approve()` would route a colliding id through `update_page` and | ||
| silently overwrite — so collisions never reach the queue; this also makes | ||
| re-running compile idempotent instead of queueing duplicates), | ||
| - its type is `session` or `log` (raw material, not topics), | ||
| - it exceeds `max_pages`. | ||
|
|
||
| The compiler proposes; it never approves. Proposals are filed by the | ||
| `wiki-compiler` actor (or `VOUCH_AGENT` when set), so under the default gate | ||
| the reviewing human is always a different actor and self-approval stays | ||
| impossible. Each non-dry run appends a `compile.run` audit event attributed | ||
| to whoever triggered it (CLI user, or the review-ui token label), with the | ||
| filed proposal ids. | ||
|
|
||
| The review UI runs one compile at a time per KB; a second click while one is | ||
| running comes back with a "already running" notice instead of stacking LLM | ||
| runs. | ||
|
|
||
| ## Current limits | ||
|
|
||
| - **Creates only.** Compiled *updates* to existing pages are a future | ||
| feature; today a colliding draft is dropped at validation (see above) and | ||
| the prompt tells the compiler to skip taken topics. | ||
| - One pass over the whole KB. Compile inlines all live claims into the | ||
| prompt; very large KBs will want an incremental "since last compile" mode. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,6 +72,7 @@ | |
| "kb.provenance_rebuild", | ||
| "kb.detect_themes", | ||
| "kb.propose_theme", | ||
| "kb.compile", | ||
| ] | ||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Label the ASCII diagram fence as text.
The unlabeled fence triggers markdownlint MD040. Mark it as
textso the diagram stays valid markdown without lint noise.💡 Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 9-9: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Source: Linters/SAST tools