Skip to main content

vulkro-sf migration-risk

Scores the risk of a planned metadata migration: a field type change, a record-type consolidation, an object split, or any structural change that moves or reshapes data. Where impact-flow maps what a change touches, migration-risk grades how dangerous the change itself is, based on the kind of transformation and the data and automation that depend on it.

Runs over the local project against a migration plan you supply. No org connection is required.

Synopsis

vulkro-sf migration-risk [PATH] --plan <path> [flags]

PATH defaults to the current directory. --plan points at the migration description (the before and after metadata, or a manifest of the planned transformations).

Flags

FlagTypeDefaultDescription
--plan <path>string(required)The migration plan: a folder pairing the before and after metadata, or a manifest describing the planned transformations.
--format <fmt>enumtableOutput format: table (human-readable risk summary) or json (machine-readable risk records, for a migration gate).

Exit codes

  • 0 - the migration plan carries no detected risk above the reporting threshold.
  • 1 - migration risk was found and reported (one or more of SF-MIGRATION-RISK-001 through 003 fired).
  • 2 - error: the plan could not be read, the project could not be parsed, or an internal error. The message names the cause and the next step.

What it does

migration-risk classifies each planned transformation and scores it, emitting three finding classes:

  • SF-MIGRATION-RISK-001: lossy transformation. A change that can drop or truncate data: shrinking a text field, narrowing a number's precision, removing a picklist value that records still use, or changing a field type in a way the platform cannot losslessly convert. The finding names the field and the loss mode.
  • SF-MIGRATION-RISK-002: dependency-breaking transformation. A change that invalidates dependent automation or references: removing a field a flow writes, renaming an object an Apex class queries, or consolidating record types that profiles still reference. The finding lists the dependents the migration would break.
  • SF-MIGRATION-RISK-003: irreversible transformation. A change with no clean rollback path: a delete that cannot be undone without a data restore, or a merge that loses the information needed to split the records back apart. The finding flags the change as one that needs a tested backout plan before it ships.

Each finding carries a risk grade so a migration can be triaged: address the irreversible and dependency-breaking changes first, stage the lossy ones behind a data backup.

Example

# Score a planned field-consolidation migration.
vulkro-sf migration-risk . --plan ./migration-plan

# JSON for a migration approval gate.
vulkro-sf migration-risk . --plan ./migration-plan --format json > migration-risk.json