Documentation
¶
Overview ¶
Package clonehistory owns durable metadata for save points imported by repository clone. It deliberately avoids clone orchestration.
Index ¶
Constants ¶
const ( ManifestSchemaVersion = 1 OperationRepoClone = "repo_clone" SavePointsModeAll = "all" )
Variables ¶
This section is empty.
Functions ¶
func ComputeImportedSavePointsEvidence ¶
func ComputeImportedSavePointsEvidence(ids []model.SnapshotID) (int, string)
ComputeImportedSavePointsEvidence returns the canonical count and checksum for imported save point IDs. It is exposed for tests and low-level recovery tools that need to construct raw manifest fixtures without going through WriteManifest.
func ManifestPath ¶
ManifestPath returns the durable imported clone history manifest path.
func ValidateManifest ¶
ValidateManifest verifies manifest identity, shape, and referenced save point publish state. A validation error means cleanup and doctor must fail closed.
func WriteManifest ¶
WriteManifest validates and atomically writes the imported clone history manifest.
Types ¶
type Manifest ¶
type Manifest struct {
SchemaVersion int `json:"schema_version"`
Operation string `json:"operation"`
SourceRepoID string `json:"source_repo_id"`
TargetRepoID string `json:"target_repo_id"`
SavePointsMode string `json:"save_points_mode"`
RuntimeStateCopied bool `json:"runtime_state_copied"`
ProtectionReason string `json:"protection_reason"`
ImportedSavePoints []model.SnapshotID `json:"imported_save_points"`
// ImportedSavePointsCount and ImportedSavePointsChecksum are durable
// self-evidence for the canonical imported save point set.
ImportedSavePointsCount int `json:"imported_save_points_count"`
ImportedSavePointsChecksum string `json:"imported_save_points_checksum"`
}
Manifest records imported all-clone save points that must remain protected from reviewed cleanup.
func LoadManifest ¶
LoadManifest reads the imported clone history manifest if present. Malformed or unsafe manifest storage returns an error so callers can fail closed.