Skip to content

chore(schema): generate the [dotfiles] schema from typed entries - #14644

Merged
jdx merged 2 commits into
claude/mise-config-explainfrom
claude/mise-config-dotfile-decls
Oct 18, 2026
Merged

jdx merged 2 commits into
claude/mise-config-explainfrom
claude/mise-config-dotfile-decls

Conversation

@jdx

@jdx jdx commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

https://entire.io/gh/jdx/mise/trails/859

The [dotfiles] and [dotfile_groups] parts of schema/mise.json are now generated from declaration types in mise-config, as the rest of the schema already is. Before, they were the last large blocks of hand-written JSON, kept in step with mise-system's parsers by hand.

What changes for users

Editors that use the mise schema now flag a typo in a dotfile entry. Before, the schema left the entry table open, so this passed without a complaint:

[dotfiles]
"~/.gitconfig" = { source = "gitconfig", mod = "copy" }   # flagged now: unknown key `mod`

The schema also documents two keys it left out before, so editors now complete them:

  • autosave: in track mode, false saves the path only on mise dotfiles save <path>.
  • enabled: false turns off an entry inherited from another config file.

mise itself still reads dotfile entries exactly as before. Each entry stays raw TOML until mise expands the dotfiles, and an unknown key in one is still ignored at that point.

Implementation

  • Declaration types. crates/mise-config/src/dotfiles.rs gains DotfileEntryDecl (a source string or a table) and DotfileTableDecl (every key a whole-file entry or an edit may hold). It also gains DotfileVariantDecl, DotfileGroupDecl and DotfileGroupEntryDecl, and MergeSetting moves here from mise-system. Each key's doc comment is its schema description.
  • Cross-key rules. Which keys an entry may combine depends on its mode, and on whether it is a whole-file entry or an edit; for example, relative applies only to symlink modes. A derive can't express that, so these rules stay hand-written in crates/mise-config/src/dotfiles/schema.rs and are added to the derived schema. They moved over unchanged.
  • Parity tests. mise-system still decides whether a table is a whole-file entry or an edit, and parses it with its own types. New tests, dotfile_keys_match_the_declaration and group_keys_match_the_declaration, check that those parsers together read exactly the keys the declarations list, so a key added to one without the other fails a test. FileTomlEntry::Table becomes the struct FileTomlTable so its keys can be listed.

Apart from the closed entry table and the two added keys, the generated [dotfiles] and [dotfile_groups] schemas are semantically identical to the hand-written ones (compared with jq -S).

Validation

  • cargo +1.95 clippy --workspace --all-features --all-targets -- -D warnings
  • cargo test --workspace --all-features --exclude mise. The new parity tests fail when a key is removed from the declaration.
  • cargo test --all-features -p mise --lib, including schema_matches_parser, which validates every toml block in docs/ and every e2e heredoc against the closed schema.
  • mise run test:e2e: config/test_schema_ajv, config/test_schema_tombi, all config/test_schema_dotfiles_*, and 14 cli/test_dotfiles_* tests.

Stacked on #14642.

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

🤖 Generated with Claude Code


Note

Low Risk
Schema and documentation generation plus refactor with parity tests; dotfile runtime parsing behavior is intentionally unchanged.

Overview
Generates [dotfiles] and [dotfile_groups] in schema/mise.json from typed declaration types in mise-config instead of large hand-written JSON blocks. Cross-key constraints (mode-specific keys, merge vs whole-file vs edit) stay in dotfiles/schema.rs and are merged onto the derived schema via entry_rules.

Editor/schema behavior: dotfile entry tables now use additionalProperties: false, so unknown keys (e.g. mod instead of mode) are flagged. The schema also documents autosave and enabled, which were missing before.

Runtime unchanged: config still stores dotfile entries as raw TOML until mise-system expands them; unknown keys are still ignored at expansion time.

mise-system alignment: FileTomlEntry::Table becomes struct FileTomlTable; MergeSetting moves to mise-config. New tests dotfile_keys_match_the_declaration and group_keys_match_the_declaration require parser field sets to match the declaration types. AGENTS.md documents the new schema workflow.

