Documentation
¶
Overview ¶
Package migrationratchet compares immutable migration evidence snapshots. A passing receipt is an incremental no-regression result, not proof of behavioral adequacy or migration completeness.
Index ¶
- Constants
- func DeltaDigest(delta Delta) string
- func Digest(value any) string
- func Encode(value any) ([]byte, error)
- func ExceptionDigest(exception Exception) string
- func PolicyDigest(policy Policy) string
- func RecordDigest(record Record) string
- func RuleDigest(rule ComparabilityRule) string
- func SnapshotDigest(snapshot Snapshot) string
- func StateDeltaDigest(delta StateDelta) string
- type Binding
- type ComparabilityRule
- type Delta
- type Denominator
- type Exception
- type ExceptionScope
- type IdentityDelta
- type IdentityMapping
- type Link
- type Policy
- type Profile
- type ProviderBinding
- type Receipt
- type Record
- type RecordSelection
- type RepositoryBinding
- type Snapshot
- type StateDelta
- type StateRule
Constants ¶
View Source
const ( ProfileSchema = "corvint-migration-evidence-ratchet/1" SnapshotSchema = "corvint-migration-evidence-snapshot/1" ReceiptSchema = "corvint-migration-evidence-ratchet-receipt/1" MaxRecords = 4096 MaxBytes = 4 << 20 )
Variables ¶
This section is empty.
Functions ¶
func DeltaDigest ¶
func ExceptionDigest ¶
func PolicyDigest ¶
func RecordDigest ¶
func RuleDigest ¶
func RuleDigest(rule ComparabilityRule) string
func SnapshotDigest ¶
func StateDeltaDigest ¶
func StateDeltaDigest(delta StateDelta) string
Types ¶
type Binding ¶
type Binding struct {
Schema string `json:"schema"`
Repository RepositoryBinding `json:"repository"`
PolicyID string `json:"policy_id"`
PolicySHA256 string `json:"policy_sha256"`
Provider ProviderBinding `json:"provider"`
ArtifactSHA256 string `json:"artifact_sha256"`
}
type ComparabilityRule ¶
type ComparabilityRule struct {
ID string `json:"id"`
SHA256 string `json:"sha256"`
BaselineArtifactSHA256 string `json:"baseline_artifact_sha256"`
CandidateArtifactSHA256 string `json:"candidate_artifact_sha256"`
Owner string `json:"owner"`
Reviewers []string `json:"reviewers"`
Reason string `json:"reason"`
Allows []string `json:"allows"`
Mappings []IdentityMapping `json:"mappings"`
Selections []RecordSelection `json:"selections"`
}
type Denominator ¶
type ExceptionScope ¶
type IdentityDelta ¶
type IdentityMapping ¶
type Policy ¶
type Policy struct {
ID string `json:"id"`
SHA256 string `json:"sha256"`
States []StateRule `json:"states"`
ForbidNewLegacy bool `json:"forbid_new_legacy"`
RequireContractForNewOrChangedTests bool `json:"require_contract_for_new_or_changed_tests"`
TerminalStatesCannotRegress bool `json:"terminal_states_cannot_regress"`
InvalidateEvidenceOnContentChange bool `json:"invalidate_evidence_on_content_change"`
UnresolvedDenominatorCannotGrow bool `json:"unresolved_denominator_cannot_grow"`
}
type Profile ¶
type Profile struct {
Schema string `json:"schema"`
EvaluatedOn string `json:"evaluated_on"`
Baseline Snapshot `json:"baseline"`
Candidate Snapshot `json:"candidate"`
MigrationRule *ComparabilityRule `json:"migration_rule,omitempty"`
}
type ProviderBinding ¶
type Receipt ¶
type Receipt struct {
Schema string `json:"schema"`
ProfileSHA256 string `json:"profile_sha256"`
EvaluatedOn string `json:"evaluated_on"`
Baseline Binding `json:"baseline"`
Candidate Binding `json:"candidate"`
BaselineDenominator Denominator `json:"baseline_denominator"`
CandidateDenominator Denominator `json:"candidate_denominator"`
Additions []Delta `json:"additions"`
Removals []Delta `json:"removals"`
ContentChanges []Delta `json:"content_changes"`
StateChanges []StateDelta `json:"state_changes"`
StaleEvidence []Delta `json:"stale_evidence"`
BrokenReverseLinks []Delta `json:"broken_reverse_links"`
Unknowns []Delta `json:"unknowns"`
Identities []IdentityDelta `json:"identities"`
PolicyFailures []string `json:"policy_failures"`
Verdict string `json:"verdict"`
Limitations []string `json:"limitations"`
}
type RecordSelection ¶
type RepositoryBinding ¶
type Snapshot ¶
type Snapshot struct {
Schema string `json:"schema"`
Repository RepositoryBinding `json:"repository"`
Policy Policy `json:"policy"`
Provider ProviderBinding `json:"provider"`
Complete bool `json:"complete"`
Fresh bool `json:"fresh"`
Records []Record `json:"records"`
Exceptions []Exception `json:"exceptions"`
ArtifactSHA256 string `json:"artifact_sha256"`
}
type StateDelta ¶
Click to show internal directories.
Click to hide internal directories.