0082. Named checks live in a checks section; reusable blocks are mixin files; step files are dropped

0082. Named checks live in a checks section; reusable blocks are mixin files; step files are dropped

Status

Accepted. Amends ADR-0053 (step files and reusable steps), ADR-0050 and ADR-0051. The line “a project’s own mixin wins over Mesh’s of the same name” in DOM-33 is the lead’s reading, for operator review.

Rows: DOM-04, DOM-28, DOM-33. None is open.

Date

2026-10-11

Deciders

operator (Saulo Vallory), 2026-10-11 (DOM-04 at 07:07; DOM-33 at 07:57).

Context

ADR-0053 planned reusable steps (step :slugify) in their own files. The study (D18) found that what teams repeat is a check, or a block of attributes and actions (timestamps, a version column), and that a step file is a second kind of reuse.

Decision

  1. Named checks are an entity-level checks section, referenced by a bare check :name in validate (DOM-28).
  2. Importable fragments are mixin files: the root is mixin :name, and an entity includes one with use :name (DOM-04, DOM-28). use is the include word for all reusable blocks.
  3. Mesh ships :timestamps and :versioned mixins, and a project may define its own, including ones named like Mesh’s (DOM-33). Lead’s reading, for operator review: the project’s own mixin wins over Mesh’s of the same name.
  4. Step files and reusable steps are dropped (ADR-0053); no DOM row states this. Reuse is a TypeScript helper, or a mixin.
An illustration; the section and the keywords are ruled, the inner lines follow Entities
entity :Invoice
  use :timestamps
  checks
    check :dueAfterIssue [
      that=({ input }) => input.dueOn >= input.issuedOn
      code="invalid_dates"
      message="the due date cannot be before the issue date"
    ]
  actions
    create :issue
      validate
        check :dueAfterIssue

Options considered

The study’s D18: (a) named checks as an extension-host run-time point written in TypeScript, after the host exists (the documented form); (b) the ADR-0053 step model, with MX check definition files that extensions can also contribute (recommended). The ruling took neither: named checks are an entity-level checks section (DOM-28), and step files were dropped, with reuse by a TypeScript helper or a mixin. That drop was ruled on 2026-10-11 with the study’s answers; no DOM row states it, so this record is its source.

Trade-off analysis

A checks section keeps a named rule next to the entity that owns it and needs no new file kind. Mixins cover what a helper cannot, since a helper cannot add attributes or actions. The tie-break (project wins) lets a project replace :timestamps with its own, at the cost that a typo in a mixin name shadows Mesh’s silently; a diagnostic noting the shadowing would help.

Consequences

  • ADR-0053 and ADR-0050: their lists of “planned” reusable steps are replaced. ADR-0051: there are no step files.
  • Named, reusable checks are core, not a run-time extension point; the extension-host page and the overview say so.
  • User docs: Entities needs the checks section and a page for mixins when built.

Action items

  • Build checks, mixin and use, with :timestamps and :versioned.
  • Operator: confirm the project-wins tie-break.