Skip to content

Run 2: operations Endpoints + Release

Implements the image upload endpoint, entity validation, and infrastructure wiring in operations, then handles release coordination for both repositories. Corresponds to specification.md Phase 2b + Release (tasks T-6 through T-9).

Author: Claude Code for jmpicnic | Date: 2026-03-31 | Status: Planning

Implement CloudFormation/Helm infrastructure wiring, the image upload presigned credential endpoint (integrated into ItemEndpoint per TD-22), imageUrl validation in ItemValidator (TD-23), and coordinate the multi-repo release with upstream-first PR ordering.

#CriterionVerification CommandExpected Output
1Run 1 exit gate passedbash .../run-1-common-module/validate-exit.shALL CHECKS PASSED
2common-module build passesmake -C /Users/jmp/code/arda/projects/image-upload-backend-worktrees/common-module clean buildExit code 0
3operations worktree existsgit -C /Users/jmp/code/arda/projects/image-upload-backend-worktrees/operations branch --show-currentjmpicnic/item-image-upload-backend
4No uncommitted changes in operationsgit -C /Users/jmp/code/arda/projects/image-upload-backend-worktrees/operations status --porcelainEmpty
5Worktree based on jmpicnic/claude-prepgit -C /Users/jmp/code/arda/projects/image-upload-backend-worktrees/operations log --oneline -1 origin/jmpicnic/claude-prepMatches HEAD ancestor
#TaskPersonaDepends OnStatusAcceptance Criteria
2.1Set up Gradle includeBuild + verify operations baselineback-end-engineerPendingincludeBuild configured for common-module worktree; make clean build passes; existing Item tests pass (spec T-6 prereq)
2.2CloudFormation pre-install.cfn.yml + Helm configmap.yaml + build.gradle.kts Helm lint valuesback-end-engineer2.1PendingIAM policies added, configmap values added, Helm lint passes (spec T-6a, T-6b)
2.3Module.kt wiring: image services + ItemService/ItemValidator DIback-end-engineer2.2PendingConfig loads; AssetKeyGenerator, CdnUrlResolver, S3AssetService instantiated; passed to ItemValidator and ItemService (spec T-6c)
2.4ImageUploadEndpoint + ItemService.generateImageUploadCredentials() + testsback-end-engineer2.3Pending7 test cases pass: happy path, auth failure, invalid content type, missing fields, policy keys, CDN URL pattern, unique keys. Routes registered in ItemEndpoint.buildRoot() (TD-22) (spec T-7)
2.5ItemValidator imageUrl validation + testsback-end-engineer2.3PendingPre-implementation: verify ScopingValidator DI precedent (TD-25). Convert ItemValidator from object to class. 9 test cases pass: CDN valid, non-CDN, wrong tenant, missing S3, null clear, grandfather, create valid, create non-CDN, create missing S3 (spec T-8)
2.6Quality review of T-6 through T-8 implementationquality-reviewer2.5PendingCode review report: no anti-patterns, follows kotlin-coding conventions, endpoint delegation pattern, validator DI pattern
2.7Address quality review findings (if any)back-end-engineer2.6PendingAll actionable findings resolved. make clean build still passes
2.8CHANGELOG + PR for common-moduleback-end-engineer2.7PendingCHANGELOG.md updated in common-module worktree; PR created via GitHub MCP; branch pushed (spec T-9 steps 9.1–9.2)
2.9CHANGELOG + version catalog bump + revert includeBuild + PR for operationsback-end-engineer2.8PendingCHANGELOG.md updated; gradle/libs.versions.toml arda-common-version bumped; settings.gradle.kts includeBuild removed; PR created via GitHub MCP; branch pushed. Expected: operations CI will fail until common-module is published (spec T-9 steps 9.7–9.11)
2.10Monitor common-module PR: checks + commentscoordinator2.8PendingBackground: monitor CI checks, diagnose/fix failures. After 30 min: read reviewer comments, present numbered table (Summary + Recommendation) to user. Execute user decisions, reply to comments, resolve threads
2.11Monitor operations PR: checks + comments (after user re-trigger)coordinator2.9PendingWait for user to re-trigger CI after common-module is published. Then: monitor CI checks, diagnose/fix failures. After 30 min from re-trigger: read reviewer comments, present numbered table to user. Execute user decisions, reply to comments, resolve threads

