Skip to content

Commit cbecb76

Browse files
committed
docs: add github architecture diagrams
1 parent 86e22e2 commit cbecb76

6 files changed

Lines changed: 345 additions & 37 deletions

File tree

COVEN-GITHUB.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
A GitHub App that turns any Coven-configured familiar into a first-class GitHub coding agent. Assign an issue to `@cody` (or any familiar bot user), and the familiar plans, edits, commits, and opens a pull request — with live oversight in CovenCave and no black-box model lock-in.
1111

12+
For the GitHub-rendered system diagrams that explain this repo at a glance, see [docs/architecture.md](docs/architecture.md).
13+
1214
---
1315

1416
## Problem
@@ -43,7 +45,29 @@ Mixing these creates a monolith that is hard to test, deploy, and reason about.
4345

4446
### Session Lifecycle
4547

48+
```mermaid
49+
sequenceDiagram
50+
participant GitHub
51+
participant Webhook as coven-github webhook
52+
participant Worker as coven-github worker
53+
participant Runtime as coven-code headless
54+
participant Cave as CovenCave
55+
56+
GitHub->>Webhook: Signed webhook for issue, label, mention, or review
57+
Webhook->>Webhook: Validate HMAC and route familiar
58+
Webhook->>GitHub: Create Check Run
59+
Webhook->>Worker: Enqueue task
60+
Worker->>Runtime: Start session with session-brief.json
61+
Worker->>Cave: Publish live status link
62+
Runtime-->>Worker: Structured progress and result.json
63+
Worker->>GitHub: Update Check Run
64+
Runtime->>GitHub: Push branch
65+
Worker->>GitHub: Open draft PR and link issue
4666
```
67+
68+
The same lifecycle in operational prose:
69+
70+
```text
4771
1. Webhook arrives
4872
→ validate HMAC signature (reject invalid)
4973
→ parse event: repo, ref, issue body/diff, assignee/label/mention

DESIGN.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
`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.
44

5+
For a visual system map, webhook sequence, task lifecycle, and trust-boundary diagrams, see [Architecture Diagrams](docs/architecture.md).
6+
57
## Design Goal
68

79
Assign GitHub work to a known familiar and get a draft PR back with visible context, evidence, and an oversight path.
@@ -15,16 +17,19 @@ The core design constraint is trust continuity:
1517

1618
## Task Flow
1719

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
20+
```mermaid
21+
flowchart LR
22+
event[GitHub event]
23+
hmac[Webhook HMAC validation]
24+
route[Event parsing and familiar routing]
25+
task[Task record and queue]
26+
worker[Worker starts isolated session]
27+
brief[coven-code receives session brief]
28+
result[Familiar drafts changes and result envelope]
29+
github[GitHub Check Run and PR updated]
30+
cave[Cave Board and session link expose oversight]
31+
32+
event --> hmac --> route --> task --> worker --> brief --> result --> github --> cave
2833
```
2934

3035
## Routing Model

HOSTED.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ Hosted OpenCoven is the managed version of `coven-github`: install the GitHub Ap
44

55
The hosted tier should monetize managed reliability and familiar continuity, while the open-source adapter remains self-hostable for trust and inspection.
66

7+
See [Architecture Diagrams](docs/architecture.md) for the hosted vs self-hosted deployment diagram and trust-boundary map.
8+
9+
## Hosted Flow
10+
11+
```mermaid
12+
flowchart LR
13+
install[Install hosted GitHub App]
14+
route[Configure familiar routing]
15+
trigger[Assign issue or add trigger label]
16+
queue[Managed queue and task history]
17+
worker[Managed isolated worker]
18+
pr[Draft PR with Check Run evidence]
19+
cave[Cave oversight link]
20+
21+
install --> route --> trigger --> queue --> worker --> pr --> cave
22+
```
23+
724
## What Hosted Adds
825

926
| Capability | Self-hosted adapter | Hosted OpenCoven |

README.md

Lines changed: 54 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@
44

