agentboard 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +62 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.md +316 -0
  5. data/Rakefile +6 -0
  6. data/app/assets/stylesheets/agentboard/application.css +510 -0
  7. data/app/controllers/agentboard/agents_controller.rb +10 -0
  8. data/app/controllers/agentboard/analytics_controller.rb +37 -0
  9. data/app/controllers/agentboard/application_controller.rb +90 -0
  10. data/app/controllers/agentboard/approvals_controller.rb +15 -0
  11. data/app/controllers/agentboard/assets_controller.rb +32 -0
  12. data/app/controllers/agentboard/board_controller.rb +46 -0
  13. data/app/controllers/agentboard/captures_controller.rb +17 -0
  14. data/app/controllers/agentboard/comments_controller.rb +9 -0
  15. data/app/controllers/agentboard/criteria_controller.rb +17 -0
  16. data/app/controllers/agentboard/dependencies_controller.rb +20 -0
  17. data/app/controllers/agentboard/executions_controller.rb +48 -0
  18. data/app/controllers/agentboard/milestones_controller.rb +23 -0
  19. data/app/controllers/agentboard/pulse_controller.rb +12 -0
  20. data/app/controllers/agentboard/sessions_controller.rb +19 -0
  21. data/app/controllers/agentboard/settings_controller.rb +9 -0
  22. data/app/controllers/agentboard/tickets_controller.rb +139 -0
  23. data/app/controllers/agentboard/workflow_runs_controller.rb +16 -0
  24. data/app/controllers/agentboard/workflows_controller.rb +62 -0
  25. data/app/helpers/agentboard/application_helper.rb +196 -0
  26. data/app/javascript/agentboard/application.js +227 -0
  27. data/app/javascript/agentboard/capture.js +299 -0
  28. data/app/jobs/agentboard/application_job.rb +4 -0
  29. data/app/models/agentboard/acceptance_criterion.rb +23 -0
  30. data/app/models/agentboard/agent_profile.rb +16 -0
  31. data/app/models/agentboard/agent_session.rb +30 -0
  32. data/app/models/agentboard/application_record.rb +13 -0
  33. data/app/models/agentboard/approval.rb +29 -0
  34. data/app/models/agentboard/artifact.rb +11 -0
  35. data/app/models/agentboard/comment.rb +9 -0
  36. data/app/models/agentboard/event.rb +37 -0
  37. data/app/models/agentboard/execution.rb +51 -0
  38. data/app/models/agentboard/idempotency_key.rb +5 -0
  39. data/app/models/agentboard/milestone.rb +7 -0
  40. data/app/models/agentboard/outbox_message.rb +11 -0
  41. data/app/models/agentboard/project.rb +43 -0
  42. data/app/models/agentboard/repository_snapshot.rb +5 -0
  43. data/app/models/agentboard/session_ticket_link.rb +18 -0
  44. data/app/models/agentboard/ticket.rb +81 -0
  45. data/app/models/agentboard/ticket_dependency.rb +34 -0
  46. data/app/models/agentboard/ticket_lease.rb +11 -0
  47. data/app/models/agentboard/usage_record.rb +10 -0
  48. data/app/models/agentboard/verification_result.rb +12 -0
  49. data/app/models/agentboard/webhook_delivery.rb +7 -0
  50. data/app/models/agentboard/workflow_definition.rb +20 -0
  51. data/app/models/agentboard/workflow_run.rb +21 -0
  52. data/app/models/agentboard/workflow_step.rb +12 -0
  53. data/app/services/agentboard/approvals.rb +76 -0
  54. data/app/services/agentboard/captures.rb +113 -0
  55. data/app/services/agentboard/completion_policy.rb +117 -0
  56. data/app/services/agentboard/current.rb +5 -0
  57. data/app/services/agentboard/data_governance.rb +68 -0
  58. data/app/services/agentboard/doctor.rb +133 -0
  59. data/app/services/agentboard/event_store.rb +88 -0
  60. data/app/services/agentboard/evidence.rb +52 -0
  61. data/app/services/agentboard/executions.rb +198 -0
  62. data/app/services/agentboard/hook_ingestion.rb +100 -0
  63. data/app/services/agentboard/idempotency.rb +28 -0
  64. data/app/services/agentboard/lease_service.rb +107 -0
  65. data/app/services/agentboard/mcp_server.rb +138 -0
  66. data/app/services/agentboard/mcp_tools.rb +341 -0
  67. data/app/services/agentboard/outbox.rb +44 -0
  68. data/app/services/agentboard/pull_requests.rb +65 -0
  69. data/app/services/agentboard/runtime/execution_runner.rb +352 -0
  70. data/app/services/agentboard/runtime/ipc_handler.rb +55 -0
  71. data/app/services/agentboard/runtime/reconciler.rb +42 -0
  72. data/app/services/agentboard/runtime/supervisor.rb +96 -0
  73. data/app/services/agentboard/session_association.rb +44 -0
  74. data/app/services/agentboard/session_correlation.rb +56 -0
  75. data/app/services/agentboard/session_credential.rb +44 -0
  76. data/app/services/agentboard/ticket_advisor.rb +60 -0
  77. data/app/services/agentboard/tickets.rb +218 -0
  78. data/app/services/agentboard/verification_service.rb +60 -0
  79. data/app/services/agentboard/workflow_engine.rb +261 -0
  80. data/app/views/agentboard/agents/index.html.erb +51 -0
  81. data/app/views/agentboard/analytics/show.html.erb +78 -0
  82. data/app/views/agentboard/approvals/_approval.html.erb +27 -0
  83. data/app/views/agentboard/approvals/index.html.erb +31 -0
  84. data/app/views/agentboard/board/_card.html.erb +36 -0
  85. data/app/views/agentboard/board/show.html.erb +73 -0
  86. data/app/views/agentboard/executions/index.html.erb +33 -0
  87. data/app/views/agentboard/executions/show.html.erb +126 -0
  88. data/app/views/agentboard/milestones/index.html.erb +28 -0
  89. data/app/views/agentboard/settings/show.html.erb +33 -0
  90. data/app/views/agentboard/shared/_dag.html.erb +24 -0
  91. data/app/views/agentboard/tickets/_form.html.erb +38 -0
  92. data/app/views/agentboard/tickets/edit.html.erb +5 -0
  93. data/app/views/agentboard/tickets/index.html.erb +51 -0
  94. data/app/views/agentboard/tickets/new.html.erb +6 -0
  95. data/app/views/agentboard/tickets/show.html.erb +343 -0
  96. data/app/views/agentboard/tickets/suggestions.html.erb +21 -0
  97. data/app/views/agentboard/workflow_runs/show.html.erb +28 -0
  98. data/app/views/agentboard/workflows/index.html.erb +49 -0
  99. data/app/views/agentboard/workflows/show.html.erb +15 -0
  100. data/app/views/layouts/agentboard/application.html.erb +93 -0
  101. data/config/routes.rb +49 -0
  102. data/db/migrate/20261114000001_create_agentboard_core.rb +144 -0
  103. data/db/migrate/20261114000002_create_agentboard_runtime.rb +213 -0
  104. data/db/migrate/20261115000001_create_agentboard_webhook_deliveries.rb +18 -0
  105. data/exe/agentboard +7 -0
  106. data/lib/agentboard/agent_container.rb +124 -0
  107. data/lib/agentboard/authorization.rb +58 -0
  108. data/lib/agentboard/capture/middleware.rb +54 -0
  109. data/lib/agentboard/capture.rb +57 -0
  110. data/lib/agentboard/cli.rb +818 -0
  111. data/lib/agentboard/command_policy.rb +44 -0
  112. data/lib/agentboard/configuration.rb +160 -0
  113. data/lib/agentboard/container_sandbox.rb +65 -0
  114. data/lib/agentboard/context_builder.rb +243 -0
  115. data/lib/agentboard/egress_proxy.rb +95 -0
  116. data/lib/agentboard/engine.rb +27 -0
  117. data/lib/agentboard/errors.rb +42 -0
  118. data/lib/agentboard/event_schema.rb +37 -0
  119. data/lib/agentboard/extensions.rb +58 -0
  120. data/lib/agentboard/git/repository.rb +92 -0
  121. data/lib/agentboard/git/worktree_manager.rb +107 -0
  122. data/lib/agentboard/git.rb +4 -0
  123. data/lib/agentboard/ids.rb +33 -0
  124. data/lib/agentboard/json_log_formatter.rb +28 -0
  125. data/lib/agentboard/path_guard.rb +27 -0
  126. data/lib/agentboard/process_ancestry.rb +40 -0
  127. data/lib/agentboard/providers/base.rb +107 -0
  128. data/lib/agentboard/providers/claude_code.rb +219 -0
  129. data/lib/agentboard/providers/codex.rb +177 -0
  130. data/lib/agentboard/providers/compatibility/claude.yml +13 -0
  131. data/lib/agentboard/providers/compatibility/codex.yml +10 -0
  132. data/lib/agentboard/providers/config_editor.rb +106 -0
  133. data/lib/agentboard/providers/cursor.rb +40 -0
  134. data/lib/agentboard/providers/fake.rb +59 -0
  135. data/lib/agentboard/providers/fake_agent_script.rb +47 -0
  136. data/lib/agentboard/providers/generic_cli.rb +35 -0
  137. data/lib/agentboard/providers/registry.rb +31 -0
  138. data/lib/agentboard/providers/types.rb +32 -0
  139. data/lib/agentboard/providers.rb +26 -0
  140. data/lib/agentboard/rails_introspection.rb +49 -0
  141. data/lib/agentboard/redactor.rb +62 -0
  142. data/lib/agentboard/result.rb +46 -0
  143. data/lib/agentboard/runtime/ipc.rb +193 -0
  144. data/lib/agentboard/runtime.rb +1 -0
  145. data/lib/agentboard/state_machines.rb +71 -0
  146. data/lib/agentboard/subprocess.rb +168 -0
  147. data/lib/agentboard/templates/Dockerfile.agent +21 -0
  148. data/lib/agentboard/verification.rb +79 -0
  149. data/lib/agentboard/version.rb +3 -0
  150. data/lib/agentboard/workflows/condition.rb +166 -0
  151. data/lib/agentboard/workflows/definition.rb +208 -0
  152. data/lib/agentboard/workflows.rb +2 -0
  153. data/lib/agentboard.rb +73 -0
  154. data/lib/generators/agentboard/install/install_generator.rb +67 -0
  155. data/lib/generators/agentboard/install/templates/config.yml +81 -0
  156. data/lib/generators/agentboard/install/templates/feature_delivery.yml +25 -0
  157. data/lib/generators/agentboard/install/templates/initializer.rb +23 -0
  158. data/lib/tasks/agentboard_tasks.rake +6 -0
  159. metadata +285 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bf3b11cf2d78d5f23885c9bcd4cef555ce44387c388ba9829691d8d80a2e7023
