Skip to content

Run 1: API Proxy Publish

Extends @arda-cards/api-proxy with BFF-compatible request context headers, adds the missing processUploadJob endpoint, updates the CHANGELOG, and publishes the package to GitHub Packages. Corresponds to specification.md.

Author: Claude Code for jmpicnic | Date: 2026-04-07 | Status: Planning

Implement RequestContext + HttpClient header refactoring so that the proxy library can forward user identity headers required by BFF routes (Authorization: Bearer, X-Author, X-Tenant-Id, X-oidc-subject, X-Request-ID). Add processUploadJob() to ItemProxy. Verify all checks, update CHANGELOG, and publish @arda-cards/api-proxy to GitHub Packages.

#CriterionVerification CommandExpected Output
1api-proxy worktree on correct branchgit -C /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/api-proxy branch --show-currentjmpicnic/image-upload-frontend
2No uncommitted changes in api-proxy worktreegit -C /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/api-proxy status --porcelainEmpty
3Existing tests passnpm --prefix /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/api-proxy run testExit 0, 225+ tests passing
4Prior implemented code present (createImageUploadUrl, deleteDraft, 8 lookup methods)git -C /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/api-proxy log --oneline -5Recent commits from preparation phase visible
#TaskPersonaDepends OnStatusAcceptance Criteria
1.0Implement RequestContext type, ProxyConfig.generateRequestId, RequestOptions, and refactor HttpClient.request()typescript-engineerPendingRequestContext, RequestOptions exported from src/shared/index.ts; HttpClient sends Authorization: Bearer always; sends X-Author/X-Tenant-Id/X-oidc-subject when context provided; falls back to apiKey for X-Author when no context; sends X-Request-ID on every request; all 8 proxy classes accept options?: RequestOptions as last parameter
1.1Add processUploadJob() method to ItemProxytypescript-engineer1.0PendingPOST /upload-job/{jobId} implemented; unit test verifies method, URL, and UploadJobStatus return type
1.2Verify all checkstypescript-engineer1.1Pendingnpm run typecheck, npm run lint, npm run test, npm run build all exit 0
1.3Update CHANGELOGtypescript-engineer1.2PendingAdded + Changed sections per Keep a Changelog format; covers RequestContext, RequestOptions, generateRequestId, processUploadJob, Authorization: Bearer header change, Node >=20.0.0 requirement
1.4Commit and pushtypescript-engineer1.3PendingAll changes committed; branch pushed to remote
1.5Create PR and publishtypescript-engineer1.4PendingPR created to main; /pr-steward run; PR merged; @arda-cards/api-proxy new version confirmed installable from GitHub Packages
1.6Documentation committypescript-engineer1.5PendingSession log / byproducts updated in documentation worktree; make pr-checks passes; documentation changes committed referencing Phase 3.1

Single worktree — all tasks execute sequentially in the api-proxy worktree.

Working directory: /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/api-proxy Branch: jmpicnic/image-upload-frontend

Sequential only — each task builds directly on the previous task’s output.

1.0 (RequestContext + HttpClient) → 1.1 (processUploadJob) → 1.2 (checks) → 1.3 (CHANGELOG) → 1.4 (commit) → 1.5 (PR + publish) → 1.6 (docs)

Single agent; no idle time.

