Skip to content
Tools/Migrations/migrate_status

migrate_status

Apply `UPG_STATUS_MIGRATIONS` graph-wide: rewrite legacy lifecycle status values to canonical phase ids. Auto-mode (no filters) selects nodes whose current status is invalid against the entity type's lifecycle and has a registered replacement (the same invariant that drives `validate_graph` lifecycle_drift). Surgical mode (`from_status` + `to_status`) overrides the registry and rewrites every (entity_type?, from_status) match. Nodes with invalid statuses but no registered replacement surface under `skipped_no_migration`. Default `dry_run=true`; pass `dry_run=false` to commit.

Migrationsper-node. Status writes go through `store.updateNode` one at a time. Dry-run is read-only.

Arguments

entity_typestringoptional

Optional. Restrict the rewrite to nodes of this canonical entity type (e.g. "service", "feature").

from_statusstringoptional

Optional. Restrict the rewrite to nodes whose current status equals this exact value. When provided, `to_status` is required and the registry is bypassed.

to_statusstringoptional

Required when `from_status` is provided. The canonical phase id to write.

dry_runbooleanoptional

Preview changes without applying (default true). Pass false to commit.

Returns

JSON: MigrateStatusResult.

Examples

Live call against the Notion example graph.

Output

{
  "migrated_nodes": 0,
  "skipped_no_migration": 0,
  "changes": [],
  "dry_run": true
}

Warnings

Default is `dry_run: true`. Pass `dry_run: false` to commit. Idempotent on retry; re-running after a successful commit reports zero changes (canonical statuses pass the validity check).

See Also