Run 2: Remaining Proxies, Polish, and Publish Preparation
Entry Criteria
Section titled “Entry Criteria”| # | Criterion | Verification Command | Expected Output |
|---|---|---|---|
| 1 | Run 1 exit gate passes | bash .../planning/run-1-foundation/validate-exit.sh | ALL CHECKS PASSED |
| 2 | Shared utilities exist | test -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/src/shared/http-client.ts && echo OK | OK |
| 3 | TenantProxy exists as reference | test -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/src/system/tenant.ts && echo OK | OK |
| 4 | CI workflows exist | test -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/.github/workflows/ci.yml && echo OK | OK |
| 5 | Staging API reachable | curl -sf -o /dev/null https://stage.alpha002.io.arda.cards/v1/user-account/docs/openApi.json && echo OK | OK |
Artifact Specifications
Section titled “Artifact Specifications”| Artifact | Path | Format | Description |
|---|---|---|---|
| UserAccountProxy | src/system/user-account.ts + .types.ts | TypeScript | Standard CRUD proxy |
| AgentForProxy | src/system/agent-for.ts + .types.ts | TypeScript | Standard CRUD proxy |
| InvitationProxy | src/system/invitation.ts + .types.ts | TypeScript | Standard CRUD proxy |
| BusinessAffiliateProxy | src/reference/business-affiliate.ts + .types.ts | TypeScript | CRUD + roles + with-details |
| ItemProxy | src/reference/item.ts + .types.ts | TypeScript | CRUD + draft + supply + lookups + print + CSV upload |
| KanbanProxy | src/resources/kanban.ts + .types.ts | TypeScript | CRUD + details + summary + events + print |
| OrderProxy | src/procurement/order.ts + .types.ts | TypeScript | CRUD + full view + from-items/cards + lines + lifecycle + annotations |
| Domain barrels | src/{reference,resources,procurement}/index.ts | TypeScript | Domain-scoped re-exports |
| Root barrel | src/index.ts | TypeScript | Re-exports all proxies + shared types |
| Test files | tests/{system,reference,resources,procurement}/*.test.ts | TypeScript | Mock-fetch tests for each proxy |
| README | README.md | Markdown | Usage examples, installation, API surface |
| CHANGELOG | CHANGELOG.md | Markdown | Initial 0.1.0 entry |
Task List
Section titled “Task List”| # | Task | Persona | Depends On | Status | Acceptance Criteria |
|---|---|---|---|---|---|
| 2.1 | Fetch user-account OpenAPI spec; implement UserAccountProxy + types | back-end-engineer | — | Pending | REQ-SYS-002; standard CRUD; types from live OpenAPI |
| 2.2 | Fetch agent-for OpenAPI spec; implement AgentForProxy + types | back-end-engineer | — | Pending | REQ-SYS-003; standard CRUD; types from live OpenAPI |
| 2.3 | Fetch invitation OpenAPI spec; implement InvitationProxy + types | back-end-engineer | — | Pending | REQ-SYS-004; standard CRUD; types from live OpenAPI |
| 2.4 | Write tests for UserAccountProxy, AgentForProxy, InvitationProxy | back-end-engineer | 2.1–2.3 | Pending | All 7 standard methods tested per proxy; follows tenant test pattern |
| 2.5 | Update src/system/index.ts barrel to export all system proxies | back-end-engineer | 2.1–2.3 | Pending | All 4 system proxies + types re-exported |
| 2.6 | Fetch business-affiliate OpenAPI spec; implement BusinessAffiliateProxy + types | back-end-engineer | — | Pending | REQ-REF-001, REQ-REF-002; CRUD + roles + with-details |
| 2.7 | Fetch item OpenAPI spec; implement ItemProxy + types | back-end-engineer | — | Pending | REQ-REF-003, REQ-REF-004; CRUD + draft + supply + lookups + print + CSV |
| 2.8 | Write tests for BusinessAffiliateProxy and ItemProxy | back-end-engineer | 2.6, 2.7 | Pending | Standard CRUD + all module-specific operations tested |
| 2.9 | Create src/reference/index.ts barrel export | back-end-engineer | 2.6, 2.7 | Pending | Both reference proxies + types re-exported |
| 2.10 | Fetch kanban OpenAPI spec; implement KanbanProxy + types | back-end-engineer | — | Pending | REQ-RES-001, REQ-RES-002, REQ-RES-003; CRUD + details + summaries + events + print; event type union |
| 2.11 | Write tests for KanbanProxy | back-end-engineer | 2.10 | Pending | Standard CRUD + all module-specific ops; event type safety verified |
| 2.12 | Create src/resources/index.ts barrel export | back-end-engineer | 2.10 | Pending | KanbanProxy + types re-exported |
| 2.13 | Fetch order OpenAPI spec; implement OrderProxy + types | back-end-engineer | — | Pending | REQ-PROC-001 through REQ-PROC-004; CRUD + full view + from-items/cards + lines + lifecycle + annotations |
| 2.14 | Write tests for OrderProxy | back-end-engineer | 2.13 | Pending | Standard CRUD + all module-specific ops tested |
| 2.15 | Create src/procurement/index.ts barrel export | back-end-engineer | 2.13 | Pending | OrderProxy + types re-exported |
| 2.16 | Create root src/index.ts barrel export | back-end-engineer | 2.5, 2.9, 2.12, 2.15 | Pending | REQ-PKG-001; all proxies + shared types re-exported |
| 2.17 | Write README.md with installation, usage examples, API surface | back-end-engineer | 2.16 | Pending | Covers all 8 proxies; shows barrel and deep import patterns |
| 2.18 | Write CHANGELOG.md initial entry | back-end-engineer | 2.16 | Pending | 0.1.0 entry describing initial release |
| 2.19 | Verify full toolchain | back-end-engineer | 2.1–2.18 | Pending | npm run format:check && npm run typecheck && npm run lint && npm run test:coverage && npm run build all pass; coverage 80%+ |
Internal Dependency Graph
Section titled “Internal Dependency Graph”System proxies (2.1, 2.2, 2.3) ─── 2.4 (tests) ─── 2.5 (system barrel) ──┐Reference proxies (2.6, 2.7) ───── 2.8 (tests) ─── 2.9 (ref barrel) ──────┤Kanban proxy (2.10) ────────────── 2.11 (tests) ── 2.12 (res barrel) ──────┼─ 2.16 (root barrel)Order proxy (2.13) ─────────────── 2.14 (tests) ── 2.15 (proc barrel) ─────┘ │ 2.17 (README) 2.18 (CHANGELOG) │ 2.19 (verify)Proxy implementations within each domain group (2.1/2.2/2.3, 2.6/2.7, etc.) are independent and can be written sequentially within the same agent session. The domain groups themselves are also independent of each other, though sequential execution is fine since it’s a single agent.
Exit Criteria
Section titled “Exit Criteria”| # | Criterion | Verification Command | Expected Output |
|---|---|---|---|
| 1 | All 8 proxy source files exist | ls /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/src/{system/{tenant,user-account,agent-for,invitation},reference/{business-affiliate,item},resources/kanban,procurement/order}.ts | wc -l | 8 |
| 2 | All 8 type files exist | ls /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/src/{system/{tenant,user-account,agent-for,invitation},reference/{business-affiliate,item},resources/kanban,procurement/order}.types.ts | wc -l | 8 |
| 3 | All 8 test files exist | ls /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/tests/{system/{tenant,user-account,agent-for,invitation},reference/{business-affiliate,item},resources/kanban,procurement/order}.test.ts | wc -l | 8 |
| 4 | Root barrel exists | test -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/src/index.ts && echo OK | OK |
| 5 | Format check passes | cd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run format:check | Exit code 0 |
| 6 | Typecheck passes | cd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run typecheck | Exit code 0 |
| 7 | Lint passes | cd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run lint | Exit code 0 |
| 8 | Tests pass with coverage | cd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run test:coverage | Exit code 0; 80%+ lines and branches |
| 9 | Build succeeds | cd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run build | Exit code 0 |
| 10 | All export paths resolve | node -e "Promise.all(['.','./shared','./system','./reference','./resources','./procurement'].map(p=>import(p.replace('.','./dist')+'/index.js'))).then(()=>console.log('OK'))" | OK |
| 11 | README exists | test -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/README.md && echo OK | OK |
| 12 | CHANGELOG exists | test -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/CHANGELOG.md && echo OK | OK |
| 13 | All changes committed | git -C /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy status --porcelain | (empty) |
Agent Prompt Templates
Section titled “Agent Prompt Templates”Back-End Engineer — be-api-proxy-proxies
Section titled “Back-End Engineer — be-api-proxy-proxies”You are implementing the remaining proxy classes for the @arda-cards/api-proxy TypeScript package.
Working directory: /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxyBranch: jmpicnic/initial-implementation
## Context- Read the project specification: .../api-proxy/specification.md- Read the requirements: .../api-proxy/requirements.md- Read the decision log: .../api-proxy/decision-log.md- Use the existing TenantProxy (src/system/tenant.ts) and its test (tests/system/tenant.test.ts) as the PATTERN to follow for all remaining proxies.
## Type Derivation (DQ-004)For each module, fetch the OpenAPI spec from: https://stage.alpha002.io.arda.cards/v1/{module}/docs/openApi.jsonDerive TypeScript types from the spec. Fall back to Kotlin source for ambiguities: - System modules: /Users/jmp/code/arda/accounts-component/ - Operations modules: /Users/jmp/code/arda/operations/
## TasksComplete tasks 2.1 through 2.19 from this project plan.
## Key Constraints- Follow the TenantProxy pattern exactly (composition, ProxyConfig constructor)- Paths must match the endpoint catalog (DQ-001) — note the doubled entity pattern- HTTP methods must match the specification (DQ-002)- 80% line and branch coverage for all new codeHandoff
Section titled “Handoff”Artifacts Consumed (from previous runs)
Section titled “Artifacts Consumed (from previous runs)”| Artifact | Source Run | Path |
|---|---|---|
| Initialized repo with toolchain | Run 1 | api-proxy/ |
| Shared utilities | Run 1 | api-proxy/src/shared/ |
| Tenant reference proxy | Run 1 | api-proxy/src/system/tenant.* |
| Tenant test pattern | Run 1 | api-proxy/tests/system/tenant.test.ts |
| CI/CD workflows | Run 1 | api-proxy/.github/workflows/ |
| Corrected specification | Run 1 | documentation/.../api-proxy/specification.md |
Artifacts Produced (for subsequent runs)
Section titled “Artifacts Produced (for subsequent runs)”| Artifact | Consumer | Path |
|---|---|---|
| Complete package ready for PR | PR review + merge | api-proxy/ |
| README | Package consumers | api-proxy/README.md |
| CHANGELOG | Release process | api-proxy/CHANGELOG.md |
Copyright: © Arda Systems 2025-2026, All rights reserved