HEAL came back a stain larger and softer than the stain it was asked to remove, and the model's half of it answered in a colour that appears nowhere near the repair. Three causes, all inside `engine/inpaint.ts`: - The fallback's reading ring was the hole dilated by two pixels whatever the brush, so the boundary of the fill was the dirt's own penumbra and the fill came back as the dirt. The pad is now proportional to the hole's own radius (`rimPad`), the fill is an inverse-square average of the clean ring relaxed into one field by 36 Jacobi rounds, and the hole's grain is read against a 2px box of the clean pixels and taken from the pixel it mirrors through its own middle. The texture half before this was a no-op — `detail = rgba[p] - fR[idx]` with `fR[idx]` the same pixel's own colour, so every donor handed over zero and the hole was the smooth field alone (15.6% of the ground's detail). Measured on a stain of radius 10 with a halo to 16 under a 12px brush (`probe-fallback.mjs`): the repair landed 22.3 levels below the ground it sits in, and comes back 0.06 off it. - The plate the model reads under the mask was the mean of every pixel of the crop, so the network met a hard step at the mask's own edge and answered in that colour. It is now the rim's own light spread inward (`cropPlate`), and the mask is downsampled by "any hole pixel in this cell" rather than by a corner sample. Step across the mask's edge: 69.3 levels before, 9.5 after. - The same repair came back different every time the reader zoomed out of it: the crop was sized from the stage's own pixels on the zoom ladder (`PREVIEW_QUANTUM`), so each zoom handed the model a different grid, and every grid invents its own pixels. The crop's box is now its share of the FRAME (`INPAINT_REF_LONG`, `exportEngine` 6e), so one spot is one grid at every zoom and at the export's own size. The patch is deliberately not baked into the photo: a recipe stays reusable on other frames and the repair stays a pass. ponytail: the pixels handed to the model are still read from whatever the stage rendered at, so the answer is the same repair to within the resampling of its input; a patch cache keyed on the frame's identity and the spots is the rung that makes it identical, and the one to take if a zoom still shows a repair move. VIGNETTING now runs both ways (-10..10): down darkens the four corners, up lifts the lens' own falloff out of them with a white ink — the same curve and the same weight. EV was defined and live on the phone but absent from the wide panel's own Light row, which is `DevelopPanels.tsx` and nothing else. `npx tsc --noEmit`, `vite build`, `heal-check`, `studio-drag` and the other suites pass. `studio-export-check` fails one assertion here on the code at HEAD as well — a frame left behind files its waiting look 9s after the pick — so it is not this change.
RecipesCam web — self-contained stack
A Docker-hosted web build of RecipesCam. Everything it needs is in this folder: move it to another machine, run two commands, and the app is up. It does not need the React Native project around it.
cp .env.example .env
docker compose up -d --build
# → http://localhost:8090
What runs where
| Service | Image | Role |
|---|---|---|
frontend |
nginx:1.27-alpine (built by frontend/Dockerfile) |
Static SPA + /api/ reverse proxy |
api |
node:22-slim (built by backend/Dockerfile) |
Accounts + saved recipes, SQLite on ./data |
frontend resolves api through Docker's embedded DNS and proxies /api/* to
it — that is why the API container is named api and why it is not published on
the host. Only ${WEB_PORT:-8090} is exposed.
Photos never leave the browser. The CanvasKit render pipeline (grade, frame, watermarks, JPEG encode) runs in the visitor's tab; the API only stores recipes as JSON.
Layout
docker-compose.yml the stack
.env.example WEB_PORT
data/ SQLite (created on first run, gitignored)
backend/ Fastify + better-sqlite3 API, own Dockerfile
frontend/ Vite + React + CanvasKit SPA, own Dockerfile + nginx.conf
shared/ vendored copies of the app's types + utils (see below)
src/engine/ skiaShim.ts (CanvasKit) + exportEngine.ts (render pipeline)
+ session.ts (localStorage/IndexedDB studio persistence)
Vendored files
frontend/shared/{types/index.ts,utils/*.ts} are byte-identical copies of
src/types/index.ts and ten src/utils/*.ts files from the React Native
project (@shopify/react-native-skia is aliased to src/engine/skiaShim.ts in
vite.config.ts + tsconfig.json, so those files compile unchanged):
cinemaShader colorUtils defaultRecipes exifWrite frameUtils jpegDpi
paramDefs recipeShare skiaImage toneShader.
The landing page needs no CDN: frontend/public/assets/fonts/*.woff2 are the
seven self-hosted faces behind the three font groups the Themes menu offers
(Plus Jakarta Sans / Inter / JetBrains Mono, Fraunces / Be Vietnam Pro /
Courier Prime, Be Vietnam Pro / Space Mono — all SIL OFL, pulled from Google
Fonts, vietnamese + latin + latin-ext subsets), and
frontend/public/assets/samples/s*.jpg are the six placeholder negatives the
film strip, preset tester and QR card show (swap them for real graded stills
whenever we have them). Its one foreign request is the QR image from
api.qrserver.com, which degrades to an empty slot offline.
When the app changes one of them, copy it back in — the renderer is only "parity" for as long as these stay in sync:
cd <repo>/docker/frontend/shared/utils
cp <repo>/src/utils/<name>.ts .
Operations
docker compose logs -f api # API log
docker compose restart api # after backend/src changes (rebuild: --build)
docker compose down # stop; ./data survives
Backup is the ./data folder — that is the whole database.
Checks
curl -s http://localhost:8090/api/health # {"ok":true}
curl -sI http://localhost:8090/ # 200, index.html
Then open the UI, drop a photo in, and confirm the preview shows the picture and
EXPORT downloads a JPEG that opens. The preview going solid black while the
export still reports a plausible size is the one failure mode worth knowing: it
means the CanvasKit GPU surfaces lost their shared GrDirectContext (see
frontend/src/engine/skiaShim.ts), and with no GPU the raster fallback renders
the same pipeline correctly, just slower.