amazon-transcreation/frontend
DJP bb8ed2a004 Round 2.7: three broken promises — empty TM, supplementary files, new-TM casing
Bug 1: Empty tm_channels was silently re-defaulted to [campaign channel]
  in both agent_single.py and job_tasks.py via `or [channel]`. Python's
  `or` treats [] as falsy, so the frontend's empty-list intent was lost.
  Fixed by replacing `or` with an explicit `is not None` check at both
  sites. Empty list now means "load no TMs"; None still falls back.

Bug 2: Supplementary files dropped by Agent1Validator. The validator
  built FileManifest(...) with explicit kwargs but forgot
  supplementary_files, so the raw field from _resolve_file_manifest
  never reached agent_single.run(). Files were uploaded to disk but
  never inlined into the LLM context. Fixed by adding
  supplementary_files=raw.get("supplementary_files", []) to the
  validator's FileManifest construction.

Bug 3: New TM channels lowercased in StepReview.tsx, breaking
  case-sensitive file lookup. On Linux, "flat_primecbmt_nl-be.json"
  ≠ "flat_PrimeCBMT_nl-be.json", so the file was silently skipped and
  zero TM entries loaded. Legacy channels worked only because the
  hardcoded CHANNEL_FILE_MAP has lowercase keys mapping to
  canonically-cased filenames; auto-discovered channels (PrimeCBM,
  PrimeCBMT, etc.) had no such safety net. Two-part fix:

  3a. StepReview.tsx no longer lowercases tm_channels — preserves case
      end-to-end from registry → frontend → backend → disk.

  3b. _resolve_all_tm_paths builds a case-insensitive index of the
      locale's TM directory once per call and resolves filenames
      against it. Forgives any historical case-drift between registry
      and disk.

Verified end-to-end with a standalone test script run inside the
backend container: 8/8 assertions pass covering empty tm_channels,
supplementary file passthrough, exact-case lookups, lowercase
fallback, missing channels, legacy MASS in both cases, and empty
tm_channels yielding no TM paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 10:57:21 -04:00
..
public feat: add production deployment, fix auth flow, add nginx reverse proxy 2026-04-10 12:53:48 -04:00
src Round 2.7: three broken promises — empty TM, supplementary files, new-TM casing 2026-05-11 10:57:21 -04:00
.env.local.example Add Azure AD MSAL SSO (SPA token exchange) 2026-04-15 18:08:46 +01:00
.gitignore feat: complete Phase 1-2 scaffold — backend, frontend, pipeline skeleton 2026-04-10 12:31:43 -04:00
components.json feat: complete Phase 1-2 scaffold — backend, frontend, pipeline skeleton 2026-04-10 12:31:43 -04:00
Dockerfile Add Azure AD MSAL SSO (SPA token exchange) 2026-04-15 18:08:46 +01:00
next.config.js feat: configure deployment for optical-dev.oliver.solutions/amazon-transcreation 2026-04-10 13:05:12 -04:00
package-lock.json Add Azure AD MSAL SSO (SPA token exchange) 2026-04-15 18:08:46 +01:00
package.json Add Azure AD MSAL SSO (SPA token exchange) 2026-04-15 18:08:46 +01:00
postcss.config.js feat: complete Phase 1-2 scaffold — backend, frontend, pipeline skeleton 2026-04-10 12:31:43 -04:00
tailwind.config.ts fix: use next/font/local for fonts and basePath for logo URLs 2026-04-10 13:25:25 -04:00
tsconfig.json feat: complete Phase 1-2 scaffold — backend, frontend, pipeline skeleton 2026-04-10 12:31:43 -04:00