Skip to content

Re-vendor neuroschema 0.6.0 (epic #2324 N1a) - #2356

Merged
neuromechanist merged 9 commits into
feature/issue-2324-epic-pipeline-progressfrom
feature/issue-2324-n1a-neuroschema-060
Nov 24, 2026
Merged

neuromechanist merged 9 commits into
feature/issue-2324-epic-pipeline-progressfrom
feature/issue-2324-n1a-neuroschema-060

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Phase N1a of epic #2324 (ADR 0137): re-vendor neuroschema 0.6.0, tag v0.6.0 on main at e09ed407.

Changes

  • build-vendor.mjs also copies views/registry.json, views/vectors/*, views/montages/* (with PROVENANCE.json) and the example product (examples/views/ to views/examples/) byte for byte, with views/SHA256SUMS.json (source path, size, SHA-256, version, commit). .gitattributes marks the copies -text.
  • Every vendored byte is read from git at the stamped commit, including the version, every schema in the walk and every view file (git cat-file blob <commit>:<path>). The file list comes from git ls-tree, so skip-worktree, autocrlf and smudge filters cannot put working-tree bytes into the copy. The dirty-tree refusal stays as a second guard. Everything is built and checked in memory before views/ is emptied, so a refused run leaves the tree untouched.
  • --check rebuilds in memory, compares against dataset.bundle.json and views/ (every file, with nothing missing and nothing extra), writes nothing, and exits 1 on any difference.
  • Bundle regenerated: 44 schemas, 15 new (definitions/view.schema.json, the kind, content and transform schemas). Regeneration from the tag is reproducible.
  • NEUROSCHEMA_VERSION 0.6.0; comments that named v0.5.0 fixed. The transition line stays ["0.4"], since 0.5.0 never left the epic, and the pin test now refuses 0.5.x.
  • Fixtures test/fixtures/neuroschema/*-ds002718-processing.json re-copied from the 0.6.0 examples.
  • PROGRESS_PATH_RE and the ProgressPath pattern in compute-progress.schema.json and compute-results-report.schema.json narrowed to 0.6.0 relativeLocation (ASCII): no . or empty segment, no trailing /, no leading or trailing space, none of % ? #. This also governs the failure lists and signalJourney link location. The old assertion that ./a and a//b are accepted is replaced by agreement tests in both directions.
  • The data_papers DOI writer pattern is now ^10\.[0-9]{4,9}/[!-~]+$ (neuroschema dataPaper.doi).
  • ADR 0137: the "in preparation" wording now names the release.
  • CHANGELOG, including the rollout window: until nemar-process adopts the narrowed path rule (P2), a recording path with %, ?, # or a leading or trailing space passes nemar-process's filter but is refused by the backend.

Tests (no mocks)

  • Release stamp (bundle and SHA256SUMS at e09ed407), view.schema.json and every registry kind in the bundle, every view file matches SHA256SUMS and SHA256SUMS lists every file, the eegprep commit in the vectors equals the recipes' engine commit, the record example validates with views and is refused with figures (renamed or added), and the example product's record validates with its declared files equal to the product bytes.
  • Progress paths: agreement both ways with the vendored relativeLocation, the ASCII-only narrowing, the schema pattern equal to the regex, and the failure lists and links refusing narrowed paths.
  • DOI: the writer agrees with the vendored schema case for case.
  • test/neuroschema-build-vendor.unit.test.ts builds a small git repository in a temporary directory and runs a copy of the script against it. It covers skip-worktree on a view file and on a schema (the committed bytes are vendored), an autocrlf CRLF working copy (the LF blob is vendored), a visible change (refused, with the vendored tree untouched), and --check (exact tree passes; a missing tree, a flipped byte, an extra file or a changed bundle each fails, and nothing is written).
  • Scripted check against the real v0.6.0 clone: views/registry.json and schema/definitions/view.schema.json were set to skip-worktree and overwritten. git status was clean, --check exited 0, and a write run left the vendored tree unchanged.

Mutation table

Each mutation was applied to the source, the targeted tests were run, and the file was restored.

# Mutation Result
M1 Bundle source_commit changed by one character 1 fail (release stamp)
M2 view.schema.json renamed in the bundle (id and refs) 1 fail (view declaration in bundle)
M3 One byte flipped in vectors/view-digest.v1.json 1 fail (SHA256SUMS)
M4 One byte flipped in montages/biosemi64.json 1 fail (SHA256SUMS)
M5 RECIPE_ENGINE commit changed 1 fail (eegprep commit equals engine)
M6 eegprep commit inside sensor-field.v1.json changed 2 fail (SHA256SUMS, eegprep commit)
M7 SHA256SUMS stamp commit changed 1 fail (release stamp)
M8 Bundle's dataQuality also admits figures 1 fail (record example refused with figures)
M9 PROGRESS_PATH_RE reverted to the 0.5.0 rule 13 fail (corpus, agreement, schema equals regex, failure lists, links)
M10 Progress JSON Schema path pattern reverted 11 fail (Ajv/zod corpus, schema equals regex)
M11 Only the results-report path pattern reverted 1 fail (shared defs equal)
M12 DOI pattern reverted to \d{4,9}/\S+ 1 fail (writer equals schema, case for case)
M13 Transition lines also admit "0.5" 2 fail (live pin tests)
M14 NEUROSCHEMA_VERSION left at 0.5.0 6 fail
M15 Extra stale file added under views/vectors/ 1 fail (SHA256SUMS lists every file)
M16 Dirty neuroschema checkout given to build-vendor refused, exit 1
M17 build-vendor reverted to the pre-review version (working-tree reads, no --check) 3 fail (skip-worktree, CRLF, --check)
M18 View files read from the working tree 2 fail (skip-worktree, CRLF)
M19 Schema walk reads the working tree 1 fail (skip-worktree)
M20 Dirty-tree refusal disabled 1 fail (visible change refused)
M21 --check ignores extra files 1 fail (--check)

Gates

  • bun install (root, backend), bun run typecheck, bun run lint: clean.
  • Targeted root tests (contract-neuroschema, contract-schemas, compute-progress-contract, compute-checkpoints, compute-recipe-progress-contract, compute-results-report-contract, compute-runner-contract, data-route.unit, plugin-manifest-contract, adr-index, changelog-format, compute-recipes-process-drift, neuroschema-build-vendor): 658 pass, 3 skip, 1 fail.
  • Targeted backend tests (bids-index-session-modalities, metadata-json-pipeline-route, metadata-json-data-papers-route, data-papers-shape, data-papers-sync, compute-progress-reconcile, compute-progress-route, compute-job-callbacks, compute-runner-progress, cron-sweep-wiring): 445 pass.
  • Expected failure, owned by N1b: test/plugin-manifest-contract.unit.test.ts, "the name and version patterns agree with neuroschema processingTypes.plugin". In 0.6.0 the plugin name pattern is narrower, so the corpus case A.b_c-d now differs. N1b changes PLUGIN_NAME_RE, so this PR leaves it unchanged.
  • Not run: the full bun test (epic gate), and the live tests contract-live and data-route (they need a deployed backend). The recipe drift test skips locally because there is no nemar-process checkout; on CI it is expected to fail on the epic branch because nemar-process dev lacks PZ.

Downstream

nemar-process re-copies compute-progress.schema.json and compute-results-report.schema.json (P2, consumer-impact item 8).

build-vendor.mjs now copies views/registry.json, views/vectors, views/montages and examples/views byte for byte into shared/contract/neuroschema/views/ with a SHA256SUMS.json, and refuses a dirty neuroschema checkout. Tested: regeneration from v0.6.0 is reproducible.
Bundle and view files from tag v0.6.0 (e09ed407): 44 schemas, the view registry, parity vectors, montages with provenance and the example product. NEUROSCHEMA_VERSION 0.6.0; fixtures re-copied from the 0.6.0 examples; the transition line stays 0.4 (0.5.0 was never deployed). New tests: release stamp, view schemas in the bundle, SHA256SUMS, eegprep commit equals the recipe engine's, record example refused with figures, example product bytes. Tested: targeted contract tests; the progress path agreement test is fixed in the next commit.
PROGRESS_PATH_RE and the ProgressPath pattern of the progress and results report schemas now refuse . segments, empty segments, leading or trailing spaces and % ? #, so live failures, failure lists and signalJourney link locations follow neuroschema 0.6.0. Tests: agreement both ways with the vendored relativeLocation, the schema pattern equals the regex, failure lists and links refuse the narrowed paths.
The writer's DOI rule is neuroschema 0.6.0 dataPaper.doi exactly: four to nine ASCII digits and a printable-ASCII suffix. Tests hold the writer to the vendored schema case for case.
Every vendored byte (version, schemas, view files) is read with git cat-file at the stamped commit and the file list from git ls-tree, so skip-worktree, autocrlf and smudge cannot leak working-tree bytes. The dirty-tree refusal stays. Everything is built and checked in memory before views/ is emptied. --check diffs against the vendored tree and writes nothing. Tested: new hermetic test (skip-worktree, CRLF, dirty refusal, --check), each guard mutated.
@github-actions

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2356

Version: 0.10.40-PR2356.0945139
Commit: 0945139


🤖 Updated on each push.

@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review r1 (code+tests+errors+comments): no Critical or Important; build-vendor now reads git blobs at the stamped commit and has --check, mutation table in the body, docblock rewrapped, CHANGELOG names the P2 window. Driver verified: the 4 build-vendor tests pass and --check against a fresh v0.6.0 clone reports an exact match. CI: only the two expected failures (plugin-name agreement, owned by N1b next; recipe drift, until nemar-process PZ reaches dev); cancelled shard rerun once. Admin-merging into the epic branch.

@neuromechanist
neuromechanist merged commit d3b5f66 into feature/issue-2324-epic-pipeline-progress Nov 24, 2026
46 of 53 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-2324-n1a-neuroschema-060 branch November 24, 2026 20:34

This branch was previously deployed

1 inactive deployment
npm — 09451398 Deployed Nov 24, 2026 by neuromechanist via publish #4848
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