Skip to content

Raise E_SCHEMA_VERSION_MISMATCH when composing a fragment #665

Closed

Description

@ExtraToast

Part of #664.

Composition admits fragments by schemaVersion range (chapter 40, the version table), but nothing raises E_SCHEMA_VERSION_MISMATCH. The code is declared in src/model/diagnostic.ts, and scripts/lint-codes.ts lists it as pending under #204, which closed without it.

So today a fragment written for a newer minor composes. Fields the composing toolkit doesn't know are dropped, and the run still exits zero. That is the silent loss the chapter's "Minor > toolkit stays a hard stop" paragraph warns about.

What

  • In composition, compare each fragment's manifest.spec.schemaVersion with the toolkit's:
    • a different major, in either direction, is E_SCHEMA_VERSION_MISMATCH;
    • the same major with a higher minor is E_SCHEMA_VERSION_MISMATCH;
    • a patch difference is admitted.
  • The message names the rule that fired, the fragment and its digest.
  • As a participant's own error, it isolates that participant at its last composed fragment even if the digest did not change (chapter 40, "A participant's own errors isolate it").
  • Remove the code from the Slice 7: every refusal through check/, the pending codes included #204 pending list in lint-codes.ts.

Why after 1.0.0

At 1.0.0 every fragment is written at 1.0.0, so nothing can trip the gate yet. It matters from the first minor release after that. The version-rollout steps in #381's runbook describe the gate as specified.

Activity

  1. ExtraToast commented on Oct 27, 2026

    @ExtraToast
    ContributorAuthor

    Resume here (updated 2026-10-27)

    State: merged as 8568aafc (PR #670).

    Next step: none.

    Blocked by: nothing.

    Decisions:

    • 2026-10-27, the maintainer: this ships in 1.0.0, not after. The check guards against a fragment newer than its composer, so the composer that must carry it is the older toolkit: a 1.0.0 without it would compose a 1.1 fragment, drop its new fields and exit zero. The rollout-order rule in Rewrite chapter 60 to rules, and write the handover and setup runbooks #381's runbook stays as practice, but the gate does not depend on it.
    • Chapter 40's table is the specification. A different major in either direction, or the same major with a higher minor, raises the error; a patch difference never does. The message names the rule that fired, the fragment and its digest.
    • 2026-10-27, the maintainer: where the fallback or Rollback fragment is itself unreadable, the run stops (chapter 40 reworded from "fails nothing"), and release-please sets SCHEMA_VERSION through extra-files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featureNew user-facing or operator-facing capability.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions