Skip to content

Generic alter <type> X { set / insert / replace / drop } with per-doctype target resolvers #712

Description

@ako

Plan item 4.1 in PROPOSAL_mdl_beta_syntax_freeze.md §8.3. Implements ADR-0012, decision 2. On the beta gate.

Goal

One alter grammar for every document type, in place of about 15 per-type forms:

alter <type> Module.Name {
  set ( Key: value ) on <target>;
  insert before|after|into <target> { <fragment> }
  replace <target> with { <fragment> }
  drop <target>;
}

Fragments use exactly the create syntax.

Scope

  • The grammar rule, with a per-document-type target resolver interface in mdl/backend.
  • Port alter page, alter snippet and alter layout (pagemutator) and alter workflow (wfmutator) onto it. Their current forms become registered aliases (see the deprecation registry issue).
  • Both backends: modelsdk and --mcp, or an explicit "not supported by this backend" error.

Done when

The existing alter tests pass through the new path, and the old forms still parse, with deprecation warnings.

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions