feat: ClawSweeper-style reference demo of the operating loop (#19) - #40
Merged
Conversation
…op (#19) Replay the full ClawSweeper-style loop against the real adapter binary with an in-memory GitHub API stub and a headless-contract-conformant fake coven-code runtime: issue assignment -> Check Run -> edited-in-place status comment -> familiar-voice draft PR, plus maintainer steering (status, retry, unknown-verb clarification), the write-access permission gate, casual-mention and self-comment suppression, and a per-token-role audit trail. Every property is asserted programmatically; a green exit proves the loop. Signed-off-by: Val Alexander <bunsthedev@gmail.com>
Signed-off-by: Val Alexander <bunsthedev@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a runnable reference demo (ClawSweeper-style) that exercises the end-to-end “operating loop” using the real coven-github serve binary, driven by signed webhook deliveries against a local in-memory GitHub API stub, and documents how to run and interpret it.
Changes:
- Add
examples/demo/run-demo.shto orchestrate a full local loop run with assertions against recorded stub state. - Add
examples/demo/github-stub.pyandexamples/demo/fake-coven-codeto provide an in-memory GitHub API and a headless-contract-v2-conformant runtime stand-in. - Document and link the demo from
README.mdand add a narrated walkthrough indocs/demo.md.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Links the new demo and marks the operating-loop reference demo as implemented. |
| examples/demo/run-demo.sh | Orchestrates the demo run (builds, starts services, replays signed webhooks, asserts outcomes). |
| examples/demo/github-stub.py | Implements an in-memory GitHub API surface plus audit/state endpoints for assertions. |
| examples/demo/fake-coven-code | Implements a contract-v2 stand-in runtime that validates tokenless brief + env-only git token. |
| docs/demo.md | Provides a narrated, act-by-act walkthrough plus requirements for running the demo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+39
to
+43
| **Want to see the whole loop run?** `examples/demo/run-demo.sh` drives the | ||
| real adapter through the full operating loop — issue assignment, Check Run, | ||
| edited-in-place status comment, maintainer steering commands, permission | ||
| gate, familiar-voice draft PR — offline and self-verifying in about a minute. | ||
| [docs/demo.md](docs/demo.md) narrates it. |
| | Label trigger | Implemented | Routes configured `trigger_labels` such as `coven:fix`. | | ||
| | Maintainer command protocol | Implemented | Typed `@familiar <verb>` grammar; casual mentions ignored; write-access gate; self-comments never re-trigger. | | ||
| | Marker-backed status comments | Implemented | One edited-in-place status surface per issue/PR; no duplicate bot comments. | | ||
| | Reference demo of the operating loop | Implemented | Offline, self-verifying replay of the full loop with a real adapter binary — see [docs/demo.md](docs/demo.md). | |
Comment on lines
+3
to
+7
| This is the ClawSweeper-style reference demo of the coven-github operating | ||
| loop (issue #19): the **real adapter binary**, driven by signed webhook | ||
| deliveries, publishing to an in-memory GitHub API stub through a | ||
| contract-conformant fake `coven-code` runtime. No network, no GitHub App | ||
| registration, no credentials — one command, about a minute, self-verifying. |
Comment on lines
+65
to
+66
| **Act 5 — steering: `status`.** Answered from the durable task store (the same | ||
| state Cave polls), listing the issue's tasks and their lifecycle states. |
Comment on lines
+114
to
+116
| `cargo`, `python3` (stdlib only), `openssl`, `curl`. The script builds the | ||
| adapter with `cargo build -p coven-github`, picks free ports, and cleans up | ||
| after itself (scratch dir is kept on failure, or with `KEEP=1`). |
Comment on lines
+55
to
+56
| for dep in cargo python3 openssl curl; do | ||
| command -v "$dep" >/dev/null || { echo "error: $dep is required" >&2; exit 64; } |
Comment on lines
+187
to
+206
| issue_comment_payload() { # $1=commenter login $2=comment body | ||
| cat <<EOF | ||
| { | ||
| "action": "created", | ||
| "issue": { | ||
| "number": $ISSUE, | ||
| "title": "$ISSUE_TITLE", | ||
| "body": "$ISSUE_BODY", | ||
| "user": { "login": "$MAINTAINER" } | ||
| }, | ||
| "comment": { "body": "$2", "user": { "login": "$1" } }, | ||
| "repository": { | ||
| "name": "$REPO_NAME", | ||
| "owner": { "login": "$REPO_OWNER" } | ||
| }, | ||
| "installation": { "id": $INSTALLATION_ID }, | ||
| "sender": { "login": "$1" } | ||
| } | ||
| EOF | ||
| } |
Comment on lines
+109
to
+112
| def _actor(self): | ||
| auth = self.headers.get("Authorization", "") | ||
| token = auth.removeprefix("Bearer ").strip() | ||
| return WORLD.tokens.get(token, "app-jwt") |
Comment on lines
+43
to
+49
| "tests_run": [ | ||
| { | ||
| "command": "cargo test -p auth refresh", | ||
| "status": "passed", | ||
| "output_summary": "9/9 passing", | ||
| } | ||
| ], |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #19 — the last link on the Wave 1 critical path (
#2 → #4 → #10 → #13 → #19).What this is
A runnable, offline, self-verifying reference demo of the full operating loop, driving the real
coven-github servebinary — no network, no GitHub App registration, no credentials:How it works
examples/demo/run-demo.shexamples/demo/github-stub.pyexamples/demo/fake-coven-codeCOVEN_GIT_TOKENdocs/demo.mdWhat the acts prove (all asserted, not eyeballed)
@cody status→ answered from the durable task store (the state Cave polls)retry→ declined pre-flight at the permission gate; no Check Run, no session spentretry→ full re-run; still exactly one status commentClosing surfaces: the per-token-role audit trail and
GET /api/github/tasks(the Cave oversight view). Cave intervention from the dashboard is honestly scoped to #18 in the doc.Verification
examples/demo/run-demo.sh→ exit 0, 18/18 assertions green (run twice, including the cleanup path)cargo check --all-targets,cargo clippy --all-targets -- -D warnings,cargo test --all— green (no Rust changes)