Single directory per repository — no intra-repo worktrees needed.

Primary working directory: /Users/jmp/code/arda/projects/image-upload-backend-worktrees/operations common-module worktree (for CHANGELOG + PR): /Users/jmp/code/arda/projects/image-upload-backend-worktrees/common-module Branch (both repos): jmpicnic/item-image-upload-backend Base branch: jmpicnic/claude-prep

The back-end-engineer works primarily in the operations worktree for tasks 2.1–2.7, then switches to common-module for 2.8, then back to operations for 2.9.

  • Sequential chain: 2.1 → 2.2 → 2.3 → 2.4 → 2.5 → 2.6 → 2.7 → 2.8 → 2.9
  • Note: T-7 (task 2.4) and T-8 (task 2.5) are independent after T-6 (task 2.3), but both modify Module.kt and share the same repo — running them sequentially avoids merge conflicts.
  • Parallel after 2.8: Task 2.10 (common-module PR monitoring) runs in the background while 2.9 (operations PR creation) proceeds.
  • Task 2.11 starts only after the user signals that common-module is published and operations CI has been re-triggered.
2.1 → 2.2 → 2.3 → 2.4 → 2.5 → 2.6 → 2.7 → 2.8 ──→ 2.9
└──→ 2.10 (background: monitor CM PR)
2.11 (after user re-trigger)

Accept idle time — the quality-reviewer is idle during implementation (2.1–2.5) and during release tasks (2.8–2.11). The back-end-engineer is idle during quality review (2.6) and during PR monitoring (2.10–2.11). Phases are short; buffer tasks add no value.

PersonaAgent NameTasks AssignedWorking DirectorySpawn Order
back-end-engineerbe-operations2.1–2.5, 2.7, 2.8, 2.9/Users/jmp/code/arda/projects/image-upload-backend-worktrees/operations (primary) + /Users/jmp/code/arda/projects/image-upload-backend-worktrees/common-module (for 2.8)First
quality-reviewerqr-operations2.6/Users/jmp/code/arda/projects/image-upload-backend-worktrees/operationsAfter 2.5
coordinator(team-lead)2.10, 2.11Both worktreesAfter 2.8
ArtifactPath (relative to operations worktree)FormatDescription
CloudFormation updatehelm/operations/pre-install.cfn.ymlYAMLIAM policies for image bucket + presign role
Helm configmap updatehelm/operations/templates/configmap.yamlYAMLImage infrastructure values
Helm lint values updatebuild.gradle.ktsKotlin/GradlePlaceholder ARNs for Helm lint
Module wiringsrc/main/kotlin/.../reference/item/Module.ktKotlinImage service instantiation + DI
Endpointsrc/main/kotlin/.../reference/item/api/rest/ImageUploadEndpoint.ktKotlinPresigned credential endpoint (or inline in ItemEndpoint)
Request/response modelssrc/main/kotlin/.../reference/item/api/rest/Model.ktKotlinImageUploadRequest, ImageUploadResponse
Service methodsrc/main/kotlin/.../reference/item/business/ItemService.ktKotlingenerateImageUploadCredentials()
Validator updatesrc/main/kotlin/.../reference/item/persistence/ItemValidator.ktKotlinobjectclass, imageUrl validation (TD-23)
Endpoint testsrc/test/kotlin/.../reference/item/api/rest/ImageUploadEndpointTest.ktKotlin/Kotest7 test cases with Harness + MockAWS
Validator testsrc/test/kotlin/.../reference/item/persistence/ItemValidatorImageUrlTest.ktKotlin/Kotest9 test cases
2.1 (baseline + includeBuild) → 2.2 (CFN + Helm) → 2.3 (Module.kt)
├──→ 2.4 (endpoint + tests)
└──→ 2.5 (validator + tests)
2.6 (quality review) → 2.7 (fixes)
2.8 (CM CHANGELOG + PR) → 2.10 (monitor CM PR, background)
2.9 (ops CHANGELOG + PR) → 2.11 (monitor ops PR, after re-trigger)
#CriterionVerification CommandExpected Output
1ImageUploadEndpointTest passesmake -C <ops-worktree> clean build 2>&1 | grep -c "ImageUploadEndpointTest"≥ 1
2imageUrl validation tests passmake -C <ops-worktree> clean build 2>&1 | grep -c "ItemValidator"≥ 1
3Existing Item tests passmake -C <ops-worktree> clean build 2>&1 | grep -c "ItemEndpointTest"≥ 1
4Full build succeedsmake -C <ops-worktree> clean buildExit code 0
5Helm lint passesBuild output includes successful Helm lint
6Quality review completedQuality review report exists and findings addressed
7common-module PR createdgh pr list --repo Arda-cards/common-module --head jmpicnic/item-image-upload-backendPR exists
8operations PR createdgh pr list --repo Arda-cards/operations --head jmpicnic/item-image-upload-backendPR exists
9common-module CHANGELOG updatedgit -C <cm-worktree> diff --name-only | grep CHANGELOGCHANGELOG.md
10operations CHANGELOG updatedgit -C <ops-worktree> diff --name-only | grep CHANGELOGCHANGELOG.md
11includeBuild revertedgrep -c includeBuild <ops-worktree>/settings.gradle.kts0 (or no match)
12Version catalog bumpedgrep arda-common-version <ops-worktree>/gradle/libs.versions.tomlNew version

Where <ops-worktree> = /Users/jmp/code/arda/projects/image-upload-backend-worktrees/operations, <cm-worktree> = /Users/jmp/code/arda/projects/image-upload-backend-worktrees/common-module.

Primary working directory: /Users/jmp/code/arda/projects/image-upload-backend-worktrees/operations Secondary working directory (for task 2.8): /Users/jmp/code/arda/projects/image-upload-backend-worktrees/common-module Use absolute paths for all tool calls. Prefix Bash commands with cd <worktree-absolute-path> &&.

Implement the image upload endpoint, entity validation, infrastructure wiring, and release coordination. Follow specification.md Phase 2b + Release (tasks T-6 through T-9).

Load skills: kotlin-coding, unit-tests-backend, unit-tests-infra, build-core-modules, release-lifecycle.

Phase 2b source root: src/main/kotlin/cards/arda/operations/reference/item/ Phase 2b test root: src/test/kotlin/cards/arda/operations/reference/item/

Tasks: 2.1 through 2.5, 2.7, 2.8, 2.9 per this plan. Each task produces its tests before the next task starts.

Key decisions: TD-22 (routes in ItemEndpoint), TD-23 (validation in ItemValidator), TD-24 (S3AssetService injected), TD-25 (verify validator DI precedent).

Task 2.1: Configure includeBuild in settings.gradle.kts pointing to /Users/jmp/code/arda/projects/image-upload-backend-worktrees/common-module. Do not commit this change. Run make clean build to verify baseline.

Task 2.5 pre-implementation: Search for ScopingValidator subclasses that are class (not object) to check DI precedent (TD-25). Document findings.

Task 2.8: Switch to common-module worktree. Write CHANGELOG.md entry. Commit and push. Create PR via GitHub MCP tools targeting jmpicnic/claude-prep base. Include attribution block.

Task 2.9: Back in operations worktree. Bump arda-common-version in gradle/libs.versions.toml. Remove includeBuild from settings.gradle.kts. Write CHANGELOG.md entry. Commit and push. Create PR via GitHub MCP tools targeting jmpicnic/claude-prep base. Include attribution block. Expected: CI will fail until common-module is published — this is intentional.

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

