@openrig/cli 0.1.2 → 0.1.4

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 (104) hide show
  1. package/daemon/assets/guidance/openrig-start.md +16 -1
  2. package/daemon/dist/adapters/claude-code-adapter.d.ts +12 -0
  3. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  4. package/daemon/dist/adapters/claude-code-adapter.js +92 -3
  5. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  6. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +5 -0
  7. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  8. package/daemon/dist/adapters/codex-runtime-adapter.js +82 -2
  9. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  10. package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
  11. package/daemon/dist/domain/agent-manifest.js +2 -1
  12. package/daemon/dist/domain/agent-manifest.js.map +1 -1
  13. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  14. package/daemon/dist/domain/native-resume-probe.js +24 -1
  15. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  16. package/daemon/dist/domain/profile-resolver.js +1 -1
  17. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  18. package/daemon/dist/domain/runtime-adapter.d.ts +1 -0
  19. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  20. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  21. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  22. package/daemon/dist/domain/startup-orchestrator.js +10 -1
  23. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  24. package/daemon/specs/agents/analyst/agent.yaml +10 -1
  25. package/daemon/specs/agents/design/agent.yaml +10 -1
  26. package/daemon/specs/agents/design/guidance/role.md +13 -0
  27. package/daemon/specs/agents/impl/agent.yaml +10 -1
  28. package/daemon/specs/agents/impl/guidance/role.md +20 -0
  29. package/daemon/specs/agents/lead/agent.yaml +10 -1
  30. package/daemon/specs/agents/lead/guidance/role.md +18 -0
  31. package/daemon/specs/agents/qa/agent.yaml +10 -1
  32. package/daemon/specs/agents/qa/guidance/role.md +52 -0
  33. package/daemon/specs/agents/reviewer/agent.yaml +10 -1
  34. package/daemon/specs/agents/reviewer/guidance/role.md +13 -0
  35. package/daemon/specs/agents/shared/agent.yaml +38 -0
  36. package/daemon/specs/agents/shared/skills/agent-browser/LOCAL-INSIGHTS.md +189 -0
  37. package/daemon/specs/agents/shared/skills/agent-browser/SKILL.md +417 -0
  38. package/daemon/specs/agents/shared/skills/brainstorming/SKILL.md +96 -0
  39. package/daemon/specs/agents/shared/skills/containerized-e2e/SKILL.md +256 -0
  40. package/daemon/specs/agents/shared/skills/containerized-e2e/scripts/Dockerfile +39 -0
  41. package/daemon/specs/agents/shared/skills/containerized-e2e/scripts/build-e2e-image.sh +37 -0
  42. package/daemon/specs/agents/shared/skills/containerized-e2e/templates/control-plane-test.yaml +40 -0
  43. package/daemon/specs/agents/shared/skills/containerized-e2e/templates/e2e-report-template.md +94 -0
  44. package/daemon/specs/agents/shared/skills/containerized-e2e/templates/expansion-collision-fragment.yaml +13 -0
  45. package/daemon/specs/agents/shared/skills/containerized-e2e/templates/expansion-pod-fragment.yaml +14 -0
  46. package/daemon/specs/agents/shared/skills/development-team/SKILL.md +149 -0
  47. package/daemon/specs/agents/shared/skills/dogfood/SKILL.md +220 -0
  48. package/daemon/specs/agents/shared/skills/dogfood/references/issue-taxonomy.md +109 -0
  49. package/daemon/specs/agents/shared/skills/dogfood/templates/dogfood-report-template.md +53 -0
  50. package/daemon/specs/agents/shared/skills/executing-plans/SKILL.md +84 -0
  51. package/daemon/specs/agents/shared/skills/frontend-design/LICENSE.txt +177 -0
  52. package/daemon/specs/agents/shared/skills/frontend-design/SKILL.md +42 -0
  53. package/daemon/specs/agents/shared/skills/openrig-user/SKILL.md +468 -0
  54. package/daemon/specs/agents/shared/skills/orchestration-team/SKILL.md +234 -0
  55. package/daemon/specs/agents/shared/skills/review-team/SKILL.md +210 -0
  56. package/daemon/specs/agents/shared/skills/systematic-debugging/CREATION-LOG.md +119 -0
  57. package/daemon/specs/agents/shared/skills/systematic-debugging/SKILL.md +296 -0
  58. package/daemon/specs/agents/shared/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  59. package/daemon/specs/agents/shared/skills/systematic-debugging/condition-based-waiting.md +115 -0
  60. package/daemon/specs/agents/shared/skills/systematic-debugging/defense-in-depth.md +122 -0
  61. package/daemon/specs/agents/shared/skills/systematic-debugging/find-polluter.sh +63 -0
  62. package/daemon/specs/agents/shared/skills/systematic-debugging/root-cause-tracing.md +169 -0
  63. package/daemon/specs/agents/shared/skills/systematic-debugging/test-academic.md +14 -0
  64. package/daemon/specs/agents/shared/skills/systematic-debugging/test-pressure-1.md +58 -0
  65. package/daemon/specs/agents/shared/skills/systematic-debugging/test-pressure-2.md +68 -0
  66. package/daemon/specs/agents/shared/skills/systematic-debugging/test-pressure-3.md +69 -0
  67. package/daemon/specs/agents/shared/skills/test-driven-development/SKILL.md +371 -0
  68. package/daemon/specs/agents/shared/skills/test-driven-development/testing-anti-patterns.md +299 -0
  69. package/daemon/specs/agents/shared/skills/using-superpowers/SKILL.md +95 -0
  70. package/daemon/specs/agents/shared/skills/verification-before-completion/SKILL.md +139 -0
  71. package/daemon/specs/agents/shared/skills/writing-plans/SKILL.md +116 -0
  72. package/daemon/specs/agents/synthesizer/agent.yaml +10 -1
  73. package/daemon/specs/demo.CULTURE.md +92 -0
  74. package/daemon/specs/demo.yaml +91 -0
  75. package/daemon/specs/implementation-pair.yaml +3 -3
  76. package/daemon/specs/product-team.CULTURE.md +137 -0
  77. package/daemon/specs/product-team.yaml +5 -4
  78. package/dist/client.d.ts +8 -1
  79. package/dist/client.d.ts.map +1 -1
  80. package/dist/client.js +15 -6
  81. package/dist/client.js.map +1 -1
  82. package/dist/commands/daemon.d.ts.map +1 -1
  83. package/dist/commands/daemon.js +5 -1
  84. package/dist/commands/daemon.js.map +1 -1
  85. package/dist/commands/up.js +2 -2
  86. package/dist/commands/up.js.map +1 -1
  87. package/dist/daemon-lifecycle.d.ts.map +1 -1
  88. package/dist/daemon-lifecycle.js +54 -7
  89. package/dist/daemon-lifecycle.js.map +1 -1
  90. package/dist/fetch-with-timeout.d.ts +9 -0
  91. package/dist/fetch-with-timeout.d.ts.map +1 -0
  92. package/dist/fetch-with-timeout.js +41 -0
  93. package/dist/fetch-with-timeout.js.map +1 -0
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +2 -1
  96. package/dist/index.js.map +1 -1
  97. package/dist/mcp-server.d.ts.map +1 -1
  98. package/dist/mcp-server.js +2 -1
  99. package/dist/mcp-server.js.map +1 -1
  100. package/dist/version.d.ts +2 -0
  101. package/dist/version.d.ts.map +1 -0
  102. package/dist/version.js +8 -0
  103. package/dist/version.js.map +1 -0
  104. package/package.json +1 -1
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: brainstorming
3
+ description: "You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation."
4
+ ---
5
+
6
+ # Brainstorming Ideas Into Designs
7
+
8
+ ## Overview
9
+
10
+ Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
11
+
12
+ Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design and get user approval.
13
+
14
+ <HARD-GATE>
15
+ Do NOT invoke any implementation skill, write any code, scaffold any project, or take any implementation action until you have presented a design and the user has approved it. This applies to EVERY project regardless of perceived simplicity.
16
+ </HARD-GATE>
17
+
18
+ ## Anti-Pattern: "This Is Too Simple To Need A Design"
19
+
20
+ Every project goes through this process. A todo list, a single-function utility, a config change — all of them. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short (a few sentences for truly simple projects), but you MUST present it and get approval.
21
+
22
+ ## Checklist
23
+
24
+ You MUST create a task for each of these items and complete them in order:
25
+
26
+ 1. **Explore project context** — check files, docs, recent commits
27
+ 2. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
28
+ 3. **Propose 2-3 approaches** — with trade-offs and your recommendation
29
+ 4. **Present design** — in sections scaled to their complexity, get user approval after each section
30
+ 5. **Write design doc** — save to `docs/plans/YYYY-MM-DD-<topic>-design.md` and commit
31
+ 6. **Transition to implementation** — invoke writing-plans skill to create implementation plan
32
+
33
+ ## Process Flow
34
+
35
+ ```dot
36
+ digraph brainstorming {
37
+ "Explore project context" [shape=box];
38
+ "Ask clarifying questions" [shape=box];
39
+ "Propose 2-3 approaches" [shape=box];
40
+ "Present design sections" [shape=box];
41
+ "User approves design?" [shape=diamond];
42
+ "Write design doc" [shape=box];
43
+ "Invoke writing-plans skill" [shape=doublecircle];
44
+
45
+ "Explore project context" -> "Ask clarifying questions";
46
+ "Ask clarifying questions" -> "Propose 2-3 approaches";
47
+ "Propose 2-3 approaches" -> "Present design sections";
48
+ "Present design sections" -> "User approves design?";
49
+ "User approves design?" -> "Present design sections" [label="no, revise"];
50
+ "User approves design?" -> "Write design doc" [label="yes"];
51
+ "Write design doc" -> "Invoke writing-plans skill";
52
+ }
53
+ ```
54
+
55
+ **The terminal state is invoking writing-plans.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skill you invoke after brainstorming is writing-plans.
56
+
57
+ ## The Process
58
+
59
+ **Understanding the idea:**
60
+ - Check out the current project state first (files, docs, recent commits)
61
+ - Ask questions one at a time to refine the idea
62
+ - Prefer multiple choice questions when possible, but open-ended is fine too
63
+ - Only one question per message - if a topic needs more exploration, break it into multiple questions
64
+ - Focus on understanding: purpose, constraints, success criteria
65
+
66
+ **Exploring approaches:**
67
+ - Propose 2-3 different approaches with trade-offs
68
+ - Present options conversationally with your recommendation and reasoning
69
+ - Lead with your recommended option and explain why
70
+
71
+ **Presenting the design:**
72
+ - Once you believe you understand what you're building, present the design
73
+ - Scale each section to its complexity: a few sentences if straightforward, up to 200-300 words if nuanced
74
+ - Ask after each section whether it looks right so far
75
+ - Cover: architecture, components, data flow, error handling, testing
76
+ - Be ready to go back and clarify if something doesn't make sense
77
+
78
+ ## After the Design
79
+
80
+ **Documentation:**
81
+ - Write the validated design to `docs/plans/YYYY-MM-DD-<topic>-design.md`
82
+ - Use elements-of-style:writing-clearly-and-concisely skill if available
83
+ - Commit the design document to git
84
+
85
+ **Implementation:**
86
+ - Invoke the writing-plans skill to create a detailed implementation plan
87
+ - Do NOT invoke any other skill. writing-plans is the next step.
88
+
89
+ ## Key Principles
90
+
91
+ - **One question at a time** - Don't overwhelm with multiple questions
92
+ - **Multiple choice preferred** - Easier to answer than open-ended when possible
93
+ - **YAGNI ruthlessly** - Remove unnecessary features from all designs
94
+ - **Explore alternatives** - Always propose 2-3 approaches before settling
95
+ - **Incremental validation** - Present design, get approval before moving on
96
+ - **Be flexible** - Go back and clarify when something doesn't make sense
@@ -0,0 +1,256 @@
1
+ ---
2
+ name: containerized-e2e
3
+ description: Run end-to-end dogfood tests inside Docker containers to simulate real user experiences. Use when you need to verify install paths, control plane functionality, UI rendering, or packaging correctness in a clean environment. Triggers include "containerized test", "Docker dogfood", "clean install test", "e2e in container", or testing that requires a fresh environment without dev-mode shortcuts.
4
+ allowed-tools: Bash(docker:*), Bash(agent-browser:*), Bash(npx agent-browser:*)
5
+ ---
6
+
7
+ # Containerized E2E Testing
8
+
9
+ Run OpenRig (or any npm-installable CLI + web UI project) through end-to-end testing inside Docker containers, simulating real user install and usage scenarios.
10
+
11
+ ## When to Use
12
+
13
+ - Verifying the npm install path works from a packed tarball
14
+ - Testing control plane functionality without live agent runtimes
15
+ - Checking UI rendering via agent-browser in a clean environment
16
+ - Regression testing after packaging changes
17
+ - Phase boundary acceptance gates
18
+
19
+ ## When NOT to Use
20
+
21
+ - Testing live agent behavior (send/capture/broadcast, whoami from inside an agent, transcript capture) — these need real claude-code/codex runtimes on the host
22
+ - Quick feedback during active TDD cycles — too slow for the edit/test loop
23
+
24
+ ## Prerequisites
25
+
26
+ - Docker installed and running
27
+ - The repo builds successfully (`npm run build` for all workspaces)
28
+ - `agent-browser` skill loaded (for UI verification commands)
29
+
30
+ ## Testing Personas
31
+
32
+ ### Fresh User
33
+
34
+ A brand new user who has never installed OpenRig. Exercises the first-run experience.
35
+
36
+ - Empty `~/.openrig/` directory
37
+ - No existing rigs, snapshots, or specs
38
+ - Tests: install, daemon start, preflight, doctor, first rig up, UI renders
39
+
40
+ ### Mature User
41
+
42
+ A user with existing OpenRig state — rigs, snapshots, library additions, transcripts.
43
+
44
+ - Pre-populated `~/.openrig/` via Docker volume persistence
45
+ - Build this state organically: run the fresh-user tests first, and the volume accumulates real state
46
+ - Tests: restore from existing snapshots, expand existing rigs, library with user-added specs, upgrade-path behaviors
47
+
48
+ To set up a mature user volume:
49
+
50
+ ```bash
51
+ # Create a named volume
52
+ docker volume create openrig-mature-user
53
+
54
+ # Run fresh-user tests with the volume mounted
55
+ docker run -it --rm --shm-size=1g \
56
+ -v openrig-mature-user:/root/.openrig \
57
+ -v /tmp/openrig-e2e-artifacts:/artifacts \
58
+ openrig-e2e
59
+
60
+ # The volume now has real state from actual rig commands
61
+ # Subsequent runs with the same volume simulate a mature user
62
+ ```
63
+
64
+ ## Workflow
65
+
66
+ ### 1. Build the E2E Image
67
+
68
+ Use the provided build script or do it manually:
69
+
70
+ ```bash
71
+ # Using the build script (recommended)
72
+ bash {SKILL_DIR}/scripts/build-e2e-image.sh /path/to/repo
73
+
74
+ # Or manually:
75
+ cd /path/to/repo
76
+ npm run build --workspace @openrig/daemon
77
+ npm run build --workspace @openrig/ui
78
+ npm run build --workspace @openrig/cli
79
+ bash scripts/build-package.sh
80
+ cd packages/cli && npm pack --pack-destination /tmp/e2e-build
81
+ cp {SKILL_DIR}/scripts/Dockerfile /tmp/e2e-build/
82
+ mv /tmp/e2e-build/openrig-cli-*.tgz /tmp/e2e-build/openrig-cli.tgz
83
+ cd /tmp/e2e-build && docker build -t openrig-e2e:latest .
84
+ ```
85
+
86
+ ### 2. Start the Container
87
+
88
+ ```bash
89
+ # Fresh user (ephemeral state)
90
+ docker run -d --rm --name openrig-e2e \
91
+ --shm-size=1g \
92
+ -v /tmp/openrig-e2e-artifacts:/artifacts \
93
+ openrig-e2e sleep infinity
94
+
95
+ # Mature user (persistent volume)
96
+ docker run -d --rm --name openrig-e2e \
97
+ --shm-size=1g \
98
+ -v openrig-mature-user:/root/.openrig \
99
+ -v /tmp/openrig-e2e-artifacts:/artifacts \
100
+ openrig-e2e sleep infinity
101
+ ```
102
+
103
+ **Important:** Always use `--shm-size=1g` for Chromium stability during browser tests.
104
+
105
+ ### 3. Run Tests Inside the Container
106
+
107
+ Execute commands via `docker exec`:
108
+
109
+ ```bash
110
+ # Start the daemon
111
+ docker exec openrig-e2e rig daemon start
112
+
113
+ # Run preflight and doctor
114
+ docker exec openrig-e2e rig preflight --json
115
+ docker exec openrig-e2e rig doctor --json
116
+
117
+ # Copy test specs into the container
118
+ docker cp {SKILL_DIR}/templates/control-plane-test.yaml openrig-e2e:/workspace/
119
+ docker cp {SKILL_DIR}/templates/expansion-pod-fragment.yaml openrig-e2e:/workspace/
120
+ docker cp {SKILL_DIR}/templates/expansion-collision-fragment.yaml openrig-e2e:/workspace/
121
+
122
+ # Launch a rig
123
+ docker exec openrig-e2e rig up /workspace/control-plane-test.yaml --json
124
+
125
+ # Check topology
126
+ docker exec openrig-e2e rig ps --json
127
+ docker exec openrig-e2e rig ps --nodes --json
128
+ ```
129
+
130
+ ### 4. Browser Testing Inside the Container
131
+
132
+ agent-browser runs inside the container via `docker exec`:
133
+
134
+ ```bash
135
+ # Open the daemon UI
136
+ docker exec openrig-e2e agent-browser open http://127.0.0.1:7433
137
+ docker exec openrig-e2e agent-browser wait --load networkidle
138
+
139
+ # Inspect interactive elements
140
+ docker exec openrig-e2e agent-browser snapshot -i
141
+
142
+ # Capture screenshots
143
+ docker exec openrig-e2e agent-browser screenshot /artifacts/screenshots/dashboard.png
144
+ docker exec openrig-e2e agent-browser screenshot --annotate /artifacts/screenshots/dashboard-annotated.png
145
+
146
+ # Navigate and verify specific surfaces
147
+ docker exec openrig-e2e agent-browser click @e4 # Open specs drawer (ref from snapshot)
148
+ docker exec openrig-e2e agent-browser wait 1000
149
+ docker exec openrig-e2e agent-browser screenshot /artifacts/screenshots/specs-drawer.png
150
+ ```
151
+
152
+ **ARM64 note:** The Dockerfile uses Debian's system chromium instead of Chrome for Testing, which is unavailable on Linux ARM64. The environment variables `AGENT_BROWSER_EXECUTABLE_PATH` and `AGENT_BROWSER_ARGS` are set in the image.
153
+
154
+ ### 5. Test Scenarios
155
+
156
+ #### Control Plane Lifecycle
157
+
158
+ ```bash
159
+ # Launch the multi-pod test spec
160
+ docker exec openrig-e2e rig up /workspace/control-plane-test.yaml --json
161
+ RIG_ID=$(docker exec openrig-e2e rig ps --json | jq -r '.[0].rigId')
162
+
163
+ # Verify topology
164
+ docker exec openrig-e2e rig ps --nodes --json
165
+
166
+ # Expand with a new pod
167
+ docker exec openrig-e2e rig expand "$RIG_ID" /workspace/expansion-pod-fragment.yaml --json
168
+
169
+ # Verify expansion
170
+ docker exec openrig-e2e rig ps --nodes --json
171
+
172
+ # Test validation rejection (colliding namespace)
173
+ docker exec openrig-e2e rig expand "$RIG_ID" /workspace/expansion-collision-fragment.yaml --json
174
+ # Should fail with namespace collision error, rig unchanged
175
+
176
+ # Snapshot
177
+ docker exec openrig-e2e rig down "$RIG_ID" --snapshot --json
178
+
179
+ # Restore and verify
180
+ SNAPSHOT_ID=$(docker exec openrig-e2e rig snapshot list "$RIG_ID" | awk 'NR==2 {print $1}')
181
+ docker exec openrig-e2e rig restore "$SNAPSHOT_ID" --rig "$RIG_ID"
182
+
183
+ # Export
184
+ docker exec openrig-e2e rig export "$RIG_ID" -o /artifacts/captures/exported-rig.yaml
185
+ ```
186
+
187
+ #### UI Verification
188
+
189
+ ```bash
190
+ # After launching a rig, verify the graph renders
191
+ docker exec openrig-e2e agent-browser open http://127.0.0.1:7433
192
+ docker exec openrig-e2e agent-browser wait --load networkidle
193
+ docker exec openrig-e2e agent-browser snapshot -i
194
+ docker exec openrig-e2e agent-browser screenshot --annotate /artifacts/screenshots/graph-with-rig.png
195
+
196
+ # Open drawers and verify content
197
+ docker exec openrig-e2e agent-browser snapshot -i # Get fresh refs
198
+ # Click through specs drawer, discovery drawer, rig detail, etc.
199
+ # Take screenshots at each step
200
+ ```
201
+
202
+ ### 6. Cleanup
203
+
204
+ ```bash
205
+ docker exec openrig-e2e rig daemon stop
206
+ docker exec openrig-e2e agent-browser close
207
+ docker stop openrig-e2e
208
+ ```
209
+
210
+ ### 7. Write Report
211
+
212
+ Copy the report template and fill it in:
213
+
214
+ ```bash
215
+ cp {SKILL_DIR}/templates/e2e-report-template.md /tmp/openrig-e2e-artifacts/report.md
216
+ ```
217
+
218
+ Fill in results as tests complete — do not batch findings for the end.
219
+
220
+ ## Test Spec Templates
221
+
222
+ | Template | Purpose |
223
+ |----------|---------|
224
+ | `templates/control-plane-test.yaml` | Multi-pod terminal-only rig spec (backend + frontend, 3 nodes, cross-pod edges) |
225
+ | `templates/expansion-pod-fragment.yaml` | Pod fragment for expansion happy path (ops pod with cross-pod edge) |
226
+ | `templates/expansion-collision-fragment.yaml` | Pod fragment that intentionally collides — for validation rejection testing |
227
+ | `templates/e2e-report-template.md` | Structured test report template |
228
+
229
+ ## Scripts
230
+
231
+ | Script | Purpose |
232
+ |--------|---------|
233
+ | `scripts/build-e2e-image.sh` | Build the Docker image from the repo (builds packages, packs tarball, builds image) |
234
+ | `scripts/Dockerfile` | The proven Dockerfile — Node 22, tmux, system Chromium, agent-browser, OpenRig CLI |
235
+
236
+ ## Limitations
237
+
238
+ - **No live agent runtimes.** The container does not include claude-code or codex. Use `runtime: terminal` specs for control plane testing. Test live agent behavior on the host.
239
+ - **ARM64 browser workaround.** Chrome for Testing is unavailable on Linux ARM64. The Dockerfile uses Debian chromium. This is transparent to agent-browser commands.
240
+ - **No GPU/display.** All browser testing is headless. Screenshots and videos capture what a user would see, but there is no visible browser window.
241
+
242
+ ## Combining with Host-Based Dogfood
243
+
244
+ For complete coverage, use both approaches:
245
+
246
+ | What to test | Where | Tool |
247
+ |-------------|-------|------|
248
+ | Install path, packaging | Container | This skill |
249
+ | CLI commands, lifecycle | Container | This skill |
250
+ | UI rendering, drawers | Container | This skill + agent-browser |
251
+ | Validation/error paths | Container | This skill |
252
+ | Live agent startup | Host | QA with /dogfood skill |
253
+ | Communication (send/capture) | Host | QA with live agents |
254
+ | Whoami from inside agent | Host | QA with live agents |
255
+ | Transcript capture | Host | QA with live agents |
256
+ | Chatroom with real participants | Host | QA with live agents |
@@ -0,0 +1,39 @@
1
+ # OpenRig Containerized E2E Testing Image
2
+ #
3
+ # Provides: Node 22, tmux, agent-browser (with system Chromium), OpenRig CLI
4
+ # Usage:
5
+ # 1. Build the CLI tarball: cd <repo>/packages/cli && npm pack
6
+ # 2. Copy tarball to build context as openrig-cli.tgz
7
+ # 3. docker build -t openrig-e2e .
8
+ # 4. docker run -it --rm --shm-size=1g -v /tmp/e2e-artifacts:/artifacts openrig-e2e
9
+ #
10
+ # ARM64 note: Chrome for Testing is unavailable on Linux ARM64.
11
+ # This image uses Debian's system chromium instead, pointed via
12
+ # AGENT_BROWSER_EXECUTABLE_PATH.
13
+
14
+ FROM node:22-bookworm
15
+
16
+ ENV DEBIAN_FRONTEND=noninteractive
17
+ ENV AGENT_BROWSER_ARGS=--no-sandbox
18
+ ENV AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium
19
+ ENV OPENRIG_HOME=/root/.openrig
20
+
21
+ RUN apt-get update \
22
+ && apt-get install -y --no-install-recommends \
23
+ ca-certificates \
24
+ chromium \
25
+ curl \
26
+ git \
27
+ procps \
28
+ tmux \
29
+ && rm -rf /var/lib/apt/lists/*
30
+
31
+ RUN npm install -g agent-browser
32
+
33
+ COPY openrig-cli.tgz /tmp/openrig-cli.tgz
34
+ RUN npm install -g /tmp/openrig-cli.tgz \
35
+ && rm /tmp/openrig-cli.tgz
36
+
37
+ WORKDIR /workspace
38
+
39
+ CMD ["/bin/bash"]
@@ -0,0 +1,37 @@
1
+ #!/bin/bash
2
+ # Build the OpenRig containerized E2E testing image.
3
+ #
4
+ # Usage: ./build-e2e-image.sh [repo-root]
5
+ # repo-root defaults to the current directory.
6
+ #
7
+ # Produces: Docker image tagged openrig-e2e:latest
8
+
9
+ set -euo pipefail
10
+
11
+ REPO_ROOT="${1:-.}"
12
+ SKILL_DIR="$(cd "$(dirname "$0")/.." && pwd)"
13
+ BUILD_CTX="/tmp/openrig-e2e-build"
14
+
15
+ echo "=== Building OpenRig packages ==="
16
+ cd "$REPO_ROOT"
17
+ npm run build --workspace @openrig/daemon
18
+ npm run build --workspace @openrig/ui
19
+ npm run build --workspace @openrig/cli
20
+ bash scripts/build-package.sh
21
+
22
+ echo "=== Packing CLI tarball ==="
23
+ mkdir -p "$BUILD_CTX"
24
+ cd "$REPO_ROOT/packages/cli"
25
+ npm pack --pack-destination "$BUILD_CTX"
26
+
27
+ echo "=== Preparing Docker build context ==="
28
+ cp "$SKILL_DIR/scripts/Dockerfile" "$BUILD_CTX/Dockerfile"
29
+ # Rename tarball to a stable name
30
+ mv "$BUILD_CTX"/openrig-cli-*.tgz "$BUILD_CTX/openrig-cli.tgz"
31
+
32
+ echo "=== Building Docker image ==="
33
+ cd "$BUILD_CTX"
34
+ docker build -t openrig-e2e:latest .
35
+
36
+ echo "=== Done ==="
37
+ echo "Run: docker run -it --rm --shm-size=1g -v /tmp/openrig-e2e-artifacts:/artifacts openrig-e2e"
@@ -0,0 +1,40 @@
1
+ version: "0.2"
2
+ name: control-plane-test
3
+ summary: >
4
+ Multi-pod terminal-only topology for containerized control-plane testing.
5
+ Exercises pods, cross-pod edges, expansion targets, and snapshot/restore
6
+ without requiring live coding runtimes.
7
+
8
+ pods:
9
+ - id: backend
10
+ label: Backend Team
11
+ members:
12
+ - id: api
13
+ runtime: terminal
14
+ agent_ref: "builtin:terminal"
15
+ profile: none
16
+ cwd: /tmp
17
+ - id: db
18
+ runtime: terminal
19
+ agent_ref: "builtin:terminal"
20
+ profile: none
21
+ cwd: /tmp
22
+ edges:
23
+ - kind: delegates_to
24
+ from: api
25
+ to: db
26
+
27
+ - id: frontend
28
+ label: Frontend Team
29
+ members:
30
+ - id: ui
31
+ runtime: terminal
32
+ agent_ref: "builtin:terminal"
33
+ profile: none
34
+ cwd: /tmp
35
+ edges: []
36
+
37
+ edges:
38
+ - kind: delegates_to
39
+ from: frontend.ui
40
+ to: backend.api
@@ -0,0 +1,94 @@
1
+ # Containerized E2E Test Report
2
+
3
+ Date: {{DATE}}
4
+ Persona: {{PERSONA}}
5
+ Image: openrig-e2e:latest
6
+
7
+ ## Summary
8
+
9
+ - Tests run: {{TOTAL}}
10
+ - Passed: {{PASSED}}
11
+ - Failed: {{FAILED}}
12
+ - Skipped: {{SKIPPED}}
13
+
14
+ ## Environment
15
+
16
+ - Node: {{NODE_VERSION}}
17
+ - tmux: {{TMUX_VERSION}}
18
+ - Chromium: {{CHROMIUM_VERSION}}
19
+ - OpenRig CLI: {{RIG_VERSION}}
20
+ - Platform: {{PLATFORM}}
21
+
22
+ ## Test Results
23
+
24
+ ### Install & Boot
25
+
26
+ | Test | Result | Notes |
27
+ |------|--------|-------|
28
+ | npm install -g | | |
29
+ | rig daemon start | | |
30
+ | rig preflight | | |
31
+ | rig doctor | | |
32
+ | UI loads in browser | | |
33
+
34
+ ### Rig Lifecycle
35
+
36
+ | Test | Result | Notes |
37
+ |------|--------|-------|
38
+ | rig up (terminal-only spec) | | |
39
+ | rig ps / rig ps --nodes | | |
40
+ | Graph renders in browser | | |
41
+ | rig down --snapshot | | |
42
+ | rig restore | | |
43
+ | Restored nodes match | | |
44
+
45
+ ### Expansion
46
+
47
+ | Test | Result | Notes |
48
+ |------|--------|-------|
49
+ | rig expand (happy path) | | |
50
+ | Graph updates after expand | | |
51
+ | ps --nodes shows new nodes | | |
52
+ | Expand with collision (rejected) | | |
53
+ | Rig unchanged after rejection | | |
54
+
55
+ ### Snapshot/Restore with Expansion
56
+
57
+ | Test | Result | Notes |
58
+ |------|--------|-------|
59
+ | Snapshot captures expanded pods | | |
60
+ | Restore brings back expanded pods | | |
61
+ | Cross-pod edges survive restore | | |
62
+ | Export includes expanded topology | | |
63
+
64
+ ### CLI Surface
65
+
66
+ | Test | Result | Notes |
67
+ |------|--------|-------|
68
+ | rig specs ls | | |
69
+ | rig specs show | | |
70
+ | rig config | | |
71
+ | rig whoami (daemon down) | | |
72
+ | rig export | | |
73
+
74
+ ### UI Surface (agent-browser)
75
+
76
+ | Test | Result | Notes |
77
+ |------|--------|-------|
78
+ | Dashboard renders | | |
79
+ | Explorer sidebar | | |
80
+ | Specs drawer opens | | |
81
+ | Discovery drawer opens | | |
82
+ | System drawer opens | | |
83
+ | Rig detail drawer | | |
84
+ | Node detail in graph | | |
85
+
86
+ ## Bugs Found
87
+
88
+ (Append each bug as discovered — do not batch)
89
+
90
+ ## Artifacts
91
+
92
+ - Screenshots: /artifacts/screenshots/
93
+ - Videos: /artifacts/videos/
94
+ - CLI transcript: /artifacts/cli-transcript.txt
@@ -0,0 +1,13 @@
1
+ # This fragment intentionally collides with the existing 'backend' pod.
2
+ # Use it to verify that expansion validation rejects namespace collisions
3
+ # and leaves the rig unchanged.
4
+ pod:
5
+ id: backend
6
+ label: Colliding Pod
7
+ members:
8
+ - id: worker
9
+ runtime: terminal
10
+ agent_ref: "builtin:terminal"
11
+ profile: none
12
+ cwd: /tmp
13
+ edges: []
@@ -0,0 +1,14 @@
1
+ pod:
2
+ id: ops
3
+ label: Operations
4
+ members:
5
+ - id: monitor
6
+ runtime: terminal
7
+ agent_ref: "builtin:terminal"
8
+ profile: none
9
+ cwd: /tmp
10
+ edges: []
11
+ crossPodEdges:
12
+ - kind: delegates_to
13
+ from: ops.monitor
14
+ to: backend.api