4
+ data.tar.gz: 0fd6e1e62af7b1da7c65e6b146f5a885217ac338c8a64ce0eb6ba58fc2fd8424
5
+ SHA512:
6
+ metadata.gz: 6a13383686616b430a6b3f798fdd00df5847411d236f5ff67ab5c1997e9cce9b127988f8e3136cfd0a81d7ecb268000341a28fe4735fec64f0ad9dc4f4b65c55
7
+ data.tar.gz: f08689ced07c4da9075f2d6298c395117d7933b5474192bd56430e6d94a2b2654f16104f8bb9bc8cc3de48d8525787ae455d55a9cc36ec42ff94249c80b50077
data/CHANGELOG.md ADDED
@@ -0,0 +1,62 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ - **Open core (decision 35.2 #6):** a new `agentboard-pro` gem (`pro/`) holds team mode,
6
+ advanced workflows, governance and the GitHub integration. Ed25519 licences are verified
7
+ offline. Expiry gives 14 days of grace, then Pro features stop; data is never affected.
8
+ - **Team mode (#1):** host-app authentication adapter (`rails g agentboard:pro:team`),
9
+ role-aware UI, separation of duties on approvals.
10
+ - **Database (#2):** team mode requires PostgreSQL. The daemon refuses to start on SQLite,
11
+ and `doctor` reports it.
12
+ - **Distribution:** `agentboard` publishes to RubyGems.org through Trusted Publishing. The
13
+ site serves `agentboard-pro` from a private Bundler compact-index server, authenticated
14
+ by the customer's licence; access follows the subscription. Verified with real Bundler.
15
+ - **Capture widget:**
16
+ - Select elements on any page of the host app and create a ticket. The ticket records
17
+ the route, the exact templates and partials (from view annotations), a selector, a
18
+ redacted HTML fragment and console errors.
19
+ - Captured templates are placed first in the agent's context.
20
+ - Community covers development; Pro (`capture`) adds other environments and region
21
+ screenshots.
22
+ - **Agents in containers (core):**
23
+ - `sandbox.agents: true` runs Claude, Codex and the fake provider in OCI containers on an
24
+ internal network. The only exit is an allowlisting egress proxy.
25
+ - Credentials are forwarded by name. Containers are removed on cancel and on runtime
26
+ reconciliation.
27
+ - New commands `agentboard sandbox init/build/status/down` and a Dockerfile template.
28
+ - Verification containers now mount paths identically, so Git resolves inside them.
29
+ - **Git hosting:** GitLab and Bitbucket alongside GitHub, behind one adapter contract
30
+ (webhook authentication, PR/MR normalisation, repository identity, PR creation). The
31
+ licence feature is now `git_hosting`; `github` stays accepted as an alias.
32
+ - **Completion (#5):** `require_merged_pr: when_linked` is the default.
33
+ - **Core:** extension registry and hooks (`Agentboard::Extensions`), `session.manage`
34
+ permission, edition shown in `doctor` and the dashboard.
35
+
36
+ ## 0.2.0
37
+
38
+ - **F21 GitHub:** signed webhooks, PR association by repository, branch and SHA, and
39
+ merge-aware completion (AT-11). Manual PR links are verified against local Git history.
40
+ - **F18 permission bridge:** Claude Code permission prompts become human approvals bound
41
+ to the execution. CommandPolicy denies production, protected-branch and credential
42
+ operations.
43
+ - **F14:** provider session resume in the same worktree; process-group CPU and memory
44
+ accounting.
45
+ - **F19:** per-step workflow timeouts and signed `external` integration steps.
46
+ - **F07/F08/F11:** rotating, revocable MCP session credentials; MCP and hook sessions
47
+ correlated through process ancestry; opt-in Codex `notify`.
48
+ - **F22:** ticket drafting suggestions that require human acceptance; static route and
49
+ table introspection; repository snapshots.
50
+ - **F23:** JSON daemon logs, operational metrics, `support-bundle`, `retention`, `purge`.
51
+ - **F06:** milestones, subtasks, configurable board columns.
52
+ - **F15/F16:** real-provider fixtures. Claude Code 2.1.325 smoke-tested end to end.
53
+ - **AT-15:** upgrade path with versioned event payloads and upcasters. PostgreSQL in CI.
54
+ - Fixes:
55
+ - Live dashboard refresh (Turbo ESM import).
56
+ - Context builder crash on empty files.
57
+ - Hook stdin read before boot.
58
+ - `--json` in subcommands.
59
+
60
+ ## 0.1.0
61
+
62
+ - First implementation: engine, domain core, MCP, runtime daemon, workflows, dashboard.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2026 PIRUBY
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,316 @@
1
+ # AgentBoard
2
+
3
+ A local-first ticket board and agent orchestration engine for Rails apps. It connects
4
+ tickets to Claude Code, OpenAI Codex, Cursor and third-party adapters. Ticket completion is
5
+ based on evidence (commits, checks bound to a commit SHA, human approval), not on what an
6
+ agent says about its own work.
7
+
8
+ ```
9
+ requirements → tickets → agent sessions → executions → code changes → tests → reviews → delivery
10
+ ```
11
+
12
+ The full specification is in `AgentBoard_Engineering_Spec_v1.1.md`, and the change history
13
+ in `CHANGELOG.md`.
14
+
15
+ - [Editions](#editions)
16
+ - [Quick start](#quick-start-macos--linux)
17
+ - [How it works](#how-it-works)
18
+ - [Running agents safely](#running-agents-safely)
19
+ - [Configuration](#configuration)
20
+ - [CLI](#cli)
21
+ - [Pro features](#pro-features)
22
+ - [Development](#development)
23
+ - [Status and known limits](#status-and-known-limits)
24
+
25
+ ## Editions
26
+
27
+ | | Community (`agentboard`, MIT) | Pro (`agentboard-pro`, commercial licence) |
28
+ |---|---|---|
29
+ | Tickets, Kanban, backlog, milestones, subtasks | ✓ | ✓ |
30
+ | MCP server for agents, passive tracking through provider hooks | ✓ | ✓ |
31
+ | Active execution: worktrees, live console, cancel/retry/resume, verification | ✓ | ✓ |
32
+ | Agent isolation: trusted local processes or containers with an egress allowlist | ✓ | ✓ |
33
+ | Human approvals, permission bridge for agent tool use | ✓ | ✓ |
34
+ | Sequential workflows (agent, command and approval steps) | ✓ | ✓ |
35
+ | Manual PR links verified against Git | ✓ | ✓ |
36
+ | Basic analytics, export, manual retention and purge | ✓ | ✓ |
37
+ | Capture widget: select elements in your app and file a ticket (development) | ✓ | ✓ |
38
+ | Capture widget on staging for the whole team, plus region screenshots | — | ✓ |
39
+ | Team mode: host-app login, roles, separation of duties (PostgreSQL) | — | ✓ |
40
+ | Advanced workflows: conditions, retries, timeouts, external and PR steps | — | ✓ |
41
+ | Governance: ops metrics, support bundle, hash-chained audit export, daily retention | — | ✓ |
42
+ | Git hosting: GitHub, GitLab and Bitbucket webhooks, merge-aware completion, PR/MR creation | — | ✓ |
43
+
44
+ - The core never needs an account or network access.
45
+ - A Pro licence is verified offline.
46
+ - When a Pro licence lapses, you get 14 days of grace, then Pro features stop. Data and
47
+ Community features are never affected.
48
+
49
+ ## Quick start (macOS / Linux)
50
+
51
+ ```bash
52
+ bundle add agentboard --group development
53
+ bin/rails generate agentboard:install # idempotent; never overwrites without --force
54
+ bin/rails db:migrate
55
+ bundle exec agentboard init # .agentboard/, .gitignore entries, provider detection
56
+ bundle exec agentboard doctor # checks everything and tells you what is missing
57
+ bundle exec agentboard provider setup claude # MCP (.mcp.json) + hooks (.claude/settings.local.json)
58
+ bundle exec agentboard provider setup codex # MCP via `codex mcp add` (add --notify for turn events)
59
+ bundle exec agentboard daemon start # agents run in this process, not in the web server
60
+ open http://localhost:3000/agentboard
61
+ ```
62
+
63
+ **Requirements:**
64
+ - Ruby 3.3 or newer, Rails 7.2 or 8.x, Git.
65
+ - PostgreSQL is recommended. SQLite works for a single developer.
66
+ - The core needs neither Node nor Python. The CSS is precompiled, and Turbo and Stimulus
67
+ are served from their gems.
68
+
69
+ **Try it without a real agent:** create a ticket on the board, open it, then
70
+ **Run an agent → Fake agent**. The built-in fake provider edits a file, commits, runs your
71
+ tests and hands the ticket to review. It calls no paid API.
72
+
73
+ ## How it works
74
+
75
+ ```
76
+ Rails host app ── AgentBoard engine: dashboard, domain services, event store + outbox
77
+ │ MCP stdio server (agentboard mcp serve) ← agents read/update tickets
78
+ │ hook ingestion (agentboard hook ingest) ← provider lifecycle events
79
+ ▼
80
+ Runtime daemon (separate OS process, authenticated Unix-socket IPC)
81
+ supervisor · worktrees · context builder · verification · DAG workflows
82
+ providers: fake · claude · codex · cursor (MCP) · gemini/opencode/copilot (detection)
83
+ isolation: trusted local process | container + egress proxy
84
+ ```
85
+
86
+ **Two ways to work with agents:**
87
+
88
+ 1. **Passive.** You run `claude` or `codex` yourself. Through MCP the agent can list,
89
+ claim, update and submit tickets. Hooks report what it does, and Git provides the
90
+ evidence. Every event is labelled with its provenance (confirmed by AgentBoard, reported
91
+ by the provider, observed in Git, or inferred).
92
+ 2. **Active.** AgentBoard launches the agent in a dedicated worktree. It gives the agent a
93
+ bounded context (ticket, criteria, relevant files, routes and tables read statically
94
+ with Prism), streams its output and commits the result. It then runs the approved test
95
+ commands against that exact commit and requests a human review.
96
+
97
+ **A ticket reaches Done only when all of these hold:**
98
+ - acceptance criteria are verified by a human;
99
+ - the required checks passed on the reviewed commit;
100
+ - a human approved the review;
101
+ - if a PR is linked, that PR was merged on the reviewed commit.
102
+
103
+ Agents can request completion but cannot bypass any of these.
104
+
105
+ ## Running agents safely
106
+
107
+ Real agents never start by default. Choose one mode in `.agentboard/config.yml`:
108
+
109
+ | Mode | Config | What the agent can reach |
110
+ |---|---|---|
111
+ | Off (default) | — | Only the fake provider runs |
112
+ | Trusted local process | `security.trusted_local_execution: true` | Your user account. Shell commands need human approval, through the permission bridge for Claude. |
113
+ | Container | `security.sandbox: container` + `sandbox.agents: true` | Only its worktree and the git directory; network only to provider APIs |
114
+
115
+ Setting up container mode:
116
+
117
+ ```bash
118
+ bundle exec agentboard sandbox init # writes .agentboard/sandbox/Dockerfile (Ruby + your gems + agent CLIs)
119
+ bundle exec agentboard sandbox build # builds the image and prints the config to enable
120
+ bundle exec agentboard sandbox status # runtime, network, egress allowlist
121
+ ```
122
+
123
+ **What container isolation enforces:**
124
+ - **Network:** an internal Docker network with no route to the internet. The only exit is
125
+ an egress proxy that allowlists provider APIs; everything else is refused and logged.
126
+ - **Filesystem:** read-only root filesystem, all capabilities dropped, no-new-privileges,
127
+ non-root user. Only the worktree and the repository's git directory are mounted.
128
+ - **Credentials:** forwarded by variable name, so values never appear in process listings.
129
+ - **Permissions:** inside the container the agent may use tools without prompts. On the
130
+ host it never can.
131
+ - **Cleanup:** containers are removed on cancel and when the daemon restarts.
132
+
133
+ **Always on, in every mode:**
134
+ - Commands come only from an approved catalog and run as argv. Nothing goes through a
135
+ shell, and ticket text never reaches argv.
136
+ - Secrets are redacted from logs, events, comments and exports.
137
+ - Model reasoning is never stored.
138
+ - Production deploys, protected-branch pushes and credential reads are denied by policy
139
+ before any human is asked.
140
+ - Approvals are bound to the exact action and commit. A code change invalidates them.
141
+
142
+ Details are in `docs/THREAT_MODEL.md`.
143
+
144
+ ## Capture widget
145
+
146
+ In development, every HTML page of your app gets a small **AgentBoard** button
147
+ (<kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd>). Click it, select one or more elements
148
+ (<kbd>Shift</kbd>+click to add), describe the problem and create a ticket. The ticket
149
+ records:
150
+
151
+ - the page and its `controller#action`;
152
+ - **the exact template or partial that rendered each element** (from Rails'
153
+ `annotate_rendered_view_with_filenames`, which AgentBoard turns on in development);
154
+ - a stable selector and a redacted HTML fragment (input values are never captured);
155
+ - console errors.
156
+
157
+ When an agent works on that ticket, those templates come first in its context. The
158
+ widget runs in a closed Shadow DOM, so it neither affects nor is affected by your CSS.
159
+
160
+ With Pro (`capture`), the widget can be enabled for other environments, typically staging
161
+ for QA and PMs with team-mode login, and can attach a screenshot cropped to the selection
162
+ using the browser's native screen-capture API:
163
+
164
+ ```yaml
165
+ capture:
166
+ environments: [development, staging]
167
+ ```
168
+
169
+ ## Configuration
170
+
171
+ `bin/rails generate agentboard:install` writes `config/agentboard.yml`. Local overrides go
172
+ in `.agentboard/config.yml`. The most important keys:
173
+
174
+ ```yaml
175
+ security:
176
+ trusted_local_execution: false # opt-in for real agents as local processes
177
+ sandbox: none # container: verification (and agents, see below) in Docker
178
+ sandbox:
179
+ agents: false # true: agents run in containers
180
+ agent_image: agentboard-agent:myapp
181
+ image: agentboard-agent:myapp # for verification commands (--network none)
182
+ credential_env: [ANTHROPIC_API_KEY, OPENAI_API_KEY]
183
+ egress_allow: [] # extra host:port beyond provider APIs
184
+ completion:
185
+ require_merged_pr: when_linked # when_linked | always | never
186
+ verification_commands: # the only commands AgentBoard will ever run
187
+ rails_test: { argv: ["bin/rails", "test"], timeout_seconds: 900, required: true }
188
+ board:
189
+ columns: [backlog, ready, claimed, in_progress, testing, review, done]
190
+ ```
191
+
192
+ Dashboard access defaults to localhost only, as a single local administrator. Team login
193
+ with roles is a Pro feature: `rails g agentboard:pro:team`.
194
+
195
+ ## CLI
196
+
197
+ Run `agentboard help` for the full list. Most commands accept `--json`.
198
+
199
+ | Area | Commands |
200
+ |---|---|
201
+ | Setup | `init`, `doctor`, `provider list/setup/remove/doctor`, `sandbox init/build/status/down`, `uninstall` |
202
+ | Tickets | `ticket list/show/create/move`, `attach KEY`, `verify KEY`, `approvals`, `approve ID [--reject]` |
203
+ | Execution | `run KEY [--provider claude] [--wait]`, `executions`, `logs ID [-f]`, `cancel ID`, `resume ID` |
204
+ | Workflows | `workflow validate/list/run` |
205
+ | Runtime | `daemon start/stop/status/restart`, `mcp serve`, `hook ingest/replay` |
206
+ | Data | `export`, `retention [--dry-run]`, `purge --confirm KEY`, `cleanup [--dry-run]` |
207
+ | Pro | `license`, `support-bundle`, `audit-export [--verify FILE]` |
208
+
209
+ Exit codes:
210
+ - 0: ok
211
+ - 1: internal error
212
+ - 2: validation error or invalid transition
213
+ - 3: not found
214
+ - 4: forbidden or policy denied
215
+ - 5: conflict
216
+ - 6: provider or capability unavailable
217
+ - 7: daemon not running
218
+
219
+ ## Pro features
220
+
221
+ `agentboard-pro` is distributed from a private gem server, and your licence is the
222
+ credential:
223
+
224
+ ```ruby
225
+ source "https://agent-board.live/gems" do
226
+ gem "agentboard-pro", group: :development
227
+ end
228
+ ```
229
+
230
+ ```bash
231
+ bundle config set --global agent-board.live "<licence>"
232
+ ```
233
+
234
+ At runtime, provide the licence in one of these places: `AGENTBOARD_LICENSE`,
235
+ `config/agentboard.license` or `~/.config/agentboard/license`.
236
+
237
+ - **Team mode.** Run `rails g agentboard:pro:team` to use your app's login (Devise or any
238
+ other) with the roles viewer, developer, maintainer and administrator. The UI respects
239
+ the role, and whoever requests an approval cannot decide it. PostgreSQL is required.
240
+ - **Git hosting.** Point a pull/merge-request webhook at `/agentboard/webhooks/github`,
241
+ `/gitlab` or `/bitbucket`, and export the secret named under `git_hosts`. Without a
242
+ secret, the endpoint does not exist. Workflow `git_pull_request` steps open PRs/MRs on
243
+ the detected host.
244
+ - **Advanced workflows.** `condition`, `retry`, `timeout_seconds`, `external` (signed
245
+ calls to allowlisted URLs) and `git_pull_request`.
246
+ - **Governance.** Queue and lag metrics, `support-bundle`, a tamper-evident
247
+ `audit-export`, and daily retention run by the daemon.
248
+
249
+ Vendor tooling for issuing licences is described in `pro/README.md`.
250
+
251
+ ## Development
252
+
253
+ ```bash
254
+ bundle install
255
+ cd test/dummy && bin/rails db:prepare && RAILS_ENV=test bin/rails db:prepare && cd ../..
256
+ bin/rails test # SQLite
257
+ DB=postgresql PGHOST=/tmp bin/rails test
258
+ bin/test-and-commit # commits only when both suites are green
259
+ cd test/dummy && bin/rails server # dashboard on http://localhost:3000/agentboard
260
+ ```
261
+
262
+ The suite covers units, services, acceptance scenarios AT-01…AT-15, security negatives
263
+ (prompt injection, forged webhooks, path traversal, approval replay), real provider
264
+ fixtures and container isolation. With Docker running, it also uses a real container.
265
+
266
+ Upgrading an installation:
267
+
268
+ ```bash
269
+ bundle update agentboard
270
+ bin/rails agentboard:install:migrations && bin/rails db:migrate
271
+ bundle exec agentboard daemon restart
272
+ ```
273
+
274
+ Historical events are never rewritten. Old payloads are upcast when read (see
275
+ `lib/agentboard/event_schema.rb`).
276
+
277
+ ### macOS notes
278
+
279
+ - On macOS, Unix socket paths are limited to 104 bytes and `$TMPDIR` is long. The runtime
280
+ socket falls back to `/tmp/agentboard-<uid>/`.
281
+ - `/var` and `/tmp` are symlinks into `/private`. Path checks compare real paths.
282
+ - Process supervision uses POSIX process groups. Containers run through Docker Desktop.
283
+
284
+ ## Status and known limits
285
+
286
+ See also `docs/COMPATIBILITY.md` and `docs/RELEASE.md`.
287
+
288
+ **Verified live (macOS, Docker Desktop):**
289
+ - **Claude Code 2.1.325, as a local process:** end-to-end run through AgentBoard
290
+ (implement → snapshot → `bin/rails test` → review). A real permission request went
291
+ through the approval bridge and was correctly denied on expiry.
292
+ - **Containers:**
293
+ - The agent image builds from `agentboard sandbox build`.
294
+ - The fake agent runs and commits inside a container.
295
+ - Verification runs `bin/rails test` in a network-less container.
296
+ - Egress, tested from inside the agent network: direct internet is blocked, a
297
+ non-allowlisted domain is refused and logged, a provider API is reachable.
298
+ - **Codex in a container:** credentials reach the API through the proxy (`CODEX_API_KEY`
299
+ mapped from `OPENAI_API_KEY`, never in argv). A successful run still needs a valid
300
+ OpenAI key; the one tested was rejected by OpenAI.
301
+ - **Claude Code in a container:** needs `ANTHROPIC_API_KEY` or a dedicated
302
+ `sandbox.claude_config_dir` logged in once. A subscription login stored in the macOS
303
+ Keychain is not available inside containers.
304
+
305
+ **Other limits:**
306
+ - The permission bridge (human approval per tool call) exists only for Claude Code running
307
+ as a local process. In a container, the container is the boundary.
308
+ - GitLab and Bitbucket integrations are covered by tests on realistic payloads and API
309
+ calls, but have not been run against live repositories.
310
+ - Windows is not supported.
311
+ - Extra lifecycle transitions were added beyond spec §24.1:
312
+ - `claimed→ready` (release)
313
+ - `testing→in_progress` (failed checks)
314
+ - `review→in_progress` (changes requested)
315
+ - `reopened→ready`
316
+ - `ready→backlog`
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+
6
+ require "bundler/gem_tasks"