Repository navigation
Pipeline checkpoints, live progress and quality views (ADR 0134, ADR 0137) - #2412
Conversation
* Vendor neuroschema 0.5.0 with a record root * Correct ADR 0134 on the neuroschema release * Add the live progress contract * Add checkpoint maps to the recipe registry * Add the checkpoint counting rules * Add the plugin manifest contract * Carry progress on the runner heartbeat * Add the pipeline progress tables * Record progress from runner heartbeats * Accept progress on the job token route * Reconcile progress when a stamp ends * Delete progress rows with the dataset * Serve pipeline extensions in metadata.json * Note stalled and reconciliation in ADR 0134 * Add the progress contract to the changelog * Name the progress route in token docblocks * Review: contract wording and code-point caps * Review: final documents, hold stamps, gates * Regenerate the progress vectors on 1.0.0-b1 * Compare checkpoint maps with nemar-process steps * Note the review changes in the changelog * Review 2: no failed link over a completed run * Update tests for neuroschema 0.5.0 and progress
* Export the pipeline run status as SQL * Add the pipeline grid contract * Add the pipeline grid service * Serve the grid, coverage and run routes * Move the stamp list to pipeline stamps * Add pipeline status and failures commands * Note the pipeline grid in the changelog * Review: job-less runs and unlisted counts * Review: CLI marks, help and stamp ids * Review 2: stored guard, lagging rows, stamp ids * Give the drill-down's stamp a test value
* Map recipe pre-checks to preprocess * Pin pre-check vectors; stricter drift test
* Add plugin checkpoints to the nemar-ica map * Read nemar-process PLUGINS in the drift test * Add plugin manifest vectors * Note plugin checkpoints in the changelog * Hold pipeline jobs to recipe result limits * Count skipped plugins at their checkpoint * Refuse an unread PLUGINS in the drift test * Pin manifest rule precedence * Changelog: plugin skips and result limits * Trim skipped_steps pairs; drop a vacuous check * Let a recipe limit raise the policy, not lower * Changelog: a recipe limit only raises
…cts (#2340) * Add the local launch specification contract * Add the recipe progress file contract * Add the results report contract * Name the three schemas in ADR 0134 * Share runnable rules with local launch One refineRunnable and LAUNCH_SPEC_MAX_DATASETS for both specs; local description names --code and --sif-root; strict Ajv. Targeted tests pass. * Name recipe progress encoding rules UTF-8, no duplicate keys, no NaN/Infinity, integers without fraction. Targeted tests pass. * Enforce results report cross-field rules Image uri pinned to digest; failures key bound and keys equal the map; each failure under its key; counts by progressProblem. Strict Ajv. Targeted tests pass. * Report each results report rule once Pin rule only with a well-formed digest; no progress rules over an empty map; a stray failure checkpoint is only failure_checkpoint_differs. Refinements exported for direct tests. Targeted tests pass. * Pin runnable rule paths and messages Entry and bundle issues checked on both launch specs. Targeted tests pass.
* Move nemar-floor and nemar-ica to 1.0.0-b2 Registry versions, regenerated progress vectors (NEMAR_WRITE_PROGRESS_VECTORS=1) and the tests that assert the current version. Targeted tests, typecheck and lint pass. * Accept plugin steps in CHECKPOINTS pre-PLUGINS nemar-process #78 lists quality/nemar-quality in nemar-ica's CHECKPOINTS before declaring PLUGINS. The drift test now accepts all or none of the plugin steps until PLUGINS is declared. Passes against nemar-process acf2690. * Changelog: recipes at 1.0.0-b2 * Keep the b1 changelog entry whole * Choose drift CHECKPOINTS by plugin mention expectedCheckpoints picks the whole map once PLUGINS is declared or CHECKPOINTS name any plugin step, else the map without them; fixed-text cases for none, whole, partial, wrong checkpoint and PLUGINS without the step. Drift test passes against nemar-process acf2690.
* Add ADR 0137: quality views drawn in browser Views are declared data the browser draws; no figure image is stored. Folds in the decisions on activations, electrode positions inferred from names, the public derivative, spectrum parameters, metric names and the plan hash. Indexed in both README lists. Tested: bun test test/adr-index.unit.test.ts. * Mark ADR 0134 partially superseded by 0137 Adds the pointer under ADR 0134's header and a note on its index line; the rest of 0134 is unchanged. Tested: bun test test/adr-index.unit.test.ts. * Fold PZ, sensor-labels and digest into ADR 0137 Activations reproduce the Zarr decomposition input exactly (store-content rounding, unit, average reference) with the 1 Hz high-pass as a display filter; positions from names are nemar.sensor-labels.v1 with stated defaults and refusal reasons; a store content_sha256 is null only for profile archive. Tested: adr-index and docs-links tests. * Address review round 1 on ADR 0137 Spectrum bound, archive-only null digest, homes rows named, supersession scope aligned across headers and index, file sizes and caps, first product-file route, anonymity gate, layout-role frame fields, converter follow-up #2343, README status date. Tested: adr-index and docs-links tests. * Revise ADR 0137 decomposition and activations The decomposition always reads preprocessed data (high-pass, line-noise removal, ASR cutoff 30, bad channels removed) on Zarr and BIDS inputs; activations are one browser multiply by the folded unmixing, sphere and average-reference matrices and approximate the decomposition input by design. Adds the raw-input alternative with the fixture numbers and the sccn/eegprep#668 limitation. Tested: adr-index and docs-links tests. * Align ADR 0137 with owner decisions for merge Line noise is a conditional 50/60 Hz band-stop until ZapLine-plus parity is measured; ASR repairs bursts only and reports asrBurstFraction (sccn/eegprep#684); channel types kept per row and keyed (sccn/eegprep#669, #2344); a view refuses rather than mislead; neuroschema 0.6.0 marked in preparation (nemarOrg/neuroschema#21), montage licensing stays a release precondition. Tested: adr-index test. * Name the bad-segment table in ADR 0137 rule Decision 1 and the README load-bearing line: an activation or signal-window view that has no bad-segment table says so on the page. Tested: adr-index and docs-links tests.
* ADR 0137: amend for neuroschema 0.6.0 review Records what the neuroschema 0.6.0 adversarial pass settled (nemarOrg/neuroschema#22-#30): scalp map rules, placement words, position bounds, labels, sensors_mismatch and envelope rules. Index line updated. Tested: adr-index unit test and lint pass. * ADR 0137: address round-1 review Corrects decisions 1 and 3 in place (bad-segment rule, 8 sensors, parity bound, nine label reasons) and reworks the 2026-11-24 amendment per the review: placement words with frame_unknown and unused_positions, cap_model and reference carrier, reference scope, eegprep differences, full I-JSON, location, size and format rules, scoped table_location_mismatch, exact sensors_mismatch conditions and the other review rulings. Index lines updated. Tested: adr-index unit test and lint pass. * ADR 0137: address round-2 review Scopes no_shaded_rows to activation views and corrects which label reason is new. Tested: adr-index unit test and lint pass.
Merge dev into the pipeline-progress epic
* Describe the pipeline group's grid and failures * Reword the pipeline docblock
* Vendor neuroschema view files with SHA256SUMS 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. * Re-vendor neuroschema 0.6.0 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. * Narrow progress paths to relativeLocation 0.6.0 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. * Tighten data_papers DOI to printable ASCII 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. * ADR 0137: neuroschema 0.6.0 is released * Changelog: neuroschema 0.6.0 re-vendor * build-vendor reads git blobs; add --check 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. * Rewrap transition-lines docblock * Changelog: progress-path rollout window
* Plugin manifest: views, prefixed metrics outputs.views replaces outputs.figures (kind, kind_version, caption, 1-8 roles, produced or from the recipe, max_bytes <= 4194304, at most 16 views); checkpoint quality only; plugin name and metric name follow neuroschema 0.6.0; problems bounds_reversed, plugin_without_output, metric_not_prefixed. Vectors regenerated. Tested: plugin-manifest contract and vectors tests. * Drop figures checkpoint; add nemar-spectrum STANDARD_CHECKPOINTS loses figures (ADR 0137); RECIPE_PLUGIN_STEPS and nemar-ica's quality checkpoint are nemar-quality then nemar-spectrum; resultLimits comment rechecked at about 16 files per recording. Progress vectors regenerated. Tested: compute-recipes, compute-checkpoints and process-drift tests (drift comparison against nemar-process dev fails only on the expected RECIPE_VERSION). * Port naming.py as compute-naming.ts label, productStem, productPath and datasetPath, a literal port of nemar-process common/naming.py at d090d84e, with compute-naming-vectors.json for nemar-process to replay. Tested: compute-naming unit test; the 24 vectors replayed against naming.py at d090d84e with 0 mismatches. * Changelog: plugin views and naming port * Manifest corpus: column, format, role limits Corpus cases for 64/65 columns, column unit 32/33, unknown column key, 16/17-character format and role names with a capital or hyphen; pins PLUGIN_MAX_VIEW_DIMS and PLUGIN_MAX_VIEW_COLUMNS; each schema pattern equals its regex source; the 64-column cap is documented as NEMAR's own. Tested: review mutations R1-R6 each fail. * List plugin view schemas as strict names PROGRESS_REQUEST_NAMES drops PluginFigureSchema for the five PluginView* schemas, and every listed name must be a zod schema exported by shared/contract/index. Tested: contract-schemas. * Drift fixture names nemar-spectrum
* Plugin manifest: optional unit on a produced role ViewProducedRole gains an optional unit (1 to 32 code points, the grammar of a neuroschema 0.6.0 column unit) in zod and the JSON Schema; a column's unit overrides it; a recipe role still refuses one. Corpus cases for 32/33 code points, empty, non-string, recipe role with unit, role unit beside column units; six new vectors, none changed. Tested: plugin-manifest contract and vectors; mutations M1-M9 each fail. * ADR 0137, changelog: produced-role unit Records the override rule and that the per-kind unit requirement is the nemar-process loader's (#2358). Tested: adr-index, changelog-format.
* Add I-JSON reader and nemar.view-digest.v1 RFC 8785 canonical form and an I-JSON reader that refuses duplicate members, lone surrogates, noncharacters, nesting past 64 and numbers that are not finite. Replays all nine view-digest vectors and the fourteen refusals. Tested: targeted unit tests. * Copy nemar-ica views product from P7 nemar-process tests/fixtures/ica-views at e4feec7b, byte for byte, with SHA256SUMS.json and provenance; never normalized by git. Fixture for phases B1 and B2 (#2341). * Correct nemar-ica files-per-recording note 17 files per recording with the record (P7), so maxFiles 25,000 admits about 1,470 recordings. Comment only (#2341). * Mirror dataQuality and run its writer rules A zod mirror of the dataset dataQuality document (level and recipes only, closed root, integers capped at 2^53-1), the writer rules run again (counts, listing, histograms, observed_range), the checks against a run's stamp, record digest, table counts and plugins, and the projection of a recording's entry with nemar.record-checks.v1. Ajv agreement corpora, the nine record-checks vectors and the P7 fixture. Tested: targeted unit tests. * Add compute_quality_documents table Migration 0151: one dataset quality summary per stamp, bound to the stamp's dataset, with named CHECKs and a dataset index. Tested on bun:sqlite and Miniflare D1, and migrations:d1-check. * Keep a run's quality summary at reconcile A succeeded run's desc-<label>_dataquality.json (at most 64 KiB) is checked against its stamp, the bytes of its dataset record, its recordings table and the recipe's plugins, and kept for its stamp with the stamp's dataset; a refusal is a fixed log word and never holds the run back. Deleted with the dataset. Tested: targeted backend tests over Miniflare R2 with the P7 product. * Serve dataQuality in metadata.json and bundle The dataset dataQuality of each recipe's current public derivative (stored, catalog or published, newest by stored_at), behind the public and concealed-deposit gate. The page bundle now carries the processing, signalJourney and dataQuality namespaces by the same read as metadata.json (#2331). Tested: targeted route tests. * Compare a summary's input, not its profile The schema pairs input_kind with profile, so comparing the profile with the stamp's again was an equivalent mutant. Tested: targeted contract tests and mutation run. * Changelog: dataset quality summaries (B1) Tested: not applicable (documentation). * Refuse a summary entry that outgrows its column JSON.stringify can print a number longer than it was written (1000e17 in 21 characters), so an entry within 65,536 bytes as written could fail the 0151 CHECK and the whole reconcile batch. Refused as entry_too_large. Tested: contract and reconcile tests with a 62,641-byte summary (#2375 review). * Check metric names before copying them A record's member named __proto__ would set the prototype of the merged metrics instead of reaching the schema. Every name must be a metricName before it is copied. Tested: contract tests, a number and an object (#2375 review). * Show only unsuperseded, undated derivatives A page's summary comes from a catalog or published row that no later catalog row superseded (ADR 0123) and whose date has not passed, in the row picked and in the rows that could hide it. Tested: the real promotion of A then B, and route tests for a superseded and a dated row (#2375 review). * Hide dataQuality for a withdrawn dataset A dataset with withdrawn_at set shows no summary on metadata.json or the page bundle, whatever its visibility, as the view route will refuse it (owner ruling). Tested: route tests. * Keep bundle metadata when pipeline read fails A failed read of the pipeline's namespaces no longer fails the bundle's metadata component: name and description stand, the namespaces are left out as metadata.json leaves them, the bundle says pipeline_degraded and is not complete, so it is no-store. Tested: a dropped table, and the isBundleComplete truth table (#2375 review). * Changelog: review fixes and owner rulings (B1) The counts rule (passed = succeeded recordings), superseded and dated derivatives, withdrawn datasets, entry_too_large and the bundle's pipeline_degraded. Tested: not applicable. * Keep a published row public once superseded Publishing never clears superseded_at, so a catalog row superseded and then published stayed hidden. The superseded term now applies to catalog rows only, on the row picked and the rows that could hide it. Tested: the real promote, supersede and publish sequence, and four mutations of the term (#2375 round 2). * Compare the P7 fixture without lazy fetches CI's nemar-process checkout is a sparse partial clone of dev, so asking it for the pinned commit fetched it, and each file after it, from GitHub: the test timed out. Git now runs with GIT_NO_LAZY_FETCH and a time bound, all files are read in one git cat-file --batch, and an absent commit or object skips with a logged reason. Tested: unset, a dev partial clone, a blob-less clone of the pin and a full checkout (0.2-0.5 s each).
* Key nemar-ica archive runs by serving index A recipe that reads the serving index on the archive input (nemar-ica) gets a version 2 derivative key whose ninth line is serving_index (none, or the index file's SHA-256), so runs with and without an index, or with different indexes, never collide. Every other key stays version 1 byte for byte. A run handed --serving-index is not keyed until the dispatcher stages the index (serving_index_unattested). Migration 0153 keeps the field on the row; ADR 0138 records the decision. Tested: contract-derivatives (vectors computed in Python and Bun), compute-derivatives (nemar-ica keying, skip word, column CHECK). * Add a JSON Schema checker the Worker can run The Worker cannot run Ajv, which compiles schemas with new Function. schema-check.ts interprets the draft 2020-12 keywords the vendored neuroschema schemas use and throws when a set is built over any keyword it does not implement. Held to python-jsonschema's kinds-verdicts (all 244 cases of the schemas dataQuality reaches) and to Ajv over the verdict, preset and kind corpora and over 50,000 one-edit mutations. Tested: test/schema-check-contract.unit.test.ts. * Refuse unsafe integers and foreign plugin views recordQualityEntry now honors the I-JSON reader's unsafe-integer flag over the whole record (integer_unsafe) and refuses a plugin view whose plugin the recipe version does not run at its quality checkpoint (view_unknown_plugin), the two points the B1 review left to B2. It also returns the dataset and recording the record says it is of. Tested: quality-documents-contract (113 pass). * Add the quality cache epoch of each dataset Migration 0152: dataset_quality_epochs, a table of its own (datasets is near D1's column cap), advanced by a trigger on every real change of visibility, status, anonymous, first_published_at, withdrawn_at or ezid_status. The quality route keys its edge cache by it. Tested: migrations:d1-check (144 migrations on local D1, catalog matches bun:sqlite), datasets-column-budget. * Serve quality views on the data plane GET /<id>/quality/v1/<recipe>/record/<recording> serves a recording's dataQuality document from the recipe's current public derivative (CURRENT_PUBLIC_DERIVATIVE_SQL), and .../file/<key>/<sha256>/<recording> one file a validated view declares. The dataset gate (active, public, unconcealed, first published, unwithdrawn, untombstoned) and the derivative are read in one D1 statement before the edge cache, which is keyed by the dataset's epoch and the derivative key. The record is checked whole against the vendored neuroschema schemas through schema-check.ts, plus recording scope and the record's own identity; a file is re-hashed before it is served. Refusals are fixed words, no-store, never cached. Tested: quality-route (47 pass, real D1 and Miniflare R2, the P7 fixture), quality-route-contract, quality-documents-contract. * Pin size, one-digest and dependentSchemas checks Kills the three mutants that survived the first round: the served file's size check (its log reason), one digest declared as two files of one format, and dependentSchemas in the schema checker. Tested: quality-route (48 pass), schema-check-contract (254 pass). * Renumber the serving-index ADR to 0140 ADR 0138 is taken on dev and 0139 on open branches. The ADR index tolerates both gaps until they land. Tested: adr-index, contract-derivatives. * Replay derivative key vectors in Python The Python harness now computes every derivative_key vector (version 1 and the version 2 key of ADR 0140) and refuses every refused one, so the cross-language claim is tested in CI where uv is available. Tested: contract-derivatives-python with NEMAR_REQUIRE_SCRUB_TOOLS=1 (117 pass). * Let the quality epoch table refuse nothing Migration 0152 keeps NOT NULL only: its one writer is a trigger inside every update of a gate column, which must never be refused for the sake of a cache. Tested: migrations:d1-check, quality-route. * Gate dataset summaries like the quality route CURRENT_QUALITY_DOCUMENTS_SQL now joins the dataset through QUALITY_DATASET_GATE_SQL (moved to quality-documents.ts), so a tombstoned or never-published dataset shows no dataQuality on metadata.json or the page bundle. Tested: metadata-json-quality (tombstoned and never-published cases), quality-documents. * Check plugin views against the row's plugins compute_derivatives.quality_plugins (migration 0153) records the recipe version's quality plugins when the row is keyed; the route checks plugin view sources against it, so a derivative of a recipe version the registry has moved past is still served, and a row without the list serves nothing. The record answer's ETag is now the SHA-256 of the body. Tested: quality-route (older version, catalog and published; stored list decides; null list refused; body ETag), compute-derivatives. * Purge quality views on unpublish and conceal purgeCacheTags and purgeQualityCache in services/cloudflare.ts purge Cache-Tag nemar-dq-<id> after the D1 write of a visibility flip to private (unpublish, withdraw), a withdrawal stamp and a concealment: best effort, logged, never blocking. The browser and shared-cache residual of up to 300 s is documented in routes/quality.ts. Tested: quality-cache-purge, review-auto-require-paths (purge after the row is private; a refused purge keeps the flip), unpublish, withdraw, anonymity suites. * Describe the B2 review fixes in the changelog Tested: not applicable (documentation). * Purge a withdrawal through its visibility flip withdrawDataset flips the row private through applyDatasetVisibility, which purges the tag after the write. The second, explicit purge after the withdrawal stamp was redundant and untested (mutant B2R-07 survived), so it is removed. Tested: withdraw, withdraw-route, review-auto-require-paths, quality-cache-purge. * Time out a cache purge after five seconds postPurge aborts a request after PURGE_TIMEOUT_MS, so a purge API that never answers cannot stall an unpublish; the failure is logged as cache_purge_failed. Tested: review-auto-require-paths (a never-answering stand-in: the flip finishes, the row is private, the failure is logged). * Set Cache-Tag again on a quality cache hit The Workers Cache API strips Cache-Tag from what it stores; the route sets it again on a hit. Tested: quality-route with a cache stand-in that strips the header. * Backfill quality plugins of floor rows Migration 0153 sets quality_plugins = '[]' on existing nemar-floor rows, which run no plugin at any version; other recipes' earlier rows stay null, as the comment says why. Tested: quality-route (migration replayed on rows written before 0153), migrations:d1-check.
* Add run-quality words to the admin contract * Admin route for a run's quality * CLI: admin compute pipeline quality * Changelog: admin run quality (B3) * Pin that an oversize table body is unread * Run quality: run_in_progress, dataset_public * CLI quality: new words, shared path bound * Changelog: run_in_progress, dataset_public
* Factor quality record and file steps out * Quality admin paths, words and grammar * Admin mount for a run's quality views * Test the admin quality views mount * Pin the admin quality path grammar * Inventory: admin quality views route * Changelog: admin quality views (B3b) * Admin views: record checks and bound reasons * Pin the not-stored fallback of the views * Point the pipeline routes at the views mount * Admin views test: lint * Share the recording rule; add forward path * Admin views: refuse any ?, stamp in logs * Pin the forward path and decoded refusals * Admin views test: bare ? and stamp logs * Changelog: narrow no-store, forward path * Pin the forward path's safe-integer bound * Stamp pattern in an import-free leaf * Seeded forward-path check, import leaves
* Launch spec v2: optional serving_index Adds serving_index to nemar.launch-spec.v2 and to a recipe job's spec, the serving index response, the container path and serving_index_mismatch. Tested: contract unit tests. * Stage the serving index at dispatch nemar-ica's archive job is handed the index only when its source_commit is the tag's; the copy is kept by digest before the job exists. Tested later with the route. * Serve the staged index to the launcher POST /compute/jobs/:id/serving-index signs the copy the recorded spec names. Tested: serving-index-staging, route inventory. * Key serving_index from the recorded digest Tested: compute-derivatives. * ADR 0141: stage the serving index Tested: adr-index. * Changelog: serving index staging Not tested: prose only. * Declare serving_index_mismatch in the state test Tested: compute-state (59 pass). * Refuse an unusable index; log copy faults index_unusable for an index the recipe would refuse (readIJson plus validate_document's shape); copy_conflict and copy_put_failed lines; a 403 from S3 is a fault. Tested: serving-index-staging. * Defer a run on a serving index fault A fault leaves a refused serving_index_deferred stamp and answers zarr_source_unverifiable; after 24 hours the run goes without the index. Tested: serving-index-staging (66 pass). * ADR 0141: amend for deferral and retention Tested: adr-index. * Serving index: 403 rule and its own word A 403 is an absent index unless the row's copy is ready with stores; a deferral answers serving_index_deferred (503) with runs_without_index_after; the age is whole minutes, the call site narrows by type. Tested: serving-index-staging (74), backend targeted (966). * ADR 0141: 403 rule, word, softer binding Not tested: prose only. * Give the schema-check corpus test 60 s Over 50,000 documents judged twice exceed bun's 5 s default on a loaded runner; the corpus keeps its size. Tested: schema-check-contract.
* Expose ETag on the public quality route * Test quality ETag exposure via the Worker * Changelog: quality route exposes ETag * Expose quality ETag on success only * Test refusal and listed-once exposure
Merge dev into the ADR 0134 epic
* Reject shared D1 migration prefixes * Accept ADRs 0140 and 0141 * Collapse Unreleased to the end state * Note skip-word lists are not an allowlist * Require four-digit migration prefixes * Run unit-pure on migration check edits * Keep ADR 0141 proposed * Fold path rule into Added entries * State the path and prefix rules in full
Merge dev into the pipeline-progress epic (AWS CLI fix)
|
Ready for the merge queue at ee43d28.
At merge: correct ADR 0140's Accepted date if the UTC merge date is not 2026-11-26; close #2341 and #2358 by hand; then nemarOrg/nemar-process#98 and nemarOrg/website#608 follow in that order. Migration numbers: #2397 also uses 0150-0154; whichever lands second renumbers (the new prefix test will fail it until then). Agentic AI tools were used. The author assumes full responsibility for this content. |
|
Correction: not ready for the merge queue. A seam check on the nemar-process side found that ADR 0134 promises checkpoint outcomes per recording ( Agentic AI tools were used. The author assumes full responsibility for this content. |
…2324) (#2416) * Add record-level processing rules Export the recordings header and row readers that parseRecordingsTable now uses, so one row is read by the same rules as the whole table. Add storedCounts, processingRecordEntry and processingRecordProblem for a recording's processing entry, and check a completed link's location against neuroschema's relativeLocation so a recording's record path can be linked. Tested: bun test test/compute-checkpoints.unit.test.ts (66 pass). * Show the promoted run on dataset pages metadata.json and the page bundle now build the dataset-level processing entry and signalJourney link from each recipe's current public derivative, as dataQuality already was: the run's reconciled counts with stored worked out as kept, and the completed link reconciliation keeps on the run row. A run in progress, a canary run and a failed run show nothing; no in_progress link is served. Migration 0154 adds compute_pipeline_progress_runs.link (backfilled from the last documents) and compute_derivatives.checkpoint_map, and drops compute_pipeline_documents, which nothing reads any more. Tested: bun test of compute-progress-reconcile, metadata-json-pipeline-route, metadata-json-quality, quality-documents, compute-runner-progress, compute-progress-route, compute-pipeline-grid, compute-pipeline, compute-pipeline-progress-migration and the new compute-pipeline-promoted-run-migration suites (all pass). * Keep the checkpoint map on derivatives Keying writes the recipe version's checkpoint map into compute_derivatives.checkpoint_map beside quality_plugins, so a recording's outcomes can be read with the map of the version that made the derivative after the registry moves on. Tested: bun test test/compute-derivatives.test.ts (91 pass). * Serve checkpoint outcomes per recording Add GET /<id>/quality/v1/<recipe>/processing/<recording> to the public quality route: the recording's neuroschema processing entry (each declared checkpoint, then stored) and its signalJourney link, built on request from the current public derivative's recordings table (a ranged scan for the exact path, bounded) and the recording's record, under the route's gate, epoch-keyed edge cache, Cache-Tag and ETag. A recording that failed or was skipped has a failed link. The contract gains the segment, the answer's format, the table bounds and the path builder; no word changes. Tested: bun test of quality-processing-route (new, 20 pass), quality-route, quality-admin-views, quality-cache-purge and test/quality-route-contract.unit.test.ts. * Note the promoted run in ADR 0134 Amend ADR 0134 after decision 9: a public page's processing and signalJourney entries, at the dataset and the record level, describe the promoted run, built on read; no in_progress link and no row per recording. The index line says so. Tested: bun test test/adr-index.unit.test.ts (11 pass). * Add the record-level processing changelog Correct the phase 2 entry to the end state (no stored documents, the run's link on its row) and describe phase B4: the promoted run on public pages, the processing endpoint, migration 0154 and the contract additions. Not tested: documentation only. * Tighten the B4 tests' mutation proofs Give the newer canary run a record of its own so dropping the public derivative term shows, add a tail of a listed path to the exact-path case, and name only mutations each test was watched failing under. Tested: the three suites (56 pass); each named mutation applied alone fails its tests (scratchpad b4-mutate.py, 20 mutations). * Keep the B4 helpers module-private promotedProcessingEntry, checkpointMapOfRow and scanRecordingRow have no caller outside their modules. Tested: typecheck; bun test quality-processing-route and metadata-json-pipeline-route (26 pass). * Harden the record-level processing rules parseRecordingsTable refuses a path two rows name (duplicate_path). A record-level entry writes unrecorded_code for a code that does not fit failureCode, and derives stored from the last declared checkpoint, as storedCounts does; the docblocks say what stored means and where the cascade rule and a skipped plugin would conflict. A registry test holds every plugin step to the last declared checkpoint. Tested: bun test test/compute-checkpoints.unit.test.ts test/compute-recipes.unit.test.ts. * Refuse repeated paths in run-quality listing The admin run-quality listing now gets duplicate_path from parseRecordingsTable and answers table_unreadable; its own de-duplication is gone, and the contract's unlisted comment says so. Tested: bun test test/quality-admin-route.test.ts (27 pass). * Fill missing checkpoint maps; one table bound The derivative sync gives a row with no checkpoint map its recipe version's map while the registry holds that version, never replacing a recorded one. TABLE_READ_MAX_BYTES is now the contract's QUALITY_TABLE_MAX_BYTES. Tested: bun test test/compute-derivatives.test.ts. * Charge processing misses and refuse repeated rows The processing endpoint scans the whole table and refuses a recording two rows name (duplicate_path); a recording with no checkpoint map is record_unreadable. A miss is charged to checkDataMissBudget, and a recording the table does not list is remembered in the edge cache under the same key while the client still gets no-store. Tests add the served-counts invariant after a real reconciliation, the size bound with no ranged read, BOM and CRLF, identity by recipe and version, a non-UTF-8 record, map validity and precedence, and the tombstoned and never-published gate. Tested: bun test test/quality-processing-route.test.ts (28 pass). * Check dataset-level entries against the schema readPipelineExtensions shows a promoted run's processing entry and link only when they pass the vendored neuroschema, as a recording's do. Tests: each term of the read's own gate alone (not_anonymous with the trigger dropped, first publication, tombstone and the rest), tombstoned and never-published datasets through metadata.json, the concealed-deposit test relabelled to the two guards it holds, and a succeeded run whose table repeats a path. Tested: bun test of metadata-json-pipeline-route, metadata-json-quality and compute-progress-reconcile. * Test the link backfill's length bound A completed link longer than the new column takes is left out of the backfill. Tested: bun test test/compute-pipeline-promoted-run-migration.test.ts. * Record what stored means for B4 ADR 0134's amendment says stored follows the last declared checkpoint and that a table repeating a path is refused; the changelog describes the miss budget, the absent memo, unrecorded_code, the map fill, the schema check and the duplicate refusal. Tested: bun test test/adr-index.unit.test.ts. * Pin the processing cache key and odd codes Route tests: a failed row whose code does not fit failureCode answers unrecorded_code on the failed checkpoint and on stored; a newer promoted derivative under the same epoch serves neither the old answer nor the old remembered absence. The route's header now says the absent-recording marker is the one refusal kept in the cache, never sent; the cache test is renamed to match. Tested: bun test test/quality-processing-route.test.ts (30 pass); removing the substitution, and dropping the derivative key from the cache key, each fail this suite.
Conflicts: CHANGELOG.md (epic Unreleased above dev's dated sections, dev's sections byte-identical), ADR gaps (0120 and 0137 landed; 127 and 139 stay), neuroschema build-vendor.mjs and validator (keep the epic's one bundle with dataset and record roots at 0.6.0; drop dev's 0.4.1 record.bundle.json and point its test at roots.record). Tested: typecheck, lint, adr-index, migration checks, neuroschema, zarr engine and backend zarr-core suites.
Merge dev into the pipeline-progress epic (0.10.41)
|
Ready for the merge queue again, at bdfed6c.
At merge, the earlier notes still hold: correct ADR 0140's Accepted date if the UTC merge date is not 2026-11-26; close #2341 and #2358 by hand; then nemarOrg/nemar-process#98 and nemarOrg/website#608 follow in that order. Migrations now run 0150-0154, and #2397 also uses 0150-0154, so whichever lands second renumbers. Follow-ups: #2415 (admin processing endpoint), nemarOrg/docs#147 (gated design page), nemarOrg/nemar-process#100. Agentic AI tools were used. The author assumes full responsibility for this content. |
# Conflicts: # .gitattributes # CHANGELOG.md
Dates the pipeline progress section (#2412) for release 0.10.44.
Summary
Implements ADR 0134 (pipeline checkpoints, live progress and quality plugins) and ADR 0137 (quality views drawn in the browser) on the backend and CLI side. This is the nemar-cli part of a cross-repository epic: nemar-process (
feature/issue-65-epic-pipeline-progress) and the website (feature/issue-586-epic-pipeline-progress) follow this one to their integration branches, in that order, because the website reads the ETag this epic adds to the public quality route.Part of #2324 (the epic stays open until the nemar-process and website epics reach their integration branches).
At merge, close by hand (the epic branch is not the default branch, so nothing auto-closed): #2341 (Phase 7 backend) and #2358 (fixed by #2359).
Phases merged into this branch
nemar admin compute pipeline status(Phase 4a: admin pipeline grid API and status command #2335), pre-check mapping (Map recipe pre-checks to preprocess #2337), help text (Describe the pipeline group's grid and failures #2354)Phases in other repositories: neuroschema 0.5.0 and 0.6.0 (released), nemar-process phases 3, 5 and 6 and P1-P7, website phase 4b and W1-W9, docs (docs#144, held until the website release).
Notes for the merge
devuntil that epic reaches itsdev; Restore ref: dev for the nemar-process CI checkout #2411 tracks setting it back.Accepted:line is 2026-11-27, the UTC day this PR can first merge todev; if it merges on a later UTC day, correct it to the merge date. ADRs 0134, 0137 and 0141 stay proposed until the nemar-process epic (and, for 0134 and 0137, the website epic) reach their integration branches.backend/wrangler-sccn.toml; nothing here turns compute on.Merge of 0.10.42 (this push)
## Unreleased, above dev's## 0.10.42,## 0.10.41and## 0.10.40), the ADR index (dev's 0139 before this epic's 0140 and 0141),backend/src/routes/admin/index.ts(both route imports kept), and the admin route count pin (270 at the merge base, 275 here, 279 on dev: 284).test/adr-index.unit.test.tsis removed, as the comment there says (3f48c9d).test/unit-pure-timings.jsongains this branch's 31 pure test files with locally measured wall times (0b3702b); no scrub suite was added.bun run typecheck(root and backend),bun run lint,biome lint --only=correctness/noUndeclaredVariables test/ backend/test/,test/ci-tier-routing.unit.test.ts,test/adr-index.unit.test.ts,test/migration-prefixes.unit.test.ts,backend/test/migrations.test.ts,backend/test/compute-switches-flag.test.ts,test/admin-route-inventory.unit.test.ts,backend/test/datasets-column-budget.test.ts, the three epic migration tests, and every epic compute pipeline, progress, quality and serving-index test (all pass; the nemar-process drift test skips locally without a checkout). Not run locally:scripts/d1-migration-check.ts(it replays through wrangler; CI runs it) and the full suite.test/datacite.integration.test.tsMeSH lookup, ECONNRESET from the NLM API), and unit-pure shard 2/6 on the push run (backend/test/publication-review-d1.test.tstimed out at 5 s, then the local D1 refused connections for the rest of that part; the same shard passed on the pull-request run and the file passes locally). On the earlier head 0b3702b, shard 3 hit the Tapis flake Flaky: tapis-standin 'job has no subscription' fails integration-dev shard #2402 twice.Delta seam review fixes (this push)
## Unreleased, above## 0.10.43) and.gitattributes(both sides kept, includingtest/fixtures/text-headers/** -text). Migration 0155 from dev now fills the gap below 0156-0160.dev; then the pina5125c7bremoved (Restore ref: dev for the nemar-process CI checkout #2411); then website Phase 3: centralize generate-archive workflow #608 intostagingand its release; then docs Release v0.5.2: bug fixes and dataset ID reuse #146 and docs Improve role management CLI discoverability #144. It states that no switch is added, compute stays dark and the new public routes only read.Accepted:set to 2026-11-27.backend/test/migrations.test.ts,test/migration-prefixes.unit.test.ts,test/adr-index.unit.test.ts,test/admin-route-inventory.unit.test.ts,test/ci-tier-routing.unit.test.ts,test/changelog-format.unit.test.ts,backend/test/compute-switches-flag.test.ts, the datasets column budget, the three epic migration tests and the quality route tests (331 pass, 0 fail).Test plan
bun test, must be green on this PR before it merges.Agentic AI tools were used. The author assumes full responsibility for this content.