Skip to content

Commit ced753d

Browse files
kapaleshreyasclaude
andcommitted
ship-mode: CI + docs + changesets + initial v0.1 release surface
Step 1 of the ship-mode plan (CI + docs + npm release prep). Stops the internal-iteration treadmill so external feedback can drive the next round of work. CI: .github/workflows/ci.yml runs build + typecheck + test on Node 20 and 22 for every push to main and every PR. pnpm + Bun set up via upstream actions, frozen-lockfile install. Live integration suites (MongoDB, real Anthropic) skip cleanly when their env vars are absent so CI stays green for forks without credentials. README polish: rewritten as a getting-started guide rather than a status report. Adds a 60-second tutorial that creates an inline GAP agent, runs it via runTask in a local subprocess, and disposes — no harness server lifecycle visible. Then shows substrate / engine / session-store swaps as one-line changes. Updated architecture diagram includes the SessionStore axis. Updated package table to 13 packages. CONTRIBUTING.md (new): documents the four pluggable ports, the conformance gate, the 9 code rules from PLAN.md, the failure-semantics contract (AuditSink fire-and-forget vs SessionStore fail-loud), the changesets workflow, the live-test env vars, and a PR checklist. Changesets: pnpm add -D @changesets/cli + pnpm changeset init. .changeset/config.json set to access:public (these are open-source scoped packages) and ignore @computeragent/examples (private). Workspace scripts added: pnpm changeset, pnpm version-packages, pnpm release. Initial changeset .changeset/initial-v0.1-release.md captures the v0.1 surface across all 13 publishable packages. The maintainer runs `pnpm version-packages` to consume it (bumps versions + writes CHANGELOGs) and `pnpm release` to publish. mongoSessionStoreBuilder helper: one-call ergonomic wrapper for the harness registry — reduces three-line boilerplate to one line in README and CONTRIBUTING examples. 3 unit tests covering construction, per-call options merge, and empty-url rejection. 278 tests, all green. CI ready, docs ready, release-prep ready — ship-mode bundle complete. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ddab9bb commit ced753d

11 files changed

Lines changed: 1129 additions & 63 deletions

File tree

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets).
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": ["@computeragent/examples"]
11+
}

.changeset/initial-v0.1-release.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
"@computeragent/protocol": minor
3+
"@computeragent/harness-server": minor
4+
"@computeragent/engine-claude-agent-sdk": minor
5+
"@computeragent/engine-gitagent": minor
6+
"@computeragent/identity-gitagentprotocol": minor
7+
"@computeragent/runtime-local": minor
8+
"@computeragent/runtime-e2b": minor
9+
"@computeragent/runtime-vzvm": minor
10+
"@computeragent/session-store-mongo": minor
11+
"@computeragent/session-store-sqlite": minor
12+
"@computeragent/sdk": minor
13+
"@computeragent/cli": minor
14+
"@computeragent/testing": minor
15+
---
16+
17+
Initial v0.1 release surface.
18+
19+
Three pluggable ports — `EngineDriver`, `IdentityLoader`, `Substrate` — plus
20+
the swappable-memory port `SessionStore` (Wedge 1.6). Reference
21+
implementations:
22+
23+
- engines: `claude-agent-sdk`, `gitagent` (gitclaw)
24+
- identity loader: `gitagentprotocol` (full GAP support — compliance,
25+
tools/MCP, sub-agents, hooks)
26+
- substrates: `local` (subprocess), `e2b` (cloud), `vzvm` (Apple VZ via Tart)
27+
- session stores: `memory`, `file`, `mongo`, `sqlite`
28+
- harness-server: SSE+POST framework, replay buffer with Last-Event-ID
29+
resume, AuditSink + AuthHandler ports, opt-in load-result validation
30+
- sdk: `ComputerAgent` + `runTask` one-shot helper + `await using` /
31+
Symbol.asyncDispose
32+
- cli: `computeragent run …`
33+
- testing: `MockEngine`, `MockLoader`, conformance suite
34+
35+
275 tests, all green. Live demos verified across all engines × all
36+
substrates × all stores against the real Anthropic API.

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
# One run per branch; new commits cancel in-flight runs on the same ref.
10+
concurrency:
11+
group: ci-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build-test:
16+
name: build + typecheck + test
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 15
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
node-version: [20, 22]
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: pnpm/action-setup@v4
29+
with:
30+
version: 9.4.0
31+
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
cache: pnpm
36+
37+
- uses: oven-sh/setup-bun@v2
38+
with:
39+
bun-version: latest
40+
41+
- name: Install
42+
run: pnpm install --frozen-lockfile
43+
44+
- name: Build
45+
run: pnpm -r build
46+
47+
- name: Typecheck
48+
run: pnpm -r typecheck
49+
50+
- name: Test
51+
# Live integration tests against MongoDB / Anthropic auto-skip when their
52+
# env vars are absent. CI runs the offline suite by default.
53+
run: pnpm -r test

