antpath 0.3.1 → 0.4.1
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.
- package/README.md +13 -14
- package/dist/_shared/blueprint.d.ts +263 -0
- package/dist/_shared/blueprint.js +505 -0
- package/dist/_shared/http.d.ts +6 -1
- package/dist/_shared/http.js +10 -5
- package/dist/_shared/index.d.ts +1 -0
- package/dist/_shared/index.js +1 -0
- package/dist/_shared/operations.d.ts +32 -9
- package/dist/_shared/operations.js +73 -12
- package/dist/_shared/runtime-types.d.ts +30 -0
- package/dist/_shared/stable.d.ts +14 -0
- package/dist/_shared/stable.js +14 -0
- package/dist/_shared/submission.d.ts +55 -0
- package/dist/_shared/submission.js +135 -1
- package/dist/cli.mjs +114 -58
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +13 -6
- package/dist/client.js +17 -16
- package/dist/client.js.map +1 -1
- package/docs/credentials.md +1 -3
- package/docs/quickstart.md +4 -7
- package/docs/release.md +57 -12
- package/examples/mcp-static-bearer.ts +1 -3
- package/examples/quickstart.ts +1 -3
- package/package.json +2 -3
- package/references/architecture-decisions.md +0 -473
- package/references/implementation-plan.md +0 -452
- package/references/research-sources.md +0 -41
- package/references/testing-strategy.md +0 -29
|
@@ -1,452 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: antpath implementation plan
|
|
3
|
-
status: accepted
|
|
4
|
-
scope: platform MVP
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# antpath implementation plan
|
|
8
|
-
|
|
9
|
-
## Goal
|
|
10
|
-
|
|
11
|
-
Convert antpath from an SDK-only package into a pnpm TypeScript workspace containing:
|
|
12
|
-
|
|
13
|
-
- a platform SDK in `packages/sdk`;
|
|
14
|
-
- a dashboard app in `apps/dashboard`;
|
|
15
|
-
- a worker service in `apps/worker`;
|
|
16
|
-
- shared packages for types, schema, configuration, redaction, and database helpers as needed.
|
|
17
|
-
|
|
18
|
-
The platform must submit, dispatch, observe, store metadata for, capture outputs from, and clean up Claude Managed Agents runs while preserving tenant isolation and secret boundaries.
|
|
19
|
-
|
|
20
|
-
Implementation is test-driven. Each behavior starts with the narrowest failing test that proves the desired invariant.
|
|
21
|
-
|
|
22
|
-
## Acceptance criteria
|
|
23
|
-
|
|
24
|
-
- The repository is a pnpm workspace and the current SDK is moved to `packages/sdk`.
|
|
25
|
-
- Dashboard and worker app folders exist with build/test integration.
|
|
26
|
-
- Auth.js authenticates dashboard users.
|
|
27
|
-
- SDK API tokens authenticate programmatic clients.
|
|
28
|
-
- Workspaces are the tenant boundary.
|
|
29
|
-
- BFF/server actions scope every dashboard/API operation by workspace membership or API-token scope.
|
|
30
|
-
- Supabase service-role credentials are never exposed to browser/client bundles.
|
|
31
|
-
- Supabase Postgres stores durable run, attempt, provider resource, event, output, output-capture-failure, cleanup, usage, workspace, and membership metadata. There is no persistent `provider_connections` table in MVP.
|
|
32
|
-
- Per-run secrets bundles (Anthropic key, optional MCP credentials, optional skill references) arrive inline on submission, are encrypted through Supabase Vault for the lifetime of that single run, and are deleted at terminal cleanup. The Vault entry is the only durable trace of the user's provider key.
|
|
33
|
-
- Run submission idempotency is enforced by workspace and request hash. The hash excludes the `secrets` block so re-submitting the same logical run with a new key still matches.
|
|
34
|
-
- Workers claim due runs with leases and `FOR UPDATE SKIP LOCKED`.
|
|
35
|
-
- Multiple workers can run concurrently without duplicate lifecycle ownership.
|
|
36
|
-
- Worker polling recovers from missed `NOTIFY`, worker restart, deploy, and expired leases.
|
|
37
|
-
- Worker creates per-run provider resources and journals them for cleanup.
|
|
38
|
-
- Worker polls provider status and events and stores only redacted metadata.
|
|
39
|
-
- Output capture is unconditional: every artifact Claude exposes on the run's session is written to private Supabase Storage, bounded only by the workspace storage cap. Files that would exceed the cap are persisted as `output_capture_failures` rows.
|
|
40
|
-
- BFF returns signed output links only after workspace authorization.
|
|
41
|
-
- Cleanup runs after terminal provider state and output capture, deletes the per-run Vault entry, and (by default) deletes Claude-side resources. `cleanup.claudeSession: "retain"` only affects Claude-side resources.
|
|
42
|
-
- Reconciliation can recover intended provider resources after partial worker crashes.
|
|
43
|
-
- User deletion is pending/soft until cleanup and storage deletion are complete.
|
|
44
|
-
- Exact tier/cap values are configurable through environment variables with conservative defaults and run-level snapshots.
|
|
45
|
-
- Security-sensitive BFF/API actions are audited and rate-limited.
|
|
46
|
-
- Workspace storage quota and workspace deletion are enforced before provider/storage side effects proceed.
|
|
47
|
-
- CI runs pnpm lint/test/build/package checks plus a local Supabase integration job.
|
|
48
|
-
- Tests follow the accepted taxonomy: deterministic unit tests (including fakes and sanitized recorded snapshots), live external-system integration tests with no skip flags, and top-to-bottom live e2e tests.
|
|
49
|
-
|
|
50
|
-
## Phase 1: Workspace foundation
|
|
51
|
-
|
|
52
|
-
Create the workspace structure without changing runtime behavior.
|
|
53
|
-
|
|
54
|
-
Deliverables:
|
|
55
|
-
|
|
56
|
-
- Root pnpm workspace configuration.
|
|
57
|
-
- Current SDK moved to `packages/sdk`.
|
|
58
|
-
- `apps/dashboard` placeholder.
|
|
59
|
-
- `apps/worker` placeholder.
|
|
60
|
-
- Shared TypeScript config/build/test commands.
|
|
61
|
-
- Existing SDK exports preserved or intentionally migrated with compatibility notes.
|
|
62
|
-
- Root validation commands:
|
|
63
|
-
- `pnpm lint`
|
|
64
|
-
- `pnpm test`
|
|
65
|
-
- `pnpm build`
|
|
66
|
-
|
|
67
|
-
TDD gate:
|
|
68
|
-
|
|
69
|
-
- Add tests or CI command checks proving the moved SDK still builds/tests from the root workspace.
|
|
70
|
-
|
|
71
|
-
Validation:
|
|
72
|
-
|
|
73
|
-
- Clean install works from root.
|
|
74
|
-
- Existing SDK tests still pass from root and package scope.
|
|
75
|
-
- Build emits SDK declarations.
|
|
76
|
-
|
|
77
|
-
## Phase 2: Shared contracts and configuration
|
|
78
|
-
|
|
79
|
-
Define shared platform contracts before implementing dashboard/worker behavior.
|
|
80
|
-
|
|
81
|
-
Deliverables:
|
|
82
|
-
|
|
83
|
-
- Shared run status and cleanup status types.
|
|
84
|
-
- Shared error taxonomy.
|
|
85
|
-
- Shared redaction helpers and secret wrapper.
|
|
86
|
-
- Shared Template/platform submission request schemas.
|
|
87
|
-
- Environment config parser with required-secret validation and conservative defaults.
|
|
88
|
-
- Plan/cap config defaults for:
|
|
89
|
-
- max run duration;
|
|
90
|
-
- workspace/user/token concurrency;
|
|
91
|
-
- polling intervals and jitter;
|
|
92
|
-
- provider token-bucket rates;
|
|
93
|
-
- retry backoffs;
|
|
94
|
-
- lease duration/renewal threshold;
|
|
95
|
-
- max attempts;
|
|
96
|
-
- cleanup retries;
|
|
97
|
-
- output caps;
|
|
98
|
-
- storage caps;
|
|
99
|
-
- signed-link TTL;
|
|
100
|
-
- free user allowance.
|
|
101
|
-
|
|
102
|
-
TDD gate:
|
|
103
|
-
|
|
104
|
-
- Unit tests for env parsing, missing required env failure, optional fallback defaults, cap snapshot values, redaction, and status transitions.
|
|
105
|
-
|
|
106
|
-
Validation:
|
|
107
|
-
|
|
108
|
-
- Missing required secrets/connectivity config fails service startup.
|
|
109
|
-
- Missing optional config falls back to conservative low limits.
|
|
110
|
-
|
|
111
|
-
## Phase 3: Database foundation
|
|
112
|
-
|
|
113
|
-
Create the durable source of truth.
|
|
114
|
-
|
|
115
|
-
Deliverables:
|
|
116
|
-
|
|
117
|
-
- Migration framework.
|
|
118
|
-
- Tables:
|
|
119
|
-
- Auth.js adapter tables: `users`, `accounts`, `sessions`, `verification_token`;
|
|
120
|
-
- antpath `app_users`;
|
|
121
|
-
- `workspaces`;
|
|
122
|
-
- `workspace_memberships`;
|
|
123
|
-
- `api_tokens`;
|
|
124
|
-
- `runs` (includes `execution_secret_id` referencing the per-run Vault entry);
|
|
125
|
-
- `run_attempts`;
|
|
126
|
-
- `provider_resources`;
|
|
127
|
-
- `run_events`;
|
|
128
|
-
- `output_objects`;
|
|
129
|
-
- `output_capture_failures`;
|
|
130
|
-
- `cleanup_attempts`;
|
|
131
|
-
- `usage_ledger`.
|
|
132
|
-
- Constraints:
|
|
133
|
-
- unique `(workspace_id, idempotency_key)` on runs;
|
|
134
|
-
- request-hash conflict handling;
|
|
135
|
-
- unique `(run_attempt_id, provider_event_id)` on events;
|
|
136
|
-
- foreign keys for workspace and attributed `app_user_id` where practical;
|
|
137
|
-
- RLS enabled and `anon`/`authenticated` direct table access revoked for platform/Auth.js tables.
|
|
138
|
-
- DB query helpers for tenant-scoped access.
|
|
139
|
-
|
|
140
|
-
TDD gate:
|
|
141
|
-
|
|
142
|
-
- Add failing database/security integration tests for migrations, idempotency, lease claim behavior, event dedupe, usage ledger idempotency, and cross-workspace access denial.
|
|
143
|
-
|
|
144
|
-
Validation:
|
|
145
|
-
|
|
146
|
-
- Migrations apply from a clean database.
|
|
147
|
-
- Concurrent claims use `FOR UPDATE SKIP LOCKED`.
|
|
148
|
-
- Event and usage ledger writes are transactional.
|
|
149
|
-
|
|
150
|
-
## Phase 4: Auth, BFF, and SDK API-token access
|
|
151
|
-
|
|
152
|
-
Establish the authorization boundary.
|
|
153
|
-
|
|
154
|
-
Deliverables:
|
|
155
|
-
|
|
156
|
-
- Auth.js dashboard authentication.
|
|
157
|
-
- User mirror or Auth.js adapter integration.
|
|
158
|
-
- Workspace membership resolution.
|
|
159
|
-
- Workspace switch/active workspace model.
|
|
160
|
-
- Hashed SDK API tokens with scopes, creator, revocation, and last-used tracking.
|
|
161
|
-
- Shared authorization helper for Auth.js sessions and API tokens.
|
|
162
|
-
- BFF/server-action routes for run submission/read/update operations.
|
|
163
|
-
- Browser/client bundle boundary preventing service-role import.
|
|
164
|
-
|
|
165
|
-
TDD gate:
|
|
166
|
-
|
|
167
|
-
- Add failing tests for membership-scoped queries, cross-workspace denial, API-token scope enforcement, revoked token rejection, attributed user freezing, and no browser service-role imports.
|
|
168
|
-
|
|
169
|
-
Validation:
|
|
170
|
-
|
|
171
|
-
- Dashboard reads and mutates only authorized workspace data.
|
|
172
|
-
- SDK token cannot access another workspace.
|
|
173
|
-
- Service-role credentials are server/worker only.
|
|
174
|
-
|
|
175
|
-
## Phase 5: Platform SDK client
|
|
176
|
-
|
|
177
|
-
Turn the SDK into the programmatic client for the platform while preserving Template ergonomics where practical.
|
|
178
|
-
|
|
179
|
-
Deliverables:
|
|
180
|
-
|
|
181
|
-
- SDK client for platform API base URL and API token.
|
|
182
|
-
- `AntpathClient` accepts `{ baseUrl, apiToken, workspaceId }` at construction; every submission carries its own inline `secrets` bundle (Anthropic key + optional MCP credentials + optional skill references). No client-held default bundle — secrets are explicit at every call site.
|
|
183
|
-
- Submit run API (carries inline `secrets`).
|
|
184
|
-
- Get run status/detail API.
|
|
185
|
-
- List metadata events API.
|
|
186
|
-
- List outputs API (returns successful captures and capture failures).
|
|
187
|
-
- Create signed output link API.
|
|
188
|
-
- Cancel run API.
|
|
189
|
-
- Delete run API.
|
|
190
|
-
- Typed errors for auth, quota, validation, conflict, not found, and provider/platform failures.
|
|
191
|
-
- Compatibility path from existing Template definitions to platform submission requests.
|
|
192
|
-
|
|
193
|
-
TDD gate:
|
|
194
|
-
|
|
195
|
-
- Type/contract tests for public SDK API and runtime tests with fake platform responses.
|
|
196
|
-
- Tests asserting `secrets` never appears in serialized request hashes, error metadata, or retry telemetry.
|
|
197
|
-
|
|
198
|
-
Validation:
|
|
199
|
-
|
|
200
|
-
- SDK does not persist provider keys: it forwards them to the platform per submission, where they are vaulted for the lifetime of one run and then deleted.
|
|
201
|
-
- SDK handles idempotency conflict, unauthorized, quota, and terminal states deterministically.
|
|
202
|
-
|
|
203
|
-
## Phase 6: Worker claim loop and state machine
|
|
204
|
-
|
|
205
|
-
Implement durable lifecycle ownership independent of provider details.
|
|
206
|
-
|
|
207
|
-
Deliverables:
|
|
208
|
-
|
|
209
|
-
- Polling loop for due runs.
|
|
210
|
-
- Optional Postgres `NOTIFY` listener for fast wakeup.
|
|
211
|
-
- Lease claim/release helpers.
|
|
212
|
-
- Lease-guarded status update helper.
|
|
213
|
-
- Per-workspace rate limit hooks.
|
|
214
|
-
- Fair due-run ordering across workspaces.
|
|
215
|
-
- Cancellation/delete request checks before side effects.
|
|
216
|
-
- Timeout handling.
|
|
217
|
-
- Error classification.
|
|
218
|
-
- Retry/backoff scheduling through `next_check_at`.
|
|
219
|
-
|
|
220
|
-
TDD gate:
|
|
221
|
-
|
|
222
|
-
- Add failing component and database tests for concurrent fake workers, expired lease reclaim, lease-token update failures, cancellation races, timeout races, and polling fallback after missed `NOTIFY`.
|
|
223
|
-
|
|
224
|
-
Validation:
|
|
225
|
-
|
|
226
|
-
- Multiple workers do not process the same run step.
|
|
227
|
-
- Expired leases recover.
|
|
228
|
-
- Worker restart leaves no required in-memory state.
|
|
229
|
-
|
|
230
|
-
## Phase 7: Fake provider lifecycle harness
|
|
231
|
-
|
|
232
|
-
Prove worker behavior with deterministic provider boundaries before live provider integration.
|
|
233
|
-
|
|
234
|
-
Deliverables:
|
|
235
|
-
|
|
236
|
-
- Fake provider implementing create resources, create session, send event, retrieve status, list events, list files, download file, and cleanup.
|
|
237
|
-
- Fake storage adapter.
|
|
238
|
-
- Fake Vault adapter.
|
|
239
|
-
- Table-driven lifecycle tests.
|
|
240
|
-
|
|
241
|
-
TDD gate:
|
|
242
|
-
|
|
243
|
-
- Add component tests for happy path, provider errors, terminal states, duplicate events, output capture, cleanup failures, and retryable failures.
|
|
244
|
-
|
|
245
|
-
Validation:
|
|
246
|
-
|
|
247
|
-
- Core run lifecycle is correct without network calls.
|
|
248
|
-
- Duplicate/replayed provider events do not double-count usage.
|
|
249
|
-
|
|
250
|
-
## Phase 8: Claude provider adapter
|
|
251
|
-
|
|
252
|
-
Adapt existing Claude Managed Agents provider code for the platform worker.
|
|
253
|
-
|
|
254
|
-
Deliverables:
|
|
255
|
-
|
|
256
|
-
- Provider client wrapper for worker.
|
|
257
|
-
- Create Environment per run.
|
|
258
|
-
- Upload skills/resources as needed.
|
|
259
|
-
- Create Agent with model/system/MCP/skills/tool policy.
|
|
260
|
-
- Create provider Vault/Credentials for MCP credentials.
|
|
261
|
-
- Create Session.
|
|
262
|
-
- Send initial user event.
|
|
263
|
-
- Retrieve session status.
|
|
264
|
-
- List session events with cursor/filter where available.
|
|
265
|
-
- List/download session files.
|
|
266
|
-
- Cleanup/archive/delete resources.
|
|
267
|
-
- Provider metadata naming/tagging for reconciliation.
|
|
268
|
-
- Provider error classification.
|
|
269
|
-
|
|
270
|
-
TDD gate:
|
|
271
|
-
|
|
272
|
-
- Add sanitized recorded provider snapshot unit tests for parsing and cleanup behavior before live e2e.
|
|
273
|
-
- Verify exact Claude events pagination/filter semantics and document bounded fallback if needed.
|
|
274
|
-
|
|
275
|
-
Validation:
|
|
276
|
-
|
|
277
|
-
- No approval-required tool policy reaches the provider.
|
|
278
|
-
- Provider IDs are persisted for cleanup.
|
|
279
|
-
- Sanitized fixtures contain no secrets.
|
|
280
|
-
|
|
281
|
-
## Phase 9: Provider resource journaling and reconciliation sweeper
|
|
282
|
-
|
|
283
|
-
Close resource leak windows.
|
|
284
|
-
|
|
285
|
-
Deliverables:
|
|
286
|
-
|
|
287
|
-
- Pre-insert intended `provider_resources` rows before provider side effects where possible.
|
|
288
|
-
- Deterministic provider names/metadata with antpath workspace/run/attempt identifiers.
|
|
289
|
-
- Sweeper for expired leases and unfinished intended resources.
|
|
290
|
-
- Orphan matching by provider list/search APIs where available.
|
|
291
|
-
- Reschedule recoverable runs.
|
|
292
|
-
- Cleanup orphaned resources.
|
|
293
|
-
|
|
294
|
-
TDD gate:
|
|
295
|
-
|
|
296
|
-
- Add tests that simulate worker crashes after provider create succeeds but before provider id persistence.
|
|
297
|
-
|
|
298
|
-
Validation:
|
|
299
|
-
|
|
300
|
-
- Sweeper can attach or cleanup recoverable resources.
|
|
301
|
-
- Cleanup remains idempotent after partial failures.
|
|
302
|
-
|
|
303
|
-
## Phase 10: Output capture and Supabase Storage
|
|
304
|
-
|
|
305
|
-
Unconditionally capture every artifact the user's Claude session exposes into private Supabase Storage. The workspace storage cap is the only user-visible quota.
|
|
306
|
-
|
|
307
|
-
Deliverables:
|
|
308
|
-
|
|
309
|
-
- Worker terminal-state list of session-scoped files via the Claude Files API (`GET /v1/files?scope_id=<sessionId>`), returning `id`, `filename`, and `size_bytes`.
|
|
310
|
-
- Workspace storage usage accounting helper.
|
|
311
|
-
- Pre-download quota check: if `(workspace_used + size_bytes) > workspace cap`, write an `output_capture_failures` row with `reason = "workspace_quota_exceeded"` and continue without downloading.
|
|
312
|
-
- Streaming download via `GET /v1/files/{file_id}/content` with a worker-internal safety cap so malformed listing responses cannot OOM the worker; safety-cap aborts are recorded as `output_capture_failures` with `reason = "download_failed"`.
|
|
313
|
-
- Private Supabase Storage upload with workspace-scoped path policy.
|
|
314
|
-
- `output_objects` metadata insert for each successful capture.
|
|
315
|
-
- Per-user attribution frozen from the run row (audit/billing dimension only; not a quota).
|
|
316
|
-
- Signed-link BFF action/API for both `output_objects` rows; capture failures are read-only.
|
|
317
|
-
|
|
318
|
-
TDD gate:
|
|
319
|
-
|
|
320
|
-
- Add failing tests for: pre-download quota check choosing failure-row over download when over cap; safety-cap abort recording a failure row; happy path writing both an `output_objects` row and an audit entry; signed-link authorization; cross-workspace denial; listing returning zero files producing zero rows; listing returning N files with mixed sizes recording the expected mix of successes and failures.
|
|
321
|
-
- Tests must assert there is no user-facing knob for `capture: boolean`, `globs`, or per-file caps.
|
|
322
|
-
|
|
323
|
-
Validation:
|
|
324
|
-
|
|
325
|
-
- Output capture is unconditional and cannot be opted out by the submitter.
|
|
326
|
-
- Oversized output payloads do not OOM the worker.
|
|
327
|
-
- BFF only creates signed links for authorized workspace users/tokens.
|
|
328
|
-
- Dashboard renders successful captures and capture failures side by side.
|
|
329
|
-
|
|
330
|
-
## Phase 11: Cleanup, deletion, and retention
|
|
331
|
-
|
|
332
|
-
Make cleanup and deletion first-class state machines. Cleanup must also destroy the per-run Vault secret.
|
|
333
|
-
|
|
334
|
-
Deliverables:
|
|
335
|
-
|
|
336
|
-
- Cleanup ordering (per the architecture decisions doc):
|
|
337
|
-
- capture session-scoped files (Phase 10);
|
|
338
|
-
- provider session files / session where supported;
|
|
339
|
-
- agent / archive;
|
|
340
|
-
- environment / archive or delete;
|
|
341
|
-
- skills uploaded for this session and other ephemeral provider resources;
|
|
342
|
-
- provider Vault/credentials created on Claude's side for MCP wiring;
|
|
343
|
-
- the antpath per-run Vault entry: `vault.deleteSecret(runs.execution_secret_id)` and clear the column;
|
|
344
|
-
- local Supabase Storage and metadata only on user deletion.
|
|
345
|
-
- The Claude-side cleanup steps are skipped when `cleanup.claudeSession === "retain"` (or the worker default is `retain`); the per-run Vault deletion still runs.
|
|
346
|
-
- Cleanup retry/backoff with idempotent calls.
|
|
347
|
-
- `cleanup_attempts` records.
|
|
348
|
-
- Cleanup state separate from user-facing run terminal state.
|
|
349
|
-
- User `pending_delete` flow.
|
|
350
|
-
- Workspace deletion flow.
|
|
351
|
-
- Audit logs and rate limits for delete/cancel/signed-link/API-token mutations.
|
|
352
|
-
|
|
353
|
-
TDD gate:
|
|
354
|
-
|
|
355
|
-
- Add tests for cleanup after success, failure, timeout, cancellation, partial provider creation, duplicate cleanup calls, and pending-delete races.
|
|
356
|
-
- Add tests that the per-run Vault entry is deleted exactly once and `runs.execution_secret_id` is cleared whether or not Claude-side resources are retained.
|
|
357
|
-
- Add tests that a key rotated on the provider side mid-run produces a `tenant_permanent` failure on the next provider call and that cleanup still runs (and the Vault entry is still deleted).
|
|
358
|
-
|
|
359
|
-
Validation:
|
|
360
|
-
|
|
361
|
-
- Cleanup failures surface actionable redacted errors.
|
|
362
|
-
- Hard deletion only happens after cleanup/storage deletion succeeds.
|
|
363
|
-
- The per-run Vault entry is always destroyed at terminal cleanup, regardless of retention knobs.
|
|
364
|
-
|
|
365
|
-
## Phase 12: Minimal dashboard
|
|
366
|
-
|
|
367
|
-
Build the tenant-scoped monitoring surface.
|
|
368
|
-
|
|
369
|
-
Deliverables:
|
|
370
|
-
|
|
371
|
-
- Sign-in/out.
|
|
372
|
-
- Workspace switcher.
|
|
373
|
-
- Runs list.
|
|
374
|
-
- Run detail page.
|
|
375
|
-
- Status, timestamps, attributed user, template hash, provider IDs where safe, usage, cleanup state, and redacted metadata events.
|
|
376
|
-
- Output list and signed-link actions.
|
|
377
|
-
- Cancel/delete actions.
|
|
378
|
-
- Quota/cap warnings.
|
|
379
|
-
|
|
380
|
-
TDD gate:
|
|
381
|
-
|
|
382
|
-
- Add component or integration tests for tenant-scoped data loading through BFF only and role/scope behavior for actions.
|
|
383
|
-
|
|
384
|
-
Validation:
|
|
385
|
-
|
|
386
|
-
- Dashboard cannot read another workspace's runs or outputs.
|
|
387
|
-
- Dashboard displays cleanup retry/failure separately from run success/failure.
|
|
388
|
-
|
|
389
|
-
## Phase 13: Observability and operations
|
|
390
|
-
|
|
391
|
-
Make the platform operable for future agents.
|
|
392
|
-
|
|
393
|
-
Deliverables:
|
|
394
|
-
|
|
395
|
-
- Structured worker logs.
|
|
396
|
-
- Redacted error reporting.
|
|
397
|
-
- Run lifecycle metrics.
|
|
398
|
-
- Worker health endpoint.
|
|
399
|
-
- Queue depth/due run metrics.
|
|
400
|
-
- Cleanup retry/dead-letter visibility.
|
|
401
|
-
- Reconciliation summary logs.
|
|
402
|
-
- Admin-only recovery tools if needed.
|
|
403
|
-
|
|
404
|
-
TDD gate:
|
|
405
|
-
|
|
406
|
-
- Add tests proving logs/events/errors cannot serialize secret wrappers and include enough non-secret identifiers for diagnosis.
|
|
407
|
-
|
|
408
|
-
Validation:
|
|
409
|
-
|
|
410
|
-
- Worker `/health` reports readiness.
|
|
411
|
-
- Operational traces include run id, workspace id, phase, attempt id, provider resource ids where safe, and cleanup status.
|
|
412
|
-
|
|
413
|
-
## Phase 14: Live-gated e2e and release readiness
|
|
414
|
-
|
|
415
|
-
Verify the complete lifecycle only when credentials are intentionally present.
|
|
416
|
-
|
|
417
|
-
Deliverables:
|
|
418
|
-
|
|
419
|
-
- Live e2e command guarded by explicit env flag.
|
|
420
|
-
- Low-cost Claude Managed Agents fixture Template.
|
|
421
|
-
- Cleanup in `finally`.
|
|
422
|
-
- Release/readiness docs.
|
|
423
|
-
- Updated README and examples for platform SDK usage.
|
|
424
|
-
- GitHub Actions pnpm CI and local Supabase integration job.
|
|
425
|
-
- Vercel dashboard and Railway worker environment-variable contracts.
|
|
426
|
-
- `pnpm dev:stack` for local Supabase/dashboard/worker startup with fail-fast config checks.
|
|
427
|
-
- Deterministic MCP/skills request-wiring tests for SDK and worker providers.
|
|
428
|
-
- Separately gated public MCP plus Anthropic skill full-session e2e.
|
|
429
|
-
|
|
430
|
-
TDD gate:
|
|
431
|
-
|
|
432
|
-
- Live e2e is not a TDD driver for core logic, but must prove final integration before release.
|
|
433
|
-
- MCP/skills request shape, permission policy, and secret non-leakage must be covered by normal deterministic tests before relying on public live e2e.
|
|
434
|
-
|
|
435
|
-
Validation:
|
|
436
|
-
|
|
437
|
-
- Full submit -> provider session -> metadata poll -> output capture -> signed link -> cleanup works.
|
|
438
|
-
- Public MCP/skills e2e runs through the explicit `pnpm test:e2e:live` command with live credentials, reaches success, emits SDK/provider events, records safe provider IDs, exercises the default cleanup path, and exercises the `cleanup.claudeSession = "retain"` override path with a follow-up provider API check.
|
|
439
|
-
- Default `pnpm lint`, `pnpm test`, and `pnpm build` pass.
|
|
440
|
-
|
|
441
|
-
## Backlog
|
|
442
|
-
|
|
443
|
-
- Persistent workspace-level provider connections (saved Anthropic keys with rotation/revocation/re-use). The MVP submission contract carries the key inline per run.
|
|
444
|
-
- Provider webhooks as wakeup/reconciliation accelerator.
|
|
445
|
-
- SSE live event stream for richer dashboard UI.
|
|
446
|
-
- Supabase Realtime with explicit Auth.js-to-Supabase authorization design.
|
|
447
|
-
- Agent/Environment caching by Template/config hash.
|
|
448
|
-
- Additional provider adapters.
|
|
449
|
-
- Runtime human approval flow if product scope changes.
|
|
450
|
-
- Advanced billing and plan management.
|
|
451
|
-
- Cloud Template registry.
|
|
452
|
-
- Curated MCP adapter catalog.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: antpath research sources
|
|
3
|
-
status: reference
|
|
4
|
-
scope: architecture research
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Research sources
|
|
8
|
-
|
|
9
|
-
Primary sources used to frame the platform MVP architecture.
|
|
10
|
-
|
|
11
|
-
| Topic | Source | Notes |
|
|
12
|
-
| --- | --- | --- |
|
|
13
|
-
| Claude Managed Agents overview | https://platform.claude.com/docs/en/managed-agents/overview.md | Agent, Environment, Session, Event primitives; provider-managed autonomous sessions. |
|
|
14
|
-
| Claude Managed Agents environments | https://platform.claude.com/docs/en/managed-agents/environments.md | Environments define container/package/network configuration; sessions get isolated instances. |
|
|
15
|
-
| Claude Managed Agents events | https://platform.claude.com/docs/en/managed-agents/events-and-streaming.md | Event stream, idle/running/terminated states, user messages, interruptions. |
|
|
16
|
-
| Claude Managed Agents files | https://platform.claude.com/docs/en/managed-agents/files.md | Session-scoped files can be listed by `scope_id` and downloaded by file ID. |
|
|
17
|
-
| Claude Managed Agents vaults | https://platform.claude.com/docs/en/managed-agents/vaults.md | Provider-side MCP credentials via vault IDs; static bearer and OAuth credentials. |
|
|
18
|
-
| Claude Managed Agents MCP connector | https://platform.claude.com/docs/en/managed-agents/mcp-connector.md | Agent declares MCP URLs; session supplies vault IDs. |
|
|
19
|
-
| Claude Managed Agents permission policies | https://platform.claude.com/docs/en/managed-agents/permission-policies.md | `always_allow` vs `always_ask`; MVP must avoid approval-required tools. |
|
|
20
|
-
| Anthropic API and data retention | https://platform.claude.com/docs/en/manage-claude/api-and-data-retention.md | Managed Agents are stateful and not automatically deleted. |
|
|
21
|
-
| Anthropic webhooks | https://docs.anthropic.com/en/api/webhooks | Webhooks are backlog; if used, treat as wakeup/reconciliation signals, not primary state. |
|
|
22
|
-
| Supabase Postgres RLS | https://supabase.com/docs/guides/database/postgres/row-level-security | RLS is not the MVP browser boundary because Auth.js is primary auth and browser data access goes through BFF. |
|
|
23
|
-
| Supabase Realtime | https://supabase.com/docs/guides/realtime | Realtime is backlog until Auth.js-to-Supabase authorization is explicitly solved. |
|
|
24
|
-
| Supabase Storage access control | https://supabase.com/docs/guides/storage/security/access-control | Private buckets and signed/server-mediated access for captured outputs. |
|
|
25
|
-
| Supabase Vault | https://supabase.com/docs/guides/database/vault | Encrypted storage for workspace BYO provider keys. |
|
|
26
|
-
| Auth.js | https://authjs.dev/ | Dashboard user auth; BFF resolves identity and workspace membership. |
|
|
27
|
-
| Vercel | https://vercel.com/docs | Dashboard deployment baseline. |
|
|
28
|
-
| Railway | https://docs.railway.com/ | Persistent worker deployment baseline. |
|
|
29
|
-
| PostgreSQL `SELECT` locking | https://www.postgresql.org/docs/current/sql-select.html | `FOR UPDATE SKIP LOCKED` for concurrent worker claims. |
|
|
30
|
-
| PostgreSQL `LISTEN`/`NOTIFY` | https://www.postgresql.org/docs/current/sql-notify.html | `NOTIFY` is wakeup only; polling remains source of truth. |
|
|
31
|
-
| npm workspaces | https://docs.npmjs.com/cli/using-npm/workspaces | Repository migration to a TypeScript workspace. |
|
|
32
|
-
| OpenAI data controls | https://developers.openai.com/api/docs/guides/your-data | Responses retention, `store`, files, container lifecycle, ZDR behavior. |
|
|
33
|
-
| OpenAI remote MCP tools | https://developers.openai.com/api/docs/guides/tools-remote-mcp | Remote MCP `authorization` is sent per request and not stored by OpenAI. |
|
|
34
|
-
| MCP transports | https://modelcontextprotocol.io/specification/2025-11-25/basic/transports.md | Stdio and Streamable HTTP requirements, session IDs, Origin validation. |
|
|
35
|
-
| MCP authorization | https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization.md | OAuth 2.1/OIDC discovery, protected resource metadata, scopes/resource binding. |
|
|
36
|
-
| MCP tools | https://modelcontextprotocol.io/specification/2025-11-25/server/tools.md | Tool schemas, structured content, task support, HITL considerations. |
|
|
37
|
-
| MCP security best practices | https://modelcontextprotocol.io/docs/tutorials/security/security_best_practices.md | Confused deputy and token passthrough risks. |
|
|
38
|
-
| MCP client best practices | https://modelcontextprotocol.io/docs/develop/clients/client-best-practices.md | Progressive discovery, dynamic server management, prompt-cache considerations. |
|
|
39
|
-
| OpenAI Agents SDK JS | https://openai.github.io/openai-agents-js/ | Future comparison point for OpenAI support. |
|
|
40
|
-
| Vercel AI SDK agents | https://ai-sdk.dev/docs/agents/building-agents | Future comparison point for TypeScript agent abstractions. |
|
|
41
|
-
| Temporal TypeScript workflows | https://docs.temporal.io/develop/typescript/workflows/basics | Future reference if antpath adds durable cloud orchestration. |
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: antpath testing strategy
|
|
3
|
-
status: accepted
|
|
4
|
-
scope: SDK package
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# antpath SDK testing strategy
|
|
8
|
-
|
|
9
|
-
The SDK follows the repository taxonomy: unit, integration, and e2e only.
|
|
10
|
-
|
|
11
|
-
## Unit
|
|
12
|
-
|
|
13
|
-
`pnpm test` and `pnpm test:unit` run deterministic unit tests. Unit tests may use fakes, generated data, and sanitized recorded snapshots, including expensive provider responses captured once and replayed later.
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
pnpm test
|
|
17
|
-
pnpm test:unit
|
|
18
|
-
pnpm test:property
|
|
19
|
-
pnpm test:unit:recorded
|
|
20
|
-
pnpm test:load:replay
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Integration
|
|
24
|
-
|
|
25
|
-
Integration tests run live external systems with no fakes and no skip flags. SDK package integration is currently covered through the workspace Supabase integration and worker provider integration commands.
|
|
26
|
-
|
|
27
|
-
## E2E
|
|
28
|
-
|
|
29
|
-
`pnpm test:e2e:live` runs the live top-to-bottom Claude Managed Agents flow. The command itself is the opt-in and requires `ANTHROPIC_API_KEY`; missing credentials fail the command rather than skipping.
|