pub enum Finding {
Mismatch {
key: String,
current: Option<String>,
expected: String,
message: String,
severity: Severity,
attribution: Vec<Provenance>,
},
UnwritableRequiredKey {
key: String,
expected: String,
attribution: Vec<Provenance>,
},
InvalidRequirements {
key: String,
message: String,
contributors: Vec<(String, String)>,
},
ParseError {
message: String,
severity: Severity,
},
ConflictingRequirements {
key: String,
contributors: Vec<(String, String)>,
reason: String,
},
InternalError {
message: String,
},
}Expand description
A structured finding emitted by a FileEngine or a linter adapter.
Variants§
Mismatch
A key on disk disagrees with what the requirement asserts.
Fields
message: StringFree-form policy-authored explanation of the mismatch: what is wrong, why it’s wrong, what should be done instead. Comes from the assertion entry that produced this finding.
attribution: Vec<Provenance>UnwritableRequiredKey
Reconcile knew where to write but the file role forbids it.
InvalidRequirements
The merged requirement set resolves per key but is JOINTLY unwritable:
the tool itself would reject the resulting file, so the engine refuses
to produce it. Always Severity::Error; hard failure; NOT waivable
(there is no on-disk value to keep – the policy set is wrong).
Preference order before reaching for this variant:
- Make the invalidity unrepresentable in the requirement types where that is natural.
- Model a genuine either/or decision as ONE key, so the merge
surfaces disagreement as
ConflictingRequirements. - Use this variant only for relational constraints across keys.
The Finding closed-set manifest row blocks ad hoc alternatives.
Fields
ParseError
The file isn’t valid in its native grammar (e.g. malformed TOML).
ConflictingRequirements
Two or more requirements disagree on the same key in the same file
(the policies that issued them are the attribution). Produced by the
engine’s merge phase, per key, naming each disagreeing policy and its
value. Always Severity::Error; the field is dropped (not written);
not waivable.
Fields
InternalError
Engine- or adapter-internal failure (panic-class, but caught
before it actually panics). Always Severity::Error.