{"record":{"id":"25fbbdc80a6b7825","repo":"astrid-runtime/astrid","slug":"required-system-migration-receipt-is-missing","errorCode":null,"errorMessage":"required system migration receipt is missing: {}","messagePattern":"required system migration receipt is missing: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs","lineNumber":426,"sourceCode":"                    \"principal migration component has no ordinary-home receipt: {}\",\n                    component.name\n                ),\n            ));\n        }\n        if let Some(current) = proofs.get(&component.name) {\n            if current != &component.destination_proof {\n                return Err(io::Error::new(\n                    io::ErrorKind::InvalidData,\n                    format!(\n                        \"destination receipt changed for migration component {}\",\n                        component.name\n                    ),\n                ));\n            }\n            continue;\n        }\n        if component.name.starts_with(\"system:\") {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidData,\n                format!(\n                    \"required system migration receipt is missing: {}\",\n                    component.name\n                ),\n            ));\n        }\n        // A current UID's immutable receipt/marker cannot silently disappear.\n        // Deleted historical UIDs are intentionally allowed to have no live\n        // projection, and an originally absent component remains absent when\n        // its ledger proof was explicitly recorded as such.\n        if is_live_principal_component(&component.name, directory)\n            && (component.source.present || !component.destination_proof.is_absent())\n        {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidData,\n                format!(\n                    \"live principal migration receipt is missing: {}\",","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs#L408-L444","documentation":"`validate_existing_proofs` requires a stored proof for every component named `system:*`. If validation reaches a system component with no proof recorded (it was not skipped by earlier continue branches), this error is thrown. System components are mandatory migration targets, so their receipts cannot be absent.","triggerScenarios":"validate_existing_proofs (via resume_existing_layout or existing_layout_requires_receipts_for_live_immutable_components) processes a component starting with `system:` that has no corresponding entry in the collected proofs.","commonSituations":"The ledger was partially restored or hand-pruned, dropping a system receipt; an interrupted migration wrote the component list but crashed before recording the system proof; a newer/older ledger schema dropped the entry.","solutions":["Restore the missing system receipt from a trusted backup of the migrations directory.","If no backup exists, delete the ledger and receipts and run the full migration (initialize_fresh_layout / migrate_legacy_layout) to regenerate them.","Stop editing the ledger manually; system receipts must be produced by the migration itself."],"exampleFix":"// before: ledger missing system: entry\n$ cp <backup>/ledger.json <migrations-dir>/ledger.json\n// after: or full regeneration\n$ rm <migrations-dir>/ledger.json && astrid migrate","handlingStrategy":"validation","validationCode":"for c in components.iter().filter(|c| c.name.starts_with(\"system:\")) {\n    if !proofs.contains_key(&c.name) {\n        eprintln!(\"missing system receipt: {}\", c.name);\n    }\n}","typeGuard":null,"tryCatchPattern":"match resume_existing_layout(...) {\n    Err(e) if e.to_string().contains(\"required system migration receipt is missing\") => {\n        eprintln!(\"restore ledger from backup or re-run full migration\");\n    }\n    r => r?,\n}","preventionTips":["Never prune `system:` entries from the migration ledger.","Back up the migrations directory before any manual intervention.","Re-run full migration after interrupted runs instead of patching the ledger."],"tags":["security","ledger","migration","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}