Skip to content

test(kinds): route kind-URI literals through the constants - #163

Merged
akesling merged 0 commit into
akesling/append-model-fieldfrom
akesling/kind-uri-constants
Aug 6, 2026
Merged

test(kinds): route kind-URI literals through the constants#163
akesling merged 0 commit into
akesling/append-model-fieldfrom
akesling/kind-uri-constants

Conversation

@akesling

@akesling akesling commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Stacked on #132 — review that first; this targets its branch and will retarget to main when it merges.

Why

Minting a kind version restates its URI in a lot of places. Before this, a mint touched ~16 files and 43 lines spelling the version, most of them test literals and registration glue re-spelling a URI that PATH_KIND_AGENT_CODING_SESSION already holds. That is the sort of duplication that lets a typo pass its own tests.

What

Tests and registration glue now go through the constants (and BUNDLED_KINDS for "newest") instead of restating the version, across toolpath::{types,jsonl}, toolpath-convo::derive, and path-cli::{kinds,cmd_kind,schema,query} plus tests/query.rs. Tests that deliberately pin older versions keep using …_V1_1_0 / …_V1_0_0, and stored fixture documents are left alone — a document's kind URI is data, not a shared string.

Two tests remain deliberately literal, for opposite reasons:

  • One pin test in toolpath::types spells the current URI in full, so a typo in the constant cannot self-validate through every test that consumes the constant.
  • A new coherence test in path-cli::kinds binds each bundled entry together: the schema's $id and meta.kind const match the entry's URI, the URI's name/version segments match the entry's fields, the compiled-in bytes match the on-disk kinds/<name>/<version>/schema.json, and the newest entry equals the constant. It was mutation-tested during review — pointing a bundled entry at the wrong version's schema fails it.

path-cli's kinds module becomes pub so the integration test can iterate BUNDLED_KINDS, matching the existing pub-for-tests precedent in that crate (harness, cmd_resume).

Net effect: a future mint touches the constant, the schema file, its BUNDLED_KINDS entry, the site page, and the changelog — the version literals that remain are all genuine mint touchpoints.

Testing

Full workspace suite, clippy, rustdoc, and the examples gate green on the stack. No behavior change: production code paths already flowed through the constants; this is tests and registration glue only.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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