Files
jdxandClaude Opus 5.5 67bafb068e chore(schema): generate the whole schema from a top-level MiseTomlDecl (#14632)
<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/mise/trails/850
<!-- entire-trail-link-end -->

Contributors no longer edit `schema/mise.json` by hand. mise-config now
generates all three published schemas (`schema/mise.json`,
`schema/mise-task.json` and `schema/miserc.json`) from Rust types and
`settings.toml`, and `mise run render:schema` writes them. For users,
the schemas that editors and the JSON Schema Store load are unchanged
apart from key order.

## What changes for contributors

- **The top level is a type.** `MiseTomlDecl`
(`crates/mise-config/src/mise_toml.rs`) declares every top-level
`mise.toml` key with its description, deprecation and schema. A new
top-level key goes in `MiseTomlDecl` and in `MiseToml`. The new
`schema_keys_match_parser` test fails until both read the same keys. It
takes `MiseToml`'s key list from the field names serde passes to
`deserialize_struct`.
- **No more stitching.** `xtasks/render/schema.ts` is gone, along with
its Node dependency (`docs:setup`). Before, it took the hand-written
`mise.json`, swapped in the generated fragments at JSON pointers, built
`[settings]` from `settings.toml`, and crawled the task `$defs` into
`mise-task.json`. All of that now lives in
`mise_config::schema::render`. The task is a two-line
`xtasks/render/schema.sh` that runs the `render-schema` example, then
oxfmt.
- **The hand-written parts sit next to their types.** Some schemas were
still hand-written JSON in `mise.json` because a derive can't describe
them. Those moved into Rust `json_schema!` functions:
- `[hooks]` in `hooks/schema.rs`. The hook declaration types (`Hooks`,
`HookDef`, `HookDefItem`, …) move from mise's `src/hooks.rs` into
`mise_config::hooks`.
  - `[deps]` in `deps/schema.rs`.
  - `[dotfiles]` and `[dotfile_groups]` in `dotfiles/schema.rs`.
  - `[daemons]` and `[daemon_providers]` in `daemons/schema.rs`.
  - The raw `[bootstrap]` values in `bootstrap/schema.rs`.
  - The shared `os_filter` in `schema/shared.rs`.
  - `[secrets]` and the plain keys in `mise_toml.rs`.
- **`[settings]` and `miserc.json`** are built by `schema/settings.rs`,
a Rust port of the old TypeScript `buildElement`.
- A hand-written schema embedded in a derived type is marked so the
generator's transforms skip it, and the marker is stripped before
output.

## Generated output

The generated files are semantically identical to the ones they replace.
This prints nothing:

```bash
for f in mise mise-task miserc; do diff <(git show origin/claude/mise-config-tools:schema/$f.json | jq -S .) <(jq -S . schema/$f.json); done
```

`mise.json`'s text diff is large because `$defs` are now sorted by name,
which keeps each section's definitions together whichever module writes
them. A few keys inside entries also change order. `mise-task.json` and
`miserc.json` are byte-identical.

`MiseToml` still parses files itself. Parsing through `MiseTomlDecl` is
the next PR.

## Validation

- `cargo +1.95 clippy --workspace --all-features --all-targets -- -D
warnings`
- `cargo test -p mise-config`. The freshness test now compares all three
files and reports the first differing JSON pointer. A mutation of each
kind (top-level property, setting, `$defs` entry) was caught at its
pointer.
- `cargo test --all-features -p mise --lib -- config::config_file hooks
schema_` (181 tests). The parity test fails when a key is removed from
the schema.
- `mise run render:schema` is idempotent.

Stacked on #14631.

*AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5;
version: 2.1.299.*

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Contributor and schema-generation workflow only; published schemas are
intended to stay semantically identical, with editor-facing output
limited to key ordering.
> 
> **Overview**
> **mise’s published JSON schemas are now fully generated from Rust**,
so contributors no longer patch `schema/mise.json` or run the old Node
stitcher.
> 
> `mise_config::schema::render` builds **`schema/mise.json`**,
**`schema/mise-task.json`**, and **`schema/miserc.json`** from
**`MiseTomlDecl`** (every top-level `mise.toml` key), derived
`JsonSchema` sections, and **`settings.toml`** via new
**`schema/settings.rs`**. The **`render-schema`** example writes those
files directly; **`xtasks/render/schema.ts`** is removed in favor of a
small **`schema.sh`** (`cargo run … render-schema`, then `oxfmt`).
**`render:schema`** no longer depends on **`docs:setup`**.
> 
> Hand-maintained schema that used to live in JSON is **colocated in
`mise-config`** (`hooks/`, `deps/`, `dotfiles/`, `daemons/`,
`bootstrap/schema.rs`, etc.). **`[hooks]` declaration types** move into
**`mise-config`**; mise keeps runtime hook execution and calls
**`hooks_from_def`**. A **`schema_keys_match_parser`** test ties
**`MiseTomlDecl`** to **`MiseToml`** field names. Freshness tests
compare all three schema files and report the first differing JSON
pointer.
> 
> **AGENTS.md**, architecture, and contributing docs describe the new
workflow (edit Rust, run **`mise run render:schema`**, never edit the
JSON).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c8d29d7f66. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Improvements**
* Expanded configuration validation for bootstrap settings, hooks,
dependencies, dotfiles, daemons, and other sections. Schemas now cover
more supported options and better identify invalid values and
combinations.
* Updated schemas for mise configuration, tasks, and rc settings to
provide more accurate validation and suggestions in schema-aware tools.
* **Documentation**
* Clarified which schemas are generated and where to update their source
definitions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 22:18:23 -05:00

4.0 KiB

build

  • Usage: build
  • Aliases: b

Build the project

ci

  • Depends: format, build, test

  • Usage: ci

Run all CI checks

clean

  • Usage: clean

Clean build artifacts

docs

  • Depends: docs:setup

  • Usage: docs

Start the documentation development server

docs:build

  • Depends: docs:setup

  • Usage: docs:build

Build the documentation site

docs:demos

  • Usage: docs:demos

Create recordings with vhs

docs:preview

  • Depends: docs:build

  • Usage: docs:preview

Preview the documentation site

docs:release

  • Depends: docs:build

  • Usage: docs:release

Release documentation site to production or remote

docs:setup

  • Usage: docs:setup

Install documentation dependencies

docs:showreel

  • Depends: docs:setup

  • Usage: docs:showreel

Render the landing-page showreel to docs/public/showreel-120.mp4 and showreel.mp4 with its poster

docs:showreel-bed

  • Usage: docs:showreel-bed

Fit a downloaded track to the showreel's 2 s bar grid as its bed (score/bed.opus)

docs:showreel-capture

  • Usage: docs:showreel-capture

Record the landing-page showreel's terminal captures in containers

docs:showreel-test

  • Depends: docs:setup

  • Usage: docs:showreel-test

Type-check and test the landing-page showreel

fetch-gpg-keys

  • Usage: fetch-gpg-keys

Fetch GPG keys for signing or verification

flamegraph

  • Usage: flamegraph

Generate a flamegraph for performance analysis

install-dev

  • Usage: install-dev

Install the current project in debug mode

lint

  • Depends: lint:*

  • Usage: lint

Run all lint checks

lint-fix

  • Usage: lint-fix
  • Aliases: format, fix

Automatically fix lint issues

lint:hk

  • Usage: lint:hk

Lint HK files

perf

  • Usage: perf

perf:record

  • Usage: perf:record

perf:task-cache

  • Usage: perf:task-cache

pre-commit

  • Usage: pre-commit

Run pre-commit hooks

release-plz

  • Usage: release-plz

Release with release-plz

render

  • Depends: render:*

  • Usage: render

Run all render tasks

render:completions

  • Depends: build

  • Usage: render:completions

Generate shell completions

render:help

  • Depends: build

  • Usage: render:help

Render help documentation

render:llms

  • Depends: render:usage, render:help

  • Usage: render:llms

Generate docs/public/llms.txt (docs index for AI agents)

render:mangen

  • Depends: render:usage

  • Usage: render:mangen

Generate man pages

render:schema

  • Usage: render:schema

Render JSON schema

render:usage

  • Depends: build

  • Usage: render:usage

Generate usage documentation

show-output-on-failure

  • Usage: show-output-on-failure

Show output on failure for documentation generation

snapshots

  • Usage: snapshots

update test snapshots

test

  • Usage: test
  • Aliases: t

run all tests

test-tool-retry

Retry failed test-tools with grace period for recent upstream releases

  • Usage: test-tool-retry [--grace-period] [--check-only] <tools>…

Arguments

  • <tools>… — Failed tools to retry

Flags

  • --grace-period — Ignore failures from tools whose upstream released <7 days ago
  • --check-only — Skip retrying tools, only check grace period (use with --grace-period)

test:build-perf-workspace

  • Usage: test:build-perf-workspace

task description

test:coverage

  • Usage: test:coverage

Run all tests with coverage report

test:e2e

  • Depends: build

  • Usage: test:e2e

  • Aliases: e, e2e

Run end-to-end tests

test:perf

  • Depends: test:build-perf-workspace

  • Usage: test:perf

Run performance tests

test:shuffle

  • Usage: test:shuffle

Run tests with shuffling enabled

test:unit

  • Usage: test:unit

run unit tests

test:unit-ci

  • Usage: test:unit-ci

run unit tests with CI time limits