Review the new and modified files in the item module:

  • helm/operations/pre-install.cfn.yml (IAM policies)
  • helm/operations/templates/configmap.yaml (Helm values)
  • src/main/kotlin/.../reference/item/Module.kt (DI wiring)
  • src/main/kotlin/.../reference/item/api/rest/ (endpoint + models)
  • src/main/kotlin/.../reference/item/business/ItemService.kt (service method)
  • src/main/kotlin/.../reference/item/persistence/ItemValidator.kt (validation)

And their test files.

Load skills: kotlin-coding, unit-tests-backend.

Evaluate against: Kotlin coding conventions, endpoint delegation pattern (endpoints must not call domain services directly), Result<T> + AppError usage, validator DI pattern, IAM least-privilege, Helm template syntax. Produce a code review report.

After creating the common-module PR (task 2.8):

  1. Background CI monitoring: Poll PR check status. If any check fails, diagnose the failure from CI logs, fix the issue in the common-module worktree, commit, and push.

  2. 30-minute comment review: After 30 minutes, read all reviewer comments on the PR. Present to the user as a numbered table:

    #ReviewerFileSummaryRecommendation
  3. Execute user decisions: For each comment, take the action the user specifies (code change, reply with rationale, create follow-up ticket). Reply to each comment with the action result and resolve the thread.

After the user signals that common-module is published and operations CI has been re-triggered:

  1. CI monitoring: Monitor re-triggered checks. If any check fails, diagnose and fix (in operations worktree), commit, push.
  2. 30-minute comment review: Same protocol as task 2.10.
  3. Execute user decisions: Same protocol as task 2.10.
ArtifactSource RunPath
AssetKeyGenerator classRun 1common-module: lib/src/main/kotlin/.../infra/storage/AssetKeyGenerator.kt
CdnUrlResolver classRun 1common-module: lib/src/main/kotlin/.../infra/storage/CdnUrlResolver.kt
S3AssetService classRun 1common-module: lib/src/main/kotlin/.../infra/storage/S3AssetService.kt
Passing common-module buildRun 1make clean build exit code 0

Artifacts Produced (for subsequent phases)

Section titled “Artifacts Produced (for subsequent phases)”
ArtifactConsumerPath
common-module PRTeam reviewers → merge → Phase 2cGitHub PR
operations PRTeam reviewers → merge → Phase 2cGitHub PR
Published common-module artifactoperations CIGitHub Packages
#QuestionOptionsRecommendationDecision
No open questions

All design questions for Run 2 were resolved during specification: TD-22 (routes in ItemEndpoint), TD-23 (validation in ItemValidator), TD-24 (S3AssetService injected), TD-25 (verify validator DI precedent).

  • All endpoint tests pass (7 cases)
  • All validator tests pass (9 cases)
  • All existing Item tests pass (no regressions)
  • make clean build succeeds with exit code 0
  • Helm lint passes
  • Quality review completed, findings addressed
  • common-module PR created, CHANGELOG updated
  • operations PR created, CHANGELOG updated, includeBuild reverted, version catalog bumped
  • PR reviewer comments addressed (both repos)
Risk / BlockerImpactMitigation
ItemValidator DI conversion breaks existing testsMediumTD-25 pre-check; test immediately after conversion
Module.kt wiring errors (missing config values)LowHelm lint catches missing required values
operations CI fails after version catalog bumpExpectedUser re-triggers after common-module publish
PR reviewer requests significant changesMediumQuality review in 2.6 catches issues early
common-module publish delay blocks operations mergeLowoperations PR is created immediately; CI re-triggered later
FileDescription
changelog.mdSummary of changes made in Run 2
learnings.mdNew knowledge (validator DI pattern, release ordering, PR monitoring)
suggestions.mdImprovement suggestions, tech debt, documentation gaps
ArtifactProduced ByLocation
Observation logCI Observersession/ci-observations.md
Improvement proposalImprovement Analyzercontinuous-improvement-proposal.md

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-03-31Plan created

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