Skip to content

Run 1: Foundation — Shared Infrastructure, Tenant Reference, CI/CD

#CriterionVerification CommandExpected Output
1api-proxy worktree existstest -d /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && echo OKOK
2Worktree is on correct branchgit -C /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy branch --show-currentjmpicnic/initial-implementation
3Repository is cleangit -C /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy status --porcelain(empty)
4Node.js 22+ availablenode --versionv22. prefix
5Staging API reachable (for OpenAPI specs)curl -sf -o /dev/null https://stage.alpha002.io.arda.cards/v1/tenant/docs/openApi.json && echo OKOK
ArtifactPathFormatDescription
Package manifestpackage.jsonJSONPer specification § package.json
TypeScript configtsconfig.jsonJSONPer specification § tsconfig.json
Vitest configvitest.config.tsTypeScriptPer specification § Coverage
ESLint configeslint.config.jsJavaScripttypescript-eslint strictTypeChecked
Prettier config.prettierrcJSONMatches api-mcp conventions
Git ignore.gitignoreTextExcludes dist/, node_modules/, coverage/
HttpClientsrc/shared/http-client.tsTypeScriptComposable HTTP client class
Common typessrc/shared/types.tsTypeScriptEntityRecord, PageResult, Query, Filter, etc.
Error handlingsrc/shared/errors.tsTypeScriptArdaApiError, parseErrorResponse
Shared barrelsrc/shared/index.tsTypeScriptRe-exports shared surface
TenantProxysrc/system/tenant.tsTypeScriptReference proxy implementation
Tenant typessrc/system/tenant.types.tsTypeScriptTypes derived from live OpenAPI spec
System barrelsrc/system/index.tsTypeScriptRe-exports system proxies
HttpClient teststests/shared/http-client.test.tsTypeScriptMock-fetch tests for HttpClient
Tenant teststests/system/tenant.test.tsTypeScriptMock-fetch tests for TenantProxy
CI workflow.github/workflows/ci.ymlYAMLFormat, typecheck, lint, test+coverage
Publish workflow.github/workflows/publish.ymlYAMLBuild + publish to GitHub Packages
#TaskPersonaDepends OnStatusAcceptance Criteria
1.1Correct specification paths to match endpoint catalog (per DQ-001)back-end-engineerPendingSpecification and requirements path tables updated; paths match endpoint catalog
1.2Initialize repository: package.json, tsconfig.json, eslint.config.js, vitest.config.ts, .prettierrc, .gitignoreback-end-engineerPendingnpm install succeeds; npm run typecheck succeeds on empty src
1.3Implement src/shared/types.ts — extract common types from api-mcp/packages/shared/src/types.tsback-end-engineer1.2PendingAll types from REQ-CORE-007 exported; npm run typecheck passes
1.4Implement src/shared/errors.ts — ArdaApiError and parseErrorResponseback-end-engineer1.2PendingArdaApiError class and parseErrorResponse function; REQ-CORE-004
1.5Implement src/shared/http-client.ts — composable HttpClient with ProxyConfigback-end-engineer1.3, 1.4PendingREQ-CORE-001 through REQ-CORE-003; composition not inheritance (REQ-PROXY-002)
1.6Create src/shared/index.ts barrel exportback-end-engineer1.3, 1.4, 1.5PendingAll shared types and classes re-exported
1.7Fetch tenant OpenAPI spec from staging and derive src/system/tenant.types.tsback-end-engineer1.2PendingTypes match OpenAPI spec; use Kotlin source as tiebreaker if ambiguous (DQ-004)
1.8Implement src/system/tenant.ts — TenantProxy with standard CRUDback-end-engineer1.5, 1.6, 1.7PendingREQ-SYS-001, REQ-PROXY-001, REQ-PROXY-003; all 7 standard methods
1.9Create src/system/index.ts barrel exportback-end-engineer1.8PendingTenantProxy and tenant types re-exported
1.10Write tests/shared/http-client.test.tsback-end-engineer1.5PendingCovers URL building, headers, time coordinates, error handling; REQ-CORE-001 through REQ-CORE-004
1.11Write tests/system/tenant.test.tsback-end-engineer1.8PendingCovers construction, all 7 CRUD methods, time coordinates, error propagation; REQ-SYS-001
1.12Set up CI workflows: .github/workflows/ci.yml and publish.ymlback-end-engineer1.2PendingWorkflow YAML matches specification § CI/CD
1.13Verify full toolchain: npm run format:check && npm run typecheck && npm run lint && npm run test:coverage && npm run buildback-end-engineer1.1–1.12PendingAll commands pass; coverage meets 80% line and branch thresholds; dist/ contains compiled output
1.1 (spec fix) ──────────────────────────────────────────────┐
1.2 (repo init) ─┬─ 1.3 (types) ─┬─ 1.5 (HttpClient) ─┬─ 1.8 (TenantProxy) ─ 1.9 (barrel)
│ │ │
├─ 1.4 (errors)─┘ ├─ 1.10 (HttpClient tests)
│ │
├─ 1.7 (tenant types) ─────────────────┘─ 1.11 (tenant tests)
└─ 1.12 (CI workflows)
All ──── 1.13 (verify)