Reviewed by Cursor Bugbot for commit c68c7bf. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Configuration
    • The configuration schema now recognizes the autosave and enabled options for dotfiles.
    • Dotfile and dotfile group settings have clearer descriptions and validation for supported fields and option combinations, including restrictions on options used with particular entry types.
    • Dotfile group names are validated against the supported character set, and unknown fields in dotfile entry objects are rejected.
    • Dotfile group configuration now describes named directory trees and how they can be selected for application.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2561b4cb-cdde-4641-85d8-2f109eac44b6
📥 Commits

Reviewing files that changed from the base of the PR and between 865e343 and c68c7bf.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f153db78-4bf7-4021-bd1f-ddad18ebedd1
📥 Commits

Reviewing files that changed from the base of the PR and between 9b8f69c and 6984204.

📒 Files selected for processing: 1
  • schema/mise.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

📝 Walkthrough

Dotfile declaration types now define entry and group schema shapes. Hand-written rules retain cross-key constraints. mise-system uses shared table and merge-setting types, with tests comparing parser fields to the declarations.

Changes: Dotfile schema and parser alignment

Layer / File(s) Summary
Dotfile declarations and schema generation
crates/mise-config/src/dotfiles.rs, crates/mise-config/src/dotfiles/schema.rs, crates/mise-config/src/mise_toml.rs, schema/mise.json, AGENTS.md
Declaration types describe dotfile entries and groups and drive schema generation. Hand-written rules define cross-key constraints. The JSON schema adds autosave and enabled, rejects undeclared entry properties, and retains the group-name pattern.
mise-system parser alignment
crates/mise-system/src/files.rs, crates/mise-system/src/edits.rs, crates/mise-system/src/dotfile_groups.rs
File table fields move into FileTomlTable, and MergeSetting is re-exported from mise-config. Parser construction and matching use the shared table type. Tests compare parser fields with declaration fields.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: marukome0743

Merge Risk: ⚪ Minimal · up to 69842

This change generates the dotfile schema from typed declarations and makes entry tables reject unknown keys in editors. No merge-blocking risk was identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 81.48% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 6 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: generating the [dotfiles] schema from typed declaration entries. Although it does not mention [dotfile_groups], it accurately summarizes the primary objec…
Full details: Docstring Coverage

Explanation

Docstring coverage is 81.48% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 6 files. (1 skipped: 1 unsupported.)

Full details: Title check

Explanation

The title clearly identifies the main change: generating the [dotfiles] schema from typed declaration entries. Although it does not mention [dotfile_groups], it accurately summarizes the primary objective.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jdx
jdx added this pull request to stack #14612 October 18, 2026 02:47
@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This PR appears safe to merge; no blocking issues were found.

Summary

This PR generates the dotfile schemas from Rust declaration types while keeping runtime parsing unchanged.

  • Dotfile tables now flag unknown keys in editors.

No actionable issues were found. No tests were run during this review.

Reviews (14) · Last reviewed commit: "Merge branch 'claude/mise-config-explain..." · Reviewed by Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 18, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review October 18, 2026 03:02

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 18, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review October 18, 2026 03:18

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 18, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review October 18, 2026 03:27

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 18, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review October 18, 2026 03:45

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 18, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review October 18, 2026 03:57

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 18, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review October 18, 2026 04:14

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 18, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review October 18, 2026 04:30

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 18, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review October 18, 2026 04:51

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 18, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review October 18, 2026 05:03

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

DotfileEntryDecl, DotfileTableDecl, DotfileVariantDecl and
DotfileGroupDecl in mise-config now declare every key a [dotfiles] or
[dotfile_groups] entry may hold, and schema/mise.json is generated from
them. The rules between keys stay hand-written in dotfiles/schema.rs.

The generated schema closes the entry table, so an editor flags a typo,
and documents `autosave` and `enabled`, which it left out. mise-system
still parses entries itself; tests check that its parsers read the
declared keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jdx
jdx force-pushed the claude/mise-config-dotfile-decls branch from b728c48 to 865e343 Compare October 18, 2026 05:03
@jdx
jdx merged commit 602c395 into main Oct 18, 2026
52 checks passed
@jdx
jdx deleted the claude/mise-config-dotfile-decls branch October 18, 2026 05:50
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