Skip to content

op invariant_mutation

Mikhail Deynekin edited this page Nov 29, 2026 · 1 revision

invariant_mutation

A declared mutation area: snapshot before, verify after, roll the whole area back on violation.

Group Invariants
Edition pro — opens with a Pro licence
Capability invariant-pin — the feature that carries this operation; the matrix is on 15 · Editions and licensing
MCP tool ragraf_invariant_mutation
CLI ragraf query invariant_mutation

Why it exists

Repairing the one place that broke leaves the rest of the mutation half-applied. Rolling back the whole declared area returns the system to a state that was known good.

What it solves

  • Declare the area by patterns before changing anything.
  • Snapshot it under .ragraf/mutations/ (bounded: 400 files, 256 MiB).
  • On a violation restore the whole area; name files changed outside it and report partial_rollback.

Parameters

Name Type Default
action str 'begin'
mutation_id str ''
paths `list[str] None`
note str ''
reindex bool True
on_violation str 'rollback'
agent str ''

What it returns

The usual envelope: ok, index_rev, capability, provenance and the operation's own section. A refusal is a named reason (constraint_present, unverifiable_constraint, origin_missing, outside_scope), not a silent false.

Full description and limits: 16 · Invariants.

Clone this wiki locally