PersonaAgent NameTasks AssignedWorking DirectorySpawn Order
typescript-engineerts-api-proxy1.0 through 1.6/Users/jmp/code/arda/projects/image-upload-frontend-worktrees/api-proxyFirst
ArtifactPath (relative to worktree)FormatDescription
RequestContext typesrc/shared/types.tsTypeScriptPer-request user identity: author, tenantId, userId
RequestOptions typesrc/shared/http-client.tsTypeScriptOptional per-request options: context?: RequestContext, contentType?: string
ProxyConfig updatesrc/shared/http-client.tsTypeScriptAdds generateRequestId?: () => string
Updated HttpClient.request()src/shared/http-client.tsTypeScriptSends Authorization: Bearer, X-Request-ID always; conditional identity headers
Updated proxy methods (8 classes)src/*/proxy.tsTypeScriptEach gains options?: RequestOptions as last parameter
processUploadJob()src/reference/item/proxy.tsTypeScriptPOST /upload-job/{jobId} returning UploadJobStatus
HttpClient unit teststests/shared/http-client.test.tsTypeScript/VitestHeader behavior verification (6+ new test cases)
ItemProxy unit testtests/reference/item/proxy.test.tsTypeScript/VitestprocessUploadJob test case
CHANGELOGCHANGELOG.mdMarkdownKeep a Changelog format; Added + Changed sections
1.0 (RequestContext + HttpClient refactor)
└──→ 1.1 (processUploadJob)
└──→ 1.2 (verify checks)
└──→ 1.3 (CHANGELOG)
└──→ 1.4 (commit + push)
└──→ 1.5 (PR + publish)
└──→ 1.6 (documentation commit)
#CriterionVerification CommandExpected Output
1RequestContext and RequestOptions exported from shared barrelnpm --prefix <worktree> run typecheckExit 0, no type errors
2HttpClient sends Authorization: Bearer on every requestnpm --prefix <worktree> run test -- --reporter=verbose 2>&1 | grep "Authorization: Bearer"Test case PASS
3HttpClient sends identity headers when context providednpm --prefix <worktree> run test -- --reporter=verbose 2>&1 | grep "X-Author"Test case PASS
4HttpClient sends X-Request-ID on every requestnpm --prefix <worktree> run test -- --reporter=verbose 2>&1 | grep "X-Request-ID"Test case PASS
5All proxy methods accept options?: RequestOptionsnpm --prefix <worktree> run typecheckExit 0 (would fail if parameter missing)
6processUploadJob() present and testednpm --prefix <worktree> run test -- --reporter=verbose 2>&1 | grep "processUploadJob"Test case PASS
7package.json engines.node updatednode -e "const p=require('./package.json'); console.log(p.engines.node)">=20.0.0
8All checks passnpm --prefix <worktree> run typecheck && npm --prefix <worktree> run lint && npm --prefix <worktree> run test && npm --prefix <worktree> run buildAll exit 0
9CHANGELOG updated with correct entrieshead -50 <worktree>/CHANGELOG.mdAdded + Changed entries present for this version
10Package published to GitHub Packagesnpm view @arda-cards/api-proxy versions --registry=https://npm.pkg.github.comNew version present
11PR merged to mainGitHub PR statusMerged
12Documentation worktree checks passmake -C /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/documentation pr-checksExit 0

Where <worktree> = /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/api-proxy.

Working directory: /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/api-proxy Use absolute paths for all tool calls.

Implement Phase 3.1 of the item image upload frontend project: specification.md.

Load skills: general-conventions, release-lifecycle.

The worktree already contains all preparation-phase code (createImageUploadUrl, deleteDraft, 8 lookup methods, bulkCreate, bulkUpdate, etc.) with 225 passing tests. Your tasks are T-0 through T-6 in the specification.

T-0 is the most complex task — read the full specification section before starting. Key points:

  • RequestContext goes in src/shared/types.ts
  • RequestOptions stays internal to http-client.ts but is exported
  • All 8 proxy classes need options?: RequestOptions as last parameter
  • The fallback behavior (no context → apiKey as X-Author) is required for backward compatibility
  • crypto.randomUUID() for X-Request-ID (Node 20+ only — update engines.node)

Key decisions already resolved: FD-08 (Node 20, crypto.randomUUID()), FD-09 (export RequestOptions from shared only).

For T-5 (PR), use mcp__github-mcp-server__create_pull_request and then run /pr-steward <pr-url>.

For T-6 (documentation), commit the session log or any byproducts to the documentation worktree at: /Users/jmp/code/arda/projects/image-upload-frontend-worktrees/documentation and run make pr-checks there before committing.

This is the first run. The entry criteria describe the preparation-phase code that already exists in the worktree (implemented prior to this project plan).

ArtifactConsumer RunPath
@arda-cards/api-proxy published at new versionRun 5 (BFF routes)GitHub Packages
RequestContext typeRun 5 (BFF wires user identity headers)src/shared/types.ts
RequestOptions typeRun 5 (BFF calls proxy methods with context)src/shared/http-client.ts
processUploadJob() methodRun 5 (BFF triggers CSV upload job)src/reference/item/proxy.ts

STOP before launching Run 2 or Run 5: Confirm the published package is installable:

Terminal window
npm view @arda-cards/api-proxy versions --registry=https://npm.pkg.github.com
#QuestionOptionsRecommendationDecision
1Node version for crypto.randomUUID()A: Node 20+, B: manual UUID for Node 18 compatADecided (FD-08): crypto.randomUUID(). Update engines.node to >=20.0.0.
2RequestOptions re-export from domain barrels?A: shared barrel only, B: all domain barrelsADecided (FD-09): Shared barrel only.
  • RequestContext, RequestOptions exported from src/shared/index.ts
  • HttpClient.request() sends Authorization: Bearer and X-Request-ID on every request
  • HttpClient.request() sends X-Author, X-Tenant-Id, X-oidc-subject when context provided
  • All 8 proxy classes accept options?: RequestOptions as last parameter
  • processUploadJob() added to ItemProxy with unit test
  • package.json engines.node = >=20.0.0
  • All checks pass: typecheck, lint, test, build
  • CHANGELOG updated with Added + Changed sections
  • @arda-cards/api-proxy published to GitHub Packages at new version
  • PR merged to main
  • Documentation worktree: make pr-checks passes, changes committed
Risk / BlockerImpactMitigation
Proxy method signature change breaks existing API testsMedium — regression in api-test repoThe options parameter is optional; existing callers compile unchanged
GitHub Packages publish CI step failsHigh — blocks Run 5Monitor CI after merge; re-trigger publish workflow if needed
crypto.randomUUID() not available in test environmentLow — test setupNode 20+ is the stated requirement; verify test runner uses Node 20
FileDescription
changelog.mdSummary of changes made in Run 1
learnings.mdObservations about api-proxy architecture, header conventions
suggestions.mdImprovement suggestions, tech debt, documentation gaps

The team’s TaskList is the single source of truth for task status. Follow the protocol at every phase boundary per the team-lead agent definition.

DateEventNotes
2026-04-07Plan created

Copyright: (c) Arda Systems 2025-2026, All rights reserved