fix(workdir): keep diagnostic context transparent to Write creation

This commit is contained in:
2026-10-09 23:21:50 +09:00
parent 10c55874e3
commit 6ac87c885e
7 changed files with 214 additions and 19 deletions
+11
View File
@@ -515,6 +515,17 @@ pub enum WorkdirError {
}
impl WorkdirError {
/// The error used for operational classification, ignoring only diagnostic
/// context (including nested context). Keep the original error for display
/// and `denial_reason`: enrichment must not alter behavior or retry policy.
pub fn classification_source(&self) -> &Self {
let mut error = self;
while let Self::DenialContext { source, .. } = error {
error = source;
}
error
}
pub fn denied(reason: WorkdirDenialReason, message: impl Into<String>) -> Self {
Self::Denied(WorkdirDenial {
reason: Some(reason),