Skip to content

Project Plan: Item Identifiers

Implements standard identifiers, additional QR codes, and labels on Item, plus the fuzzy /lookup and exact /by-code endpoints. See the Design for architecture and the Decision Log for decisions; Round 2 DQs must be resolved (or explicitly deferred) before Phase 1 starts. Backend phases are sequential; the frontend phase can run in parallel with Phase 2 once the API contract in the design is frozen.

RepositoryRoleBranch
operationsupstream (API provider)jmpicnic/item-identifiers/operations
arda-frontend-appdownstream (BFF consumer)jmpicnic/item-identifiers/frontend
documentationproject docs + byproductsjmpicnic/item-identifiers/docs

There is no build-time dependency between operations and arda-frontend-app (HTTP contract only) and no common-module change (per DQ-013 recommendation), so no composite builds or version catalog updates are expected.

Task Execution Protocol (applies to every code task)

Section titled “Task Execution Protocol (applies to every code task)”
  1. Red — write the task’s tests first; they compile and fail.
  2. Green — implement until the task’s tests pass.
  3. Verify — escalate per the verification cadence: compile → targeted test roots → full gate only at phase exit.
  4. Commit — one self-contained, reviewable commit per task on the repo’s project branch.

Phase 1: Backend Domain and Persistence (operations)

Section titled “Phase 1: Backend Domain and Persistence (operations)”

Entry criteria: All Round 2 DQs Decided or Deferred — satisfied 2026-07-22 (all 16 decided).

#TaskRepositoryDepends OnAcceptance Criteria
T-01Identifier value classes (Upc, Ean, Gtin, Isbn, Asin — no naked String) + ItemIdentifiers value objectoperationsUnit tests: valid/invalid shapes per identifier kind (ISBN-10 and ISBN-13 both accepted); blank→null normalization in the raw-string factory; validating serializers reject malformed wire values; Result error channel (DQ-014)
T-02CodeCandidates expansion utilityoperationsUnit tests: 8/12/13/14-digit families, ASIN/QR verbatim, ISBN 10↔13 conversion incl. 979… one-directionality (DQ-006/DQ-010)
T-03Item, Entity, ItemSerializer, ItemInput field additionsoperationsT-01Serialization round-trip tests incl. empty/populated lists; validate() enforces config-driven bounds: labels ≤128, QRs ≤64, ≤256 chars/entry, dedupe, order preserved (DQ-015)
T-04Persistence: ItemIdentifiersComponent, jsonb columns, fillPayloadoperationsT-03Record round-trip integration test; legacy rows read with empty lists
T-05Migrations V024 (columns + generated search_text incl. left(notes, 256) per DQ-009) and V025 (+.sql.conf, concurrent indexes)operationsT-04ContainerizedPostgres migration test: columns, generated values, all indexes present
T-06Phase gate: item module test roots greenoperationsT-01..T-05Full item-module test run passes

Exit criteria: operations builds; item module tests green; migration verified on a clean container.

Phase 2: Backend Search Endpoints (operations)

Section titled “Phase 2: Backend Search Endpoints (operations)”

Entry criteria: Phase 1 exit.

#TaskRepositoryDepends OnAcceptance Criteria
T-07ItemUniverse.lookupPage (fuzzy predicate, ranking per DQ-011, Query composition, cursors) + ItemService.lookupItems (transaction boundary)operationsT-06Integration tests: match on name/identifier/label, ranking, filter composition, tenant isolation, effective-as-of; service test: universe called inside inTransaction(db)
T-08ItemUniverse.byCode (candidate-set predicate) + jsonb containment operator + ItemService.findByCode (CodeCandidates expansion, DQ-012 result cap, transaction boundary)operationsT-06Integration tests: normalized-family hits, QR exact containment, tenant isolation; service tests: expansion in service (not endpoint), cap applied
T-09ItemEndpoint routes: POST /lookup, GET /lookup/{page}, /by-code (per DQ-012) — request validation + response formatting only, delegating to ItemServiceoperationsT-07, T-08Route tests: 200 happy paths, 400 blank param, auth failures; no business logic in the endpoint
T-10Bruno API tests for the three routesoperations (api-tests/)T-09Suite green against local cluster per run-operations-api-test
T-11Performance verification per DQ-016operationsT-09EXPLAIN-based test asserts index usage (no seq scan); checked-in seeding script makes the 50k-item benchmark repeatable; results recorded in byproducts

Exit criteria: full operations gate green (build, all tests); API tests pass locally.

Phase 3: Frontend BFF and Types (arda-frontend-app)

