Skip to content

Quality inventory copy and state model - #632

Merged
neuromechanist merged 9 commits into
feature/issue-625-epic-quality-axesfrom
feature/issue-625-phase0b-quality-tab
Nov 28, 2026
Merged

neuromechanist merged 9 commits into
feature/issue-625-epic-quality-axesfrom
feature/issue-625-phase0b-quality-tab

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Phase 0b.1 of the quality-axes epic: the contract copy, the pure state model and the tokens the Data quality tab (0b.2) draws from. No visible change.

What is copied and how it is pinned

  • scripts/copy-quality-views-vocabulary.mjs gains a second source root, nemar-cli's shared/contract/quality/, checked against its own SHA256SUMS.json (nemar.contract-files.v1). It copies inventory.json and copy.json byte for byte into src/lib/quality/vocabulary/ (server bundle only) and writes src/lib/quality/vocabulary/pin.json (nemar.website-vendored-quality.v1: path, copy, size, SHA-256, plus an informational copied_from_commit). inventory.schema.json is listed upstream and deliberately not copied (the page uses a hand guard); any other listed file is refused. --check covers both roots and keeps the recorded commit, so an unrelated nemar-cli commit does not fail it.
  • Copied at the nemar-cli epic head cf2c3eff (item set 1.0.0, neuroschema 0.7.0). The same run re-pinned the view vocabulary at that ref: only neuroschema_version and source_commit changed in its pin; no copied file's content changed (lead ruling on Q-0b-11).
  • test/quality-contract-drift.test.ts: copies match the pin always; the pin matches nemar-cli strictly when NEMAR_CLI_QUALITY_CONTRACT is set (CI), sibling checkout otherwise, visible skip when absent; describePinDrift unit cases (listed not copied, copied not listed, digest or size differs, unplaceable file, commit never compared).
  • CI: sparse checkout adds /shared/contract/quality/; Vitest env adds NEMAR_CLI_QUALITY_CONTRACT.

Expected red in CI: test/quality-contract-drift.test.ts and test/quality-views-vocabulary-drift.test.ts fail against nemar-cli dev until the nemar-cli quality-axes epic (nemarOrg/nemar-cli#2524) merges to dev (one-merge rule: nemar-cli dev first, website staging second). Locally green against the epic head.

The model

  • src/lib/quality/inventory.ts: readInventory (hand guard: types, closed vocabularies, unique ids prefixed by their axis, prerequisites naming elements, supported_for inside applies_to, fix, reason and producer references) and INVENTORY, read once at module load.
  • src/lib/quality/copy.ts: qualityCopy (throws on an unknown key, a missing or an unused param) and COPY_KEYS_USED.
  • src/lib/quality/states.ts: glyph and class per state and item value; words come from copy.json.
  • src/lib/quality/version.ts: staleNote (dataset-version staleness, derived, never stored).
  • src/lib/quality/axes.ts: evaluateQuality (preconditions, one Signal card per recipe, Metadata and Annotation panels, one banner by plurality with precedence ties) and mergeItemResults (gate states win, undeclared ids dropped and logged, stored stale ignored).
  • src/lib/types.ts: Dataset gains data_complete, bytes_present, total_files (nemar-cli contract names).
  • src/styles/tokens.css: --q-placeholder, --q-placeholder-track, --q-hatch, --q-danger and seven --iclabel-* tokens in all three theme blocks; .rules/design-language.md gets a "Quality states and ICLabel classes" table.

Deviations from the card

  • Copy keys follow 0a.3's copy.json, not the card's provisional names (state_word.<state>, qualifier.stale_dataset, info.exported, info.direction.*, precondition.integrity.complete|present|not_audited).
  • --q-danger is added: --color-danger is not dark-lifted (about 2.6:1 on the navy ground), and a failed glyph must clear 3:1. The token test holds it.
  • QualityInput gains viewedVersion (Q-0b-2 version line), notPublic (Q-0b-5 not_public) and items (1b's item results, so not_computable through a prerequisite is testable now).
  • The integrity sentence for data_complete = 0 fills precondition.integrity.present with formatted byte sizes, since the catalog stores bytes, not file counts. A byte-worded copy key in nemar-cli would read better; flagged for the lead.
  • biome.json ignores src/lib/quality/vocabulary (generated copies, like the views vocabulary).

Tests and gates

  • bun run typecheck (0 errors), bun run lint
  • test/quality-contract-drift.test.ts (12), quality-inventory (19), quality-copy (6), quality-axes (85, generated from the inventory: every element through every state its declaration can reach, banners, stale, preconditions, unlisted, recipe order, mixed modalities), quality-state-tokens (10), quality-views-vocabulary-drift (15)
  • NEMAR_CLI_QUALITY_CONTRACT=<nemar-cli epic checkout>/shared/contract/quality/SHA256SUMS.json drift test green; copy-quality-views-vocabulary.mjs --check green against the epic head
  • Not run: the full bun run test (epic to staging only); CI's strict drift tests (red until nemar-cli#2524 reaches dev)

Part of #625
Part of nemarOrg/nemar-cli#2524

Review round 1 (head 5663e52): integrity line prints no sizes and no bare word (byte copy key waits on nemar-cli#2545); a document that is not an object is not withheld (not processed); notPublic required; site reason words held to the inventory with their sentences asserted in full; all four never-measured signal elements reach measured through an edited parsed fixture; drift test fails on a missing listed file; states declared once; Draft exported; duplicate item ids logged and dropped. Tests: axes, copy, inventory, drift 128 pass; strict drift 12 pass; typecheck, lint. The new-copy-key items (bytes sentence, modality-free not-supported sentence) follow once nemar-cli#2545 lands.

Review round 1, copy keys (head 08ac941): re-copied the inventory and copy at nemar-cli epic 7736cb96 (nemar-cli#2545; pin moved; new 1a.1 reason words and definitions); the integrity line uses precondition.integrity.present_bytes; elements with an empty supported_for say qualifier.not_supported_any, those supported for other datatypes keep the per-datatype sentence (both tested). Axes, copy, inventory, drift 152 pass; strict drift against 7736cb96 27 pass; typecheck, lint.


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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

@neuromechanist
neuromechanist merged commit 941efc2 into feature/issue-625-epic-quality-axes Nov 28, 2026
3 of 4 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-625-phase0b-quality-tab branch November 28, 2026 23:39
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