Skip to content

Use @galaxy-foundry/tag-registry for the meta_tags.yml format - #389

Merged
jmchilton merged 1 commit into
mainfrom
use-tag-registry-pkg
Jul 27, 2026
Merged

Use @galaxy-foundry/tag-registry for the meta_tags.yml format#389
jmchilton merged 1 commit into
mainfrom
use-tag-registry-pkg

Conversation

@jmchilton

Copy link
Copy Markdown
Member

Posted by Claude (AI assistant) on behalf of @jmchilton — authored by Claude, not by them personally.

Adopts @galaxy-foundry/tag-registry@0.1.0. The meta_tags.yml format 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.ts is 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 arrangement license-policy already set — the barrel re-exports only the TagRegistry type, 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. buildNoteSchema and buildKindContext are unchanged — both still take a tags registry of the same shape, so the schema, the validator, the manifest generator and the /tags pages all behave identically.

We gain validation we never had

The old loader was yaml.load(...) as TagRegistryFile, so a malformed registry arrived as an undefined somewhere downstream. Now refused at load, naming the file: a missing facets block, a facet without label/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, so facetOf answers with whichever won the iteration and /tags files the tag under one facet while the other silently lists it too.

Tests

Moved to the package — the synthetic format cases (tags.test.ts is 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 facets asserted that facets() returns exactly {key, label, description} — that is fixed by the accessor, so it always passed, and would have kept passing with open: true sitting 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-added open: true is still a silent no-op and this is the only thing that catches it. Verified by adding one:

FAIL tests/registry-drift.test.ts > declares no open facets in meta_tags.yml
facets declaring `open`: meta

Red, then green with it removed.

Droppedevery 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-cli reports 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

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.
@jmchilton
jmchilton merged commit da2c1e2 into main Jul 27, 2026
1 check passed
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