Skip to content

Choreography: Backend Services for Item Image Upload

OrderRunDirectoryTriggerEstimated Tasks
1Run 1: common-module Libraryrun-1-common-module/Manual7 (5 implementation + 2 review)
2Run 2: operations Endpoints + Releaserun-2-operations/After Run 1 exit gate passes11 (5 implementation + 2 review + 4 release/monitoring)
ArtifactProduced ByConsumed ByPathFormat
AssetKeyGenerator classRun 1Run 2 (Module.kt, endpoint)common-module: lib/src/.../infra/storage/AssetKeyGenerator.ktKotlin
CdnUrlResolver classRun 1Run 2 (Module.kt, validator)common-module: lib/src/.../infra/storage/CdnUrlResolver.ktKotlin
S3AssetService classRun 1Run 2 (Module.kt, endpoint, validator, CSV)common-module: lib/src/.../infra/storage/S3AssetService.ktKotlin
Passing common-module buildRun 1Run 2 (entry criterion)make clean build exit codeBuild output
Committed common-module codeRun 1Run 2 (includeBuild)Branch jmpicnic/item-image-upload-backendGit
common-module PRRun 2Team reviewers → merge → CI/CD publishGitHub PRGitHub
operations PRRun 2Team reviewers → mergeGitHub PRGitHub
Published common-module artifactRun 2 (post-merge, automated)operations CI (re-trigger)GitHub PackagesMaven

All hand-offs are filesystem-only — no in-memory state is shared between runs. Each run reads its inputs from the worktree filesystem.

  1. Run 1 completes all tasks and validate-exit.sh passes.
  2. The coordinator verifies the exit gate output.
  3. Run 2’s entry criteria are checked:
    • Run 1 exit gate passed
    • common-module builds successfully
    • operations worktree exists and is clean
  4. Run 2 is launched.

No deployment gate between runs — Run 2 consumes common-module classes via Gradle includeBuild (local source tree), not a published artifact. The published artifact dependency is only relevant at PR merge time.

After Run 2 completes, the following steps happen outside the agent team:

  1. common-module PR review: Team members review and approve the common-module PR. Agent has addressed initial reviewer comments.
  2. common-module merge: Team member merges the PR. CI/CD automatically tags and publishes to GitHub Packages.
  3. operations CI re-trigger: User re-triggers operations CI after the common-module artifact is available. User notifies the agent (task 2.11).
  4. operations PR review: Team members review and approve the operations PR. Agent addresses reviewer comments after re-trigger.
  5. operations merge: Team member merges the PR.

Three worktrees, all pre-existing (created during project setup):

WorktreeRepositoryBranchUsed By
projects/image-upload-backend-worktrees/common-modulecommon-modulejmpicnic/item-image-upload-backendRun 1 (primary), Run 2 (CHANGELOG + PR)
projects/image-upload-backend-worktrees/operationsoperationsjmpicnic/item-image-upload-backendRun 2 (primary)
projects/image-upload-backend-worktrees/documentationdocumentationjmpicnic/item-image-upload-backendPlanning documents (this directory)

Base branch (all repos): jmpicnic/claude-prep

No new worktrees need to be created between runs. Both runs use the same worktrees and the same branch names. Run 2 picks up where Run 1 left off in common-module (for CHANGELOG + PR creation).

Cleanup: After both PRs are merged, remove all three worktrees:

Terminal window
git -C /Users/jmp/code/arda/common-module worktree remove \
/Users/jmp/code/arda/projects/image-upload-backend-worktrees/common-module
git -C /Users/jmp/code/arda/operations worktree remove \
/Users/jmp/code/arda/projects/image-upload-backend-worktrees/operations
git -C /Users/jmp/code/arda/documentation worktree remove \
/Users/jmp/code/arda/projects/image-upload-backend-worktrees/documentation
rmdir /Users/jmp/code/arda/projects/image-upload-backend-worktrees
  • Diagnosis: Check which tasks completed by reviewing git diff in the common-module worktree. Each task produces independent files (except T-5 which modifies existing code).
  • Retry: Fix the failing task. If T-5 (CSV refactoring) caused regressions, git checkout the modified file and restart T-5.
  • Build failure: Run make clean build and review the Gradle output. Common issues: MockAWS configuration, import statements, test assertions.
  • Test failures: Run individual test classes to isolate:
    Terminal window
    cd <cm-worktree> && ./gradlew :lib:test --tests "*.AssetKeyGeneratorTest"
  • Build failure: Check for compilation errors, missing imports, or Gradle dependency issues.
  • CSV regression: If CsvS3DirectAccessTest or S3BucketAccessTest fail, review the T-5 changes. The factory method signature changed (TD-24) — ensure tests supply an S3AssetService instance.
  • Diagnosis: Run make clean build to identify failing tests.
  • Endpoint errors: Check ImageUploadEndpointTest — common issues: MockAWS service registration, Harness configuration, content negotiation.
  • Validator errors: Check ItemValidator tests — common issues: ApplicationContext mock setup, BitemporalEntity construction, AppError type matching.
  • Module wiring: If config loading fails, verify Helm values match the requireExtra() keys in Module.kt.
  • PR creation failure: Check GitHub authentication (gh auth status). Verify branch is pushed to remote.
  • CHANGELOG missing: Ensure the CHANGELOG entry follows Keep a Changelog format with the correct version header.
  • includeBuild not reverted: Check settings.gradle.kts for remaining includeBuild directives.
  • Version catalog not bumped: Verify gradle/libs.versions.toml has the new arda-common-version.
  • common-module artifact not found: Verify the common-module release was published to GitHub Packages. Check the package version matches arda-common-version in the operations version catalog.
  • Test compilation error: The common-module API may have changed during review. Re-check imports and method signatures.
RunCommand
1/launch-team 2-backend-services/plan/run-1-common-module
2/launch-team 2-backend-services/plan/run-2-operations

Paths are relative to the project root: projects/image-upload-backend-worktrees/documentation/src/content/docs/roadmap/completed/item-image-upload/


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