Section titled “Phase 3: Frontend BFF and Types (arda-frontend-app)”

Entry criteria: Design § API Contract frozen (Round 2 DQs resolved). May run in parallel with Phase 2.

#TaskRepositoryDepends OnAcceptance Criteria
T-12Unified identifier validators src/lib/shared/identifiers.ts (port prototype UPC/EAN/ISBN-10; add GTIN-14, ISBN-13, ASIN)arda-frontend-appJest parity tests mirroring backend accept/reject sets
T-13Types + mappers: arda-api.ts, items.ts, ardaMappers.tsarda-frontend-appType-check green; mapper round-trip tests
T-14BFF routes POST /api/arda/items/lookup, GET /api/arda/items/by-codearda-frontend-appT-13Route tests with MSW upstream: envelope, auth, error mapping
T-15SSRM accessors for identifiers, QRs, labels in filteringProperties.tsarda-frontend-appT-13filterEngine tests: free-text token matches the new fields (DQ-008)
T-16Phase gate: lint, typecheck, full Jest suitearda-frontend-appT-12..T-15Repo pre-push gate green

Exit criteria: frontend gate green; no UI component changes in the diff (phase-2 boundary).

Phase 4: Documentation Byproducts (documentation)

Section titled “Phase 4: Documentation Byproducts (documentation)”

Entry criteria: Phases 2 and 3 exit (content reflects final implementation).

#TaskRepositoryDepends OnAcceptance Criteria
T-17Update item module reference (current-system/functional/reference-data/item/) with new fields + endpointsdocumentationT-09Page reflects shipped contract; make pr-checks green
T-18Update domain model (domain/information-model/assets/items.md) with the three new attributesdocumentationT-03Entity table updated; links resolve

Exit criteria: make pr-checks green in the documentation worktree.

Entry criteria: Phases 2–4 exit.

Per-repository lifecycle (CHANGELOG → gate → PR → steward → merge), in dependency order. operations merges and deploys first; the frontend PR notes the dependency and merges after the backend endpoints are live in dev; documentation last.

#TaskRepositoryDepends OnAcceptance Criteria
T-19CHANGELOG entry under [Unreleased]Added (minor; internal refactors under Fixed)operationsT-11CLQ validation passes
T-20Pre-push guard + gate: staged-diff scan (no local overrides, no absolute paths), full build/test, push, feat: PR with attribution block; changelog listed largest-impact firstoperationsT-19PR open, CI green
T-21Steward operations PR (pr-steward): checks, review threads; merge only on user directionoperationsT-20PR merged; release tagged
T-22CHANGELOG per repo’s current model (direct-edit vs PR-body — verify at PR time, repo is migrating), gate, push, feat: PR with dependency note on the operations releasearda-frontend-appT-16, T-21PR open, CI green, dependency note present
T-23Steward frontend PR; merge after operations endpoints deployed to devarda-frontend-appT-22PR merged
T-24Documentation PR: PR-body ## CHANGELOG, make pr-checks, project docs status frontmatter set to completed (documents stay in place), then worktree/branch cleanup for all three reposdocumentationT-17, T-18, T-23PR merged; worktrees removed with no uncommitted work

Exit criteria: all three PRs merged; worktrees and local branches removed; project docs marked completed.

The graph shows the coarse phase ordering: backend phases are sequential, the frontend phase starts from the frozen API contract and can overlap Phase 2, and documentation and release close the project in dependency order.

PlantUML diagram

PersonaWorking DirectoryAgent Name Pattern
Back-end engineerprojects/item-identifiers-worktrees/operationsbe-item-identifiers
Front-end engineerprojects/item-identifiers-worktrees/arda-frontend-appfe-item-identifiers
Technical writerprojects/item-identifiers-worktrees/documentationtw-item-identifiers

Single-agent-per-repo, sequential within each repo; no integration branch (one project branch per repo, as in the manufacturer-field project).

WorktreeBranchCleanup
projects/item-identifiers-worktrees/operationsjmpicnic/item-identifiers/operationsafter T-21
projects/item-identifiers-worktrees/arda-frontend-appjmpicnic/item-identifiers/frontendafter T-23
projects/item-identifiers-worktrees/documentationjmpicnic/item-identifiers/docsafter T-24
projects/item-identifiers-worktrees/prototype-scan-to-itemsymlink (read-only reference)remove symlink at close

Push guards (every push): stage narrowly (never git add -A); scan the staged diff for includeBuild, absolute /Users/ paths, and -worktrees references; run the repo’s full local gate first. Before removing any worktree: verify no uncommitted changes and all branches pushed.



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