Use the codec audit and repair in place of OCS's corruption guard

Opening a drawing no longer drops entities with its own sanity checks or
rewrites knotless splines; recovery runs the codec's repair and records
its actions and unresolved issues in the drawing's notifications. Xref
merges keep every entity. The dropped-entity counts, their command-line
warnings, recovery report rows and the automation "purged" field go with
the guard.

AUDIT now reports the codec's audit (counts plus the first 50 issues) and
asks whether to fix; Yes applies the codec repair as one undo step.

Cargo: codec 325fa98, kernel dfca391, graph 5d4e713.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-16 12:02:39 +03:00
1 parent 3c9404510f
commit 04b2c07a38
43 files changed
+192 -763

No files matched your search

-19
View File
@@ -24,8 +24,6 @@ pub struct RecoveryReport {
pub source_sha256: Option<String>,
pub read_stats: Option<codec::ReadStats>,
pub entities_scanned: usize,
pub entities_removed: usize,
pub referenced_entities_removed: usize,
pub parser_errors_recovered: usize,
pub diagnostics: Vec<(String, String)>,
pub references_checked: usize,
@@ -54,8 +52,6 @@ impl RecoveryReport {
source_sha256: Option<String>,
read_stats: Option<codec::ReadStats>,
entities_scanned: usize,
entities_removed: usize,
referenced_entities_removed: usize,
references: &[XrefInfo],
notifications: &codec::notification::NotificationCollection,
save_as_required: bool,
@@ -163,8 +159,6 @@ impl RecoveryReport {
source_sha256,
read_stats,
entities_scanned,
entities_removed,
referenced_entities_removed,
parser_errors_recovered,
diagnostics,
references_checked: references.len(),
@@ -211,8 +205,6 @@ impl RecoveryReport {
.unwrap_or(0),
read_stats,
entities_scanned: 0,
entities_removed: 0,
referenced_entities_removed: 0,
diagnostics: Vec::new(),
references_checked: 0,
references_loaded: 0,
@@ -233,17 +225,11 @@ impl RecoveryReport {
}
}
pub fn removed_total(&self) -> usize {
self.entities_removed
.saturating_add(self.referenced_entities_removed)
}
pub fn issues_found(&self) -> usize {
self.parser_errors_recovered
.saturating_add(self.references_recovered)
.saturating_add(self.references_failed)
.saturating_add(self.references_missing)
.saturating_add(self.removed_total())
.saturating_add(usize::from(self.error.is_some()))
}
@@ -315,11 +301,6 @@ impl RecoveryReport {
));
}
lines.push(format!("Entities scanned: {}", self.entities_scanned));
lines.push(format!("Entities removed: {}", self.entities_removed));
lines.push(format!(
"Referenced entities removed: {}",
self.referenced_entities_removed
));
lines.push(format!(
"Parser errors recovered: {}",
self.parser_errors_recovered