50 lines
2.8 KiB
Markdown
50 lines
2.8 KiB
Markdown
# Tasks — Sandbox VM Host Bridge
|
|
|
|
## 0. Pre-flight (non-negotiable)
|
|
|
|
- [x] 0.1 Confirm clean working tree (`git status` reports nothing) and no in-flight worktrees with uncommitted work
|
|
- [x] 0.2 If any worktrees exist under `.claude/worktrees/`, account for each
|
|
- [x] 0.3 Confirm `MANIFEST.md` package count matches `find packages -maxdepth 3 -name package.json`
|
|
- [x] 0.4 §0a Sync: worktree-isolated agents fast-forward to orchestrator-supplied SHA
|
|
|
|
## 1. New shared types in api-types
|
|
|
|
- [x] 1.1 `packages/api-stack/api/api-types/src/sandbox-bridge/sandbox-bridge.types.ts` — `SerializedRequest`, `SerializedResponse`, `SerializedHeaders`, `SerializedPrincipal`, `SerializedTenant`. Zero runtime.
|
|
- [x] 1.2 Sibling `.md`, `index.ts`, `.test.ts`.
|
|
- [x] 1.3 `./sandbox-bridge` subpath added to api-types package.json exports.
|
|
|
|
## 2. Bridge package scaffold
|
|
|
|
- [x] 2.1 `packages/api-stack/api/api-sandbox-vm-host-bridge/` with `package.json`, `tsconfig.lib.json`, `vite.config.ts`, `vitest.config.ts`, `README.md`.
|
|
- [x] 2.2 Deps: `@suaveplan/api-sandbox-vm`, `@suaveplan/api-host`, `@suaveplan/api-types`, `@suaveplan/error`, `tslib`, `zod`.
|
|
|
|
## 3. Implementation (feature folders)
|
|
|
|
- [x] 3.1 `src/bridge/bridge.ts` — `createSandboxedVmPluginModule({ sandbox, manifest, registry })` factory.
|
|
- [x] 3.2 `src/marshal/marshal-request.ts` — host RequestContext → SerializedRequest.
|
|
- [x] 3.3 `src/marshal/marshal-response.ts` — SerializedResponse → host Response.
|
|
- [x] 3.4 `src/error-codes/error-codes.ts` — 5 SAND_VM_BRIDGE codes + SandboxVmBridgeError with public constructor.
|
|
- [x] 3.5 `src/lifecycle/lifecycle.ts` — start/dispose forwarders with idempotency.
|
|
- [x] 3.6 `src/route-discovery/route-discovery.ts` — `bridge.registerRoute` capability + registry-capture + non-empty enforcement.
|
|
- [x] 3.7 `src/instruments/instruments.ts` — bridge-level OTel counters (requests-marshalled, marshal-failures, handler-rejections, invocation-duration histogram).
|
|
- [x] 3.8 Paired `.md` per implementation file (≥200 words, 6 sections).
|
|
|
|
## 4. Conformance harness
|
|
|
|
- [x] 4.1 `src/testing/vm-host-bridge-conformance/vm-host-bridge-conformance.ts` — `runVmHostBridgeConformance({ buildBridge })` with 5 invariants.
|
|
- [x] 4.2 Sibling `.md`, `.types.ts`, `.test.ts`, `index.ts`.
|
|
- [x] 4.3 Re-export via `./testing` subpath.
|
|
|
|
## 5. Tests
|
|
|
|
- [x] 5.1 Real vm-sandbox + bridged-plugin integration test in `tests/integration/full-flow.test.ts`.
|
|
- [x] 5.2 100% istanbul coverage on touched modules.
|
|
- [x] 5.3 Public-constructor lint clean.
|
|
- [x] 5.4 `bunx --bun turbo lint typecheck test:coverage --filter=@suaveplan/api-sandbox-vm-host-bridge` green.
|
|
|
|
## 6. Archive
|
|
|
|
- [x] 6.1 Fold delta into `openspec/specs/api-sandbox-vm-host-bridge/spec.md`.
|
|
- [x] 6.2 Move folder → `openspec/archive/2026-05-27-api-sandbox-vm-host-bridge/`.
|
|
- [x] 6.3 Refresh `MANIFEST.md`.
|