Repository navigation
Phase B1: dataset quality summaries (#2324) - #2375
Merged
neuromechanist merged 17 commits intoNov 25, 2026
Merged
neuromechanist merged 17 commits into
neuromechanist merged 17 commits into
Conversation
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.
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).
17 files per recording with the record (P7), so maxFiles 25,000 admits about 1,470 recordings. Comment only (#2341).
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.
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.
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.
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.
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.
Tested: not applicable (documentation).
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).
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).
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).
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.
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).
The counts rule (passed = succeeded recordings), superseded and dated derivatives, withdrawn datasets, entry_too_large and the bundle's pipeline_degraded. Tested: not applicable.
Contributor
Author
|
Review round 1 fixes and owner rulings, head c9dbcc8 (six commits on top of 52989cf).
Gates:
New mutations, each applied alone with the file restored after it: 18, all killed.
N02 survived its first run: the superseded row became a second current row that the read happened to overwrite. Both tests now assert that 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. |
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2375Version: 🤖 Updated on each push. |
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).
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).
neuromechanist
merged commit Nov 25, 2026
e9aff59
into
feature/issue-2324-epic-pipeline-progress
48 of 53 checks passed
This was referenced Nov 26, 2026
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.
Part of #2324 (phase B1 of the live quality views, ADR 0137 decision 8). Takes the B1 items of #2341 and the page-bundle issue #2331.
What changed
shared/contract/view-digest.ts: an I-JSON reader (RFC 7493) andnemar.view-digest.v1(RFC 8785).The reader refuses a duplicate member (escaped or not), a lone surrogate, a noncharacter, nesting past 64 and a number that is not finite, and flags an integer literal past 2^53 - 1.
All nine digest vectors (
computed_viewandnumbersamong them) and all fourteen refusals replay.test/fixtures/quality/ica-views/: nemar-processtests/fixtures/ica-views(product andindex.json) at e4feec7b, byte for byte, held toSHA256SUMS.json.With
NEMAR_PROCESS_DIRnaming a checkout that holds the commit, each copy is compared withgit show..gitattributeskeeps git from normalizing it.backend/src/services/quality-documents.tsandshared/contract/data-quality.ts:dataQuality(levelandrecipesonly, closed root, integers at most 2^53 - 1, lengths counted in code points), with every pattern held to the bundle's text;dataquality.problems): counts add up, listed + left out = failed + skipped, n = bins + underflow + overflow, edges, min/median/max,observed_range, unsafe integers;record_sha256equals the dataset record's bytes; counts equal the recordings table's; and every metric is bare or<plugin>:for a plugin of the recipe'squalitycheckpoint;nemar.record-checks.v1(all nine vectors replay);recordQualityEntry, a recording's entry projected from its record. Recipe metrics come fromextensions.nemar.metrics(solineNoiseBeforeDbis the number, neversummaryMetrics' table). Each plugin thatranadds its step'squalityMetrics(<plugin>:names only).views_skippedadmits nemar-process's own words. Record checks run before the entry is returned. No route serves it yet (B2).compute_quality_documents: one row per stamp, withdataset_idandrecipefrom the stamp, the entry (65,536 or fewer characters),record_sha256andwritten_at, and an index on(dataset_id, recipe, stamp_id).Deleted with the dataset in
services/deletion.ts.compute-pipeline-progress.ts): a succeeded run'sproduct/desc-<label>_dataquality.json(at most 64 KiB) is checked as above against the record bytes read once for the run's link.A refused summary is not kept. It logs
quality_not_written stamp=<id> reason=<word>and never holds the run back.A read fault leaves the run for a later call.
readPipelineExtensionsis the one read/<id>/metadata.jsonand/<id>/page-bundle.jsonboth use.extensions.dataQualitycarries the summary of each recipe's current public derivative:stored,catalogorpublished, the newest bystored_at, with the larger key winning a tie.The predicate is
CURRENT_PUBLIC_DERIVATIVE_SQL, for B2 to reuse.A canary shows nothing, and so does a concealed deposit. A private dataset is still a 404.
The page bundle now carries
processing,signalJourneyanddataQuality(page-bundle.json does not carry the pipeline extensions #2331).shared/compute-recipes.ts:recipeQualityDocumentPath,recipeQualityPlugins, and the maxFiles comment (17 files per recording, about 1,470 recordings).B1 checklist
dataQualityprojection,level/recipesonly, closed rootobserved_range; listed + left out = failed + skippedviews_skippedaccepts nemar-process's words (no_good_window,frame_rotated,no_serving_index,not_in_serving_index,serving_index_stale)extensions.nemar.metrics, plugin metrics from their step'squalityMetrics, mergedlineNoiseBeforeDbread fromextensions.nemar.metricsdataset_idbound from the stamp (write) and the D1 rows (read), never the documentnemar-quality:percentBrainComponentschecked against the P7 fixture (n = 1; it equals the plugin step's value)nemar.record-checks.v1before an entry is returnedcompute-recipes.tsmaxFiles comment: 17 files per recording, about 1,470 recordingstests/fixtures/ica-viewsat a pin, by digestGates
bun run typecheck,bun run lint,bunx biome checkon every touched TypeScript file: cleanbun run migrations:d1-check: 142 migrations replayed on real D1, catalog matches bun:sqliteview-digest-contract,quality-documents-contract(also withNEMAR_PROCESS_DIR, byte comparison included),compute-recipes,contract-neuroschema,contract-schemas,adr-index,plugin-manifest-contract,compute-progress-contractcompute-recipes-process-driftwithNEMAR_REQUIRE_PROCESS_RECIPES=1against nemar-process e4feec7b: 16 passquality-documents,metadata-json-quality,compute-quality-documents-migration,compute-pipeline,compute-progress-reconcile,metadata-json-pipeline-route,page-bundle-*,compute-progress-route,compute-runner-progress,compute-pipeline-grid,compute-pipeline-progress-migration,compute-derivatives,metadata-json-*,anonymity-projection,anonymity-publication-paths,anonymous-release,anonymity-writers,bids-index-session-modalities,data-route-manifest-stream,landing-payload-archivebun test, because it is the epic-to-devgate (about 80 minutes). Also not run:anonymity-identifier-withheld, because it reaches real S3 and times out (Unit tier: anonymity-identifier-withheld page-bundle test reaches real S3 and times out #1548).Mutation table
Each mutation was applied alone, the named suites were run, and the file was restored (
git statuswas clean after each). 60 mutations, all killed.M12 first survived: the profile comparison made the input comparison redundant, since the schema pairs them. The redundant profile comparison is removed (2a85c4c), and M12 is now killed.
missingin n.passthrough())summaryMetricsviews_skippedreason to neuroschema's five wordsrelativeLocationview_source_mismatchmetric_producer_mismatch.0/__proto__through the setterpipelineExtensions: dropdataQualityDeviations from the plan
shared/contract/view-digest.ts, not B2'squality-route.ts. The backend reads the dataset summary with the reader in B1, and B2 imports it.quality-views.ts).test/quality-documents-contract.unit.test.tsandtest/view-digest-contract.unit.test.ts, nottest/contract/quality-documents-agreement.test.ts.promoteDerivativeis exercised inquality-documents.test.tsthroughreadPipelineExtensions, the read both routes call. It does not go over HTTP because an eligible dataset needs a version row, and with one the handlers reach S3.no-store), whilemetadata.jsonleaves the namespaces out. This keeps a bundle that lacks them from being cached as complete.index.jsonwere copied, because B2 needs the view files.Questions for the owner
docs/processing-extensions.mdsays the dataset summary'scounts.passedequals the last declared checkpoint'spassed. nemar-process writespassedas the succeeded recordings, so the two differ when a plugin is skipped on a succeeded recording (that recording countsskippedatquality). B1 holds the summary to the recordings table, as nemar-process writes it. Should neuroschema's sentence change, or the writer?metadata.json, the pipeline namespaces are gated likeprocessingandsignalJourney: public and not concealed. A dataset withdrawn after its derivative was promoted still shows its summary there, while B2's route will refuse a withdrawn dataset. ShoulddataQualityalso drop for a withdrawn dataset?devsecond renumbers; B1 takes 0151.No remote environment was touched: nothing was deployed, and no dev or production D1 was read or written.
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.