55
`coven-github` is the GitHub App adapter for [OpenCoven](https://opencoven.ai). It bridges GitHub's issue and pull-request workflow with the Coven harness — turning any Coven-configured familiar into a first-class GitHub coding agent, without black-box model lock-in.
66

7-
```
8-
GitHub issue assigned to @cody
9-
→ coven-github webhook receiver
10-
→ spawns coven-code session with issue context
11-
→ Check Run shows live progress in GitHub UI
12-
→ familiar opens branch, commits, pushes
13-
→ PR opened and linked to original issue
14-
→ Cave session available for live oversight
7+
```mermaid
8+
flowchart LR
9+
issue[GitHub issue, label, mention, or review comment]
10+
app[coven-github GitHub App]
11+
worker[coven-github worker]
12+
familiar[coven-code familiar session]
13+
check[GitHub Check Run]
14+
pr[Draft pull request]
15+
cave[CovenCave oversight]
16+
17+
issue --> app
18+
app --> worker
19+
worker --> familiar
20+
worker --> check
21+
familiar --> pr
22+
worker --> cave
23+
check --> reviewer[Maintainer]
24+
pr --> reviewer
25+
cave --> reviewer
1526
```
1627

1728
---
@@ -24,31 +35,47 @@ Every existing GitHub coding agent is a black box: GitHub's model, GitHub's cont
2435

2536
That is the product wedge: assign it like a teammate, get a PR back, and keep Cave oversight in the loop. A familiar should know the difference between "technically works" and "good enough for this repo, this team, and this moment."
2637

27-
See [Design](DESIGN.md), [Hosted OpenCoven](HOSTED.md), [Familiar Contract](FAMILIAR-CONTRACT.md), [Roadmap](ROADMAP.md), and [Hosted vs self-hosted](docs/hosted-vs-self-hosted.md) for the operational plan.
38+
See [Architecture Diagrams](docs/architecture.md), [Design](DESIGN.md), [Hosted OpenCoven](HOSTED.md), [Familiar Contract](FAMILIAR-CONTRACT.md), [Roadmap](ROADMAP.md), and [Hosted vs self-hosted](docs/hosted-vs-self-hosted.md) for the operational plan.
2839

2940
---
3041

3142
## Architecture
3243

44+
```mermaid
45+
flowchart TB
46+
subgraph github[GitHub]
47+
trigger[Issue assignment<br/>trigger label<br/>@mention<br/>review comment]
48+
checks[Check Run]
49+
pull[Draft PR]
50+
end
51+
52+
subgraph adapter[coven-github]
53+
webhook[Webhook receiver<br/>HMAC validation<br/>event parsing]
54+
routing[Familiar routing<br/>bot username<br/>trigger labels]
55+
tasks[Task queue/store<br/>status and audit]
56+
runner[Worker<br/>session brief<br/>timeout enforcement]
57+
end
58+
59+
subgraph runtime[OpenCoven runtime]
60+
session[coven-code --headless]
61+
result[Result envelope<br/>summary, branch, evidence]
62+
end
63+
64+
cave[CovenCave oversight<br/>live session and intervention]
65+
66+
trigger --> webhook
67+
webhook --> routing
68+
routing --> tasks
69+
tasks --> runner
70+
runner --> session
71+
session --> result
72+
result --> runner
73+
runner --> checks
74+
runner --> pull
75+
runner --> cave
3376
```
34-
GitHub
35-
│ webhook (issue assigned / @mention / label)
36-
37-
coven-github (this repo)
38-
│ validates HMAC · enqueues task · creates Check Run
39-
40-
coven-code --headless --context session-brief.json
41-
│ agent loop: reads code · edits · runs tests
42-
│ emits structured progress events
43-
44-
GitHub Check Run API ← live status: "Cody: running tests…"
45-
46-
47-
git push → GitHub PR ← opened by coven-code's git tool
48-
49-
50-
CovenCave oversight UI ← watch session live, intervene, steer
51-
```
77+
78+
For deeper system, sequence, state, security-boundary, and hosted deployment diagrams, read [docs/architecture.md](docs/architecture.md).
5279

5380
### Components
5481

0 commit comments

Comments
 (0)