From e386ffe54805667abf15dfbf271427358fe424c7 Mon Sep 17 00:00:00 2001 From: Aadharsh Pannirselvam <19518661+oddharsh@users.noreply.github.com> Date: Sun, 23 Aug 2026 21:11:56 -0400 Subject: [PATCH] fix(photos): three shell call sites still name the .mjs files #526 renamed #526 moved the photo pipeline to TypeScript and says it rewrote "the shell scripts that invoke them". It got add-photos.sh (check-photo-pipeline.ts) and missed three: extract-photo-metadata.sh build-exif-index.mjs -> .ts extract-photo-metadata.sh build-histogram-index.mjs -> .ts hash-thumbnails.sh build-image-fingerprints.mjs -> .ts All three throw MODULE_NOT_FOUND, because no file answers to those names any more. Two of them are the steps that roll the per-photo files into the two committed indexes, so the failure lands after the expensive work rather than before it. This is the same family as the rest of this branch and it is why the branch exists: a rename that a grep for the old string cannot find, in a pipeline nobody has run since the moves, so the break sits there looking fine. Worth noting that the extension is the visible half. The reason a sweep misses these is that the specifier is assembled from a variable and a literal, which is gotcha 29's blind spot again. node 26 runs a .ts file directly (type stripping), verified here, so `node` is still correct in front of these and only the name was wrong. Controls, all three run after the change. build-image-fingerprints.ts exits 0 on a clean checkout. The other two exit 1 on a MISSING public/images/meta, which is the gitignored build output that extract-photo-metadata.sh writes earlier in the same script, so standalone in a clean tree that is the honest answer; with the directory present both exit 0 and regenerate exif.json and histograms.json byte-identically, no drift against the committed copies. --- tools/photos/add-photos.sh | 4 ++-- tools/photos/extract-photo-metadata.sh | 6 +++--- tools/photos/hash-thumbnails.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/photos/add-photos.sh b/tools/photos/add-photos.sh index e82209e66..2fba09203 100755 --- a/tools/photos/add-photos.sh +++ b/tools/photos/add-photos.sh @@ -41,7 +41,7 @@ # bust anymore.) # 6. captions anything still missing alt text (gen-alt-text.py), then validates # the whole artifact graph — pixels, EXIF, histograms, captions, the index — -# via check-photo-pipeline.mjs, which fails the run rather than let an +# via check-photo-pipeline.ts, which fails the run rather than let an # unlabelled image reach a deploy # # REMOTE_RENDER_ONLY=1 skips R2 uploads. The GitHub Actions pipeline uses it @@ -478,7 +478,7 @@ fi # gets captioned here rather than waiting for a deploy. resumable and idempotent: # already-captioned stems cost nothing. a 429 (the free 10k neurons/day) stops it # early, which is why the failure is tolerated here and the real gate is -# check-photo-pipeline.mjs below. +# check-photo-pipeline.ts below. if command -v python3 >/dev/null 2>&1; then python3 "$SCRIPT_DIR/gen-alt-text.py" || \ echo " captions incomplete — re-run 'bun run captions' before deploying" diff --git a/tools/photos/extract-photo-metadata.sh b/tools/photos/extract-photo-metadata.sh index 4e3a4c9bc..cc3e3ab41 100755 --- a/tools/photos/extract-photo-metadata.sh +++ b/tools/photos/extract-photo-metadata.sh @@ -184,11 +184,11 @@ done # roll the per-photo EXIF (minus histograms) into the one shared index the # tooltip warms on idle. derived data, so it MUST be rebuilt whenever the -# per-photo files change; check-photo-pipeline.mjs fails on any drift. -node "$SCRIPT_DIR/build-exif-index.mjs" +# per-photo files change; check-photo-pipeline.ts fails on any drift. +node "$SCRIPT_DIR/build-exif-index.ts" # The packed bars the grid inlines into each tile as data-hist. Same input as the # EXIF index above, different consumer: this one never reaches a browser whole. -node "$SCRIPT_DIR/build-histogram-index.mjs" +node "$SCRIPT_DIR/build-histogram-index.ts" COUNT=$(jq 'keys | length' "$OUT") if [ "$MERGE" -eq 1 ]; then diff --git a/tools/photos/hash-thumbnails.sh b/tools/photos/hash-thumbnails.sh index 5e022d6e0..6be37d143 100755 --- a/tools/photos/hash-thumbnails.sh +++ b/tools/photos/hash-thumbnails.sh @@ -101,7 +101,7 @@ with open(map_path, "w") as f: # 1. drop the un-hashed source tiers we just addressed — they live in /i/ now. # metadata.json / alt.json / hashes.json / meta/ stay put. # 2. drop /i/ files a re-encode superseded (not referenced by the merged map), -# so public/i/ is 1:1 with hashes.json and check-photo-pipeline.mjs passes. +# so public/i/ is 1:1 with hashes.json and check-photo-pipeline.ts passes. pruned_src = pruned_i = 0 for stem in stems: for name in (f"{stem}.avif", f"{stem}.jpg", f"{stem}-400.avif", f"{stem}-200.avif"): @@ -125,4 +125,4 @@ EOF # The short URL hash above is intentionally kept separate from the full-byte # fingerprint used by the exact photo_recipe matcher. -node "$SCRIPT_DIR/build-image-fingerprints.mjs" +node "$SCRIPT_DIR/build-image-fingerprints.ts"