diff --git a/.github/workflows/golden-tests-full.yml b/.github/workflows/golden-tests-full.yml index 782b9a64..c1cd8261 100644 --- a/.github/workflows/golden-tests-full.yml +++ b/.github/workflows/golden-tests-full.yml @@ -3,9 +3,10 @@ name: "Golden tests (all model assets)" # The ML golden tests skip when their model files are absent, and a skipped # test is reported as a pass. `server-rs-tests.yml` closes that hole for the # face family (89 MB, cheap enough per PR), but BioCLIP (834 MB) and SigLIP2 -# (2.2 GB) are too heavy to fetch on every push. This job fetches all three -# and runs with LRG_REQUIRE_GOLDENS=all, so a missing asset fails instead of -# skipping — the numerical checks either run or the job goes red. +# (2.2 GB) are too heavy to fetch on every push. This job fetches every +# family — AuraFace (261 MB) from Hugging Face, the rest from releases — and +# runs with LRG_REQUIRE_GOLDENS=all, so a missing asset fails instead of +# skipping: the numerical checks either run or the job goes red. # # Deliberately *not* cached. A fresh download each night also verifies that # the published release assets are still present and fetchable, which is what @@ -97,6 +98,19 @@ jobs: mv "$dest/aesthetic_goldens.json" "$GITHUB_WORKSPACE/server-rs/testdata/aesthetic_goldens.json" mv "$dest/bioclip2_image_fp16.onnx" "$dest/bioclip2_image.onnx" + # AuraFace is not a release asset: the server downloads it from + # Hugging Face at a pinned commit (routes/face_recognizer.rs). The + # repo, revision, file and sha256 the golden reference was made from + # are recorded next to that reference in face_goldens.json, so take + # them from there and refuse a file whose hash does not match. + src_json="$GITHUB_WORKSPACE/server-rs/testdata/face_goldens.json" + read -r af_repo af_rev af_file af_sha < <(jq -r \ + '.astronaut_512.auraface_source | "\(.repo) \(.revision) \(.file) \(.sha256)"' \ + "$src_json") + curl -fsSL --retry 4 --retry-all-errors -o "$dest/auraface_glintr100.onnx" \ + "https://huggingface.co/$af_repo/resolve/$af_rev/$af_file?download=true" + echo "$af_sha $dest/auraface_glintr100.onnx" | sha256sum -c - + ls -lh "$dest" df -h . diff --git a/AGENTS.md b/AGENTS.md index d0c902e5..49f0879b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -86,10 +86,10 @@ cargo run -p lrg-server -- --db-path /path/to/lrgenius.db --debug **The ML golden tests skip when their model files are absent, and a skip is reported as a pass.** Set `LRG_REQUIRE_GOLDENS` to the families whose assets -are present (`face`, `siglip`, `aesthetic`, `bioclip`, or `all`) to turn that skip into a +are present (`face`, `auraface`, `siglip`, `aesthetic`, `bioclip`, or `all`) to turn that skip into a failure — this is what stops CI being green on numerical checks that never ran. PR CI provisions the face pair (89 MB) and requires it; the nightly -`golden-tests-full.yml` fetches all three. If you add a golden test, gate it +`golden-tests-full.yml` fetches every family. If you add a golden test, gate it through `crates/lrg-ml/tests/common/assets_ready` rather than an early `return`. diff --git a/CLAUDE.md b/CLAUDE.md index ed1c0f3b..f392835e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -86,10 +86,10 @@ cargo run -p lrg-server -- --db-path /path/to/lrgenius.db --debug **The ML golden tests skip when their model files are absent, and a skip is reported as a pass.** Set `LRG_REQUIRE_GOLDENS` to the families whose assets -are present (`face`, `siglip`, `aesthetic`, `bioclip`, or `all`) to turn that skip into a +are present (`face`, `auraface`, `siglip`, `aesthetic`, `bioclip`, or `all`) to turn that skip into a failure — this is what stops CI being green on numerical checks that never ran. PR CI provisions the face pair (89 MB) and requires it; the nightly -`golden-tests-full.yml` fetches all three. If you add a golden test, gate it +`golden-tests-full.yml` fetches every family. If you add a golden test, gate it through `crates/lrg-ml/tests/common/assets_ready` rather than an early `return`. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3b420692..701f0688 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -135,7 +135,7 @@ must survive every edit. - **Lightroom Tests over MCP**: With Lightroom open (the agent bridge starts with it) and `LRGENIUS_MCP_TOKEN` set to the agent token from the Plug-in Manager, `cd server-rs && cargo test -p lrg-mcp --test live_lightroom -- --ignored --test-threads=1` runs the plugin's in-Lightroom tests through the MCP endpoint (see `docs/wiki/Dev-Agent-Bridge.md`). They work on whichever catalog is open, so use a test catalog that holds copies of your photos, above all with `LRG_LIVE_WRITES=1`, which changes photos. AI coding agents run the full live test from `.claude/skills/lrgenius-mcp-full-test/SKILL.md` and must not test in your production catalog without your approval. - **Plugin Unit Tests**: Pure Lua logic (helpers in `Util.lua`, keyword and photo-id handling) is tested headlessly with [busted](https://lunarmodules.github.io/busted/): run `busted` from the repo root (`luarocks install busted`). Specs live in `plugin/spec/`, `.busted` configures them, and `plugin/spec/spec_helper.lua` stubs the Lightroom SDK. CI runs them via `lua-tests.yml`. Add specs when you touch pure helpers. - **Backend Tests**: `cd server-rs && cargo test --workspace`. - - The ML golden tests **skip when their model files are absent, and a skip is reported as a pass** — so a green run on a machine without the model assets has not checked the model numerics. Set `LRG_REQUIRE_GOLDENS` to the families whose assets you have (`face`, `siglip`, `aesthetic`, `bioclip`, or `all`) to turn that skip into a failure. PR CI requires `face`; the nightly `golden-tests-full.yml` runs `all`. See [`server-rs/README.md`](server-rs/README.md#golden-tests-and-lrg_require_goldens) for fetching the assets. + - The ML golden tests **skip when their model files are absent, and a skip is reported as a pass** — so a green run on a machine without the model assets has not checked the model numerics. Set `LRG_REQUIRE_GOLDENS` to the families whose assets you have (`face`, `auraface`, `siglip`, `aesthetic`, `bioclip`, or `all`) to turn that skip into a failure. PR CI requires `face`; the nightly `golden-tests-full.yml` runs `all`. See [`server-rs/README.md`](server-rs/README.md#golden-tests-and-lrg_require_goldens) for fetching the assets. --- diff --git a/docs/wiki/Dev-Server-README.md b/docs/wiki/Dev-Server-README.md index bb36fe73..acec3eed 100644 --- a/docs/wiki/Dev-Server-README.md +++ b/docs/wiki/Dev-Server-README.md @@ -142,13 +142,14 @@ LRG_REQUIRE_GOLDENS=face,siglip cargo test --workspace # a subset LRG_REQUIRE_GOLDENS=all cargo test --workspace # every family ``` -Family names are `face`, `siglip`, `aesthetic` and `bioclip`. Per-family rather than a +Family names are `face`, `auraface`, `siglip`, `aesthetic` and `bioclip`. Per-family rather than a single switch because they differ in cost by more than an order of magnitude -(89 MB, 2.2 GB, 868 MB and 834 MB respectively). +(89 MB, 261 MB, 2.2 GB, 868 MB and 834 MB respectively). CI uses both halves: `server-rs-tests.yml` downloads the face pair on every PR and sets `LRG_REQUIRE_GOLDENS=face`, while the nightly `golden-tests-full.yml` -fetches all three and runs with `all`. The models resolve through the same +fetches every family (AuraFace from its pinned Hugging Face commit, the +rest from releases) and runs with `all`. The models resolve through the same `LRG_*_ONNX` env vars and `~/.cache/lrgenius/models/` fallback the server uses, so a machine that has run the plugin's model download needs no extra setup. diff --git a/server-rs/README.md b/server-rs/README.md index a3f53a6c..1fac9c76 100644 --- a/server-rs/README.md +++ b/server-rs/README.md @@ -138,13 +138,14 @@ LRG_REQUIRE_GOLDENS=face,siglip cargo test --workspace # a subset LRG_REQUIRE_GOLDENS=all cargo test --workspace # every family ``` -Family names are `face`, `siglip`, `aesthetic` and `bioclip`. Per-family rather than a +Family names are `face`, `auraface`, `siglip`, `aesthetic` and `bioclip`. Per-family rather than a single switch because they differ in cost by more than an order of magnitude -(89 MB, 2.2 GB, 868 MB and 834 MB respectively). +(89 MB, 261 MB, 2.2 GB, 868 MB and 834 MB respectively). CI uses both halves: `server-rs-tests.yml` downloads the face pair on every PR and sets `LRG_REQUIRE_GOLDENS=face`, while the nightly `golden-tests-full.yml` -fetches all three and runs with `all`. The models resolve through the same +fetches every family (AuraFace from its pinned Hugging Face commit, the +rest from releases) and runs with `all`. The models resolve through the same `LRG_*_ONNX` env vars and `~/.cache/lrgenius/models/` fallback the server uses, so a machine that has run the plugin's model download needs no extra setup.