Skip to content

Commit 8139ae8

Browse files
saravmajesticclaude
andcommitted
feat: add health_path, two-phase docs, verification section, bun --hot
- Fix health_path: /global/health (was empty) - Document two-phase sandbox lifecycle (code-ready / server-ready) - Add verification section: tests, health check, curl, CLI commands - Update start_command to use bun --hot for live module reloading Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d95d858 commit 8139ae8

1 file changed

Lines changed: 60 additions & 5 deletions

File tree

.claude/skills/dev-workflow/SKILL.md

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,28 @@ The monorepo workspace packages are:
3030
- `packages/dbt-tools` — dbt integration tools
3131
- `packages/drivers` — database driver adapters (optional deps)
3232

33+
## Two-phase sandbox lifecycle
34+
35+
| Phase | Marker file | What's available |
36+
|---|---|---|
37+
| **Phase 1: code-ready** | `/workspace/.code-ready` | Source code, `node_modules`, linters, `bun test` |
38+
| **Phase 2: server-ready** | `/workspace/.server-ready` | Server on :4096, `curl /global/health`, hot reload active |
39+
40+
`harness spawn` returns at phase 1 (~10s with base image). Server starts with `bun --hot` for live module reloading — file changes reflect immediately without restart.
41+
42+
**Before running curl or verifying server behavior**, check phase 2:
43+
```bash
44+
test -f /workspace/.server-ready && echo "ready" || echo "still starting..."
45+
```
46+
3347
## What happens on sandbox create
3448

3549
1. The init containers mint a GitHub token and clone the repo into `/workspace/altimate-code`.
36-
2. The main container runs `bun install` to ensure all workspace dependencies are resolved (most are pre-baked in the base image, so this is a fast delta install).
50+
2. The main container runs `bun install` (near-instant with base image pre-baking deps).
3751
3. `.code-ready` is touched — the agent can now read/write code, run linters, run tests.
38-
4. The server is started via `bun run --cwd packages/opencode --conditions=browser src/index.ts serve --port 4096 --hostname 0.0.0.0`.
39-
5. `.server-ready` is touched — the agent can now interact with the HTTP API.
52+
4. The server starts with `bun --hot` for live module reloading on file changes.
53+
5. Once the server binds port 4096, `.server-ready` is touched.
54+
6. Agent edits source → bun hot-swaps modules → `curl` shows updated response immediately.
4055

4156
## Sandbox Contract
4257

@@ -46,7 +61,7 @@ repo_url: https://github.com/AltimateAI/altimate-code.git
4661
base_image: altimateacr.azurecr.io/altimate-code-base:latest
4762
working_dir: /workspace/altimate-code
4863
port: 4096
49-
health_path: ""
64+
health_path: /global/health
5065

5166
# altimate-code is a standalone tool — it does not expose services consumed
5267
# by other sandboxes in the typical Altimate stack.
@@ -63,7 +78,47 @@ setup_commands:
6378
- name: install-deps
6479
cmd: bun install
6580

66-
start_command: bun run --cwd packages/opencode --conditions=browser src/index.ts serve --port 4096 --hostname 0.0.0.0
81+
start_command: bun --hot run --cwd packages/opencode --conditions=browser src/index.ts serve --port 4096 --hostname 0.0.0.0
82+
```
83+
84+
## Verification
85+
86+
Before creating a PR, verify in the running sandbox. Use the `verify-changes` skill for the full process.
87+
88+
### Always check
89+
90+
```bash
91+
# 1. Run tests
92+
cd /workspace/altimate-code/packages/opencode && bun test --timeout 30000
93+
# Include output summary in PR body
94+
95+
# 2. Health endpoint
96+
curl -sf localhost:4096/global/health
97+
# Expected: {"healthy":true,"version":"local"}
98+
```
99+
100+
### For server/API changes
101+
102+
```bash
103+
# Make change → bun --hot reloads automatically (~1-3s)
104+
# Then curl the affected endpoint
105+
curl -sf localhost:4096/<endpoint>
106+
# Include request + response in PR body
107+
```
108+
109+
### For CLI changes
110+
111+
```bash
112+
# Run the CLI command and capture output
113+
cd /workspace/altimate-code
114+
bun run --cwd packages/opencode --conditions=browser src/index.ts <command>
115+
# Include output in PR body
116+
```
117+
118+
### Test command
119+
120+
```bash
121+
cd /workspace/altimate-code/packages/opencode && bun test --timeout 30000
67122
```
68123

69124
## Troubleshooting

0 commit comments

Comments
 (0)