Skip to content

Align recipe registry versions with the images - #2329

Merged
neuromechanist merged 9 commits into
devfrom
fix/recipe-registry-versions
Nov 23, 2026
Merged

neuromechanist merged 9 commits into
devfrom
fix/recipe-registry-versions

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

ADR 0134 Phase 2 (epic #2324) attaches checkpoint maps to the registry entry's version.
The registry said nemar-floor and nemar-ica are 1.0.0 with engine [email protected],
but the nemar-process images (origin/dev) report RECIPE_VERSION = "1.0.0-b1" for both
(recipes/nemar_process/nemar_floor/steps.py, nemar_ica/steps.py; pre-release scheme in docs/recipes.md)
and the engine as [email protected]+edf694c8344b9c4c68672eac3acf9a819f1462a8,
because eegprep is installed from a pinned git commit and common/versions.py appends the commit (docs/recipes.md, 54 characters).
With the old values every real run would reconcile as no_checkpoint_map, and, already today,
end in tuple_mismatch and hold the registry tuple (registry_drift).

The engine is changed with the version: aligning the version alone would leave every run a tuple_mismatch.

Change

  • shared/compute-recipes.ts: both entries version: "1.0.0-b1", engine a shared RECIPE_ENGINE constant with the image's text; a docblock says where the values come from.
    appVersion (the Tapis application version) is unchanged.
  • Tests: the finished-run record fixture (backend/test/helpers/compute-pipeline-fixture.ts) now writes what the image writes, and the assertions and seeded stamps that stand for the registry tuple follow it.
    Contract vectors (shared/contract/derivatives-vectors.json) and the pinned legacy pipeline-key text are fixed inputs, not registry reads, and are unchanged.

Investigation: does the string change behavior for existing rows?

Where the registry version and engine are read (origin/dev):

  • Claim and live-stamp checks bind recipe.version, recipe.engine (backend/src/services/compute-pipeline.ts:753, :1400); candidates (--eligible and the daily dispatcher) bind them at :1281-1282; the tuple hold check at :648.
  • On success the stamp is rewritten from the record (SUCCEED_STAMP_SQL, :346), and a record differing from the claimed tuple holds the claimed tuple (:1086-1104).
  • pipelineKey (:366) and the derivative keys (compute-derivatives.ts:470-472, migration 0143) read the stamp row, never the registry.
  • Migrations 0117/0141 store the strings; the CHECKs allow - and +, and the engine text fits the 64-character column and the derivative-key contract regex.
  • CLI (src/commands/admin-compute-pipeline.ts) only prints stamp values; no help text states a version. No website parity reads these values.

Effects (also in CHANGELOG.md ## Unreleased):

  • Succeeded stamps on the old tuple (1.0.0 / [email protected], only the pre-scheme demonstration image writes it) stop blocking re-dispatch of their dataset.
  • Failures on the old tuple stop counting toward the retry cooldown and the failure cap.
  • tuple_mismatch holds on the old tuple stop applying, as HOLD_TUPLE_SQL documents.
  • An in-flight stamp on the old tuple does not block a claim of the new one, so a dataset can run twice; the second sync ends tuple_already_stamped. Deploy with no open nemar-floor stamps.
  • A succeeded stamp from a 1.0.0-b1 image already holds the new tuple (rewritten on success) and now blocks re-dispatch, as it should.
  • No stored derivative key changes, no data migration, and nothing here touches a DOI (compute-derivatives.ts:37).

Deploy order. No published image reports the new tuple yet (nemar-process main is still 1.0.0 with eegprep from PyPI). If this ships first, the first finished run holds the NEW tuple and that hold never clears. Order: nemar-process release, publish the runtime image from main, repin COMPUTE_RUNTIME_IMAGE wherever compute is or will be on, check the pinned digest's tuple with nemar-recipe version, then deploy this.

I could not query production or staging D1 for existing stamp rows (read access was denied in this session), so the count of rows on the old tuple is unverified; the code paths above bound the effect.

Review round 1

  • Release order (Important) -> CHANGELOG.md ## Unreleased entry: the new tuple, the deploy order, the effects on existing rows; mirrored above.
  • Docblock -> shared/compute-recipes.ts names the sources (RECIPE_VERSION in recipes/nemar_process/{nemar_floor,nemar_ica}/steps.py, the eegprep git pin in pyproject.toml with the suffix from common/versions.py), says the values must match the image COMPUTE_RUNTIME_IMAGE pins and that a move repins the image first, that RECIPE_ENGINE moves with the pin and loses +<commit> at an eegprep release, and that nemar-ica moves on its own pins.
  • Cross-repo drift check (Important) -> test/compute-recipes-process-drift.unit.test.ts: each registry version equals the recipe's RECIPE_VERSION, and engine equals eegprep@<uv.lock version>+<pyproject git rev> (bare from an index). The four files are added to the nemar-process sparse checkout (ref: dev) in .github/workflows/test.yml, and NEMAR_REQUIRE_PROCESS_RECIPES=1 is set next to its siblings, so a missing checkout or file fails.
    Evidence on a local sparse extract: against nemar-process origin/dev 4 pass; against origin/main it fails (nemar-floor.version expected 1.0.0, received 1.0.0-b1); with the registry engine mutated to [email protected] against dev it fails (nemar-floor.engine); with the version mutated to 1.0.0 it fails (nemar-floor.version); required with no checkout, 2 fail; unset, 2 skip.
  • Fixture comment -> backend/test/helpers/compute-pipeline-fixture.ts says it catches drift from this copy of the image's record, and names the cross-repo test.
  • tuple_mismatch log -> now ends version_differs, engine_differs or both (field names only), with three tests in backend/test/compute-pipeline.test.ts (mutation: dropping engine_differs fails two).

Review round 2

  • I1 drift test read a commented-out old pin from pyproject.toml (false pass) -> the engine now comes only from the eegprep block of uv.lock: its version, plus the resolved commit after # in source = { git = "...#<sha>" }; a registry source gives the bare engine; pyproject.toml is no longer read or checked out. Parser cases: a git lock, an index lock, a [tool.uv.sources]/branch-style lock entry, and the eegprep-lean block's commit never chosen. Reproduced on an extract of nemar-process dev with the real pin moved to a new commit (lock moved too) and the old pin left commented out above it: the round-1 test passes (4 pass), the new one fails (nemar-floor.engine expected [email protected]+2222..., received ...+edf694c8...).
  • S2 -> expect(COMPUTE_RECIPES.length).toBeGreaterThan(0) before the loop.
  • S3 -> the test.yml checkout comment lists the new paths and their size (uv.lock about 600 KB); pyproject.toml dropped from the sparse list.
  • S4 -> recipeVersionOf accepts a type annotation, either quote style and a trailing comment, and still ignores a commented-out line; cases for each.

Tests

Run:

  • backend: all test/compute-pipeline*, test/compute-derivatives*, test/compute-runner* (17 files, 674 pass), compute-fixture-eligibility, zarr-source-check (110 pass)
  • root: test/admin-compute-*.test.ts and test/compute-*.unit.test.ts file by file (all pass), test/contract-derivatives.unit.test.ts
  • round 2: the drift test against dev (6 pass), against main (fails on nemar-floor.version), unset (skips visibly); compute-recipes.unit, ci-tier-routing.unit
  • round 1: test/compute-recipes-process-drift.unit.test.ts (with the checkout), compute-recipes.unit, admin-compute-pipeline-cli, ci-tier-routing.unit, compute-observation-contract.unit, env-undefined-guard.unit, changelog-format.unit; backend compute pipeline, derivatives and runner suites again (677 pass)
  • bun run typecheck, bun run lint, biome check on the changed files

Not run: the full bun test (about 80 minutes; it runs at epic to dev per the testing rules).

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2329

Version: 0.10.40-PR2329.903feec
Commit: 903feec


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 5c734f7 into dev Nov 23, 2026
31 checks passed
@neuromechanist
neuromechanist deleted the fix/recipe-registry-versions branch November 23, 2026 06:02

This branch was previously deployed

1 inactive deployment
npm — 903feec5 Deployed Nov 23, 2026 by neuromechanist via publish #4789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant