Use @galaxy-foundry/tag-registry for the meta_tags.yml format - #389
Merged
Conversation
packages/note-schema/src/tags.ts is deleted, not shimmed: the package is a line-for-line home for what was there, so there is nothing left to compose. note-schema now re-exports only the `TagRegistry` type, which a caller needs to name the kind-context options — the exact arrangement license-policy already has, and for the same reason. Every other call site imports the loader from the package directly. Gains validation we never had: `yaml.load(...) as TagRegistryFile` met a malformed registry as an undefined downstream. Now a missing facets block, a facet without label/description, a tag with no gloss, or a tag two facets both declare is refused at load, naming the file. Tests: the synthetic format cases move to the package, which can prove them — our vocabulary is entirely slashed, so it cannot witness "a bare key resolves" or "a prefix-lookalike does not". The real-registry invariants move to tests/registry-drift.test.ts, beside the corpus checks they belong with, and tags.test.ts is gone. One of those was vacuous and is now not. "declares no open facets" asserted the shape of facets(), which is fixed by the accessor and always passed. It reads the YAML now — `open: true` is still a silent no-op in the package, so this is the only thing that catches it. Verified by adding one: red, then green.
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.
Adopts
@galaxy-foundry/tag-registry@0.1.0. Themeta_tags.ymlformat moves to the package; our facet vocabulary stays at the repo root — the package deliberately ships none, because facets are the browse axes of one domain.Deleted rather than shimmed
packages/note-schema/src/tags.tsis gone, not reduced to a composition point. Unlike the reference contract, there is nothing to compose: the package is a line-for-line home for what was there. So this follows the arrangementlicense-policyalready set — the barrel re-exports only theTagRegistrytype, because a caller building the kind-context options has to name it, and every other call site imports the loader from the package directly. One place to look, nothing here to drift.Breaking for importers of
@galaxy-foundry/note-schema; changeset included.buildNoteSchemaandbuildKindContextare unchanged — both still take atagsregistry of the same shape, so the schema, the validator, the manifest generator and the/tagspages all behave identically.We gain validation we never had
The old loader was
yaml.load(...) as TagRegistryFile, so a malformed registry arrived as anundefinedsomewhere downstream. Now refused at load, naming the file: a missingfacetsblock, a facet withoutlabel/description, a tag with no gloss, or a tag two facets both declare. That last one neither instance could have caught — with two declarations there is no single declaring facet, sofacetOfanswers with whichever won the iteration and/tagsfiles the tag under one facet while the other silently lists it too.Tests
Moved to the package — the synthetic format cases (
tags.test.tsis deleted). "A bare key resolves exactly like a slashed one" and "a prefix-lookalike is not thereby a member" are the rules the browse surface rests on, and neither instance's real registry can witness them: both vocabularies happen to be entirely slashed. They are proven there once, for both instances.Moved to
tests/registry-drift.test.ts— the real-registry invariants, which belong beside the corpus checks rather than in a package that no longer has tag code.One of them was vacuous and is now not.
declares no open facetsasserted thatfacets()returns exactly{key, label, description}— that is fixed by the accessor, so it always passed, and would have kept passing withopen: truesitting in the YAML. It reads the raw file now. The package ignores unrecognized facet keys (exactly as both hand-rolled loaders did), so a re-addedopen: trueis still a silent no-op and this is the only thing that catches it. Verified by adding one:Red, then green with it removed.
Dropped —
every registered tag has a non-empty gloss and a declaring facet. The parser refuses such a registry outright; nothing that loads it could reach the assertion.Verification
packages-build,typecheck(0 errors),test(155),packages-test,packages-typecheck,packages-lint,packages-format,validate(226 files, 0 errors),check:kinds,smoke:packages,cast summarize-nextflow --check(clean),site:build(365 pages) — all green.check:planemo-clireports one page out of date. Pre-existing: it fails identically with this branch stashed, and CI has passed it — a local planemo version difference, not this change.🤖 Generated with Claude Code