Repository navigation
Hand every BIDS run its tag commit; agree on skipped derivatives - #2460
Merged
Merged
Conversation
A nemar-ica run of the archive with no serving index staged got no --source-commit, so its record stated no commit, its stamp had no input digest and its derivative was skipped for good (no_input_digest). The staging answer now carries the tag's commit whenever it was read, and the job spec hands it as --source-commit with or without an index. Tested: serving-index-staging, compute-derivatives (nemar-ica cases), compute-serving-index-contract; each new case fails with the fix reverted.
Names the mechanism decision 6 always implied: a run staged without a serving index is handed --source-commit and the tag's commit whenever it was read, so its derivative is keyed none and stored. Tested: adr-index unit test.
The grid and a run's detail read the stored checkpoint from a progress row that only the stamp sync resolved, so after the derivative store skipped a run they showed it pending until the next sync, and coverage counted it complete. The store's pass now resolves the stored rows it decided, and coverage complete excludes a run whose decided stored row did not keep every recording. Tested: compute-derivatives (new view cases), compute-progress-reconcile, compute-pipeline-grid, quality-admin-route; both parts revert-checked.
Not tested: changelog text only.
Keeps the new case apart from the nemar-ica placeholder case, which a parallel change edits. Tested: compute-serving-index-contract unit test (13 pass).
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2460Version: 🤖 Updated on each push. |
The read bounds and the derivative object prefix move to a leaf module the progress and quality modules read, so the store imports resolveDecidedStored at the top with no cycle; the dynamic import and its catch, which only guarded the module load, are gone. Tested: compute-derivatives, compute-progress-reconcile, quality suites (252 pass).
keyStamp trusted the record's git: digest. When the recorded spec hands --source-commit, the stamp's digest must be exactly git:<that commit>; another commit, or two handed, is digest_mismatch. Tested: compute-derivatives (98 pass); the two mismatch cases fail with the check removed.
Every Worker-dispatched run of the archive, nemar-floor included, now reads its version's tag commit at dispatch and gets --source-commit. A GitHub fault defers the run (source_commit_deferred, a refused stamp, no end; it stops the queue); an absent tag refuses it (version_tag_absent, nothing written). Staging is handed the commit and reads only the index. Suites that dispatch a BIDS run use a GitHub tag stand-in (helpers/github-tags.ts). The coverage case now uses a genuinely unkeyable run (digest_mismatch), as does the CLI help. Tested: 29 backend compute and quality suites (1059 pass) plus the callback, cron, sweep, metadata and CLI suites; revert-checked.
Supersedes the last clause of ADR 0121 decision 10 and refines ADR 0141 decisions 3 and 4 (pointers in both); the 0141 amendment added earlier on this branch is folded into it. Tolerates the 0142 gap that PR #2458 reserves. Tested: adr-index unit test.
Not tested: changelog text only.
Only a GitHub credential fault (no_github_credentials, token_mint_ failed) stops a run over the queue, and it ends the daily tick; a github_unreadable deferral is one repository's and is passed over. A run asks for PIPELINE_RUN_EXTRA_TRIES (10) candidates beyond its room, so datasets refused for a missing tag or deferred never fill it. The tag stand-in now answers both tag spellings. Tested: compute-pipeline-queue (33 pass); each new case fails with its mutation.
A source_commit_deferred stamp no longer counts as another kind in SERVING_INDEX_DEFERRAL_AGE_SQL, so it does not restart the 24 hours. Tested: serving-index-staging (79 pass); the new case fails when the word is counted as another kind.
Narrows decision 2, adds the extra tries to decision 3 and the clock to decision 5; index line and changelog follow. Tested: adr-index unit test.
…ce-commit # Conflicts: # CHANGELOG.md
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.
Summary
Two faults found by a local end-to-end run of the ADR 0134 pipeline (nemar-ica on the archive input of on007823), widened in review round 1 by the owner's ruling of 2026-11-27 (ADR 0143, proposed here).
nemar-process records the commit it is handed (
--source-commit) asextensions.nemar.dataset.source_commit, and ADR 0123 decision 3 keys a BIDS derivative bygit:and that commit.The dispatcher handed one only with a staged index, so every other run of the archive (every
nemar-floorrun included) stated none, its stamp had no digest, and the derivative store skipped it for good (no_input_digest). ADR 0121 decision 10 had written that state down.Fix (ADR 0143):
versionTagCommit, one tag lookup, before the claim) and is handed it as--source-commit: after the staged index's file when one was staged (byte-identical to before), alone otherwise;github_unreadable,token_mint_failed,no_github_credentials) defers the run: arefusedstampsource_commit_deferred, a 503source_commit_deferredwith the fault's word, no end (a run without its commit could never be keyed), and it stops a run over the queue;keyStampkeys a BIDS stamp only when its digest is exactlygit:and the commit the recorded specification hands; another commit, or two handed, isdigest_mismatch(a specification from before that hands none is not checked).The
storedcheckpoint was resolved only by the stamp sync, which none of those read-only routes runs, and coveragecompleteread only the last checkpoint beforestored.Fix:
syncDerivativesends by resolving thestoredrows it decided (resolveDecidedStored, now a static import: the read bounds and the derivative object prefix moved to a leaf module,compute-derivative-constants.ts, so there is no import cycle and no dynamic import), and coveragecompleteexcludes a run whose decidedstoredrow did not keep every recording. An undecided run still counts complete by its last checkpoint.The tag_absent decision (review round 1, item 4)
A version whose tag the repository does not have is refused (
version_tag_absent, 409, nothing written, logged asversion_tag_absent dataset=<id> version=<tag>), not run and not deferred.A version the data plane serves whose tag is gone is an integrity fault an administrator mends by restoring the tag: a retry cannot mend it, so a deferral would only write a stamp on every pass, and a run without its commit could never be keyed, so running it would spend an allocation on a derivative that cannot be stored.
The dataset stays a candidate of the queue, which moves on to the next one (the word does not stop a run over the queue).
The dry run still reads only D1 and the configuration, so it can say
would_dispatchfor such a version; the live run refuses it.ADRs
dev).test/adr-index.unit.test.tstolerates the 0142 gap that Phase 0: ADR 0142 (license identification, decision card, lineage reliability) #2458 reserves; whichever of the two merges second removes that entry.Repro (local stack, before this change)
v1.0.0: the tag is at4662b76aand the serving index sayssource_commitbc47f4bc, 6 commits ahead, so staging answeredsource_commit_differsand the arguments carried no--source-commit.pipeline statusshowedstored 0/1 Pandcomplete 1;derivatives syncansweredderivative_unkeyable: { no_input_digest: 1 }.storedpending and coverage stillcomplete 1; only after apipeline statuscall (which syncs) did the run detail showstored: skipped.Tests
Targeted (from
backend/unless noted), all on the pushed head:What the tests pin:
serving-index-staging.test.ts: the tag's commit is read first (with or without the tag'sv), and nothing is written; an absent tag istag_absent, refusedversion_tag_absent(409) with nothing written and logged; a GitHub fault, and a production Worker without the App, are deferred with asource_commit_deferredstamp and still deferred two days on; a live stamp refuses the deferral's claim; throughdispatchPipelineJob, a floor run is deferred, then refused, before any job, and dispatched once the tag is there; staging is handed the commit and asks GitHub nothing; index faults alone defer, and a run past 24 hours has its commit; nemar-ica's arguments end with--source-commit <tag commit>for every word, and a spec of a run of the archive without a commit, or with an abbreviated one, throws.compute-derivatives.test.ts: the on007823 shape throughsourceCommitForRun,servingIndexForRun,recipeJobSpec, the stamp sync and the store pass (stored,git:<tag commit>,serving_index none);digest_mismatchfor a record that states another commit, or a spec that hands two; a record that states the handed commit is keyed by it; the view cases now use a genuinely unkeyable run (digest_mismatch: every recording passed, the record states another commit) and a stored one.zarr-source-check.test.ts: a BIDS recipe asks GitHub only for its tag (one request), reads no index and asks no compare, and its vector is the archive's own and--source-commit.compute-runner-jobs.test.ts: the BIDS spec hands the commit, and one without throws.backend/test/helpers/github-tags.ts, wired intostartLifecycleFixture({ githubTags: true })): a real loopback server for the one external request, with the App configuration and a seeded installation token.Revert checks (each restored afterwards):
no_input_digest; the store'sstoredstep removed, both view cases fail; the coverage rule reverted, the skipped case fails.digest_mismatchcases fail.Not run: the full
bun test(about 80 minutes); it would check the suites no grep for pipeline dispatch, stamps or the changed functions found, because every Worker-dispatched BIDS run now makes a GitHub request that a suite without the stand-in answersno_github_credentials.Review round 2 (queue starvation)
source_commit_deferredleftSTOPS_A_RUN; a run over the queue stops on it only when the reason isno_github_credentialsortoken_mint_failed(SOURCE_COMMIT_CREDENTIAL_FAULTS), and the daily cron then ends the tick (ENDS_THE_RUN).github_unreadablecan be one repository's (a renamed repository underredirect: "manual", an empty one, a 451, a bad sha), so that dataset is deferred and the queue moves on.pipelineCandidatesforPIPELINE_RUN_EXTRA_TRIES(10) candidates beyond its room and stops at the room. I kept ADR 0143 decision 3 as written (refused with nothing written, the dataset stays a candidate and the queue moves on) instead of excluding such datasets in the candidate SQL. The SQL cannot know that a tag exists again without a record of its absence, and writing one would change decision 3. The extra tries bound what one tick spends: at most 40 GitHub requests and about 80 statements, added to the cron's cost note. More than ten refused datasets at once at the head of the order would still hold a run, and each is logged by name.source_commit_deferredstamps (SERVING_INDEX_DEFERRAL_AGE_SQL).ADR 0143 decisions 2, 3 and 5, the index line and the changelog say so. The GitHub tag stand-in now answers a tag the same under both spellings (
v1.0.0, then1.0.0after a 404), which the absent-tag cases need.Tests and revert checks:
compute-pipeline-queue.test.ts: a credential fault (a production Worker without the App) stops the queue at the first of three datasets with one deferral stamp (fails with "never stop onsource_commit_deferred"); a 502 for the first repository defers it and the second dispatches (fails with "stop on everysource_commit_deferred" and with "only the room's worth of candidates"); ten heads refusedversion_tag_absentand the eleventh dispatches, with only its stamp written (fails with "only the room's worth of candidates").serving-index-staging.test.ts: an index deferral 25 hours ago and a commit deferral an hour ago, then an index fault, runs without the index (fails when the commit's deferral counts as another kind).Merging with the other open PRs
CHANGELOG.mdconflicts (both add under Unreleased; keep both). After both merge, two nemar-ica cases of Lift nemar-ica's placeholder: an administrator can run it #2462 assert the reason a credential-less Worker gave, and with this PR's tag stand-in the run gets its commit and is deferred by the index read instead:compute-pipeline.test.ts("nemar-ica is no longer a placeholder ...") andcompute-pipeline-routes.test.ts("nemar-ica is no longer recipe_placeholder ...") then seeserving_index_deferredwithindex_unreadable, notno_github_credentials. Checked in a throwaway merge; whichever PR merges second updates those two expectations.142fromTOLERATED_GAPSintest/adr-index.unit.test.tswhen both have landed.Agentic AI tools were used. Workflows follow the Research Skills (doi:10.5281/zenodo.20696515). The author assumes full responsibility for this content and associated changes.