Tasks 1.1 and 1.2 can start in parallel. Tasks 1.3, 1.4, 1.7, and 1.12 can start once 1.2 is done. The dependency chain then flows through 1.5 → 1.8 → tests → verify.

#CriterionVerification CommandExpected Output
1npm install succeedscd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm ciExit code 0
2Format check passescd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run format:checkExit code 0
3Typecheck passescd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run typecheckExit code 0
4Lint passescd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run lintExit code 0
5Tests pass with coveragecd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run test:coverageExit code 0; 80%+ lines and branches
6Build succeedscd /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy && npm run buildExit code 0; dist/ exists
7Shared barrel exports correct typesnode -e "import('./dist/shared/index.js')"No errors
8System barrel exports TenantProxynode -e "import('./dist/system/index.js')"No errors
9No runtime dependenciesnode -e "const p=JSON.parse(require('fs').readFileSync('package.json','utf8'));process.exit(p.dependencies?1:0)"Exit code 0
10No MCP importsgrep -r '@modelcontextprotocol' src/ && echo FAIL || echo OKOK
11All changes committedgit -C /Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy status --porcelain(empty)
12Specification paths corrected (per DQ-001)Visual review of specification.md path tablesPaths match endpoint catalog

Back-End Engineer — be-api-proxy-foundation

Section titled “Back-End Engineer — be-api-proxy-foundation”
You are implementing the foundation 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 goal: /Users/jmp/code/arda/projects/api-proxy-worktrees/documentation/src/content/docs/roadmap/in-progress/api-proxy/goal.md
- Read the specification: /Users/jmp/code/arda/projects/api-proxy-worktrees/documentation/src/content/docs/roadmap/in-progress/api-proxy/specification.md
- Read the decision log: /Users/jmp/code/arda/projects/api-proxy-worktrees/documentation/src/content/docs/roadmap/in-progress/api-proxy/decision-log.md
- Reference implementation: /Users/jmp/code/arda/api-mcp/packages/shared/src/ (consultative only)
- Tenant reference: /Users/jmp/code/arda/api-mcp/packages/tenant-mcp/src/ (consultative only)
## Type Derivation (DQ-004)
Fetch OpenAPI specs from live staging server: https://stage.alpha002.io.arda.cards/v1/{module}/docs/openApi.json
Fall back to Kotlin source in operations/ or accounts-component/ for ambiguities.
## Tasks
Complete tasks 1.1 through 1.13 from this project plan in order.
## Key Constraints
- Composition over inheritance (REQ-PROXY-002)
- No runtime dependencies (REQ-CORE-005)
- No MCP imports (REQ-CORE-006)
- TypeScript strict mode with verbatimModuleSyntax (REQ-PKG-003)
- 80% line and branch coverage (REQ-PKG-005)
ArtifactSourcePath
Empty api-proxy repositoryInitial setup/Users/jmp/code/arda/projects/api-proxy-worktrees/api-proxy/
Project specificationPlanningdocumentation/.../api-proxy/specification.md
Decision logPlanningdocumentation/.../api-proxy/decision-log.md
api-mcp shared sourceConsultative reference/Users/jmp/code/arda/api-mcp/packages/shared/src/
ArtifactConsumer RunPath
Initialized repo with working toolchainRun 2api-proxy/ (all config files)
Shared utilities (HttpClient, types, errors)Run 2api-proxy/src/shared/
Tenant reference proxy + typesRun 2api-proxy/src/system/tenant.*
Test patternsRun 2api-proxy/tests/shared/, api-proxy/tests/system/
CI/CD workflowsRun 2api-proxy/.github/workflows/
Corrected specificationRun 2documentation/.../api-proxy/specification.md