Repository navigation
Check the Zarr copy's source commit on dispatch (DM-06b) - #2153
Merged
neuromechanist merged 5 commits intoNov 14, 2026
Merged
neuromechanist merged 5 commits into
neuromechanist merged 5 commits into
Conversation
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2153Version: 🤖 Updated on each push. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Card DM-06b of the portable compute plan: the dispatch proves the Zarr serving copy describes the tagged data.
For a recipe whose input is
zarr,resolveRun(after DM-06's newest-version and ready-copy refusals, before any read) resolves T (the tag's commit, GitHub) and S (the serving index'ssource_commit), decidesexact(S equals T) ormetadata_only(GitHub compareT...Sisahead,behind_by0, fewer than 300 files, every path and every renamed file's previous path under.nemar/or.github/), and passes--source-commit S --tag-commit T --commit-equivalence <verdict>plus one--commit-delta-pathper path in the compare's order. This replaces the dataset row'szarr_source_commit(the row's commit is no longer read).Words:
zarr_source_mismatch(409, definite) andzarr_source_unverifiable(503, cannot be read; joinsNON_DATASET_FAILURE_WORDS). A refusal writes no job, stamp, hold or ledger row, only the route's usual audit row, as forversion_untagged.Bounds, literal: at most 3 GitHub requests per dispatch (tag, tag without its
vafter a 404 or 422, one compare at 100 files per page), each abandoned after 5 s,maxAttempts1 (no retry), redirects not followed, bodies read to at most 1 MiB (commit) and 8 MiB (compare); one index read, abandoned after 10 s, over HTTP read to at most 64 MiB (in production it isgetZarrIndex, whose body this file cannot bound; the wait for it is bounded); the installation-token wait is bounded by 5 s. The index read and the tag lookup run together: longest call 15 s.Credentials: the App installation token when configured; outside production with no App, unauthenticated; in production with no App (or an App that cannot mint), nothing is requested and the word is
zarr_source_unverifiable.NEMAR_ZARR_INDEX_BASE(test seam) is honored only outside production.Local stack:
--seed-from-catalogsets the index base to the public serving host and records a datasetreadywith its public index's store count (the public record carries neither);--seed-fixturestarts the stand-in (verdictexact, S equals the fixture version's commit). The two seeds are refused together (one GitHub API and one index base per stack).Tests: new
backend/test/zarr-source-check.test.ts(65 tests through the real admin route, a real loopback stand-in for GitHub and the index inbackend/test/helpers/github-compare-standin.ts); updated compute-runner-jobs, compute-local-stack and the pipeline CLI tests for the new vector and seeding.Gates:
bun run typecheckandbun run lintpass;bunx biome checkon every touched file: no errors (3 pre-existinganywarnings); zarr-source-check, compute-runner-jobs, compute-local-stack, compute-pipeline-dispatch and the pipeline CLI test: 259 pass, 0 fail; the wholetest/compute-*andbackend/test/compute-*set with the contract and ADR-index tests: 2648 pass, 0 fail, 6 skip.Mutations: 32 one-line mutations, each killed by the test named for it; one (dropping the declared-length fast path) is behavior-identical because the streaming count bounds the same body.
Not run, would check: the full
bun testbecause it is the epic gate.Deviations: see the card report (delta cap 24 not 32 because a job's argument vector holds 64 strings; zero changed files is a mismatch because the recipe refuses
metadata_onlywith no path;shared/compute-recipes.ts, the route's sentence table andtest/admin-compute-pipeline-cli.test.tstouched because the vector, the words and the CLI test need them).Merge note for epic D (#2116, touches
compute-pipeline.ts):resolveRunis(db, id, wanted, recipe, env)here; merge it as(db, id, wanted, except, recipe, env).Card: DM-06b.
Review round 1 fixes (head see the last commit):
commits/refs/tags/<name>for both thevform and thev-less fallback (the shorttags/form is a 422); a branch or a bare ref of the tag's name cannot answer as T. The stand-in now models ref resolution (a branch resolves by its bare name andrefs/heads/, never throughrefs/tags/; a lightweight and an annotated tag both resolve to the commit).ZARR_SOURCE_REASONS(tag_absent,compare_absent,compare_behind,compare_diverged,compare_identical,too_many_files,data_path,too_many_delta_paths,no_delta_path,delta_path_unsupportedfor the 409;no_github_credentials,token_mint_failed,github_unreadable,compare_unreadable,no_index,index_unreadable,index_commit_unusable,check_threwfor the 503), in the route body, the dry run'sblocked, and the CLI output (..., reason compare_behind). The header says whatmetadata_onlyproves: no file outside.nemar/and.github/changed.launchStringBytes, a third of the 49,152-byte bound) arezarr_source_mismatchwith reasondelta_path_unsupported, neverinvalid_spec. Tests: 24 paths of 512 ASCII characters dispatch and fit the launcher; 10 paths of 500 non-ASCII characters dispatch and fit, 11 are refused; a JSON\ud800escape is refused.per_pagecomments are corrected (it pages COMMITS; files come on the first page, at most 300 for the whole comparison; the 24-path cap is the real limit); the stand-in caps a compare's files at 300 and a 1000-file case is refusedtoo_many_files..NEMAR/x,.Github/x) and a root with no slash (.nemar,.github) are data paths (tests).no_github_credentials), an App that cannot mint (token_mint_failed) and a GitHub outage (github_unreadable);check_threwlogs the error's name, never its message.docs/recipes.mdterms: the recipe accepts at most 32--commit-delta-pathvalues; the dispatch carries 24 because 16 fixed arguments plus 2 per path equal the job's 64-argument cap (JobSpecSchema). Raising the cap to carry 32 needs 80 arguments there.zarr_source_unverifiable(github_unreadable), and the next one mints a fresh token. Test: the cache entry is gone (the next call reaches the mint).nemar-local-stack/0, and outside production the check's own requests carry it too; the Worker'sNEMAR-APIonly in production). Tests for each.afterAllinstead of setting them undefined.github/transport.ts) andgetZarrIndex's missing abort signal and body-size bound (s3.ts).POST /app/installations/{id}/access_tokens) CAN narrow a token to named repositories and read-only permissions: yes. Not done here because the shared mint and its per-installation cache (github-auth.ts) are outside this card; a narrowed token would need its own cache key. Follow-up card.Gates after round 1:
bun run typecheckandbun run lintpass;bunx biome checkon the touched files: no errors; zarr-source-check 82 tests pass; the wholetest/compute-*andbackend/test/compute-*set with the contract, ADR-index and pipeline CLI tests: 2669 pass, 6 skip, 0 fail. 22 more one-line mutations, each killed by the test named for it (one, a reason on the CLI's per-dataset run line, was unreachable for a Zarr recipe and was removed). Not run, would check: the fullbun testbecause it is the epic gate. One MiniflareECONNRESETin abeforeEachof a six-file combined run was infrastructure; the file passes alone.