pub enum PlanValidationError {
Show 20 variants
NotObject,
SchemaVersionMissing,
SchemaVersionNotInt,
UnsupportedSchemaVersion {
found: u64,
supported: Vec<u32>,
},
Malformed {
message: String,
},
UnknownField {
path: String,
field: String,
},
EmptyString {
path: String,
},
AcceptanceEmpty,
AcceptanceNoCheck,
ChunksEmpty,
InvalidChunkId {
id: String,
expected: &'static str,
},
DuplicateChunkId {
id: String,
},
UnknownDep {
chunk: String,
dep: String,
},
DuplicateDep {
chunk: String,
dep: String,
},
DependencyCycle {
cycle: Vec<String>,
},
ChunkNoCheck {
chunk: String,
},
ChunkNoFiles {
chunk: String,
},
UnsafePath {
chunk: String,
path: String,
},
UnsafeCwd {
location: String,
path: String,
},
ExpectExitOutOfRange {
location: String,
value: i64,
},
}Expand description
A plan.json document failed schema validation.
Every variant names one violation. The CLI renders these as a
schema_violation error; PlanValidationError::expected supplies the
machine-readable expected hint for the variants that carry one, mirroring
crate::report::ReportValidationError.
Variants§
NotObject
The document root was not a JSON object.
SchemaVersionMissing
The required schema_version field was absent.
SchemaVersionNotInt
schema_version was present but not a non-negative integer.
UnsupportedSchemaVersion
schema_version declared a major this build does not support.
Fields
supported: Vec<u32>The majors this build accepts (see SUPPORTED_PLAN_SCHEMAS).
Malformed
The document is a supported version but does not match the v3 shape
(missing required field, wrong type, unknown acceptance kind, unknown
tier, …). Carries the underlying serde message.
UnknownField
An undeclared field appeared and is not in TOLERATED_OPTIONAL_FIELDS.
Fields
EmptyString
A required string field was empty (or whitespace-only).
AcceptanceEmpty
acceptance[] was empty.
AcceptanceNoCheck
acceptance[] contained no executable check (only assertions).
ChunksEmpty
chunks[] was empty.
InvalidChunkId
A chunk id was empty or used characters outside [A-Za-z0-9_.-] (with a
leading alphanumeric). Chunk ids must be safe to reference and log.
DuplicateChunkId
Two chunks shared an id.
UnknownDep
A chunk’s deps referenced an id that no chunk defines.
DuplicateDep
A chunk listed the same dependency more than once.
DependencyCycle
The dependency graph contained a cycle.
Fields
ChunkNoCheck
A chunk declared no executable check.
ChunkNoFiles
A chunk declared no files_touched entries.
UnsafePath
A files_touched entry was not a safe repo-relative path.
UnsafeCwd
A check’s optional cwd was not a safe repo-relative directory. Held to
the same lexical guard as files_touched (is_safe_repo_relative) —
cwd controls where a shell command executes, so an absolute path
(/etc) or a ../~ traversal would let a check escape the worktree the
floor gates. Absence already means “the worktree root”, so a bare . is
rejected too — there is one spelling for root, not two.
Fields
ExpectExitOutOfRange
A check’s optional expect_exit was outside the range a sh -c process
can actually report. A shell exit status is 0..=255; a value outside it
(negative, or > 255) could never match code() and would make the check
permanently un-passable, so it is rejected at validation rather than
silently failing every run.
Implementations§
Source§impl PlanValidationError
impl PlanValidationError
Sourcepub fn expected(&self) -> Option<Value>
pub fn expected(&self) -> Option<Value>
The machine-readable expected hint for this error, if any — mirrors
crate::report::ReportValidationError::expected so the CLI can attach
the same structured payload.
Trait Implementations§
Source§impl Debug for PlanValidationError
impl Debug for PlanValidationError
Source§impl Display for PlanValidationError
impl Display for PlanValidationError
impl Eq for PlanValidationError
Source§impl Error for PlanValidationError
impl Error for PlanValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()