|
| 1 | +# coven-github Design |
| 2 | + |
| 3 | +`coven-github` is a thin GitHub ingress layer for trusted familiar work. It should not become a generic agent platform inside the GitHub App. The GitHub App accepts repository events, routes them to the right familiar, records task state, and keeps humans in control through Cave oversight. |
| 4 | + |
| 5 | +## Design Goal |
| 6 | + |
| 7 | +Assign GitHub work to a known familiar and get a draft PR back with visible context, evidence, and an oversight path. |
| 8 | + |
| 9 | +The core design constraint is trust continuity: |
| 10 | + |
| 11 | +- The same familiar can return to the same repository with memory and team context. |
| 12 | +- The team can see what the familiar used, changed, tested, and could not decide. |
| 13 | +- The service can fail transparently without losing task state. |
| 14 | +- The open-source adapter remains self-hostable so buyers can inspect the trust boundary. |
| 15 | + |
| 16 | +## Task Flow |
| 17 | + |
| 18 | +```text |
| 19 | +GitHub event |
| 20 | + -> webhook HMAC validation |
| 21 | + -> event parsing and familiar routing |
| 22 | + -> task record and queue |
| 23 | + -> worker starts isolated session |
| 24 | + -> coven-code --headless receives session brief |
| 25 | + -> familiar drafts changes and result envelope |
| 26 | + -> GitHub Check Run and PR are updated |
| 27 | + -> Cave Board and session link expose oversight |
| 28 | +``` |
| 29 | + |
| 30 | +## Routing Model |
| 31 | + |
| 32 | +The initial self-hosted adapter uses TOML familiar config: |
| 33 | + |
| 34 | +- `bot_username` routes issue assignment and mentions. |
| 35 | +- `trigger_labels` route issue labels such as `coven:fix`. |
| 36 | +- `skills` and `model` shape the familiar runtime. |
| 37 | + |
| 38 | +Hosted routing should move this into installation-scoped configuration: |
| 39 | + |
| 40 | +- installation id, |
| 41 | +- organization, |
| 42 | +- repository, |
| 43 | +- familiar id, |
| 44 | +- allowed trigger labels, |
| 45 | +- memory scope, |
| 46 | +- skill pack, |
| 47 | +- model route, |
| 48 | +- autonomy tier. |
| 49 | + |
| 50 | +## Cave Oversight Gate |
| 51 | + |
| 52 | +Cave oversight is the control plane. It should show: |
| 53 | + |
| 54 | +- task status and terminal state, |
| 55 | +- familiar identity, |
| 56 | +- repository and issue/PR links, |
| 57 | +- Check Run link, |
| 58 | +- session link, |
| 59 | +- context and memory scope used, |
| 60 | +- evidence collected, |
| 61 | +- human decision points. |
| 62 | + |
| 63 | +Draft PRs are the default. The team should promote more autonomy only after the familiar earns trust through repeated visible work. |
| 64 | + |
| 65 | +## Operational Pattern |
| 66 | + |
| 67 | +ClawSweeper is the reference pattern for conservative GitHub automation inside the OpenClaw ecosystem: narrow promises, durable state, marker-backed comments edited in place, explicit maintainer commands, and deterministic gates before repair or merge work. |
| 68 | + |
| 69 | +`coven-github` should borrow the operating style without becoming the same product: |
| 70 | + |
| 71 | +- Keep one visible status surface per task instead of noisy repeated comments. |
| 72 | +- Treat maintainer commands as clear steering inputs, not casual chat. |
| 73 | +- Store durable task records before worker execution starts. |
| 74 | +- Re-check live GitHub state immediately before every mutation. |
| 75 | +- Prefer proposal, draft PR, and Cave approval loops before any higher-autonomy behavior. |
| 76 | +- Make status, evidence, and next action obvious to reviewers who never open Cave. |
| 77 | + |
| 78 | +The familiar layer adds the moat: a known teammate with repo and team context. The ClawSweeper pattern supplies the operational discipline that makes that familiar safe to trust. |
| 79 | + |
| 80 | +## Trust Boundaries |
| 81 | + |
| 82 | +| Boundary | Rule | |
| 83 | +|---|---| |
| 84 | +| Webhook ingress | Validate HMAC before parsing or routing. | |
| 85 | +| Tenant data | Scope task state by GitHub installation before hosted launch. | |
| 86 | +| Worker execution | Run each task with a timeout and isolated workspace. | |
| 87 | +| Git auth | Use installation tokens, not user credentials. | |
| 88 | +| Memory | Make familiar memory opt-in, inspectable, and revocable. | |
| 89 | +| Comments | Ignore familiar bot self-comments to avoid loops. | |
| 90 | +| Output | Prefer draft PRs and explicit failure states. | |
| 91 | + |
| 92 | +## Hosted Reliability Requirements |
| 93 | + |
| 94 | +Hosted `coven-github` needs these before paid beta: |
| 95 | + |
| 96 | +1. Durable queue. |
| 97 | +2. Persistent task store. |
| 98 | +3. GitHub delivery idempotency. |
| 99 | +4. Tenant-scoped task API auth. |
| 100 | +5. Installation-scoped familiar routing. |
| 101 | +6. Worker isolation and timeout enforcement. |
| 102 | +7. Audit events for accepted, started, retried, timed out, failed, needs input, PR opened, and completed. |
| 103 | + |
| 104 | +## Why This Design Monetizes |
| 105 | + |
| 106 | +The paid product is not "an agent that can write code." The paid product is a managed trust pipeline: |
| 107 | + |
| 108 | +- Teams keep familiar context instead of re-explaining their standards. |
| 109 | +- Managers get visibility instead of hidden automation. |
| 110 | +- Security reviewers get a self-host path and a clear credential boundary. |
| 111 | +- Engineers get PRs from a known actor with a history. |
| 112 | + |
| 113 | +That is what generic GitHub bots and one-shot coding agents do not provide. |
0 commit comments