type
Artifact
type Artifact struct {
// Version identifies this Ridu artifact JSON format.
Version uint32 `json:"version"`
// Name is the lowercase author-supplied migration name.
Name string `json:"name"`
// Planner records the exact planner and version used at creation.
Planner Planner `json:"planner"`
// MinimumRunnerContract is the lowest execution contract that may run
// every phase and executor in this artifact.
MinimumRunnerContract uint32 `json:"minimumRunnerContract,omitempty"`
// PreviousArtifactDigest binds this artifact to the exact preceding artifact,
// including data-only transitions whose manifest digest does not change.
// It is empty only for the initial artifact.
PreviousArtifactDigest string `json:"previousArtifactDigest"`
// FromDigest and ToDigest establish immutable manifest lineage.
FromDigest string `json:"fromDigest"`
ToDigest string `json:"toDigest"`
// Before is absent only for an initial migration from an empty schema.
Before *schema.Snapshot `json:"before,omitempty"`
// After is the complete desired manifest after every step succeeds.
After schema.Snapshot `json:"after"`
// Phases are the resumable execution plan.
Phases []Phase `json:"phases"`
// Risks retains machine-readable planner and linter findings for review.
Risks []Risk `json:"risks"`
codec *artifactCodecState
}The immutable definition of one migration.
Source migration/migration.go:258
Versionuint32- Version identifies this Ridu artifact JSON format.
Namestring- Name is the lowercase author-supplied migration name.
PlannerPlanner- Planner records the exact planner and version used at creation.
MinimumRunnerContractuint32- MinimumRunnerContract is the lowest execution contract that may run every phase and executor in this artifact.
PreviousArtifactDigeststring- PreviousArtifactDigest binds this artifact to the exact preceding artifact, including data-only transitions whose manifest digest does not change. It is empty only for the initial artifact.
FromDigeststring- FromDigest and ToDigest establish immutable manifest lineage.
ToDigeststring- The ToDigest value.
Before*schema.Snapshot- Before is absent only for an initial migration from an empty schema.
Afterschema.Snapshot- After is the complete desired manifest after every step succeeds.
Phases[]Phase- Phases are the resumable execution plan.
Risks[]Risk- Risks retains machine-readable planner and linter findings for review.
ArtifactVersion is 1. Incompatible historical formats are intentionally unsupported. Application authors normally use ridu migrate commands and review the artifact rather than construct it by hand.
Methods
Artifact.AfterManifest()AfterManifest returns the validated immutable after snapshot.
Artifact.BeforeManifest()BeforeManifest returns the validated immutable before snapshot. Initial artifacts return an error because they intentionally have no parent state.
Artifact.Digest()Digest returns the SHA-256 digest of the canonical artifact JSON.
Artifact.MarshalJSON()MarshalJSON emits the frozen artifact wire contract.
Artifact.UnmarshalJSON()UnmarshalJSON uses the same fail-closed versioned decoder as artifact files.
Artifact.Validate()Validate checks the planner-owned structure and manifest lineage of an artifact plan. Publication binds a non-initial plan to its exact predecessor; serialization and digesting reject the plan until that binding exists.