Commit ebc6736
authored
feat(agent-teams): v0.4.0 — run ID, bulk approve, dashboard grouping (#66)
* feat(agent-teams): v0.4 — run ID, bulk approve, dashboard grouping (#64)
* feat(run-id): W1 — add RunID to data model and plumbing
Add run ID support throughout the stack to enable agent team grouping.
Changes:
- hookInput: add session_id, transcript_path, cwd, permission_mode,
hook_event_name, tool_use_id fields (full Claude Code PreToolUse schema)
- deriveRunID(): new func, priority: RAMPART_RUN > session_id > CLAUDE_CONVERSATION_ID > ""
- hookParseResult: add RunID field, populated from deriveRunID(session_id)
- engine.ToolCall: add RunID string field
- audit.Event: add run_id field (omitempty)
- hook cmd: wire RunID through call and audit event
- proxy server: accept run_id in createApprovalRequest, expose in list response
- hook_approval client: pass run_id to POST /v1/approvals
- tests: update requestApproval calls to pass empty runID string
The session_id field in Claude Code's PreToolUse JSON is shared across
all agents in the same Claude Code session, making it the ideal run ID
source for agent team grouping with zero new integration required.
Priority order for run ID:
1. RAMPART_RUN env (explicit override for scripted orchestration)
2. session_id from Claude Code hook stdin JSON
3. CLAUDE_CONVERSATION_ID env (future fallback)
4. "" (no grouping, standalone call)
* feat(bulk-approve): W2 — bulk resolve API and auto-approve cache
* ci: fix docs deploy target — push to peg/rampart-docs, not local gh-pages
The live docs at docs.rampart.sh are served from peg/rampart-docs (gh-pages branch).
The previous workflow was deploying to peg/rampart's own gh-pages branch, which
nobody visits, causing docs to appear permanently stale.
Fix: build site with mkdocs build, then rsync+push to peg/rampart-docs via a PAT.
Requires DOCS_DEPLOY_TOKEN secret (PAT with contents:write on peg/rampart-docs).
* feat(dashboard): W3 — group pending approvals by run_id
* test(proxy): Go tests for bulk-resolve and run_groups (W2/W3)
Adds 7 new tests covering the v0.4 agent teams features:
BulkResolve:
- TestBulkResolve_ApprovesAllInRun — resolves 2 approvals, returns ids
- TestBulkResolve_EmptyRunIDRejected — 400 on empty/whitespace/missing run_id
- TestBulkResolve_NoAuth — 401 without token
- TestBulkResolve_ZeroResolved_WhenNoPendingForRun — 0 resolved, ids=[] (not null)
AutoApproveCache:
- TestAutoApproveCache_SubsequentCallsSkipQueue — after bulk-approve, new
approval from same run gets status=approved without queuing
ListApprovals run_groups:
- TestListApprovals_RunGroups — 2+ pending with same run_id form a group;
solo item (no run_id) excluded; flat approvals still has all items
- TestListApprovals_RunGroupsSortedByEarliestCreatedAt — groups sorted by
MIN(created_at) chronologically, not by run_id UUID
* feat(cline): wire taskId as run_id for agent team grouping
Cline's taskId is scoped to a single task/conversation, making it
equivalent to Claude Code's session_id for run grouping. Maps via
deriveRunID() so RAMPART_RUN override still takes priority.
* chore: CHANGELOG for v0.4.0 and v0.3.1
* fix(hook): handle 200 auto-approve response from serve
When bulk-resolve is called for a run, subsequent POST /v1/approvals
from that run return 200 {status: approved} instead of 201 (pending).
The hook approval client only checked for StatusCreated (201), so the
200 was treated as an error and fell back to hookAsk (native Claude
Code prompt). Auto-approve never actually worked in the real hook flow.
Fix: check for 200 + status=approved before the 201 check, return
hookAllow immediately without entering the poll loop.
* docs: overhaul 5-minute tutorial, quickstart, add agent teams page
tutorial.md:
- Lead with rampart quickstart (one command) instead of manual setup
- Add approval flow section with dashboard (require_approval → approve)
- Agent teams tip (run grouping, Approve All)
- Replace stale rampart watch ASCII UI with accurate dashboard reference
- Cut bloated MCP section to a link
- Add rampart doctor verification step
- Flow diagram kept but tightened
quickstart.md:
- Trim to essentials: one-command setup, doctor, test, approve
- Remove fake ASCII watch terminal UI
- Fix action: log → action: watch language
- Dashboard mention for approval flow
features/agent-teams.md (new):
- Run ID grouping, auto-approve cache, bulk-resolve API
- Dashboard cluster card UX
- Audit trail run_id field
- Supported agents table (Claude Code / Cline / RAMPART_RUN override)
- Wired into mkdocs.yml nav under Features
* fix(test): check http response error before using resp (go vet)1 parent c5e2a90 commit ebc6736
File tree
16 files changed
+1134
-226
lines changed- .github/workflows
- cmd/rampart/cli
- docs-site
- features
- getting-started
- internal
- approval
- audit
- dashboard/static
- engine
- proxy
- scripts
16 files changed
+1134
-226
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
10 | 37 | | |
11 | 38 | | |
12 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
26 | 39 | | |
27 | 40 | | |
28 | 41 | | |
| |||
72 | 85 | | |
73 | 86 | | |
74 | 87 | | |
| 88 | + | |
75 | 89 | | |
76 | 90 | | |
77 | 91 | | |
| |||
80 | 94 | | |
81 | 95 | | |
82 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
83 | 119 | | |
84 | 120 | | |
85 | 121 | | |
| |||
292 | 328 | | |
293 | 329 | | |
294 | 330 | | |
| 331 | + | |
295 | 332 | | |
296 | 333 | | |
297 | 334 | | |
| |||
320 | 357 | | |
321 | 358 | | |
322 | 359 | | |
| 360 | + | |
323 | 361 | | |
324 | 362 | | |
325 | 363 | | |
| |||
364 | 402 | | |
365 | 403 | | |
366 | 404 | | |
367 | | - | |
| 405 | + | |
368 | 406 | | |
369 | 407 | | |
370 | 408 | | |
| |||
403 | 441 | | |
404 | 442 | | |
405 | 443 | | |
| 444 | + | |
406 | 445 | | |
407 | 446 | | |
408 | 447 | | |
| |||
464 | 503 | | |
465 | 504 | | |
466 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
467 | 509 | | |
468 | 510 | | |
469 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
56 | | - | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
97 | 112 | | |
98 | 113 | | |
99 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
0 commit comments