test(kinds): route kind-URI literals through the constants - #164
Open
akesling wants to merge 1 commit into
Open
Conversation
Tests and registration glue spell the agent-coding-session URI via PATH_KIND_AGENT_CODING_SESSION (and the superseded-version constants) instead of restating the version, so a future mint touches only the constant, the schema file, its BUNDLED_KINDS entry, the site page, and the changelog. One deliberate literal remains: a pin test spelling the full URI so a typo in the constant cannot self-validate. A new coherence test binds each bundled entry together: schema $id and meta.kind const match the entry URI, the URI's segments match the entry's name/version, the bundled bytes match the on-disk schema, and the newest entry is the current constant. path-cli's kinds module goes pub so integration tests can iterate BUNDLED_KINDS, matching the existing pub-for-tests precedent in the crate; its module docs name the private schema module in prose rather than linking it, since a public module's docs cannot link a private item.
This was referenced Aug 6, 2026
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.
Supersedes #163, which GitHub auto-marked as merged when the branch was restructured (its commits briefly appeared in its former base branch). Same change, retargeted to
mainwhere it belongs.Why
Minting a kind version restates its URI in a lot of places. Today most of those places are test literals and registration glue re-spelling a URI that
PATH_KIND_AGENT_CODING_SESSIONalready holds — duplication that lets a typo pass its own tests.Landing this before the next mint means the mint itself touches only the constant, its schema file, its
BUNDLED_KINDSentry, the site page, and the changelog.What
Tests and registration glue go through the constants (and
BUNDLED_KINDSfor "newest") instead of restating the version, acrosstoolpath::{types,jsonl},toolpath-convo::derive, andpath-cli::{kinds,cmd_kind,schema,query}plustests/query.rs. Tests that deliberately pin older versions keep using the version-suffixed constants, and stored fixture documents are left alone — a document's kind URI is data, not a shared string.Two tests stay deliberately literal, for opposite reasons:
toolpath::typesspells the current URI in full, so a typo in the constant cannot self-validate through every test that consumes the constant.path-cli::kindsbinds each bundled entry together: the schema's$idandmeta.kindconst match the entry's URI, the URI's name/version segments match the entry's fields, the compiled-in bytes match the on-diskkinds/<name>/<version>/schema.json, and the newest entry equals the constant. Mutation-tested during review — pointing a bundled entry at the wrong version's schema fails it.path-cli'skindsmodule becomespubso the integration test can iterateBUNDLED_KINDS, matching the existing pub-for-tests precedent in that crate (harness,cmd_resume).Testing
Full workspace suite, clippy, rustdoc, and the examples gate green. No behavior change — production code already flowed through the constants; this is tests and registration glue only.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.