CONTRIBUTING.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Contributing to ComputerAgent
2+
3+
ComputerAgent is a TypeScript monorepo (pnpm + turbo) implementing the **Harness Protocol** as a set of pluggable ports. Most contributions add a new plug-in (engine, identity loader, substrate, session store) by implementing a small interface — the framework itself is intentionally closed to modification.
4+
5+
## Setup
6+
7+
Requires [Bun](https://bun.sh) ≥ 1.1, [Node](https://nodejs.org) ≥ 20, [pnpm](https://pnpm.io) ≥ 9.
8+
9+
```bash
10+
git clone https://github.com/open-gitagent/ComputerAgent
11+
cd ComputerAgent
12+
pnpm install
13+
pnpm build
14+
pnpm test
15+
```
16+
17+
CI runs `pnpm -r build`, `pnpm -r typecheck`, and `pnpm -r test` on Node 20 and 22 for every PR.
18+
19+
## Adding a plug-in
20+
21+
The four pluggable ports each follow the same shape — implement the interface, register at server boot.
22+
23+
| Port | Where it lives | Contract |
24+
|---|---|---|
25+
| `EngineDriver` | `packages/engine-*` | Wraps an agent loop. `startSession(ctx)` returns an `AsyncIterable<EngineEvent>`. |
26+
| `IdentityLoader` | `packages/identity-*` | Translates a "what is this agent" source into engine-native options. `load(args)` returns `IdentityLoadResult`. |
27+
| `Substrate` | `packages/runtime-*` | Boots a harness-server somewhere. `bootHarness({envs})` returns `{baseUrl, shutdown}`. |
28+
| `SessionStore` | `packages/session-store-*` | Cross-process conversation persistence. `append(key, entries)` + `load(key)`. Re-exported from the Claude Agent SDK so any backend works the same way for both engines. |
29+
30+
### Validate against the conformance suite
31+
32+
`@computeragent/testing` ships portable cases that any conforming implementation must pass:
33+
34+
```ts
35+
import { conformanceCases, runConformanceSuite } from "@computeragent/testing";
36+
37+
const report = await runConformanceSuite(() => yourDriver(yourHarness));
38+
console.log(`${report.passed} passed, ${report.failed.length} failed`);
39+
```
40+
41+
If the suite passes, your plug-in is a drop-in replacement.
42+
43+
For `SessionStore` specifically, the LSP gate is in `packages/session-store-sqlite/src/integration.test.ts` — clone that file, swap in your store, run it. Three assertions: round-trip, cross-process resume, `UNKNOWN_STORE` error registry hygiene.
44+
45+
## Code rules
46+
47+
These are enforced by review (no automated lint yet):
48+
49+
1. **No file over 250 LOC.** Hard cap. Split by responsibility.
50+
2. **No abstraction without a second consumer.** YAGNI is non-negotiable.
51+
3. **Pure functions for translations.** Side effects (fs, network) live at the edges.
52+
4. **Errors are values at boundaries.** Use the `BadRequest` / `NotFound` / `Conflict` helpers in `packages/harness-server/src/error-mapper.ts`. Don't throw raw.
53+
5. **Zod at the wire, types inside.** All inbound HTTP and outbound SSE bodies pass through zod. Internal code uses inferred types.
54+
6. **No `any`.** `unknown` and narrow.
55+
7. **No emojis in source, logs, or generated output.** Plain text everywhere.
56+
8. **Imports go down the dependency graph.** `engine-*` and `identity-*` import from `@computeragent/protocol`. `harness-server` imports only from `@computeragent/protocol`. No cross-imports between engine and identity packages.
57+
9. **Tests live next to source.** `foo.ts` + `foo.test.ts`. Vitest.
58+
59+
## Failure semantics
60+
61+
Documented contract — please don't change without an RFC:
62+
63+
- **`AuditSink`** — fire-and-forget. Errors swallowed. The harness keeps going.
64+
- **`SessionStore`** — fail loud. Errors surface to the client via `ca_session_ended { reason: "error" }`. Data integrity matters.
65+
- **`EngineDriver`** — fail loud. Errors surface as above.
66+
- **`IdentityLoader`** — fail at session-create time as `400 BAD_REQUEST`.
67+
- **Sibling sessions** — never share blast radius. One bad session must not corrupt another.
68+
69+
The `validateStoreEntries` server option lets deployments enforce the SessionStore contract at the framework boundary (drops malformed entries from `load()` before they reach the engine). Default OFF — framework is pass-through; engines validate.
70+
71+
## Versioning
72+
73+
We use [changesets](https://github.com/changesets/changesets) for cross-package versioning.
74+
75+
After making a change that affects published packages:
76+
77+
```bash
78+
pnpm changeset # describe what changed; pick semver bump per package
79+
git add .changeset/
80+
git commit -m "..."
81+
```
82+
83+
When ready to release, the maintainer runs:
84+
85+
```bash
86+
pnpm version-packages # consumes pending changesets, bumps versions, updates CHANGELOGs
87+
pnpm release # builds all packages and publishes those that bumped
88+
```
89+
90+
`@computeragent/examples` is private (the demo scripts) and excluded from versioning.
91+
92+
## Live tests
93+
94+
The `MONGO_URL` and `ANTHROPIC_API_KEY` env vars opt into live integration suites:
95+
96+
```bash
97+
MONGO_URL="mongodb://..." pnpm --filter @computeragent/session-store-mongo test
98+
ANTHROPIC_API_KEY="sk-..." bun run examples/wedge16-mongo-resume-demo.ts
99+
```
100+
101+
CI runs the offline suite by default; the live ones skip cleanly when the env vars are absent.
102+
103+
## Pull request checklist
104+
105+
- [ ] `pnpm -r build` clean
106+
- [ ] `pnpm -r typecheck` clean
107+
- [ ] `pnpm -r test` clean
108+
- [ ] If you added a published-package change, `pnpm changeset` was run
109+
- [ ] If you added a new plug-in, a passing conformance run is included in the PR description
110+
- [ ] No file added over 250 LOC
111+
112+
## License
113+
114+
All contributions are under [MIT](./LICENSE).

0 commit comments

Comments
 (0)