From 39a251ec69024c137c32a6df3a4b795a6194baf3 Mon Sep 17 00:00:00 2001 From: dev_agent Date: Tue, 6 Oct 2026 21:33:02 -0400 Subject: [PATCH] Move dedupe cases fixture into web so docker build can see it The PWA's names.test.ts imported internal/ai/harness/testdata/dedupe_cases.json, which is outside the web build context the Dockerfile's web stage copies, so tsc failed and docker build . failed. The single case file now lives at web/src/dinners/testdata/dedupe_cases.json; the harness Go test reads it from there, as TestLetterFoldsMatchPWA already reads letterFolds.json. Maestro task: 3eee9f68-2d34-4e49-8ca5-43bacfb642f0 Co-Authored-By: Claude Opus 5.5 --- docs/ARCHITECTURE.md | 2 +- internal/ai/harness/dedupe_test.go | 8 ++++---- web/src/dinners/names.test.ts | 2 +- web/src/dinners/names.ts | 2 +- .../src/dinners}/testdata/dedupe_cases.json | 0 5 files changed, 7 insertions(+), 7 deletions(-) rename {internal/ai/harness => web/src/dinners}/testdata/dedupe_cases.json (100%) diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 4da8dd8..2c66c03 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -517,7 +517,7 @@ Regular has a name `harness.Similar` to it — the PWA's copy of the name rules in `web/src/dinners/names.ts` folds letters with `web/src/dinners/letterFolds.json`, which `gen_folds.py` writes from the same table as the server's, and runs the same cases, -`internal/ai/harness/testdata/dedupe_cases.json`, as the server's) and +`web/src/dinners/testdata/dedupe_cases.json`, as the server's) and notifications (`/onboarding/notifications`: what MealQuest notifies about, the iOS install hint, "Turn on notifications" and "Maybe later"). Either button sends `PATCH /api/v1/settings/household` with diff --git a/internal/ai/harness/dedupe_test.go b/internal/ai/harness/dedupe_test.go index 9f7ff2b..8653385 100644 --- a/internal/ai/harness/dedupe_test.go +++ b/internal/ai/harness/dedupe_test.go @@ -8,11 +8,11 @@ import ( "unicode/utf8" ) -// TestSharedDedupeCases runs testdata/dedupe_cases.json, which the PWA's -// copy of Normalize and Similar (web/src/dinners/names.ts) runs too, so the -// two cannot drift apart on these names. +// TestSharedDedupeCases runs web/src/dinners/testdata/dedupe_cases.json, +// which the PWA's copy of Normalize and Similar (web/src/dinners/names.ts) +// runs too, so the two cannot drift apart on these names. func TestSharedDedupeCases(t *testing.T) { - raw, err := os.ReadFile("testdata/dedupe_cases.json") + raw, err := os.ReadFile("../../../web/src/dinners/testdata/dedupe_cases.json") if err != nil { t.Fatal(err) } diff --git a/web/src/dinners/names.test.ts b/web/src/dinners/names.test.ts index f2677fd..9ac8ac5 100644 --- a/web/src/dinners/names.test.ts +++ b/web/src/dinners/names.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import cases from '../../../internal/ai/harness/testdata/dedupe_cases.json' +import cases from './testdata/dedupe_cases.json' import { normalizeName, similarNames } from './names.ts' // The cases internal/ai/harness's tests run against Normalize and Similar. diff --git a/web/src/dinners/names.ts b/web/src/dinners/names.ts index 52cc50d..9967834 100644 --- a/web/src/dinners/names.ts +++ b/web/src/dinners/names.ts @@ -1,7 +1,7 @@ // The PWA's copy of the server's dinner-name rules (internal/ai/harness // Normalize and Similar), so a screen can tell beforehand that the dinners // API would refuse a name as a duplicate. The server still decides. -// internal/ai/harness/testdata/dedupe_cases.json is run against both. +// web/src/dinners/testdata/dedupe_cases.json is run against both. import folds from './letterFolds.json' diff --git a/internal/ai/harness/testdata/dedupe_cases.json b/web/src/dinners/testdata/dedupe_cases.json similarity index 100% rename from internal/ai/harness/testdata/dedupe_cases.json rename to web/src/dinners/testdata/dedupe_cases.json