Skip to content

Run 2: Remaining Proxies, Polish, and Publish Preparation

#CriterionVerification CommandExpected Output
1Run 1 exit gate passesbash .../planning/run-1-foundation/validate-exit.shALL CHECKS PASSED
2Shared utilities existtest -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/src/shared/http-client.ts && echo OKOK
3TenantProxy exists as referencetest -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/src/system/tenant.ts && echo OKOK
4CI workflows existtest -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/.github/workflows/ci.yml && echo OKOK
5Staging API reachablecurl -sf -o /dev/null https://stage.alpha002.io.arda.cards/v1/user-account/docs/openApi.json && echo OKOK
ArtifactPathFormatDescription
UserAccountProxysrc/system/user-account.ts + .types.tsTypeScriptStandard CRUD proxy
AgentForProxysrc/system/agent-for.ts + .types.tsTypeScriptStandard CRUD proxy
InvitationProxysrc/system/invitation.ts + .types.tsTypeScriptStandard CRUD proxy
BusinessAffiliateProxysrc/reference/business-affiliate.ts + .types.tsTypeScriptCRUD + roles + with-details
ItemProxysrc/reference/item.ts + .types.tsTypeScriptCRUD + draft + supply + lookups + print + CSV upload
KanbanProxysrc/resources/kanban.ts + .types.tsTypeScriptCRUD + details + summary + events + print
OrderProxysrc/procurement/order.ts + .types.tsTypeScriptCRUD + full view + from-items/cards + lines + lifecycle + annotations
Domain barrelssrc/{reference,resources,procurement}/index.tsTypeScriptDomain-scoped re-exports
Root barrelsrc/index.tsTypeScriptRe-exports all proxies + shared types
Test filestests/{system,reference,resources,procurement}/*.test.tsTypeScriptMock-fetch tests for each proxy
READMEREADME.mdMarkdownUsage examples, installation, API surface
CHANGELOGCHANGELOG.mdMarkdownInitial 0.1.0 entry
#TaskPersonaDepends OnStatusAcceptance Criteria
2.1Fetch user-account OpenAPI spec; implement UserAccountProxy + typesback-end-engineerPendingREQ-SYS-002; standard CRUD; types from live OpenAPI
2.2Fetch agent-for OpenAPI spec; implement AgentForProxy + typesback-end-engineerPendingREQ-SYS-003; standard CRUD; types from live OpenAPI
2.3Fetch invitation OpenAPI spec; implement InvitationProxy + typesback-end-engineerPendingREQ-SYS-004; standard CRUD; types from live OpenAPI
2.4Write tests for UserAccountProxy, AgentForProxy, InvitationProxyback-end-engineer2.1–2.3PendingAll 7 standard methods tested per proxy; follows tenant test pattern
2.5Update src/system/index.ts barrel to export all system proxiesback-end-engineer2.1–2.3PendingAll 4 system proxies + types re-exported
2.6Fetch business-affiliate OpenAPI spec; implement BusinessAffiliateProxy + typesback-end-engineerPendingREQ-REF-001, REQ-REF-002; CRUD + roles + with-details
2.7Fetch item OpenAPI spec; implement ItemProxy + typesback-end-engineerPendingREQ-REF-003, REQ-REF-004; CRUD + draft + supply + lookups + print + CSV
2.8Write tests for BusinessAffiliateProxy and ItemProxyback-end-engineer2.6, 2.7PendingStandard CRUD + all module-specific operations tested
2.9Create src/reference/index.ts barrel exportback-end-engineer2.6, 2.7PendingBoth reference proxies + types re-exported
2.10Fetch kanban OpenAPI spec; implement KanbanProxy + typesback-end-engineerPendingREQ-RES-001, REQ-RES-002, REQ-RES-003; CRUD + details + summaries + events + print; event type union
2.11Write tests for KanbanProxyback-end-engineer2.10PendingStandard CRUD + all module-specific ops; event type safety verified
2.12Create src/resources/index.ts barrel exportback-end-engineer2.10PendingKanbanProxy + types re-exported
2.13Fetch order OpenAPI spec; implement OrderProxy + typesback-end-engineerPendingREQ-PROC-001 through REQ-PROC-004; CRUD + full view + from-items/cards + lines + lifecycle + annotations
2.14Write tests for OrderProxyback-end-engineer2.13PendingStandard CRUD + all module-specific ops tested
2.15Create src/procurement/index.ts barrel exportback-end-engineer2.13PendingOrderProxy + types re-exported
2.16Create root src/index.ts barrel exportback-end-engineer2.5, 2.9, 2.12, 2.15PendingREQ-PKG-001; all proxies + shared types re-exported
2.17Write README.md with installation, usage examples, API surfaceback-end-engineer2.16PendingCovers all 8 proxies; shows barrel and deep import patterns
2.18Write CHANGELOG.md initial entryback-end-engineer2.16Pending0.1.0 entry describing initial release
2.19Verify full toolchainback-end-engineer2.1–2.18Pendingnpm run format:check && npm run typecheck && npm run lint && npm run test:coverage && npm run build all pass; coverage 80%+
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.

#CriterionVerification CommandExpected Output
1All 8 proxy source files existls /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 -l8
2All 8 type files existls /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 -l8
3All 8 test files existls /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 -l8
4Root barrel existstest -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/src/index.ts && echo OKOK
5Format check passescd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run format:checkExit code 0
6Typecheck passescd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run typecheckExit code 0
7Lint passescd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run lintExit code 0
8Tests pass with coveragecd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run test:coverageExit code 0; 80%+ lines and branches
9Build succeedscd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run buildExit code 0
10All export paths resolvenode -e "Promise.all(['.','./shared','./system','./reference','./resources','./procurement'].map(p=>import(p.replace('.','./dist')+'/index.js'))).then(()=>console.log('OK'))"OK
11README existstest -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/README.md && echo OKOK
12CHANGELOG existstest -f /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/CHANGELOG.md && echo OKOK
13All changes committedgit -C /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy status --porcelain(empty)

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-proxy
Branch: 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.json
Derive 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/
## Tasks
Complete 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 code
ArtifactSource RunPath
Initialized repo with toolchainRun 1api-proxy/
Shared utilitiesRun 1api-proxy/src/shared/
Tenant reference proxyRun 1api-proxy/src/system/tenant.*
Tenant test patternRun 1api-proxy/tests/system/tenant.test.ts
CI/CD workflowsRun 1api-proxy/.github/workflows/
Corrected specificationRun 1documentation/.../api-proxy/specification.md
ArtifactConsumerPath
Complete package ready for PRPR review + mergeapi-proxy/
READMEPackage consumersapi-proxy/README.md
CHANGELOGRelease processapi-proxy/CHANGELOG.md