Class RepairPlan
A reviewable, ordered description of what a repair will do — produced by a read-only pass and consumed by the only mutating one.
public sealed class RepairPlan
- Inheritance
-
RepairPlan
- Inherited Members
Remarks
The plan is a file, not a flag. It records the report it was derived from and the identity of the database it was derived for, and applying it re-scans first and refuses if the database changed. Repairing against a stale diagnosis is how a repair tool damages a healthy database, and a plan that cannot detect staleness is a plan that invites it.
The natural product instinct is one command that does the right thing. That is rejected here: the cost of a wrong automatic repair is unbounded and unrecoverable, while the cost of one extra command is thirty seconds.
Constructors
RepairPlan()
public RepairPlan()
Fields
PlanVersion
Schema version of the plan's serialized form.
public const int PlanVersion = 1
Field Value
Properties
BlockedReason
Why this plan must not be applied at all, or null when it may be. Set when the database's on-disk format
revision is not the one this build speaks (DescribeRevisionRefusal(int)).
public string BlockedReason { get; init; }
Property Value
Remarks
Distinct from IsEmpty, and the distinction is the whole point: an empty plan means nothing needs repairing, a blocked one means this build must not be the one to try. Collapsing them would report "nothing to repair" about a database with real findings, which is the most misleading sentence the tool could print.
CreatedUtc
When the plan was produced.
public DateTime CreatedUtc { get; init; }
Property Value
DatabaseFingerprint
Fingerprint of the report this plan was derived from, and of the database state it described.
public required string DatabaseFingerprint { get; init; }
Property Value
IsBlocked
Whether applying this plan would be refused outright. Surfaces the refusal before the operator consents to it.
public bool IsBlocked { get; }
Property Value
IsEmpty
Whether the plan would do anything.
public bool IsEmpty { get; }
Property Value
Loss
The full loss enumeration.
public required LossManifest Loss { get; init; }
Property Value
RequiresLossyConsent
Whether any step would destroy something, and therefore whether consent is required.
public bool RequiresLossyConsent { get; }
Property Value
Source
Human-readable identity of the target database.
public required string Source { get; init; }
Property Value
Steps
The ordered steps.
public required IReadOnlyList<RepairStep> Steps { get; init; }
Property Value
Unaddressed
Findings this plan cannot address at all, with the reason. The honest remainder.
public required IReadOnlyList<string> Unaddressed { get; init; }
Property Value
Verdict
The verdict the plan was built to address.
public required IntegrityVerdict Verdict { get; init; }