Repository navigation
Manifest-name check, CI on npm test, two JSG fixes, and a gated @types/shexj check - #92
Merged
Merged
Conversation
- extends-open-or-each-each_fail-cross-each -> extends-open-or-each-each_pass-cross-each
A test is identified twice -- by its IRI (<#1dot_pass>, "@id": "#1dot_pass") and by its mf:name -- and harnesses select and report by either. c6dfca8 fixed one that had drifted (extends-open-or-each-each_pass-cross-each, named ..._fail-...); this keeps them from drifting again. For every */manifest.{ttl,jsonld}: each test has exactly one name, equal to the fragment of its id; no id or name is used twice; mf:entries and the defined tests are the same set; and the two serializations list the same ids, in the same order, with the same names. That last part also covers negativeStructure and validation-contrib, which CI's regeneration check leaves out. Wired in as `npm run test-manifest-names`, into `npm test`, and as a CI step. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…o red
Six skills for AI assistants working in this repo, written down from one
session (2026-10-06) so that the next one can say why something is red
without rediscovering it:
ci-red why a check, a CI run or a Dependabot PR is red, the
fix, and where a green run proves less than it seems
manifests ttl is the source, jsonld is generated, and a test's
id, name and entries-list item are one string
changing-the-grammar the places the language is written down, which are
derived, and what keeps each honest (or doesn't)
shexj-types @types/shexj in DefinitelyTyped: how it is managed,
what type-checking the schemas can prove, and why a
version-gated expected failure beats waiting on a
release; with the history of test-ts/makeTsTests.sh
adding-a-check where a check goes, and how to show that it bites
repo-history answering "when did this show up" from git, npm
tarballs and DefinitelyTyped
Written against a tree that also has test-ts removed, CI calling `npm test`
and ShExJ.jsg tightened; those land separately. The type check that
shexj-types calls "designed, not yet built" comes next.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
test-ts has been in `npm test` since the day it was written (630f48b, 2022-08-28) and has never passed anywhere else: it calls bin/makeTsTests.sh, which was never committed, and a bare `tsc` with no typescript dependency. CI (0f45c51) worked around it by running the other steps one by one, and three later commits appended checks to `test` without noticing it could not pass. Remove it, and have the workflow call `npm test`, so the two cannot diverge again. The regeneration diff and the informational missing.js stay as their own steps, since neither belongs in `npm test`. The per-check comments become one list above the step; each check's rationale is in its script header. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… exclusions
Found by reading the JSG next to @types/shexj, which already said both.
- `Shape { abstract:BOOL ? }` duplicated ShapeDecl's. ShExR.shex, vocab.csv
and the types all put abstract on ShapeDecl only.
- IriStemRange's exclusions were optional, unlike LiteralStemRange's and
LanguageStemRange's. A range with nothing excluded is an IriStem, not an
IriStemRange with an empty list; ShExR.shex, ShExV.jsg and the types all
require it.
No schema in the corpus used either, so `npm test` is unchanged -- which is
also why both went unnoticed: nothing here tests that a grammar rejects
anything.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…, gated
What test-ts was meant to do, rebuilt: every schemas/*.json is wrapped as
`const schema: Schema = {…}` and handed to tsc, so the types published from
DefinitelyTyped are checked against the whole corpus, which nothing there can
do (its tests are static .ts files). 491 of 491 pass against 2.1.7. Three
documents the types must reject are checked too, among them the two the JSG
just stopped accepting.
The gate: when ShExJ gains something, the schemas using it are rejected by the
published types until a DefinitelyTyped PR merges and publishes, a day or two
later, and nothing can notify this repo when it does. Rather than leave CI red,
the AHEAD table lists those schemas with the newest @types/shexj known not to
accept them. They are expected to fail while that version or an older one is
installed, and required to pass once a newer one is -- which first happens in
Dependabot's bump PR, so that PR merges itself if the new types are right and
goes red if they are not.
Replayed against 2022: with 2.1.2 installed (no Shape.extends) 22 schemas
fail; gated at 2.1.2 they are expected to; with 2.1.3 they must pass, and do.
Wired in as `npm run test-shexj-types`, in `npm test`; typescript added as a
devDependency. The shexj-types and ci-red skills now describe the built check
rather than the design.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Conflicts in package.json and .github/workflows/ci.yml: main had appended manifest-ld-check and manifest-ld-legacy-check to `test` (before test-ts) and added them as workflow steps; this branch had removed test-ts and made the workflow call `npm test`. Resolved by keeping both checks in `test` and listing them in the comment above the single `npm test` step; their separate steps go, as the other checks' did, since `npm test` runs them.
The YAML had carried the one id/name disagreement as an "@id" with a note; with manifest.ttl fixed, bin/manifest-ld-from-legacy.js writes a plain `name`, and manifest-ld.{jsonld,ttl} follow. manifest-ld-legacy-check passes again for validation.
Renamed to match the two skills #91 added (shextest-manifest-ld, shextest-vocabularies): the maintainer's skills from sibling repos are collected in one place, where bare names would collide. ci-red -> shextest-ci-red manifests -> shextest-manifests changing-the-grammar -> shextest-grammar shexj-types -> shextest-shexj-types adding-a-check -> shextest-checks repo-history -> shextest-history And brought up to date with manifest-ld: a test is now named in manifest-ld.yaml too, and an "@id" there is the id/name mismatch carried over; editing manifest.ttl means regenerating the jsonld, the YAML and its two renderings, in that order; manifest-ld-check and manifest-ld-legacy-check have rows in the red-CI table; the three vocab CSVs are told apart. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
bin/manifest-ld-from-legacy.js carries an id/name disagreement into the YAML as a `name` plus an "@id" with a note -- which is how validation's one mismatch looked there until c6dfca8. So an "@id" on an entry is the same defect in the file meant to become the source. Check that none has one, that each entry is named once, and that the YAML lists the tests manifest.ttl lists, in its order. Verified on the pre-fix YAML (reports the "@id" and the resulting name difference) and on copies with a duplicated name and two entries swapped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Five commits that each stand alone (plus
c6dfca8, the manifest-name fix that was only on localmain), then a merge ofmainafter #91 landed, and three commits adapting to it.+ bin/checkManifestNames.js— every test's<#id>must equal itsmf:name, in bothmanifest.ttlandmanifest.jsonld, in all five manifest directories; also entries ↔ definitions, no duplicates, and both serializations listing the same tests in the same order. Prompted byc6dfca8. Verified against the pre-fix commit (flags exactly that mismatch) and nine deliberately broken manifests.+ .claude/skills— six skills recording what each check is for, what red means and what to do about it, how the manifests and the grammar renderings relate, how@types/shexjis managed, and how to do history archaeology on this repo.- test-ts— it has been innpm testsince 630f48b (2022) and could never pass:bin/makeTsTests.shwas never committed (no.sh/.tsfile ever has been, on any branch; the npm tarball has none either). CI had been running the other checks one by one to avoid it. CI now callsnpm test, so the two cannot diverge again; the regeneration diff and the informationalmissing.jsstay as their own steps.~ doc/ShExJ.jsg—abstractremoved fromShape(it isShapeDecl's);IriStemRange.exclusionsmade required, as for the other two ranges. Both already matched ShExR.shex, ShExV.jsg, vocab.csv and@types/shexj; no schema used either.+ bin/checkShExJTypes.js— whattest-tswas meant to do: eachschemas/*.jsonwrapped asconst schema: Schema = {…}and type-checked against the installed@types/shexj(491 of 491 pass against 2.1.7), plus three documents the types must reject. TheAHEADtable gates schemas that are ahead of the published types: expected to fail while the listed version or older is installed, required to pass once a newer one is — which first happens in Dependabot's bump PR, so that PR merges itself if the DefinitelyTyped change is right and goes red if it is not. Replayed against 2022's 2.1.2 → 2.1.3 (Shape.extends).After #91 (
manifest-ld) merged:main— conflicts inpackage.jsonandci.yml:manifest-ld-checkandmanifest-ld-legacy-checkstay intestand are listed in the comment above the singlenpm teststep; their separate workflow steps go, as the other checks' did.~ validation/manifest-ld— regenerated afterc6dfca8: the YAML had carried the one id/name mismatch as an"@id"with a note;manifest-ld-legacy-checkpasses again.~ skills— renamed to theshextest-prefix YAML-LD manifests in place of the authoritative Turtle #91's skills use, and updated formanifest-ld(a test is now named in the YAML too; the regeneration order; the two new checks in the red-CI table).~ checkManifestNames— also checksmanifest-ld.yaml: no entry carries an"@id"(that is the id/name mismatch carried over), each is named once, and it lists the testsmanifest.ttllists, in its order.Rehearsed in a fresh clone (Node 26, macOS): regeneration diff,
npm test(all fivemanifest-lddirectories: 6 checks pass) andmissing.jsall pass.Side findings, not changed here:
test-shexv-valmatches no files (validation/*.valwere removed in 2023);package.jsonhas"file"where npm expects"files", sonpm publishships nearly the whole tree, now including.claude/skills/.🤖 Generated with Claude Code