Skip to main content

auths_cli/errors/
registry.rs

1//! Error code registry — **generated** by `cargo xtask gen-error-docs`.
2//!
3//! Do not edit manually. Re-run the generator after changing any `AuthsErrorInfo` impl:
4//! ```sh
5//! cargo xtask gen-error-docs
6//! ```
7//!
8//! ## Range Allocation
9//!
10//! | Range   | Crate            | Layer |
11//! |---------|------------------|-------|
12//! | E0xxx   | Reserved/meta    | -     |
13//! | E1xxx   | auths-crypto     | 0     |
14//! | E2xxx   | auths-verifier   | 1     |
15//! | E3xxx   | auths-core       | 2     |
16//! | E4xxx   | auths-id         | 3     |
17//! | E5xxx   | auths-sdk        | 3-4   |
18//! | E6xxx   | auths-cli        | 6     |
19
20/// Returns the explanation markdown for a given error code, or `None` if unknown.
21///
22/// Args:
23/// * `code`: An error code string like `"AUTHS-E3001"`.
24#[rustfmt::skip]
25pub fn explain(code: &str) -> Option<&'static str> {
26    match code {
27        // --- auths-crypto (CryptoError) ---
28        "AUTHS-E1001" => Some("# AUTHS-E1001\n\n**Crate:** `auths-crypto`\n\n**Type:** `CryptoError::InvalidSignature`\n\n## Message\n\nInvalid signature\n\n## Suggestion\n\nThe signature does not match the data or public key\n"),
29        "AUTHS-E1002" => Some("# AUTHS-E1002\n\n**Crate:** `auths-crypto`\n\n**Type:** `CryptoError::InvalidKeyLength`\n\n## Message\n\nInvalid public key length: expected {expected}, got {actual}\n\n## Suggestion\n\nEnsure the key length matches the declared curve (32 bytes Ed25519, 33 bytes P-256 compressed SEC1)\n"),
30        "AUTHS-E1003" => Some("# AUTHS-E1003\n\n**Crate:** `auths-crypto`\n\n**Type:** `CryptoError::InvalidPrivateKey`\n\n## Message\n\nInvalid private key: {0}\n"),
31        "AUTHS-E1004" => Some("# AUTHS-E1004\n\n**Crate:** `auths-crypto`\n\n**Type:** `CryptoError::OperationFailed`\n\n## Message\n\nCrypto operation failed: {0}\n"),
32        "AUTHS-E1005" => Some("# AUTHS-E1005\n\n**Crate:** `auths-crypto`\n\n**Type:** `CryptoError::UnsupportedTarget`\n\n## Message\n\nOperation not supported on current compilation target\n\n## Suggestion\n\nThis operation is not available on the current platform\n"),
33
34        // --- auths-crypto (DidKeyError) ---
35        "AUTHS-E1101" => Some("# AUTHS-E1101\n\n**Crate:** `auths-crypto`\n\n**Type:** `DidKeyError::InvalidPrefix`\n\n## Message\n\nDID must start with 'did:key:z', got: {0}\n\n## Suggestion\n\nDID must start with 'did:key:z'\n"),
36        "AUTHS-E1102" => Some("# AUTHS-E1102\n\n**Crate:** `auths-crypto`\n\n**Type:** `DidKeyError::Base58DecodeFailed`\n\n## Message\n\nBase58 decoding failed: {0}\n"),
37        "AUTHS-E1103" => Some("# AUTHS-E1103\n\n**Crate:** `auths-crypto`\n\n**Type:** `DidKeyError::UnsupportedMulticodec`\n\n## Message\n\nUnsupported multicodec: expected Ed25519 [0xED, 0x01] or P-256 [0x80, 0x24]\n\n## Suggestion\n\nSupported key types: Ed25519, P-256 (secp256r1)\n"),
38        "AUTHS-E1104" => Some("# AUTHS-E1104\n\n**Crate:** `auths-crypto`\n\n**Type:** `DidKeyError::InvalidKeyLength`\n\n## Message\n\nInvalid key length: got {0} bytes\n"),
39
40        // --- auths-keri (KeriDecodeError) ---
41        "AUTHS-E1201" => Some("# AUTHS-E1201\n\n**Crate:** `auths-keri`\n\n**Type:** `KeriDecodeError::UnsupportedKeyType`\n\n## Message\n\nUnsupported KERI key type: prefix '{0}'\n\n## Suggestion\n\nSupported verkey prefixes: 'D'/'B' (Ed25519 transferable/non-transferable), '1AAJ'/'1AAI' (P-256 transferable/non-transferable).\n"),
42        "AUTHS-E1202" => Some("# AUTHS-E1202\n\n**Crate:** `auths-keri`\n\n**Type:** `KeriDecodeError::EmptyInput`\n\n## Message\n\nMissing KERI prefix: empty string\n\n## Suggestion\n\nProvide a non-empty KERI-encoded key string\n"),
43        "AUTHS-E1203" => Some("# AUTHS-E1203\n\n**Crate:** `auths-keri`\n\n**Type:** `KeriDecodeError::DecodeError`\n\n## Message\n\nBase64url decode failed: {0}\n"),
44        "AUTHS-E1204" => Some("# AUTHS-E1204\n\n**Crate:** `auths-keri`\n\n**Type:** `KeriDecodeError::InvalidLength`\n\n## Message\n\nInvalid key length: expected {expected} bytes, got {actual}\n"),
45
46        // --- auths-crypto (SshKeyError) ---
47        "AUTHS-E1301" => Some("# AUTHS-E1301\n\n**Crate:** `auths-crypto`\n\n**Type:** `SshKeyError::InvalidFormat`\n\n## Message\n\nMalformed or invalid OpenSSH public key: {0}\n\n## Suggestion\n\nCheck that the public key is a valid OpenSSH format\n"),
48        "AUTHS-E1302" => Some("# AUTHS-E1302\n\n**Crate:** `auths-crypto`\n\n**Type:** `SshKeyError::UnsupportedKeyType`\n\n## Message\n\nUnsupported key type: expected ssh-ed25519 or ecdsa-sha2-nistp256\n\n## Suggestion\n\nSupported key types: ssh-ed25519, ecdsa-sha2-nistp256\n"),
49
50        // --- auths-verifier (AttestationError) ---
51        "AUTHS-E2001" => Some("# AUTHS-E2001\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::IssuerSignatureFailed`\n\n## Message\n\nIssuer signature verification failed: {0}\n\n## Suggestion\n\nVerify the attestation was signed with the correct issuer key\n"),
52        "AUTHS-E2002" => Some("# AUTHS-E2002\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::DeviceSignatureFailed`\n\n## Message\n\nDevice signature verification failed: {0}\n\n## Suggestion\n\nVerify the device key matches the attestation\n"),
53        "AUTHS-E2003" => Some("# AUTHS-E2003\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::AttestationExpired`\n\n## Message\n\nAttestation expired on {at}\n\n## Suggestion\n\nRequest a new attestation from the issuer\n"),
54        "AUTHS-E2004" => Some("# AUTHS-E2004\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::AttestationRevoked`\n\n## Message\n\nAttestation revoked\n\n## Suggestion\n\nThis device has been revoked; contact the identity admin\n"),
55        "AUTHS-E2005" => Some("# AUTHS-E2005\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::TimestampInFuture`\n\n## Message\n\nAttestation timestamp {at} is in the future\n\n## Suggestion\n\nCheck system clock synchronization\n"),
56        "AUTHS-E2006" => Some("# AUTHS-E2006\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::MissingCapability`\n\n## Message\n\nMissing required capability: required {required:?}, available {available:?}\n\n## Suggestion\n\nRequest an attestation with the required capability\n"),
57        "AUTHS-E2007" => Some("# AUTHS-E2007\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::SigningError`\n\n## Message\n\nSigning failed: {0}\n\n## Suggestion\n\nThe cryptographic signing operation failed; verify key material is valid\n"),
58        "AUTHS-E2008" => Some("# AUTHS-E2008\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::DidResolutionError`\n\n## Message\n\nDID resolution failed: {0}\n\n## Suggestion\n\nCheck that the DID is valid and resolvable\n"),
59        "AUTHS-E2009" => Some("# AUTHS-E2009\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::SerializationError`\n\n## Message\n\nSerialization error: {0}\n\n## Suggestion\n\nFailed to serialize/deserialize attestation data; check JSON format\n"),
60        "AUTHS-E2010" => Some("# AUTHS-E2010\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::InputTooLarge`\n\n## Message\n\nInput too large: {0}\n\n## Suggestion\n\nReduce the size of the JSON input or split into smaller batches\n"),
61        "AUTHS-E2011" => Some("# AUTHS-E2011\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::InvalidInput`\n\n## Message\n\nInvalid input: {0}\n\n## Suggestion\n\nCheck the input parameters and ensure they match the expected format\n"),
62        "AUTHS-E2012" => Some("# AUTHS-E2012\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::CryptoError`\n\n## Message\n\nCrypto error: {0}\n\n## Suggestion\n\nA cryptographic operation failed; verify key material is valid\n"),
63        "AUTHS-E2013" => Some("# AUTHS-E2013\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::InternalError`\n\n## Message\n\nInternal error: {0}\n\n## Suggestion\n\nAn unexpected internal error occurred; please report this issue\n"),
64        "AUTHS-E2014" => Some("# AUTHS-E2014\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::OrgVerificationFailed`\n\n## Message\n\nOrganizational Attestation verification failed: {0}\n\n## Suggestion\n\nVerify organizational identity is properly configured\n"),
65        "AUTHS-E2015" => Some("# AUTHS-E2015\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::OrgAttestationExpired`\n\n## Message\n\nOrganizational Attestation expired\n\n## Suggestion\n\nRequest a new organizational attestation from the admin\n"),
66        "AUTHS-E2016" => Some("# AUTHS-E2016\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::OrgDidResolutionFailed`\n\n## Message\n\nOrganizational DID resolution failed: {0}\n\n## Suggestion\n\nCheck that the organization's DID is correctly configured\n"),
67        "AUTHS-E2017" => Some("# AUTHS-E2017\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::BundleExpired`\n\n## Message\n\nBundle is {age_secs}s old (max {max_secs}s). Refresh with: auths id export-bundle\n\n## Suggestion\n\nRe-export the bundle: auths id export-bundle --alias <ALIAS> --output bundle.json --max-age-secs <SECS>\n"),
68        "AUTHS-E2018" => Some("# AUTHS-E2018\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::AttestationTooOld`\n\n## Message\n\nAttestation is {age_secs}s old (max {max_secs}s)\n\n## Suggestion\n\nRequest a fresh attestation or increase the max_age threshold\n"),
69        "AUTHS-E2019" => Some("# AUTHS-E2019\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::CapabilityEscalation`\n\n## Message\n\nDelegated attestation escalates capability beyond its delegator\n"),
70        "AUTHS-E2020" => Some("# AUTHS-E2020\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::DelegationOutlivesParent`\n\n## Message\n\nDelegated attestation outlives its delegator\n"),
71        "AUTHS-E2021" => Some("# AUTHS-E2021\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::DelegatorRevoked`\n\n## Message\n\nDelegator attestation is revoked\n"),
72        "AUTHS-E2022" => Some("# AUTHS-E2022\n\n**Crate:** `auths-verifier`\n\n**Type:** `AttestationError::DelegatorUnresolved`\n\n## Message\n\nDelegator attestation could not be resolved\n\n## Suggestion\n\nRe-issue the delegated attestation within the delegator's capability and validity scope\n"),
73
74        // --- auths-verifier (CommitVerificationError) ---
75        "AUTHS-E2101" => Some("# AUTHS-E2101\n\n**Crate:** `auths-verifier`\n\n**Type:** `CommitVerificationError::UnsignedCommit`\n\n## Message\n\ncommit is unsigned\n\n## Suggestion\n\nThis commit has no Auths-Id/Auths-Device trailer. Run `auths init` so the prepare-commit-msg hook signs future commits, or backfill with `auths sign <ref>`.\n"),
76        "AUTHS-E2102" => Some("# AUTHS-E2102\n\n**Crate:** `auths-verifier`\n\n**Type:** `CommitVerificationError::GpgNotSupported`\n\n## Message\n\nGPG signatures are not verified by Auths — use did:keri trailers via `auths init`\n\n## Suggestion\n\nAuths verifies its own did:keri commit trailers, not GPG or SSH signatures. Run `auths init` to enable Auths signing.\n"),
77        "AUTHS-E2103" => Some("# AUTHS-E2103\n\n**Crate:** `auths-verifier`\n\n**Type:** `CommitVerificationError::SshSigParseFailed`\n\n## Message\n\nSSHSIG parse failed: {0}\n\n## Suggestion\n\nThe SSH signature could not be parsed; verify the commit was signed correctly\n"),
78        "AUTHS-E2104" => Some("# AUTHS-E2104\n\n**Crate:** `auths-verifier`\n\n**Type:** `CommitVerificationError::UnsupportedKeyType`\n\n## Message\n\nunsupported SSH key type: {found}\n\n## Suggestion\n\nUse an Ed25519 or ECDSA P-256 SSH key for signing\n"),
79        "AUTHS-E2105" => Some("# AUTHS-E2105\n\n**Crate:** `auths-verifier`\n\n**Type:** `CommitVerificationError::NamespaceMismatch`\n\n## Message\n\nnamespace mismatch: expected \\\"{expected}\\\", found \\\"{found}\\\"\n\n## Suggestion\n\nThe signature namespace doesn't match; ensure git config gpg.ssh.defaultKeyCommand is set correctly\n"),
80        "AUTHS-E2106" => Some("# AUTHS-E2106\n\n**Crate:** `auths-verifier`\n\n**Type:** `CommitVerificationError::HashAlgorithmUnsupported`\n\n## Message\n\nunsupported hash algorithm: {0}\n\n## Suggestion\n\nUse SHA-256 or SHA-512 hash algorithm for signing\n"),
81        "AUTHS-E2107" => Some("# AUTHS-E2107\n\n**Crate:** `auths-verifier`\n\n**Type:** `CommitVerificationError::SignatureInvalid`\n\n## Message\n\nsignature verification failed\n\n## Suggestion\n\nThe commit signature does not match the signed data; the commit may have been modified after signing\n"),
82        "AUTHS-E2108" => Some("# AUTHS-E2108\n\n**Crate:** `auths-verifier`\n\n**Type:** `CommitVerificationError::UnknownSigner`\n\n## Message\n\nsigner identity is not trusted (no matching pinned root)\n\n## Suggestion\n\nThe signer's identity is not trusted here. Pin it with `auths trust pin --did <did>`, or add it to .auths/roots.\n"),
83        "AUTHS-E2109" => Some("# AUTHS-E2109\n\n**Crate:** `auths-verifier`\n\n**Type:** `CommitVerificationError::CommitParseFailed`\n\n## Message\n\ncommit parse failed: {0}\n\n## Suggestion\n\nThe Git commit object is malformed; check repository integrity with `git fsck`\n"),
84
85        // --- auths-verifier (OrgBundleError) ---
86        "AUTHS-E2201" => Some("# AUTHS-E2201\n\n**Crate:** `auths-verifier`\n\n**Type:** `OrgBundleError::Integrity`\n\n## Message\n\nbundle integrity failure for '{id}': {reason}\n\n## Suggestion\n\nThe bundle was modified after it was produced; obtain a fresh, untampered bundle\n"),
87        "AUTHS-E2202" => Some("# AUTHS-E2202\n\n**Crate:** `auths-verifier`\n\n**Type:** `OrgBundleError::MissingMemberKel`\n\n## Message\n\nbundle is missing the KEL for delegated member '{member}'\n\n## Suggestion\n\nThe bundle is incomplete; re-produce it with `auths org bundle`\n"),
88        "AUTHS-E2203" => Some("# AUTHS-E2203\n\n**Crate:** `auths-verifier`\n\n**Type:** `OrgBundleError::MissingDelegatorSeal`\n\n## Message\n\nmember '{member}' has no delegation seal in the org KEL\n"),
89        "AUTHS-E2204" => Some("# AUTHS-E2204\n\n**Crate:** `auths-verifier`\n\n**Type:** `OrgBundleError::Canonicalize`\n\n## Message\n\ncanonicalization failed: {0}\n\n## Suggestion\n\nThe file is not a valid air-gapped org bundle; re-export it\n"),
90        "AUTHS-E2205" => Some("# AUTHS-E2205\n\n**Crate:** `auths-verifier`\n\n**Type:** `OrgBundleError::Parse`\n\n## Message\n\nparse failed: {0}\n"),
91        "AUTHS-E2206" => Some("# AUTHS-E2206\n\n**Crate:** `auths-verifier`\n\n**Type:** `OrgBundleError::RecordInvalid`\n\n## Message\n\noffboarding record invalid: {0}\n\n## Suggestion\n\nThe off-boarding record does not match the org KEL; obtain a fresh bundle from the org\n"),
92
93        // --- auths-verifier (EvidencePackError) ---
94        "AUTHS-E2301" => Some("# AUTHS-E2301\n\n**Crate:** `auths-verifier`\n\n**Type:** `EvidencePackError::Canonicalize`\n\n## Message\n\ncanonicalization failed: {0}\n\n## Suggestion\n\nThe file is not a valid evidence pack; re-export it with `auths compliance report`\n"),
95        "AUTHS-E2302" => Some("# AUTHS-E2302\n\n**Crate:** `auths-verifier`\n\n**Type:** `EvidencePackError::Decode`\n\n## Message\n\ndecode failed: {0}\n"),
96        "AUTHS-E2303" => Some("# AUTHS-E2303\n\n**Crate:** `auths-verifier`\n\n**Type:** `EvidencePackError::OfflineVerification`\n\n## Message\n\noffline verification failed: {0}\n\n## Suggestion\n\nThe pack failed offline verification; obtain a fresh, untampered pack from the org\n"),
97
98        // --- auths-core (AgentError) ---
99        "AUTHS-E3001" => Some("# AUTHS-E3001\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::KeyNotFound`\n\n## Message\n\nKey not found\n\n## Suggestion\n\nRun `auths key list` to see available keys\n"),
100        "AUTHS-E3002" => Some("# AUTHS-E3002\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::IncorrectPassphrase`\n\n## Message\n\nIncorrect passphrase\n\n## Suggestion\n\nCheck your passphrase and try again. Set AUTHS_PASSPHRASE for automation, or run `auths agent start` for session caching\n"),
101        "AUTHS-E3003" => Some("# AUTHS-E3003\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::MissingPassphrase`\n\n## Message\n\nMissing Passphrase\n\n## Suggestion\n\nProvide a passphrase with --passphrase or set AUTHS_PASSPHRASE\n"),
102        "AUTHS-E3004" => Some("# AUTHS-E3004\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::SecurityError`\n\n## Message\n\nSecurity error: {0}\n\n## Suggestion\n\nRun `auths doctor` to check system keychain access and security configuration\n"),
103        "AUTHS-E3005" => Some("# AUTHS-E3005\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::CryptoError`\n\n## Message\n\nCrypto error: {0}\n\n## Suggestion\n\nA cryptographic operation failed; check key material with `auths key list`\n"),
104        "AUTHS-E3006" => Some("# AUTHS-E3006\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::KeyDeserializationError`\n\n## Message\n\nKey deserialization error: {0}\n\n## Suggestion\n\nThe stored key is corrupted; re-import with `auths key import`\n"),
105        "AUTHS-E3007" => Some("# AUTHS-E3007\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::SigningFailed`\n\n## Message\n\nSigning failed: {0}\n\n## Suggestion\n\nThe signing operation failed; verify your key is accessible with `auths key list`\n"),
106        "AUTHS-E3008" => Some("# AUTHS-E3008\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::Proto`\n\n## Message\n\nProtocol error: {0}\n\n## Suggestion\n\nA protocol error occurred; check that both sides are running compatible versions\n"),
107        "AUTHS-E3009" => Some("# AUTHS-E3009\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::IO`\n\n## Message\n\nIO error: {0}\n\n## Suggestion\n\nCheck file permissions and that the filesystem is not read-only\n"),
108        "AUTHS-E3010" => Some("# AUTHS-E3010\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::GitError`\n\n## Message\n\ngit error: {0}\n\n## Suggestion\n\nEnsure you're in a Git repository\n"),
109        "AUTHS-E3011" => Some("# AUTHS-E3011\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::InvalidInput`\n\n## Message\n\nInvalid input: {0}\n\n## Suggestion\n\nCheck the command arguments and try again\n"),
110        "AUTHS-E3012" => Some("# AUTHS-E3012\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::MutexError`\n\n## Message\n\nMutex lock poisoned: {0}\n\n## Suggestion\n\nA concurrency error occurred; restart the operation\n"),
111        "AUTHS-E3013" => Some("# AUTHS-E3013\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::StorageError`\n\n## Message\n\nStorage error: {0}\n\n## Suggestion\n\nCheck file permissions and disk space\n"),
112        "AUTHS-E3014" => Some("# AUTHS-E3014\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::UserInputCancelled`\n\n## Message\n\nUser input cancelled\n\n## Suggestion\n\nRun the command again and provide the required input\n"),
113        "AUTHS-E3015" => Some("# AUTHS-E3015\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::BackendUnavailable`\n\n## Message\n\nKeychain backend unavailable: {backend} - {reason}\n\n## Suggestion\n\nRun `auths doctor` to diagnose keychain issues\n"),
114        "AUTHS-E3016" => Some("# AUTHS-E3016\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::StorageLocked`\n\n## Message\n\nStorage is locked, authentication required\n\n## Suggestion\n\nAuthenticate with your platform keychain\n"),
115        "AUTHS-E3017" => Some("# AUTHS-E3017\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::BackendInitFailed`\n\n## Message\n\nFailed to initialize keychain backend: {backend} - {error}\n\n## Suggestion\n\nRun `auths doctor` to diagnose keychain issues\n"),
116        "AUTHS-E3018" => Some("# AUTHS-E3018\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::CredentialTooLarge`\n\n## Message\n\nCredential too large for backend (max {max_bytes} bytes, got {actual_bytes})\n\n## Suggestion\n\nReduce the credential size or use file-based storage with AUTHS_KEYCHAIN_BACKEND=file\n"),
117        "AUTHS-E3019" => Some("# AUTHS-E3019\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::AgentLocked`\n\n## Message\n\nAgent is locked. Unlock with 'auths agent unlock' or restart the agent.\n\n## Suggestion\n\nRun `auths agent unlock` or restart with `auths agent start`\n"),
118        "AUTHS-E3020" => Some("# AUTHS-E3020\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::WeakPassphrase`\n\n## Message\n\nPassphrase too weak: {0}\n\n## Suggestion\n\nUse at least 12 characters with uppercase, lowercase, and a digit or symbol\n"),
119        "AUTHS-E3021" => Some("# AUTHS-E3021\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::HsmPinLocked`\n\n## Message\n\nHSM PIN is locked — reset required\n\n## Suggestion\n\nReset the HSM PIN using your HSM vendor's admin tools\n"),
120        "AUTHS-E3022" => Some("# AUTHS-E3022\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::HsmDeviceRemoved`\n\n## Message\n\nHSM device removed\n\n## Suggestion\n\nReconnect the HSM device and try again\n"),
121        "AUTHS-E3023" => Some("# AUTHS-E3023\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::HsmSessionExpired`\n\n## Message\n\nHSM session expired\n\n## Suggestion\n\nRetry the operation — a new session will be opened\n"),
122        "AUTHS-E3024" => Some("# AUTHS-E3024\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::HsmUnsupportedMechanism`\n\n## Message\n\nHSM does not support mechanism: {0}\n\n## Suggestion\n\nCheck that your HSM supports Ed25519 (CKM_EDDSA)\n"),
123        "AUTHS-E3025" => Some("# AUTHS-E3025\n\n**Crate:** `auths-core`\n\n**Type:** `AgentError::HardwareKeyNotExportable`\n\n## Message\n\nOperation '{operation}' requires a software-backed key; hardware-backed keys (e.g. Secure Enclave) cannot export raw material\n\n## Suggestion\n\nUse a software-backed keychain backend for this operation, or re-initialize your identity without Secure Enclave\n"),
124
125        // --- auths-core (TrustError) ---
126        "AUTHS-E3101" => Some("# AUTHS-E3101\n\n**Crate:** `auths-core`\n\n**Type:** `TrustError::Io`\n\n## Message\n\nI/O error: {0}\n\n## Suggestion\n\nCheck disk space and file permissions\n"),
127        "AUTHS-E3102" => Some("# AUTHS-E3102\n\n**Crate:** `auths-core`\n\n**Type:** `TrustError::InvalidData`\n\n## Message\n\n{0}\n\n## Suggestion\n\nThe trust store may be corrupted; delete and re-pin with `auths trust pin`\n"),
128        "AUTHS-E3103" => Some("# AUTHS-E3103\n\n**Crate:** `auths-core`\n\n**Type:** `TrustError::NotFound`\n\n## Message\n\nnot found: {0}\n\n## Suggestion\n\nRun `auths trust list` to see pinned identities\n"),
129        "AUTHS-E3104" => Some("# AUTHS-E3104\n\n**Crate:** `auths-core`\n\n**Type:** `TrustError::Serialization`\n\n## Message\n\nserialization error: {0}\n\n## Suggestion\n\nThe trust store data is corrupted; delete and re-pin with `auths trust pin`\n"),
130        "AUTHS-E3105" => Some("# AUTHS-E3105\n\n**Crate:** `auths-core`\n\n**Type:** `TrustError::AlreadyExists`\n\n## Message\n\nalready exists: {0}\n\n## Suggestion\n\nRun `auths trust list` to see existing entries\n"),
131        "AUTHS-E3106" => Some("# AUTHS-E3106\n\n**Crate:** `auths-core`\n\n**Type:** `TrustError::Lock`\n\n## Message\n\nlock acquisition failed: {0}\n\n## Suggestion\n\nCheck file permissions and try again\n"),
132        "AUTHS-E3107" => Some("# AUTHS-E3107\n\n**Crate:** `auths-core`\n\n**Type:** `TrustError::PolicyRejected`\n\n## Message\n\npolicy rejected: {0}\n\n## Suggestion\n\nRun `auths trust pin` to pin this identity\n"),
133
134        // --- auths-core (PairingError) ---
135        "AUTHS-E3201" => Some("# AUTHS-E3201\n\n**Crate:** `auths-core`\n\n**Type:** `PairingError::Protocol`\n\n## Message\n\n_(transparent — see inner error)_\n\n## Suggestion\n\nEnsure both devices are running compatible auths versions\n"),
136        "AUTHS-E3202" => Some("# AUTHS-E3202\n\n**Crate:** `auths-core`\n\n**Type:** `PairingError::QrCodeFailed`\n\n## Message\n\nQR code generation failed: {0}\n\n## Suggestion\n\nQR code generation failed; try relay-based pairing with `auths device pair --registry <url>` instead\n"),
137        "AUTHS-E3203" => Some("# AUTHS-E3203\n\n**Crate:** `auths-core`\n\n**Type:** `PairingError::RelayError`\n\n## Message\n\nRelay error: {0}\n\n## Suggestion\n\nCheck your internet connection\n"),
138        "AUTHS-E3204" => Some("# AUTHS-E3204\n\n**Crate:** `auths-core`\n\n**Type:** `PairingError::LocalServerError`\n\n## Message\n\nLocal server error: {0}\n\n## Suggestion\n\nThe local pairing server failed to start; check that the port is available\n"),
139        "AUTHS-E3205" => Some("# AUTHS-E3205\n\n**Crate:** `auths-core`\n\n**Type:** `PairingError::MdnsError`\n\n## Message\n\nmDNS error: {0}\n\n## Suggestion\n\nmDNS discovery failed; try relay-based pairing with `auths device pair --registry <url>` instead\n"),
140        "AUTHS-E3206" => Some("# AUTHS-E3206\n\n**Crate:** `auths-core`\n\n**Type:** `PairingError::NoPeerFound`\n\n## Message\n\nNo peer found on local network\n\n## Suggestion\n\nEnsure both devices are on the same network\n"),
141        "AUTHS-E3207" => Some("# AUTHS-E3207\n\n**Crate:** `auths-core`\n\n**Type:** `PairingError::LanTimeout`\n\n## Message\n\nLAN pairing timed out\n\n## Suggestion\n\nCheck your network and try again\n"),
142
143        // --- auths-core (CryptoError) ---
144        "AUTHS-E3301" => Some("# AUTHS-E3301\n\n**Crate:** `auths-core`\n\n**Type:** `CryptoError::SshKeyConstruction`\n\n## Message\n\nSSH key construction failed: {0}\n"),
145        "AUTHS-E3302" => Some("# AUTHS-E3302\n\n**Crate:** `auths-core`\n\n**Type:** `CryptoError::SigningFailed`\n\n## Message\n\nsigning failed: {0}\n"),
146        "AUTHS-E3303" => Some("# AUTHS-E3303\n\n**Crate:** `auths-core`\n\n**Type:** `CryptoError::PemEncoding`\n\n## Message\n\nPEM encoding failed: {0}\n"),
147        "AUTHS-E3304" => Some("# AUTHS-E3304\n\n**Crate:** `auths-core`\n\n**Type:** `CryptoError::InvalidSeedLength`\n\n## Message\n\ninvalid seed length: expected 32, got {0}\n\n## Suggestion\n\nEnsure the seed is exactly 32 bytes\n"),
148        "AUTHS-E3305" => Some("# AUTHS-E3305\n\n**Crate:** `auths-core`\n\n**Type:** `CryptoError::InvalidKeyFormat`\n\n## Message\n\ninvalid key format: {0}\n\n## Suggestion\n\nCheck that the key file is a valid Ed25519 key\n"),
149
150        // --- auths-keri (WitnessError) ---
151        "AUTHS-E3401" => Some("# AUTHS-E3401\n\n**Crate:** `auths-keri`\n\n**Type:** `WitnessError::Network`\n\n## Message\n\nnetwork error: {0}\n\n## Suggestion\n\nCheck your internet connection\n"),
152        "AUTHS-E3402" => Some("# AUTHS-E3402\n\n**Crate:** `auths-keri`\n\n**Type:** `WitnessError::Duplicity`\n\n## Message\n\nduplicity detected: {0}\n\n## Suggestion\n\nThis identity may be compromised — investigate immediately\n"),
153        "AUTHS-E3403" => Some("# AUTHS-E3403\n\n**Crate:** `auths-keri`\n\n**Type:** `WitnessError::Rejected`\n\n## Message\n\nevent rejected: {reason}\n"),
154        "AUTHS-E3404" => Some("# AUTHS-E3404\n\n**Crate:** `auths-keri`\n\n**Type:** `WitnessError::Timeout`\n\n## Message\n\ntimeout after {0}ms\n\n## Suggestion\n\nCheck witness endpoint availability and retry\n"),
155        "AUTHS-E3405" => Some("# AUTHS-E3405\n\n**Crate:** `auths-keri`\n\n**Type:** `WitnessError::InvalidSignature`\n\n## Message\n\ninvalid receipt signature from witness {witness_id}\n"),
156        "AUTHS-E3406" => Some("# AUTHS-E3406\n\n**Crate:** `auths-keri`\n\n**Type:** `WitnessError::InsufficientReceipts`\n\n## Message\n\ninsufficient receipts: got {got}, need {required}\n\n## Suggestion\n\nEnsure enough witnesses are online\n"),
157        "AUTHS-E3407" => Some("# AUTHS-E3407\n\n**Crate:** `auths-keri`\n\n**Type:** `WitnessError::SaidMismatch`\n\n## Message\n\nreceipt SAID mismatch: expected {expected}, got {got}\n"),
158        "AUTHS-E3408" => Some("# AUTHS-E3408\n\n**Crate:** `auths-keri`\n\n**Type:** `WitnessError::Storage`\n\n## Message\n\nstorage error: {0}\n"),
159        "AUTHS-E3409" => Some("# AUTHS-E3409\n\n**Crate:** `auths-keri`\n\n**Type:** `WitnessError::Serialization`\n\n## Message\n\nserialization error: {0}\n"),
160
161        // --- auths-core (StorageError) ---
162        "AUTHS-E3501" => Some("# AUTHS-E3501\n\n**Crate:** `auths-core`\n\n**Type:** `StorageError::NotFound`\n\n## Message\n\nnot found: {path}\n"),
163        "AUTHS-E3502" => Some("# AUTHS-E3502\n\n**Crate:** `auths-core`\n\n**Type:** `StorageError::AlreadyExists`\n\n## Message\n\nalready exists: {path}\n"),
164        "AUTHS-E3503" => Some("# AUTHS-E3503\n\n**Crate:** `auths-core`\n\n**Type:** `StorageError::CasConflict`\n\n## Message\n\ncompare-and-swap conflict\n\n## Suggestion\n\nRetry the operation — another process made a concurrent change\n"),
165        "AUTHS-E3504" => Some("# AUTHS-E3504\n\n**Crate:** `auths-core`\n\n**Type:** `StorageError::Io`\n\n## Message\n\nstorage I/O error: {0}\n\n## Suggestion\n\nCheck file permissions and disk space\n"),
166        "AUTHS-E3505" => Some("# AUTHS-E3505\n\n**Crate:** `auths-core`\n\n**Type:** `StorageError::Internal`\n\n## Message\n\ninternal storage error: {0}\n"),
167
168        // --- auths-core (NetworkError) ---
169        "AUTHS-E3601" => Some("# AUTHS-E3601\n\n**Crate:** `auths-core`\n\n**Type:** `NetworkError::Unreachable`\n\n## Message\n\nendpoint unreachable: {endpoint}\n\n## Suggestion\n\nCheck your internet connection\n"),
170        "AUTHS-E3602" => Some("# AUTHS-E3602\n\n**Crate:** `auths-core`\n\n**Type:** `NetworkError::Timeout`\n\n## Message\n\nrequest timed out: {endpoint}\n\n## Suggestion\n\nThe server may be overloaded — retry later\n"),
171        "AUTHS-E3603" => Some("# AUTHS-E3603\n\n**Crate:** `auths-core`\n\n**Type:** `NetworkError::NotFound`\n\n## Message\n\nresource not found: {resource}\n\n## Suggestion\n\nThe requested resource was not found on the server; verify the URL or identifier\n"),
172        "AUTHS-E3604" => Some("# AUTHS-E3604\n\n**Crate:** `auths-core`\n\n**Type:** `NetworkError::Unauthorized`\n\n## Message\n\nunauthorized\n\n## Suggestion\n\nCheck your authentication credentials\n"),
173        "AUTHS-E3605" => Some("# AUTHS-E3605\n\n**Crate:** `auths-core`\n\n**Type:** `NetworkError::InvalidResponse`\n\n## Message\n\ninvalid response: {detail}\n\n## Suggestion\n\nThe server returned an unexpected response; check server compatibility\n"),
174        "AUTHS-E3606" => Some("# AUTHS-E3606\n\n**Crate:** `auths-core`\n\n**Type:** `NetworkError::Internal`\n\n## Message\n\ninternal network error: {0}\n\n## Suggestion\n\nThe server encountered an internal error; retry later or contact the server administrator\n"),
175
176        // --- auths-core (ResolutionError) ---
177        "AUTHS-E3701" => Some("# AUTHS-E3701\n\n**Crate:** `auths-core`\n\n**Type:** `ResolutionError::DidNotFound`\n\n## Message\n\nDID not found: {did}\n\n## Suggestion\n\nVerify the DID is correct and the identity exists\n"),
178        "AUTHS-E3702" => Some("# AUTHS-E3702\n\n**Crate:** `auths-core`\n\n**Type:** `ResolutionError::InvalidDid`\n\n## Message\n\ninvalid DID {did}: {reason}\n\n## Suggestion\n\nCheck the DID format (e.g., did:key:z6Mk... or did:keri:E...)\n"),
179        "AUTHS-E3703" => Some("# AUTHS-E3703\n\n**Crate:** `auths-core`\n\n**Type:** `ResolutionError::KeyRevoked`\n\n## Message\n\nkey revoked for DID: {did}\n\n## Suggestion\n\nThis key has been revoked — contact the identity owner\n"),
180        "AUTHS-E3704" => Some("# AUTHS-E3704\n\n**Crate:** `auths-core`\n\n**Type:** `ResolutionError::Network`\n\n## Message\n\nnetwork error: {0}\n\n## Suggestion\n\nCheck your internet connection\n"),
181
182        // --- auths-core (PlatformError) ---
183        "AUTHS-E3801" => Some("# AUTHS-E3801\n\n**Crate:** `auths-core`\n\n**Type:** `PlatformError::AuthorizationPending`\n\n## Message\n\nOAuth authorization pending\n\n## Suggestion\n\nComplete the authorization on the linked device, then the CLI will continue automatically\n"),
184        "AUTHS-E3802" => Some("# AUTHS-E3802\n\n**Crate:** `auths-core`\n\n**Type:** `PlatformError::SlowDown`\n\n## Message\n\nOAuth slow down\n\n## Suggestion\n\nThe authorization server is rate-limiting; the CLI will retry automatically\n"),
185        "AUTHS-E3803" => Some("# AUTHS-E3803\n\n**Crate:** `auths-core`\n\n**Type:** `PlatformError::AccessDenied`\n\n## Message\n\nOAuth access denied\n\n## Suggestion\n\nRe-run the command and approve the authorization request\n"),
186        "AUTHS-E3804" => Some("# AUTHS-E3804\n\n**Crate:** `auths-core`\n\n**Type:** `PlatformError::ExpiredToken`\n\n## Message\n\ndevice code expired\n\n## Suggestion\n\nThe device code expired — restart the flow\n"),
187        "AUTHS-E3805" => Some("# AUTHS-E3805\n\n**Crate:** `auths-core`\n\n**Type:** `PlatformError::Network`\n\n## Message\n\nnetwork error: {0}\n\n## Suggestion\n\nCheck your internet connection\n"),
188        "AUTHS-E3806" => Some("# AUTHS-E3806\n\n**Crate:** `auths-core`\n\n**Type:** `PlatformError::Platform`\n\n## Message\n\nplatform error: {message}\n\n## Suggestion\n\nA platform-specific error occurred; run `auths doctor` to diagnose\n"),
189
190        // --- auths-core (SshAgentError) ---
191        "AUTHS-E3901" => Some("# AUTHS-E3901\n\n**Crate:** `auths-core`\n\n**Type:** `SshAgentError::CommandFailed`\n\n## Message\n\nssh-add command failed: {0}\n\n## Suggestion\n\nCheck that the key file exists and has correct permissions\n"),
192        "AUTHS-E3902" => Some("# AUTHS-E3902\n\n**Crate:** `auths-core`\n\n**Type:** `SshAgentError::NotAvailable`\n\n## Message\n\nSSH agent not available: {0}\n\n## Suggestion\n\nStart the SSH agent: eval $(ssh-agent -s)\n"),
193        "AUTHS-E3903" => Some("# AUTHS-E3903\n\n**Crate:** `auths-core`\n\n**Type:** `SshAgentError::IoError`\n\n## Message\n\nI/O error: {0}\n\n## Suggestion\n\nCheck file permissions\n"),
194
195        // --- auths-core (ConfigStoreError) ---
196        "AUTHS-E3951" => Some("# AUTHS-E3951\n\n**Crate:** `auths-core`\n\n**Type:** `ConfigStoreError::Read`\n\n## Message\n\nfailed to read config from {path}\n\n## Suggestion\n\nCheck that ~/.auths/config.toml exists and is readable\n"),
197        "AUTHS-E3952" => Some("# AUTHS-E3952\n\n**Crate:** `auths-core`\n\n**Type:** `ConfigStoreError::Write`\n\n## Message\n\nfailed to write config to {path}\n\n## Suggestion\n\nCheck file permissions for ~/.auths/config.toml\n"),
198
199        // --- auths-core (NamespaceVerifyError) ---
200        "AUTHS-E3961" => Some("# AUTHS-E3961\n\n**Crate:** `auths-core`\n\n**Type:** `NamespaceVerifyError::UnsupportedEcosystem`\n\n## Message\n\nunsupported ecosystem: {ecosystem}\n\n## Suggestion\n\nSupported ecosystems: npm, pypi, cargo, docker, go, maven, nuget\n"),
201        "AUTHS-E3962" => Some("# AUTHS-E3962\n\n**Crate:** `auths-core`\n\n**Type:** `NamespaceVerifyError::PackageNotFound`\n\n## Message\n\npackage '{package_name}' not found in {ecosystem}\n\n## Suggestion\n\nCheck the package name and ensure it exists on the registry\n"),
202        "AUTHS-E3963" => Some("# AUTHS-E3963\n\n**Crate:** `auths-core`\n\n**Type:** `NamespaceVerifyError::OwnershipNotConfirmed`\n\n## Message\n\nownership of '{package_name}' on {ecosystem} not confirmed for the given identity\n\n## Suggestion\n\nEnsure you are listed as an owner/collaborator on the upstream registry\n"),
203        "AUTHS-E3964" => Some("# AUTHS-E3964\n\n**Crate:** `auths-core`\n\n**Type:** `NamespaceVerifyError::ChallengeExpired`\n\n## Message\n\nverification challenge expired\n\n## Suggestion\n\nStart a new verification challenge\n"),
204        "AUTHS-E3965" => Some("# AUTHS-E3965\n\n**Crate:** `auths-core`\n\n**Type:** `NamespaceVerifyError::InvalidToken`\n\n## Message\n\ninvalid verification token: {reason}\n\n## Suggestion\n\nTokens must start with 'auths-verify-' followed by a hex string\n"),
205        "AUTHS-E3966" => Some("# AUTHS-E3966\n\n**Crate:** `auths-core`\n\n**Type:** `NamespaceVerifyError::InvalidPackageName`\n\n## Message\n\ninvalid package name '{name}': {reason}\n\n## Suggestion\n\nPackage names cannot be empty, contain control characters, or use path traversal\n"),
206        "AUTHS-E3967" => Some("# AUTHS-E3967\n\n**Crate:** `auths-core`\n\n**Type:** `NamespaceVerifyError::NetworkError`\n\n## Message\n\nverification network error: {message}\n\n## Suggestion\n\nCheck your internet connection and try again\n"),
207        "AUTHS-E3968" => Some("# AUTHS-E3968\n\n**Crate:** `auths-core`\n\n**Type:** `NamespaceVerifyError::RateLimited`\n\n## Message\n\nrate limited by {ecosystem} registry\n\n## Suggestion\n\nWait a moment and retry the verification\n"),
208
209        // --- auths-id (FreezeError) ---
210        "AUTHS-E4001" => Some("# AUTHS-E4001\n\n**Crate:** `auths-id`\n\n**Type:** `FreezeError::Io`\n\n## Message\n\n_(transparent — see inner error)_\n\n## Suggestion\n\nCheck file permissions and disk space\n"),
211        "AUTHS-E4002" => Some("# AUTHS-E4002\n\n**Crate:** `auths-id`\n\n**Type:** `FreezeError::Deserialization`\n\n## Message\n\nfailed to parse freeze state: {0}\n\n## Suggestion\n\nThe freeze state file may be corrupted; try deleting it\n"),
212        "AUTHS-E4003" => Some("# AUTHS-E4003\n\n**Crate:** `auths-id`\n\n**Type:** `FreezeError::InvalidDuration`\n\n## Message\n\ninvalid duration format: {0}\n\n## Suggestion\n\nUse a valid duration format (e.g. '30m', '2h', '7d')\n"),
213        "AUTHS-E4004" => Some("# AUTHS-E4004\n\n**Crate:** `auths-id`\n\n**Type:** `FreezeError::ZeroDuration`\n\n## Message\n\nduration must be greater than zero\n\n## Suggestion\n\nSpecify a positive duration\n"),
214
215        // --- auths-id (StorageError) ---
216        "AUTHS-E4101" => Some("# AUTHS-E4101\n\n**Crate:** `auths-id`\n\n**Type:** `StorageError::Git`\n\n## Message\n\n_(transparent — see inner error)_\n\n## Suggestion\n\nCheck that the Git repository is not corrupted\n"),
217        "AUTHS-E4102" => Some("# AUTHS-E4102\n\n**Crate:** `auths-id`\n\n**Type:** `StorageError::Serialization`\n\n## Message\n\nserialization error: {0}\n\n## Suggestion\n\nFailed to serialize storage data; this may indicate a version mismatch\n"),
218        "AUTHS-E4103" => Some("# AUTHS-E4103\n\n**Crate:** `auths-id`\n\n**Type:** `StorageError::Io`\n\n## Message\n\nI/O error: {0}\n\n## Suggestion\n\nCheck file permissions and disk space\n"),
219        "AUTHS-E4104" => Some("# AUTHS-E4104\n\n**Crate:** `auths-id`\n\n**Type:** `StorageError::NotFound`\n\n## Message\n\nnot found: {0}\n\n## Suggestion\n\nVerify the identity or resource exists\n"),
220        "AUTHS-E4105" => Some("# AUTHS-E4105\n\n**Crate:** `auths-id`\n\n**Type:** `StorageError::InvalidData`\n\n## Message\n\n{0}\n\n## Suggestion\n\nThe stored data may be corrupted; try re-initializing\n"),
221        "AUTHS-E4106" => Some("# AUTHS-E4106\n\n**Crate:** `auths-id`\n\n**Type:** `StorageError::SchemaValidation`\n\n## Message\n\nschema validation failed: {0}\n\n## Suggestion\n\nEnsure data matches the expected schema version\n"),
222        "AUTHS-E4107" => Some("# AUTHS-E4107\n\n**Crate:** `auths-id`\n\n**Type:** `StorageError::Index`\n\n## Message\n\nindex error: {0}\n\n## Suggestion\n\nTry rebuilding the index\n"),
223
224        // --- auths-id (InitError) ---
225        "AUTHS-E4201" => Some("# AUTHS-E4201\n\n**Crate:** `auths-id`\n\n**Type:** `InitError::Git`\n\n## Message\n\n_(transparent — see inner error)_\n\n## Suggestion\n\nCheck that the Git repository is accessible\n"),
226        "AUTHS-E4202" => Some("# AUTHS-E4202\n\n**Crate:** `auths-id`\n\n**Type:** `InitError::Keri`\n\n## Message\n\nKERI operation failed: {0}\n\n## Suggestion\n\nKERI event processing failed; check identity state\n"),
227        "AUTHS-E4203" => Some("# AUTHS-E4203\n\n**Crate:** `auths-id`\n\n**Type:** `InitError::Key`\n\n## Message\n\nkey operation failed: {0}\n\n## Suggestion\n\nCheck keychain access and passphrase. Headless/CI (no Touch ID): set AUTHS_KEYCHAIN_BACKEND=file AUTHS_KEYCHAIN_FILE=<path> AUTHS_PASSPHRASE=<pass>, or run `auths init --profile ci`.\n"),
228        "AUTHS-E4204" => Some("# AUTHS-E4204\n\n**Crate:** `auths-id`\n\n**Type:** `InitError::InvalidData`\n\n## Message\n\n{0}\n\n## Suggestion\n\nIdentity data is malformed; try re-initializing with `auths init`\n"),
229        "AUTHS-E4205" => Some("# AUTHS-E4205\n\n**Crate:** `auths-id`\n\n**Type:** `InitError::Storage`\n\n## Message\n\nstorage operation failed: {0}\n\n## Suggestion\n\nCheck storage backend connectivity\n"),
230        "AUTHS-E4206" => Some("# AUTHS-E4206\n\n**Crate:** `auths-id`\n\n**Type:** `InitError::Registry`\n\n## Message\n\nregistry error: {0}\n\n## Suggestion\n\nCheck registry backend configuration\n"),
231        "AUTHS-E4207" => Some("# AUTHS-E4207\n\n**Crate:** `auths-id`\n\n**Type:** `InitError::Crypto`\n\n## Message\n\ncrypto operation failed: {0}\n\n## Suggestion\n\nA cryptographic operation during initialization failed; check your keychain access\n"),
232        "AUTHS-E4208" => Some("# AUTHS-E4208\n\n**Crate:** `auths-id`\n\n**Type:** `InitError::Identity`\n\n## Message\n\nidentity error: {0}\n\n## Suggestion\n\nIdentity initialization failed; check storage and keychain configuration\n"),
233        "AUTHS-E4209" => Some("# AUTHS-E4209\n\n**Crate:** `auths-id`\n\n**Type:** `InitError::Witness`\n\n## Message\n\nwitness receipting failed: {0}\n\n## Suggestion\n\nToo few of the identity's designated witnesses returned a valid receipt; check witness connectivity and the configured threshold\n"),
234
235        // --- auths-id (IdentityError) ---
236        "AUTHS-E4401" => Some("# AUTHS-E4401\n\n**Crate:** `auths-id`\n\n**Type:** `IdentityError::Keri`\n\n## Message\n\nKERI error: {0}\n\n## Suggestion\n\nKERI operation failed; check identity state\n"),
237        "AUTHS-E4402" => Some("# AUTHS-E4402\n\n**Crate:** `auths-id`\n\n**Type:** `IdentityError::Pkcs8EncodeError`\n\n## Message\n\nPKCS#8 encoding error: {0}\n"),
238        "AUTHS-E4403" => Some("# AUTHS-E4403\n\n**Crate:** `auths-id`\n\n**Type:** `IdentityError::Pkcs8DecodeError`\n\n## Message\n\nPKCS#8 decoding error: {0}\n\n## Suggestion\n\nThe key may be in an unsupported format\n"),
239        "AUTHS-E4404" => Some("# AUTHS-E4404\n\n**Crate:** `auths-id`\n\n**Type:** `IdentityError::EmptyPassphrase`\n\n## Message\n\nPassphrase required\n\n## Suggestion\n\nProvide a non-empty passphrase\n"),
240        "AUTHS-E4405" => Some("# AUTHS-E4405\n\n**Crate:** `auths-id`\n\n**Type:** `IdentityError::InvalidKeyLength`\n\n## Message\n\nInvalid key length: expected 32, got {0}\n\n## Suggestion\n\nExpected a 32-byte Ed25519 key\n"),
241        "AUTHS-E4406" => Some("# AUTHS-E4406\n\n**Crate:** `auths-id`\n\n**Type:** `IdentityError::KeyStorage`\n\n## Message\n\nKey storage error: {0}\n\n## Suggestion\n\nCheck keychain permissions\n"),
242        "AUTHS-E4407" => Some("# AUTHS-E4407\n\n**Crate:** `auths-id`\n\n**Type:** `IdentityError::KeyRetrieval`\n\n## Message\n\nKey retrieval error: {0}\n\n## Suggestion\n\nCheck that the key alias exists in the keychain\n"),
243        "AUTHS-E4408" => Some("# AUTHS-E4408\n\n**Crate:** `auths-id`\n\n**Type:** `IdentityError::RingError`\n\n## Message\n\nRing crypto error: {0}\n"),
244
245        // --- auths-id (StorageError) ---
246        "AUTHS-E4409" => Some("# AUTHS-E4409\n\n**Crate:** `auths-id`\n\n**Type:** `StorageError::NotFound`\n\n## Message\n\n_(transparent — see inner error)_\n\n## Suggestion\n\nVerify the storage path exists and is initialized\n"),
247        "AUTHS-E4410" => Some("# AUTHS-E4410\n\n**Crate:** `auths-id`\n\n**Type:** `StorageError::CasConflict`\n\n## Message\n\n_(transparent — see inner error)_\n\n## Suggestion\n\nA concurrent modification was detected; retry the operation\n"),
248        "AUTHS-E4411" => Some("# AUTHS-E4411\n\n**Crate:** `auths-id`\n\n**Type:** `StorageError::Io`\n\n## Message\n\n_(transparent — see inner error)_\n\n## Suggestion\n\nCheck file permissions, disk space, and storage backend connectivity\n"),
249
250        // --- auths-id (KelError) ---
251        "AUTHS-E4601" => Some("# AUTHS-E4601\n\n**Crate:** `auths-id`\n\n**Type:** `KelError::Git`\n\n## Message\n\nGit error: {0}\n\n## Suggestion\n\nCheck that the Git repository is accessible and not corrupted\n"),
252        "AUTHS-E4602" => Some("# AUTHS-E4602\n\n**Crate:** `auths-id`\n\n**Type:** `KelError::Serialization`\n\n## Message\n\nSerialization error: {0}\n"),
253        "AUTHS-E4603" => Some("# AUTHS-E4603\n\n**Crate:** `auths-id`\n\n**Type:** `KelError::NotFound`\n\n## Message\n\nKEL not found for prefix: {0}\n\n## Suggestion\n\nInitialize the identity first with 'auths init'\n"),
254        "AUTHS-E4604" => Some("# AUTHS-E4604\n\n**Crate:** `auths-id`\n\n**Type:** `KelError::InvalidOperation`\n\n## Message\n\nInvalid operation: {0}\n"),
255        "AUTHS-E4605" => Some("# AUTHS-E4605\n\n**Crate:** `auths-id`\n\n**Type:** `KelError::InvalidData`\n\n## Message\n\nInvalid data: {0}\n\n## Suggestion\n\nThe KEL data may be corrupted; try re-syncing\n"),
256        "AUTHS-E4606" => Some("# AUTHS-E4606\n\n**Crate:** `auths-id`\n\n**Type:** `KelError::ChainIntegrity`\n\n## Message\n\nChain integrity error: {0}\n\n## Suggestion\n\nThe KEL has non-linear history; this indicates tampering\n"),
257        "AUTHS-E4607" => Some("# AUTHS-E4607\n\n**Crate:** `auths-id`\n\n**Type:** `KelError::ValidationFailed`\n\n## Message\n\nValidation failed: {0}\n"),
258
259        // --- auths-id (ResolveError) ---
260        "AUTHS-E4801" => Some("# AUTHS-E4801\n\n**Crate:** `auths-id`\n\n**Type:** `ResolveError::InvalidFormat`\n\n## Message\n\nInvalid DID format: {0}\n\n## Suggestion\n\nUse the format 'did:keri:E<prefix>'\n"),
261        "AUTHS-E4802" => Some("# AUTHS-E4802\n\n**Crate:** `auths-id`\n\n**Type:** `ResolveError::NotFound`\n\n## Message\n\nKEL not found for prefix: {0}\n\n## Suggestion\n\nThe identity does not exist; check the DID prefix\n"),
262        "AUTHS-E4803" => Some("# AUTHS-E4803\n\n**Crate:** `auths-id`\n\n**Type:** `ResolveError::Kel`\n\n## Message\n\nKEL error: {0}\n"),
263        "AUTHS-E4804" => Some("# AUTHS-E4804\n\n**Crate:** `auths-id`\n\n**Type:** `ResolveError::Validation`\n\n## Message\n\nValidation error: {0}\n"),
264        "AUTHS-E4805" => Some("# AUTHS-E4805\n\n**Crate:** `auths-id`\n\n**Type:** `ResolveError::InvalidKeyEncoding`\n\n## Message\n\nInvalid key encoding: {0}\n"),
265        "AUTHS-E4806" => Some("# AUTHS-E4806\n\n**Crate:** `auths-id`\n\n**Type:** `ResolveError::NoCurrentKey`\n\n## Message\n\nNo current key in identity\n\n## Suggestion\n\nThe identity has no active key; it may be abandoned\n"),
266        "AUTHS-E4807" => Some("# AUTHS-E4807\n\n**Crate:** `auths-id`\n\n**Type:** `ResolveError::UnknownKeyType`\n\n## Message\n\nUnknown key type: {0}\n\n## Suggestion\n\nOnly Ed25519 keys (D prefix) are currently supported\n"),
267
268        // --- auths-id (RotationError) ---
269        "AUTHS-E4821" => Some("# AUTHS-E4821\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::Kel`\n\n## Message\n\nKEL error: {0}\n"),
270        "AUTHS-E4822" => Some("# AUTHS-E4822\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::Validation`\n\n## Message\n\nValidation error: {0}\n"),
271        "AUTHS-E4823" => Some("# AUTHS-E4823\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::KeyGeneration`\n\n## Message\n\nKey generation failed: {0}\n"),
272        "AUTHS-E4824" => Some("# AUTHS-E4824\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::InvalidKey`\n\n## Message\n\nInvalid key: {0}\n"),
273        "AUTHS-E4825" => Some("# AUTHS-E4825\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::CommitmentMismatch`\n\n## Message\n\nKey commitment mismatch\n\n## Suggestion\n\nThe provided key does not match the pre-committed next key. Use the key that was generated during initialization or the last rotation.\n"),
274        "AUTHS-E4826" => Some("# AUTHS-E4826\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::IdentityAbandoned`\n\n## Message\n\nIdentity is abandoned (empty next commitment)\n\n## Suggestion\n\nThis identity has been permanently abandoned. Create a new identity with 'auths init'.\n"),
275        "AUTHS-E4827" => Some("# AUTHS-E4827\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::Serialization`\n\n## Message\n\nSerialization error: {0}\n"),
276        "AUTHS-E4828" => Some("# AUTHS-E4828\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::Storage`\n\n## Message\n\nStorage error: {0}\n"),
277        "AUTHS-E4829" => Some("# AUTHS-E4829\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::RotationFailed`\n\n## Message\n\nRotation failed: {0}\n"),
278        "AUTHS-E4830" => Some("# AUTHS-E4830\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::KeyNotFound`\n\n## Message\n\nKey not found: {0}\n"),
279        "AUTHS-E4831" => Some("# AUTHS-E4831\n\n**Crate:** `auths-id`\n\n**Type:** `RotationError::KeyDecryptionFailed`\n\n## Message\n\nKey decryption failed: {0}\n"),
280
281        // --- auths-id (TenantIdError) ---
282        "AUTHS-E4851" => Some("# AUTHS-E4851\n\n**Crate:** `auths-id`\n\n**Type:** `TenantIdError::InvalidLength`\n\n## Message\n\nmust be 1–64 characters (got {0})\n\n## Suggestion\n\nTenant ID must be between 1 and 64 characters\n"),
283        "AUTHS-E4852" => Some("# AUTHS-E4852\n\n**Crate:** `auths-id`\n\n**Type:** `TenantIdError::InvalidCharacter`\n\n## Message\n\ncontains disallowed character {0:?} (only [a-z0-9_-] allowed)\n\n## Suggestion\n\nOnly lowercase letters, digits, hyphens, and underscores are allowed\n"),
284        "AUTHS-E4853" => Some("# AUTHS-E4853\n\n**Crate:** `auths-id`\n\n**Type:** `TenantIdError::Reserved`\n\n## Message\n\n'{0}' is reserved\n\n## Suggestion\n\nChoose a different tenant ID; this name is reserved\n"),
285
286        // --- auths-id (RegistryError) ---
287        "AUTHS-E4861" => Some("# AUTHS-E4861\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::Storage`\n\n## Message\n\nStorage error: {0}\n\n## Suggestion\n\nCheck storage backend connectivity\n"),
288        "AUTHS-E4862" => Some("# AUTHS-E4862\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::InvalidPrefix`\n\n## Message\n\nInvalid prefix '{prefix}': {reason}\n\n## Suggestion\n\nKERI prefixes must start with 'E' (Blake3 SAID)\n"),
289        "AUTHS-E4863" => Some("# AUTHS-E4863\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::InvalidDeviceDid`\n\n## Message\n\nInvalid device DID '{did}': {reason}\n\n## Suggestion\n\nDevice DIDs must be in 'did:key:z...' format\n"),
290        "AUTHS-E4864" => Some("# AUTHS-E4864\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::EventExists`\n\n## Message\n\nEvent already exists: {prefix} seq {seq}\n\n## Suggestion\n\nThis event has already been appended to the KEL\n"),
291        "AUTHS-E4865" => Some("# AUTHS-E4865\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::SequenceGap`\n\n## Message\n\nSequence gap for {prefix}: expected {expected}, got {got}\n\n## Suggestion\n\nEvents must be appended in strict sequence order\n"),
292        "AUTHS-E4866" => Some("# AUTHS-E4866\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::NotFound`\n\n## Message\n\nNot found: {entity_type} '{id}'\n"),
293        "AUTHS-E4867" => Some("# AUTHS-E4867\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::Serialization`\n\n## Message\n\nSerialization error: {0}\n"),
294        "AUTHS-E4868" => Some("# AUTHS-E4868\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::ConcurrentModification`\n\n## Message\n\nConcurrent modification: {0}\n\n## Suggestion\n\nRetry the operation; another process modified the registry\n"),
295        "AUTHS-E4869" => Some("# AUTHS-E4869\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::SaidMismatch`\n\n## Message\n\nSAID mismatch: expected {expected}, got {actual}\n\n## Suggestion\n\nThe event content does not match its declared SAID\n"),
296        "AUTHS-E4870" => Some("# AUTHS-E4870\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::InvalidEvent`\n\n## Message\n\nInvalid event: {reason}\n"),
297        "AUTHS-E4871" => Some("# AUTHS-E4871\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::Io`\n\n## Message\n\nI/O error: {0}\n\n## Suggestion\n\nCheck file permissions and disk space\n"),
298        "AUTHS-E4872" => Some("# AUTHS-E4872\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::Internal`\n\n## Message\n\nInternal error: {0}\n"),
299        "AUTHS-E4873" => Some("# AUTHS-E4873\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::InvalidTenantId`\n\n## Message\n\ninvalid tenant ID '{tenant_id}': {kind}\n"),
300        "AUTHS-E4874" => Some("# AUTHS-E4874\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::Attestation`\n\n## Message\n\nAttestation error: {0}\n"),
301        "AUTHS-E4875" => Some("# AUTHS-E4875\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::StaleAttestation`\n\n## Message\n\nStale attestation: {0}\n\n## Suggestion\n\nThe attestation has been superseded by a newer version\n"),
302        "AUTHS-E4876" => Some("# AUTHS-E4876\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::NotImplemented`\n\n## Message\n\nNot implemented: {method}\n\n## Suggestion\n\nThis operation is not supported by the current backend\n"),
303        "AUTHS-E4877" => Some("# AUTHS-E4877\n\n**Crate:** `auths-id`\n\n**Type:** `RegistryError::BatchValidationFailed`\n\n## Message\n\nBatch validation failed at index {index}: {source}\n"),
304
305        // --- auths-id (InceptionError) ---
306        "AUTHS-E4901" => Some("# AUTHS-E4901\n\n**Crate:** `auths-id`\n\n**Type:** `InceptionError::KeyGeneration`\n\n## Message\n\nKey generation failed: {0}\n"),
307        "AUTHS-E4902" => Some("# AUTHS-E4902\n\n**Crate:** `auths-id`\n\n**Type:** `InceptionError::Kel`\n\n## Message\n\nKEL error: {0}\n\n## Suggestion\n\nCheck the KEL state; a KEL may already exist for this prefix\n"),
308        "AUTHS-E4903" => Some("# AUTHS-E4903\n\n**Crate:** `auths-id`\n\n**Type:** `InceptionError::Storage`\n\n## Message\n\nStorage error: {0}\n\n## Suggestion\n\nCheck storage backend connectivity\n"),
309        "AUTHS-E4904" => Some("# AUTHS-E4904\n\n**Crate:** `auths-id`\n\n**Type:** `InceptionError::Validation`\n\n## Message\n\nValidation error: {0}\n"),
310        "AUTHS-E4905" => Some("# AUTHS-E4905\n\n**Crate:** `auths-id`\n\n**Type:** `InceptionError::Serialization`\n\n## Message\n\nSerialization error: {0}\n"),
311        "AUTHS-E4906" => Some("# AUTHS-E4906\n\n**Crate:** `auths-id`\n\n**Type:** `InceptionError::InvalidThreshold`\n\n## Message\n\nInvalid threshold {threshold} for key_count={key_count}: {reason}\n\n## Suggestion\n\nEnsure the threshold count does not exceed the number of keys, and that weighted clauses have one weight per key summing to at least 1\n"),
312
313        // --- auths-id (IncrementalError) ---
314        "AUTHS-E4951" => Some("# AUTHS-E4951\n\n**Crate:** `auths-id`\n\n**Type:** `IncrementalError::Kel`\n\n## Message\n\nKEL error: {0}\n"),
315        "AUTHS-E4952" => Some("# AUTHS-E4952\n\n**Crate:** `auths-id`\n\n**Type:** `IncrementalError::ChainContinuity`\n\n## Message\n\nChain continuity error: expected previous SAID {expected}, got {actual}\n\n## Suggestion\n\nThe KEL chain is broken; clear the cache and retry\n"),
316        "AUTHS-E4953" => Some("# AUTHS-E4953\n\n**Crate:** `auths-id`\n\n**Type:** `IncrementalError::SequenceError`\n\n## Message\n\nSequence error: expected {expected}, got {actual}\n\n## Suggestion\n\nThe KEL has sequence gaps; re-sync from a trusted source\n"),
317        "AUTHS-E4954" => Some("# AUTHS-E4954\n\n**Crate:** `auths-id`\n\n**Type:** `IncrementalError::MalformedSequence`\n\n## Message\n\nMalformed sequence number: {raw:?}\n"),
318        "AUTHS-E4955" => Some("# AUTHS-E4955\n\n**Crate:** `auths-id`\n\n**Type:** `IncrementalError::InvalidEventType`\n\n## Message\n\nInvalid event type in KEL: {0}\n"),
319        "AUTHS-E4956" => Some("# AUTHS-E4956\n\n**Crate:** `auths-id`\n\n**Type:** `IncrementalError::NonLinearHistory`\n\n## Message\n\nKEL history is non-linear: commit {commit} has {parent_count} parents (expected 1)\n\n## Suggestion\n\nThe KEL has merge commits, indicating tampering\n"),
320        "AUTHS-E4957" => Some("# AUTHS-E4957\n\n**Crate:** `auths-id`\n\n**Type:** `IncrementalError::MissingParent`\n\n## Message\n\nKEL history is corrupted: commit {commit} has no parent but is not inception\n\n## Suggestion\n\nThe KEL commit history is corrupted\n"),
321
322        // --- auths-id (AnchorError) ---
323        "AUTHS-E4961" => Some("# AUTHS-E4961\n\n**Crate:** `auths-id`\n\n**Type:** `AnchorError::Kel`\n\n## Message\n\nKEL error: {0}\n"),
324        "AUTHS-E4962" => Some("# AUTHS-E4962\n\n**Crate:** `auths-id`\n\n**Type:** `AnchorError::Validation`\n\n## Message\n\nValidation error: {0}\n"),
325        "AUTHS-E4963" => Some("# AUTHS-E4963\n\n**Crate:** `auths-id`\n\n**Type:** `AnchorError::Serialization`\n\n## Message\n\nSerialization error: {0}\n"),
326        "AUTHS-E4964" => Some("# AUTHS-E4964\n\n**Crate:** `auths-id`\n\n**Type:** `AnchorError::InvalidDid`\n\n## Message\n\nInvalid DID format: {0}\n\n## Suggestion\n\nUse the format 'did:keri:E<prefix>'\n"),
327        "AUTHS-E4965" => Some("# AUTHS-E4965\n\n**Crate:** `auths-id`\n\n**Type:** `AnchorError::NotFound`\n\n## Message\n\nKEL not found for prefix: {0}\n\n## Suggestion\n\nInitialize the identity first with 'auths init'\n"),
328        "AUTHS-E4966" => Some("# AUTHS-E4966\n\n**Crate:** `auths-id`\n\n**Type:** `AnchorError::Signing`\n\n## Message\n\nSigning error: {0}\n\n## Suggestion\n\nCheck that the key alias exists and the passphrase is correct\n"),
329        "AUTHS-E4967" => Some("# AUTHS-E4967\n\n**Crate:** `auths-id`\n\n**Type:** `AnchorError::IxnForbidden`\n\n## Message\n\nIdentity cannot emit interaction events: {0}\n\n## Suggestion\n\nDevice authorization requires a transferable identity (non-empty n[]) without establishment-only restriction (no EO in c[]). Create a new identity with auths init.\n"),
330        "AUTHS-E4968" => Some("# AUTHS-E4968\n\n**Crate:** `auths-id`\n\n**Type:** `AnchorError::WitnessQuorumNotMet`\n\n## Message\n\nWitness quorum not met: {0}\n\n## Suggestion\n\nCheck witness server connectivity and threshold configuration\n"),
331
332        // --- auths-id (WitnessIntegrationError) ---
333        "AUTHS-E4971" => Some("# AUTHS-E4971\n\n**Crate:** `auths-id`\n\n**Type:** `WitnessIntegrationError::Collection`\n\n## Message\n\nReceipt collection failed: {0}\n\n## Suggestion\n\nCheck witness server connectivity and threshold configuration\n"),
334        "AUTHS-E4972" => Some("# AUTHS-E4972\n\n**Crate:** `auths-id`\n\n**Type:** `WitnessIntegrationError::Storage`\n\n## Message\n\nReceipt storage failed: {0}\n\n## Suggestion\n\nCheck storage backend permissions\n"),
335        "AUTHS-E4973" => Some("# AUTHS-E4973\n\n**Crate:** `auths-id`\n\n**Type:** `WitnessIntegrationError::Runtime`\n\n## Message\n\nTokio runtime error: {0}\n"),
336        "AUTHS-E4974" => Some("# AUTHS-E4974\n\n**Crate:** `auths-id`\n\n**Type:** `WitnessIntegrationError::QuorumNotMet`\n\n## Message\n\nwitness quorum not met: {valid} valid receipt(s), need {required}\n\n## Suggestion\n\nToo few witnesses returned a valid, verifiable receipt for this event\n"),
337        "AUTHS-E4975" => Some("# AUTHS-E4975\n\n**Crate:** `auths-id`\n\n**Type:** `WitnessIntegrationError::Encoding`\n\n## Message\n\nsubmit-body encoding failed: {0}\n\n## Suggestion\n\nThe event or its attachment could not be serialized\n"),
338
339        // --- auths-id (CredentialRegistryError) ---
340        "AUTHS-E4981" => Some("# AUTHS-E4981\n\n**Crate:** `auths-id`\n\n**Type:** `CredentialRegistryError::ThresholdUnsupported`\n\n## Message\n\nissuer '{issuer}' is multi-signature (kt≥2); credential registry anchoring is single-author only\n\n## Suggestion\n\nCredential issuance currently requires a single-signature (kt=1) issuer\n"),
341        "AUTHS-E4982" => Some("# AUTHS-E4982\n\n**Crate:** `auths-id`\n\n**Type:** `CredentialRegistryError::Tel`\n\n## Message\n\nTEL event error: {0}\n"),
342        "AUTHS-E4983" => Some("# AUTHS-E4983\n\n**Crate:** `auths-id`\n\n**Type:** `CredentialRegistryError::Anchor`\n\n## Message\n\nKEL anchoring failed: {0}\n"),
343        "AUTHS-E4984" => Some("# AUTHS-E4984\n\n**Crate:** `auths-id`\n\n**Type:** `CredentialRegistryError::Storage`\n\n## Message\n\nregistry storage error: {0}\n"),
344
345        // --- auths-id (CacheError) ---
346        "AUTHS-E4986" => Some("# AUTHS-E4986\n\n**Crate:** `auths-id`\n\n**Type:** `CacheError::Io`\n\n## Message\n\nI/O error: {0}\n\n## Suggestion\n\nCheck cache directory permissions; the cache is optional and can be cleared\n"),
347        "AUTHS-E4987" => Some("# AUTHS-E4987\n\n**Crate:** `auths-id`\n\n**Type:** `CacheError::Json`\n\n## Message\n\nJSON serialization error: {0}\n\n## Suggestion\n\nThe cache file may be corrupted; try clearing it with 'auths cache clear'\n"),
348        "AUTHS-E4988" => Some("# AUTHS-E4988\n\n**Crate:** `auths-id`\n\n**Type:** `CacheError::InvalidDid`\n\n## Message\n\ninvalid DID: {0}\n\n## Suggestion\n\nThe DID must be a 'did:keri:' identity\n"),
349
350        // --- auths-id (HookError) ---
351        "AUTHS-E4991" => Some("# AUTHS-E4991\n\n**Crate:** `auths-id`\n\n**Type:** `HookError::Io`\n\n## Message\n\nIO error: {0}\n\n## Suggestion\n\nCheck file permissions on the Git hooks directory\n"),
352        "AUTHS-E4992" => Some("# AUTHS-E4992\n\n**Crate:** `auths-id`\n\n**Type:** `HookError::NotGitRepo`\n\n## Message\n\nNot a Git repository: {0}\n\n## Suggestion\n\nEnsure the path points to a valid Git repository\n"),
353
354        // --- auths-sdk (SetupError) ---
355        "AUTHS-E5001" => Some("# AUTHS-E5001\n\n**Crate:** `auths-sdk`\n\n**Type:** `SetupError::IdentityAlreadyExists`\n\n## Message\n\nidentity already exists: {did}\n\n## Suggestion\n\nUse `auths id show` to inspect the existing identity\n"),
356        "AUTHS-E5002" => Some("# AUTHS-E5002\n\n**Crate:** `auths-sdk`\n\n**Type:** `SetupError::KeychainUnavailable`\n\n## Message\n\nkeychain unavailable ({backend}): {reason}\n\n## Suggestion\n\nRun `auths doctor` to diagnose keychain issues\n"),
357        "AUTHS-E5004" => Some("# AUTHS-E5004\n\n**Crate:** `auths-sdk`\n\n**Type:** `SetupError::GitConfigError`\n\n## Message\n\ngit config error: {0}\n\n## Suggestion\n\nEnsure Git is configured: git config --global user.name/email\n"),
358        "AUTHS-E5006" => Some("# AUTHS-E5006\n\n**Crate:** `auths-sdk`\n\n**Type:** `SetupError::PlatformVerificationFailed`\n\n## Message\n\nplatform verification failed: {0}\n\n## Suggestion\n\nPlatform identity verification failed; check your platform credentials and network connectivity\n"),
359        "AUTHS-E5007" => Some("# AUTHS-E5007\n\n**Crate:** `auths-sdk`\n\n**Type:** `SetupError::InvalidSetupConfig`\n\n## Message\n\ninvalid setup config: {0}\n"),
360        "AUTHS-E5008" => Some("# AUTHS-E5008\n\n**Crate:** `auths-sdk`\n\n**Type:** `SetupError::WeakPassphrase`\n\n## Message\n\npassphrase from {source_name} is too weak: {reason}\n\n## Suggestion\n\nUse at least 12 characters with 3 of 4 character classes (lowercase, uppercase, digit, symbol)\n"),
361
362        // --- auths-sdk (DeviceError) ---
363        "AUTHS-E5101" => Some("# AUTHS-E5101\n\n**Crate:** `auths-sdk`\n\n**Type:** `DeviceError::IdentityNotFound`\n\n## Message\n\nidentity not found: {did}\n\n## Suggestion\n\nRun `auths init` to create an identity first\n"),
364        "AUTHS-E5102" => Some("# AUTHS-E5102\n\n**Crate:** `auths-sdk`\n\n**Type:** `DeviceError::DeviceNotFound`\n\n## Message\n\ndevice not found: {did}\n\n## Suggestion\n\nRun `auths device list` to see linked devices\n"),
365        "AUTHS-E5103" => Some("# AUTHS-E5103\n\n**Crate:** `auths-sdk`\n\n**Type:** `DeviceError::AttestationError`\n\n## Message\n\nattestation error: {0}\n\n## Suggestion\n\nThe attestation operation failed; run `auths device list` to check device status\n"),
366        "AUTHS-E5105" => Some("# AUTHS-E5105\n\n**Crate:** `auths-sdk`\n\n**Type:** `DeviceError::DeviceDidMismatch`\n\n## Message\n\ndevice DID mismatch: expected {expected}, got {actual}\n\n## Suggestion\n\nCheck that --device matches the key name\n"),
367        "AUTHS-E5106" => Some("# AUTHS-E5106\n\n**Crate:** `auths-sdk`\n\n**Type:** `DeviceError::DelegationError`\n\n## Message\n\ndevice delegation failed: {0}\n\n## Suggestion\n\nThe device delegation could not be authored or anchored; check the root identity\n"),
368
369        // --- auths-sdk (DeviceExtensionError) ---
370        "AUTHS-E5201" => Some("# AUTHS-E5201\n\n**Crate:** `auths-sdk`\n\n**Type:** `DeviceExtensionError::IdentityNotFound`\n\n## Message\n\nidentity not found\n\n## Suggestion\n\nRun `auths init` to create an identity first\n"),
371        "AUTHS-E5202" => Some("# AUTHS-E5202\n\n**Crate:** `auths-sdk`\n\n**Type:** `DeviceExtensionError::NoAttestationFound`\n\n## Message\n\nno attestation found for device {device_did}\n\n## Suggestion\n\nRun `auths device link` to create an attestation for this device\n"),
372        "AUTHS-E5203" => Some("# AUTHS-E5203\n\n**Crate:** `auths-sdk`\n\n**Type:** `DeviceExtensionError::AlreadyRevoked`\n\n## Message\n\ndevice {device_did} is already revoked\n\n## Suggestion\n\nThis device has been revoked and cannot be extended; link a new device with `auths device link`\n"),
373        "AUTHS-E5204" => Some("# AUTHS-E5204\n\n**Crate:** `auths-sdk`\n\n**Type:** `DeviceExtensionError::AttestationFailed`\n\n## Message\n\nattestation creation failed: {0}\n\n## Suggestion\n\nFailed to create the extension attestation; check key access and try again\n"),
374
375        // --- auths-sdk (RotationError) ---
376        "AUTHS-E5301" => Some("# AUTHS-E5301\n\n**Crate:** `auths-sdk`\n\n**Type:** `RotationError::IdentityNotFound`\n\n## Message\n\nidentity not found at {path}\n\n## Suggestion\n\nRun `auths init` to create an identity first\n"),
377        "AUTHS-E5302" => Some("# AUTHS-E5302\n\n**Crate:** `auths-sdk`\n\n**Type:** `RotationError::KeyNotFound`\n\n## Message\n\nkey not found: {0}\n\n## Suggestion\n\nRun `auths key list` to see available keys\n"),
378        "AUTHS-E5303" => Some("# AUTHS-E5303\n\n**Crate:** `auths-sdk`\n\n**Type:** `RotationError::KeyDecryptionFailed`\n\n## Message\n\nkey decryption failed: {0}\n\n## Suggestion\n\nCheck your passphrase and try again\n"),
379        "AUTHS-E5304" => Some("# AUTHS-E5304\n\n**Crate:** `auths-sdk`\n\n**Type:** `RotationError::KelHistoryFailed`\n\n## Message\n\nKEL history error: {0}\n\n## Suggestion\n\nRun `auths doctor` to check KEL integrity\n"),
380        "AUTHS-E5305" => Some("# AUTHS-E5305\n\n**Crate:** `auths-sdk`\n\n**Type:** `RotationError::RotationFailed`\n\n## Message\n\nrotation failed: {0}\n\n## Suggestion\n\nKey rotation failed; verify your current key is accessible with `auths key list`\n"),
381        "AUTHS-E5306" => Some("# AUTHS-E5306\n\n**Crate:** `auths-sdk`\n\n**Type:** `RotationError::PartialRotation`\n\n## Message\n\nrotation event committed to KEL but keychain write failed — manual recovery required: {0}\n\n## Suggestion\n\nRe-run the rotation with the same new key to complete the keychain write\n"),
382        "AUTHS-E5307" => Some("# AUTHS-E5307\n\n**Crate:** `auths-sdk`\n\n**Type:** `RotationError::HardwareKeyNotRotatable`\n\n## Message\n\nrotation requires a software-backed key; alias '{alias}' is hardware-backed (Secure Enclave) and cannot export the raw key material rotation needs\n\n## Suggestion\n\nHardware-backed keys (Secure Enclave / HSM) cannot be rotated in-place; provision a software-backed identity or rotate by creating a new identity\n"),
383
384        // --- auths-sdk (AgentError) ---
385        "AUTHS-E5311" => Some("# AUTHS-E5311\n\n**Crate:** `auths-sdk`\n\n**Type:** `AgentError::IdentityNotFound`\n\n## Message\n\nidentity not found: {did}\n\n## Suggestion\n\nRun `auths init` to create a root identity first\n"),
386        "AUTHS-E5312" => Some("# AUTHS-E5312\n\n**Crate:** `auths-sdk`\n\n**Type:** `AgentError::AlreadyDelegated`\n\n## Message\n\nan agent key already exists under alias '{alias}'\n\n## Suggestion\n\nAn agent already exists under this alias. Reuse it, rotate it with `auths id agent rotate`, or pass a fresh --label; `auths id agent list` shows existing agents.\n"),
387        "AUTHS-E5313" => Some("# AUTHS-E5313\n\n**Crate:** `auths-sdk`\n\n**Type:** `AgentError::DelegationError`\n\n## Message\n\nagent delegation failed: {0}\n\n## Suggestion\n\nThe agent delegation could not be authored or anchored; check the root identity\n"),
388        "AUTHS-E5314" => Some("# AUTHS-E5314\n\n**Crate:** `auths-sdk`\n\n**Type:** `AgentError::AgentNotFound`\n\n## Message\n\nagent not found: {did}\n\n## Suggestion\n\nRun `auths id agent list` to see the agents this identity has delegated\n"),
389        "AUTHS-E5315" => Some("# AUTHS-E5315\n\n**Crate:** `auths-sdk`\n\n**Type:** `AgentError::Revoked`\n\n## Message\n\nagent {did} is revoked\n\n## Suggestion\n\nThis agent was revoked and cannot be rotated; delegate a new agent instead\n"),
390        "AUTHS-E5316" => Some("# AUTHS-E5316\n\n**Crate:** `auths-sdk`\n\n**Type:** `AgentError::OutsideDelegatorScope`\n\n## Message\n\nrequested capability '{capability}' exceeds the delegator's scope\n\n## Suggestion\n\nNarrow the agent's --scope to a subset of the delegator's own capabilities\n"),
391        "AUTHS-E5317" => Some("# AUTHS-E5317\n\n**Crate:** `auths-sdk`\n\n**Type:** `AgentError::AttestationError`\n\n## Message\n\nagent delegation attestation failed: {0}\n\n## Suggestion\n\nThe delegation attestation could not be signed; check the keychain aliases\n"),
392        "AUTHS-E5318" => Some("# AUTHS-E5318\n\n**Crate:** `auths-sdk`\n\n**Type:** `AgentError::AnchorError`\n\n## Message\n\nagent delegation attestation anchoring failed: {0}\n\n## Suggestion\n\nThe delegation attestation could not be anchored; check the root identity's KEL\n"),
393
394        // --- auths-sdk (RegistrationError) ---
395        "AUTHS-E5400" => Some("# AUTHS-E5400\n\n**Crate:** `auths-sdk`\n\n**Type:** `RegistrationError::NoRegistryConfigured`\n\n## Message\n\nno registry configured. Auths needs no registry: identity, signing and verification are local and git-native, and a signer's KEL reaches a verifier over the same git remote as the code. Pass --registry <url> or set AUTHS_REGISTRY_URL only if you are running one.\n\n## Suggestion\n\nRegistration is optional — signing and verification need no registry. Pass --registry <url> or set AUTHS_REGISTRY_URL only if you run one\n"),
396        "AUTHS-E5401" => Some("# AUTHS-E5401\n\n**Crate:** `auths-sdk`\n\n**Type:** `RegistrationError::AlreadyRegistered`\n\n## Message\n\nidentity already registered at this registry\n\n## Suggestion\n\nThis identity is already registered; use `auths id show` to see registration details\n"),
397        "AUTHS-E5402" => Some("# AUTHS-E5402\n\n**Crate:** `auths-sdk`\n\n**Type:** `RegistrationError::QuotaExceeded`\n\n## Message\n\nregistration quota exceeded — try again later\n\n## Suggestion\n\nWait a few minutes and try again\n"),
398        "AUTHS-E5403" => Some("# AUTHS-E5403\n\n**Crate:** `auths-sdk`\n\n**Type:** `RegistrationError::InvalidDidFormat`\n\n## Message\n\ninvalid DID format: {did}\n\n## Suggestion\n\nRun `auths doctor` to check local identity data\n"),
399        "AUTHS-E5404" => Some("# AUTHS-E5404\n\n**Crate:** `auths-sdk`\n\n**Type:** `RegistrationError::IdentityLoadError`\n\n## Message\n\nidentity load error: {0}\n\n## Suggestion\n\nRun `auths doctor` to check local identity data\n"),
400        "AUTHS-E5405" => Some("# AUTHS-E5405\n\n**Crate:** `auths-sdk`\n\n**Type:** `RegistrationError::RegistryReadError`\n\n## Message\n\nregistry read error: {0}\n\n## Suggestion\n\nRun `auths doctor` to check local identity data\n"),
401        "AUTHS-E5406" => Some("# AUTHS-E5406\n\n**Crate:** `auths-sdk`\n\n**Type:** `RegistrationError::SerializationError`\n\n## Message\n\nserialization error: {0}\n\n## Suggestion\n\nRun `auths doctor` to check local identity data\n"),
402
403        // --- auths-sdk (McpAuthError) ---
404        "AUTHS-E5501" => Some("# AUTHS-E5501\n\n**Crate:** `auths-sdk`\n\n**Type:** `McpAuthError::BridgeUnreachable`\n\n## Message\n\nbridge unreachable: {0}\n\n## Suggestion\n\nCheck network connectivity to the OIDC bridge\n"),
405        "AUTHS-E5502" => Some("# AUTHS-E5502\n\n**Crate:** `auths-sdk`\n\n**Type:** `McpAuthError::TokenExchangeFailed`\n\n## Message\n\ntoken exchange failed (HTTP {status}): {body}\n\n## Suggestion\n\nVerify your credentials and try again\n"),
406        "AUTHS-E5503" => Some("# AUTHS-E5503\n\n**Crate:** `auths-sdk`\n\n**Type:** `McpAuthError::InvalidResponse`\n\n## Message\n\ninvalid response: {0}\n\n## Suggestion\n\nThe OIDC bridge returned an unexpected response; verify the bridge URL and try again\n"),
407        "AUTHS-E5504" => Some("# AUTHS-E5504\n\n**Crate:** `auths-sdk`\n\n**Type:** `McpAuthError::InsufficientCapabilities`\n\n## Message\n\ninsufficient capabilities: requested {requested:?}\n\n## Suggestion\n\nRequest fewer capabilities or contact your administrator\n"),
408
409        // --- auths-sdk (TrustError) ---
410        "AUTHS-E5551" => Some("# AUTHS-E5551\n\n**Crate:** `auths-sdk`\n\n**Type:** `TrustError::UnknownIdentity`\n\n## Message\n\nUnknown identity '{did}' and trust policy is '{policy}'\n\n## Suggestion\n\nRun `auths trust pin --did <did>` or add the identity to .auths/roots.json\n"),
411        "AUTHS-E5552" => Some("# AUTHS-E5552\n\n**Crate:** `auths-sdk`\n\n**Type:** `TrustError::KeyResolutionFailed`\n\n## Message\n\nFailed to resolve public key for identity {did}\n\n## Suggestion\n\nVerify the identity exists and has a valid public key registered\n"),
412        "AUTHS-E5553" => Some("# AUTHS-E5553\n\n**Crate:** `auths-sdk`\n\n**Type:** `TrustError::InvalidTrustStore`\n\n## Message\n\nInvalid trust store: {0}\n\n## Suggestion\n\nCheck the format of your trust store (roots.json or ~/.auths/known_identities.json)\n"),
413        "AUTHS-E5554" => Some("# AUTHS-E5554\n\n**Crate:** `auths-sdk`\n\n**Type:** `TrustError::TofuRequiresInteraction`\n\n## Message\n\nTOFU trust decision required but running in non-interactive mode\n\n## Suggestion\n\nRun interactively (on a TTY), or pre-pin the identity with `auths trust pin` so no interactive decision is needed\n"),
414
415        // --- auths-sdk (OrgError) ---
416        "AUTHS-E5601" => Some("# AUTHS-E5601\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::AdminNotFound`\n\n## Message\n\nno admin with the given public key found in organization '{org}'\n\n## Suggestion\n\nVerify you are using the correct admin key for this organization\n"),
417        "AUTHS-E5602" => Some("# AUTHS-E5602\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::MemberNotFound`\n\n## Message\n\nmember '{did}' not found in organization '{org}'\n\n## Suggestion\n\nRun `auths org list-members` to see current members\n"),
418        "AUTHS-E5603" => Some("# AUTHS-E5603\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::AlreadyRevoked`\n\n## Message\n\nmember '{did}' is already revoked\n\n## Suggestion\n\nThis member has already been revoked from the organization\n"),
419        "AUTHS-E5604" => Some("# AUTHS-E5604\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::InvalidCapability`\n\n## Message\n\ninvalid capability '{cap}': {reason}\n\n## Suggestion\n\nUse a valid capability (e.g., 'sign_commit', 'manage_members', 'admin')\n"),
420        "AUTHS-E5605" => Some("# AUTHS-E5605\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::InvalidDid`\n\n## Message\n\ninvalid organization DID: {0}\n\n## Suggestion\n\nOrganization DIDs must be valid did:keri identifiers\n"),
421        "AUTHS-E5606" => Some("# AUTHS-E5606\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::InvalidPublicKey`\n\n## Message\n\ninvalid public key: {0}\n\n## Suggestion\n\nPublic keys must be hex-encoded Ed25519 keys\n"),
422        "AUTHS-E5607" => Some("# AUTHS-E5607\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::Signing`\n\n## Message\n\nsigning error: {0}\n\n## Suggestion\n\nThe signing operation failed; check your key access with `auths key list`\n"),
423        "AUTHS-E5608" => Some("# AUTHS-E5608\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::Identity`\n\n## Message\n\nidentity error: {0}\n\n## Suggestion\n\nFailed to load identity; run `auths id show` to check identity status\n"),
424        "AUTHS-E5609" => Some("# AUTHS-E5609\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::KeyStorage`\n\n## Message\n\nkey storage error: {0}\n\n## Suggestion\n\nFailed to access key storage; run `auths doctor` to diagnose\n"),
425        "AUTHS-E5610" => Some("# AUTHS-E5610\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::Storage`\n\n## Message\n\nstorage error: {0}\n\n## Suggestion\n\nFailed to access organization storage; check repository permissions\n"),
426        "AUTHS-E5611" => Some("# AUTHS-E5611\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::Anchor`\n\n## Message\n\nanchor error: {0}\n\n## Suggestion\n\nKEL anchoring failed; check identity and registry state\n"),
427        "AUTHS-E5612" => Some("# AUTHS-E5612\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::OrgThresholdDelegationUnsupported`\n\n## Message\n\norganization '{org}' uses a multi-signature controller (kt≥2); KERI-native member delegation requires a single-signature (kt=1) org\n\n## Suggestion\n\nMulti-signature org anchoring is not yet supported; use a single-signature (kt=1) org\n"),
428        "AUTHS-E5613" => Some("# AUTHS-E5613\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::MemberKeyExists`\n\n## Message\n\na member key already exists under alias '{alias}'\n\n## Suggestion\n\nChoose a different member alias; run `auths org list-members` to see existing members\n"),
429        "AUTHS-E5614" => Some("# AUTHS-E5614\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::Delegation`\n\n## Message\n\nmember delegation failed: {0}\n\n## Suggestion\n\nThe member delegation could not be authored or anchored; check the org identity\n"),
430        "AUTHS-E5615" => Some("# AUTHS-E5615\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::IdentityExists`\n\n## Message\n\nan identity already exists at {location}; refusing to create an organization over it\n\n## Suggestion\n\nAn identity already exists here; use a fresh repository path to create a new organization\n"),
431        "AUTHS-E5616" => Some("# AUTHS-E5616\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::IdentityInit`\n\n## Message\n\nfailed to initialize organization identity: {0}\n\n## Suggestion\n\nFailed to initialize the org identity; check key access and repository state\n"),
432        "AUTHS-E5617" => Some("# AUTHS-E5617\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::Attestation`\n\n## Message\n\nfailed to create admin attestation: {0}\n\n## Suggestion\n\nFailed to sign the admin attestation; check your key access with `auths key list`\n"),
433        "AUTHS-E5618" => Some("# AUTHS-E5618\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::MemberNotDelegable`\n\n## Message\n\nmember '{did}' is not a delegated identifier of organization '{org}'\n\n## Suggestion\n\nThe member must first incept a delegated identity naming this org as delegator (pairing) before it can be off-boarded\n"),
434        "AUTHS-E5622" => Some("# AUTHS-E5622\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::PolicyCompile`\n\n## Message\n\ninvalid org policy: {reason}\n\n## Suggestion\n\nFix the policy JSON (a serialized `Expr`); see `auths org policy show` for the current policy\n"),
435        "AUTHS-E5623" => Some("# AUTHS-E5623\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::PolicyBlobMissing`\n\n## Message\n\norg policy blob for hash '{hash}' is missing from storage\n\n## Suggestion\n\nThe policy blob is missing; re-anchor it with `auths org policy set`\n"),
436        "AUTHS-E5624" => Some("# AUTHS-E5624\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::PolicyIntegrity`\n\n## Message\n\norg policy integrity failure: KEL committed hash '{expected}' but the stored blob hashes to '{actual}'\n\n## Suggestion\n\nThe stored policy was modified after anchoring; re-anchor a trusted policy with `auths org policy set`\n"),
437        "AUTHS-E5625" => Some("# AUTHS-E5625\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::ChainCycle`\n\n## Message\n\ndelegation chain cycle detected at '{did}'\n\n## Suggestion\n\nThe delegation chain is malformed (a cycle); inspect the identifiers' KELs\n"),
438        "AUTHS-E5626" => Some("# AUTHS-E5626\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::ChainTooDeep`\n\n## Message\n\ndelegation chain exceeds the maximum depth of {max} hops\n\n## Suggestion\n\nThe delegation chain is too deep; reduce delegation nesting\n"),
439        "AUTHS-E5627" => Some("# AUTHS-E5627\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::ChainBrokenHop`\n\n## Message\n\ndelegation chain is broken: no KEL found for '{did}'\n\n## Suggestion\n\nA KEL in the delegation chain is missing; ensure all delegators' KELs are present\n"),
440        "AUTHS-E5628" => Some("# AUTHS-E5628\n\n**Crate:** `auths-sdk`\n\n**Type:** `OrgError::OidcPolicyInvalid`\n\n## Message\n\ninvalid OIDC-subject policy: {reason}\n\n## Suggestion\n\nFix the OIDC-subject policy JSON (issuer + repository, optional workflow_ref); nothing was anchored\n"),
441
442        // --- auths-sdk (ApprovalError) ---
443        "AUTHS-E5701" => Some("# AUTHS-E5701\n\n**Crate:** `auths-sdk`\n\n**Type:** `ApprovalError::NotApprovalRequired`\n\n## Message\n\ndecision is not RequiresApproval\n\n## Suggestion\n\nThis operation does not require approval; run it directly without the --approve flag\n"),
444        "AUTHS-E5702" => Some("# AUTHS-E5702\n\n**Crate:** `auths-sdk`\n\n**Type:** `ApprovalError::RequestNotFound`\n\n## Message\n\napproval request not found: {hash}\n\n## Suggestion\n\nRun `auths approval list` to see pending requests\n"),
445        "AUTHS-E5703" => Some("# AUTHS-E5703\n\n**Crate:** `auths-sdk`\n\n**Type:** `ApprovalError::RequestExpired`\n\n## Message\n\napproval request expired at {expires_at}\n\n## Suggestion\n\nSubmit a new approval request\n"),
446        "AUTHS-E5704" => Some("# AUTHS-E5704\n\n**Crate:** `auths-sdk`\n\n**Type:** `ApprovalError::ApprovalAlreadyUsed`\n\n## Message\n\napproval already used (JTI: {jti})\n\n## Suggestion\n\nSubmit a new approval request\n"),
447        "AUTHS-E5705" => Some("# AUTHS-E5705\n\n**Crate:** `auths-sdk`\n\n**Type:** `ApprovalError::PartialApproval`\n\n## Message\n\napproval partially applied — attestation stored but nonce/cleanup failed: {0}\n\n## Suggestion\n\nCheck approval status and retry if needed\n"),
448        "AUTHS-E5706" => Some("# AUTHS-E5706\n\n**Crate:** `auths-sdk`\n\n**Type:** `ApprovalError::ApprovalStorage`\n\n## Message\n\nstorage error: {0}\n\n## Suggestion\n\nCheck file permissions and disk space\n"),
449
450        // --- auths-sdk (ArtifactSigningError) ---
451        "AUTHS-E5850" => Some("# AUTHS-E5850\n\n**Crate:** `auths-sdk`\n\n**Type:** `ArtifactSigningError::IdentityNotFound`\n\n## Message\n\nidentity not found in configured identity storage\n\n## Suggestion\n\nRun `auths init` to create an identity, or `auths key import` to restore one\n"),
452        "AUTHS-E5851" => Some("# AUTHS-E5851\n\n**Crate:** `auths-sdk`\n\n**Type:** `ArtifactSigningError::KeyResolutionFailed`\n\n## Message\n\nkey resolution failed: {0}\n\n## Suggestion\n\nRun `auths status` to see available device aliases\n"),
453        "AUTHS-E5852" => Some("# AUTHS-E5852\n\n**Crate:** `auths-sdk`\n\n**Type:** `ArtifactSigningError::KeyDecryptionFailed`\n\n## Message\n\nkey decryption failed: {0}\n\n## Suggestion\n\nCheck your passphrase and try again\n"),
454        "AUTHS-E5853" => Some("# AUTHS-E5853\n\n**Crate:** `auths-sdk`\n\n**Type:** `ArtifactSigningError::DigestFailed`\n\n## Message\n\ndigest computation failed: {0}\n\n## Suggestion\n\nVerify the file exists and is readable\n"),
455        "AUTHS-E5854" => Some("# AUTHS-E5854\n\n**Crate:** `auths-sdk`\n\n**Type:** `ArtifactSigningError::AttestationFailed`\n\n## Message\n\nattestation creation failed: {0}\n\n## Suggestion\n\nCheck identity storage with `auths status`\n"),
456        "AUTHS-E5855" => Some("# AUTHS-E5855\n\n**Crate:** `auths-sdk`\n\n**Type:** `ArtifactSigningError::ResignFailed`\n\n## Message\n\nattestation re-signing failed: {0}\n\n## Suggestion\n\nVerify your device key is accessible with `auths status`\n"),
457        "AUTHS-E5856" => Some("# AUTHS-E5856\n\n**Crate:** `auths-sdk`\n\n**Type:** `ArtifactSigningError::InvalidCommitSha`\n\n## Message\n\ninvalid commit SHA: {0} (expected 40 or 64 hex characters)\n\n## Suggestion\n\nProvide a full SHA-1 (40 hex chars) or SHA-256 (64 hex chars) commit hash\n"),
458        "AUTHS-E5857" => Some("# AUTHS-E5857\n\n**Crate:** `auths-sdk`\n\n**Type:** `ArtifactSigningError::DeviceRevoked`\n\n## Message\n\ndevice revoked: {0}\n\n## Suggestion\n\nThis device has been removed; pair a new device or sign from an active one\n"),
459        "AUTHS-E5858" => Some("# AUTHS-E5858\n\n**Crate:** `auths-sdk`\n\n**Type:** `ArtifactSigningError::KeyRotatedOut`\n\n## Message\n\nsigning key rotated out of the KEL: {0}\n\n## Suggestion\n\nThis key was rotated out; sign with the identity's current key\n"),
460
461        // --- auths-sdk (SigningError) ---
462        "AUTHS-E5901" => Some("# AUTHS-E5901\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::IdentityFrozen`\n\n## Message\n\nidentity is frozen: {0}\n\n## Suggestion\n\nTo unfreeze: auths emergency unfreeze\n"),
463        "AUTHS-E5902" => Some("# AUTHS-E5902\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::KeyResolution`\n\n## Message\n\nkey resolution failed: {0}\n\n## Suggestion\n\nRun `auths key list` to check available keys\n"),
464        "AUTHS-E5903" => Some("# AUTHS-E5903\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::SigningFailed`\n\n## Message\n\nsigning operation failed: {0}\n\n## Suggestion\n\nThe signing operation failed; verify your key is accessible with `auths key list`\n"),
465        "AUTHS-E5904" => Some("# AUTHS-E5904\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::InvalidPassphrase`\n\n## Message\n\ninvalid passphrase\n\n## Suggestion\n\nCheck your passphrase and try again\n"),
466        "AUTHS-E5905" => Some("# AUTHS-E5905\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::PemEncoding`\n\n## Message\n\nPEM encoding failed: {0}\n\n## Suggestion\n\nFailed to encode the key in PEM format; the key material may be corrupted\n"),
467        "AUTHS-E5906" => Some("# AUTHS-E5906\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::AgentUnavailable`\n\n## Message\n\nagent unavailable: {0}\n\n## Suggestion\n\nStart the agent with `auths agent start`\n"),
468        "AUTHS-E5907" => Some("# AUTHS-E5907\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::AgentSigningFailed`\n\n## Message\n\nagent signing failed\n\n## Suggestion\n\nCheck agent logs with `auths agent status`\n"),
469        "AUTHS-E5908" => Some("# AUTHS-E5908\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::PassphraseExhausted`\n\n## Message\n\npassphrase exhausted after {attempts} attempt(s)\n\n## Suggestion\n\nThe passphrase you entered is incorrect (tried 3 times). Verify it matches what you set during init, or try: auths key export --key-alias <alias> --format pub\n"),
470        "AUTHS-E5909" => Some("# AUTHS-E5909\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::KeychainUnavailable`\n\n## Message\n\nkeychain unavailable: {0}\n\n## Suggestion\n\nRun `auths doctor` to diagnose keychain issues\n"),
471        "AUTHS-E5910" => Some("# AUTHS-E5910\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::KeyDecryptionFailed`\n\n## Message\n\nkey decryption failed: {0}\n\n## Suggestion\n\nCheck your passphrase and try again\n"),
472        "AUTHS-E5911" => Some("# AUTHS-E5911\n\n**Crate:** `auths-sdk`\n\n**Type:** `SigningError::KeyNotFound`\n\n## Message\n\nno signing key under alias '{alias}'\n\n## Suggestion\n\nRun `auths key list` to see available aliases, or `auths init` to create one\n"),
473
474        // --- auths-sdk (AuthChallengeError) ---
475        "AUTHS-E6001" => Some("# AUTHS-E6001\n\n**Crate:** `auths-sdk`\n\n**Type:** `AuthChallengeError::EmptyNonce`\n\n## Message\n\nnonce must not be empty\n\n## Suggestion\n\nProvide the nonce from the authentication challenge\n"),
476        "AUTHS-E6002" => Some("# AUTHS-E6002\n\n**Crate:** `auths-sdk`\n\n**Type:** `AuthChallengeError::EmptyDomain`\n\n## Message\n\ndomain must not be empty\n\n## Suggestion\n\nProvide the domain (e.g. auths.dev)\n"),
477        "AUTHS-E6003" => Some("# AUTHS-E6003\n\n**Crate:** `auths-sdk`\n\n**Type:** `AuthChallengeError::Canonicalization`\n\n## Message\n\ncanonical JSON serialization failed: {0}\n\n## Suggestion\n\nThis is an internal error; please report it as a bug\n"),
478
479        // --- auths-sdk (CredentialError) ---
480        "AUTHS-E6101" => Some("# AUTHS-E6101\n\n**Crate:** `auths-sdk`\n\n**Type:** `CredentialError::IssueeNotFound`\n\n## Message\n\nissuee identity not found (no KEL): {did}\n\n## Suggestion\n\nThe issuee must have an incepted identity (KEL) before it can be credentialed\n"),
481        "AUTHS-E6102" => Some("# AUTHS-E6102\n\n**Crate:** `auths-sdk`\n\n**Type:** `CredentialError::RegistryError`\n\n## Message\n\ncredential registry error: {0}\n\n## Suggestion\n\nCheck the issuer identity and registry storage are reachable\n"),
482        "AUTHS-E6103" => Some("# AUTHS-E6103\n\n**Crate:** `auths-sdk`\n\n**Type:** `CredentialError::AlreadyRevoked`\n\n## Message\n\ncredential already revoked: {said}\n\n## Suggestion\n\nThis credential is already revoked; no further action is needed\n"),
483        "AUTHS-E6104" => Some("# AUTHS-E6104\n\n**Crate:** `auths-sdk`\n\n**Type:** `CredentialError::KtThresholdUnsupported`\n\n## Message\n\nissuer is multi-signature (kt≥2); credential anchoring is single-author only\n\n## Suggestion\n\nCredential issuance currently requires a single-signature (kt=1) issuer\n"),
484        "AUTHS-E6105" => Some("# AUTHS-E6105\n\n**Crate:** `auths-sdk`\n\n**Type:** `CredentialError::SchemaUnknown`\n\n## Message\n\ncapability schema unknown or uncomputable\n\n## Suggestion\n\nThe compiled-in capability schema is unavailable; this is a build defect\n"),
485        "AUTHS-E6106" => Some("# AUTHS-E6106\n\n**Crate:** `auths-sdk`\n\n**Type:** `CredentialError::StaleOrUnresolvable`\n\n## Message\n\ncredential status is stale or unresolvable: {reason}\n\n## Suggestion\n\nNo fresh witnessed tip was reachable; sync the issuer KEL/receipts and retry, or relax --require-witnesses\n"),
486        "AUTHS-E6107" => Some("# AUTHS-E6107\n\n**Crate:** `auths-sdk`\n\n**Type:** `CredentialError::MalformedUsageCap`\n\n## Message\n\nmalformed quantitative usage cap '{cap}': a calls: capability must carry a non-negative integer bound (e.g. calls:3)\n\n## Suggestion\n\nUse a quantitative cap with a non-negative integer bound, e.g. --cap calls:3\n"),
487
488        // --- auths-cli (SignerKelError) ---
489        "AUTHS-E6301" => Some("# AUTHS-E6301\n\n**Crate:** `auths-cli`\n\n**Type:** `SignerKelError::Unavailable`\n\n## Message\n\nsigner's KEL for {did} is not available locally: {reason}\n\n## Suggestion\n\nFetch the signer's KEL with `git fetch <remote> 'refs/auths/*:refs/auths/*'`, or verify against an evidence bundle with `--identity-bundle`.\n"),
490
491        // --- auths-oidc-port (OidcError) ---
492        "AUTHS-E8001" => Some("# AUTHS-E8001\n\n**Crate:** `auths-oidc-port`\n\n**Type:** `OidcError::JwtDecode`\n\n## Message\n\nJWT decode failed: {0}\n\n## Suggestion\n\nVerify the token format and ensure it is a valid JWT\n"),
493        "AUTHS-E8002" => Some("# AUTHS-E8002\n\n**Crate:** `auths-oidc-port`\n\n**Type:** `OidcError::SignatureVerificationFailed`\n\n## Message\n\nsignature verification failed\n\n## Suggestion\n\nCheck that the JWKS endpoint is up-to-date and the token is from a trusted issuer\n"),
494        "AUTHS-E8003" => Some("# AUTHS-E8003\n\n**Crate:** `auths-oidc-port`\n\n**Type:** `OidcError::ClaimsValidationFailed`\n\n## Message\n\nclaim validation failed - {claim}: {reason}\n\n## Suggestion\n\nThe token has expired; acquire a new token from the OIDC provider\n"),
495        "AUTHS-E8004" => Some("# AUTHS-E8004\n\n**Crate:** `auths-oidc-port`\n\n**Type:** `OidcError::UnknownKeyId`\n\n## Message\n\nunknown key ID: {0}\n\n## Suggestion\n\nThe JWKS cache may be stale; refresh the JWKS from the issuer endpoint\n"),
496        "AUTHS-E8005" => Some("# AUTHS-E8005\n\n**Crate:** `auths-oidc-port`\n\n**Type:** `OidcError::JwksResolutionFailed`\n\n## Message\n\nJWKS resolution failed: {0}\n\n## Suggestion\n\nCheck network connectivity to the JWKS endpoint and ensure the issuer URL is correct\n"),
497        "AUTHS-E8006" => Some("# AUTHS-E8006\n\n**Crate:** `auths-oidc-port`\n\n**Type:** `OidcError::AlgorithmMismatch`\n\n## Message\n\nalgorithm mismatch: expected {expected}, got {got}\n\n## Suggestion\n\nVerify that the expected algorithm matches the algorithm used by the OIDC provider\n"),
498        "AUTHS-E8007" => Some("# AUTHS-E8007\n\n**Crate:** `auths-oidc-port`\n\n**Type:** `OidcError::ClockSkewExceeded`\n\n## Message\n\ntoken expired (exp: {token_exp}, now: {current_time}, leeway: {leeway}s)\n\n## Suggestion\n\nSynchronize the system clock or increase the configured clock skew tolerance\n"),
499        "AUTHS-E8008" => Some("# AUTHS-E8008\n\n**Crate:** `auths-oidc-port`\n\n**Type:** `OidcError::TokenReplayDetected`\n\n## Message\n\ntoken replay detected (jti: {0})\n\n## Suggestion\n\nA token with this ID has already been used; acquire a new token from the OIDC provider\n"),
500
501        // --- auths-core (LogError) ---
502        "AUTHS-E9001" => Some("# AUTHS-E9001\n\n**Crate:** `auths-core`\n\n**Type:** `LogError::SubmissionRejected`\n\n## Message\n\nsubmission rejected: {reason}\n\n## Suggestion\n\nCheck the attestation format and payload size\n"),
503        "AUTHS-E9002" => Some("# AUTHS-E9002\n\n**Crate:** `auths-core`\n\n**Type:** `LogError::NetworkError`\n\n## Message\n\nnetwork error: {0}\n\n## Suggestion\n\nCheck your internet connection and the log's API URL\n"),
504        "AUTHS-E9003" => Some("# AUTHS-E9003\n\n**Crate:** `auths-core`\n\n**Type:** `LogError::RateLimited`\n\n## Message\n\nrate limited, retry after {retry_after_secs}s\n\n## Suggestion\n\nWait and retry; the log is rate-limiting requests\n"),
505        "AUTHS-E9004" => Some("# AUTHS-E9004\n\n**Crate:** `auths-core`\n\n**Type:** `LogError::InvalidResponse`\n\n## Message\n\ninvalid response: {0}\n\n## Suggestion\n\nThe log returned an unexpected response; check the log version\n"),
506        "AUTHS-E9005" => Some("# AUTHS-E9005\n\n**Crate:** `auths-core`\n\n**Type:** `LogError::EntryNotFound`\n\n## Message\n\nentry not found\n\n## Suggestion\n\nThe entry may not be sequenced yet; retry after a moment\n"),
507        "AUTHS-E9006" => Some("# AUTHS-E9006\n\n**Crate:** `auths-core`\n\n**Type:** `LogError::ConsistencyViolation`\n\n## Message\n\nconsistency violation: {0}\n\n## Suggestion\n\nThe log returned data that does not match what was submitted\n"),
508        "AUTHS-E9007" => Some("# AUTHS-E9007\n\n**Crate:** `auths-core`\n\n**Type:** `LogError::Unavailable`\n\n## Message\n\nlog unavailable: {0}\n\n## Suggestion\n\nThe transparency log is unavailable; retry later or use --allow-unlogged\n"),
509
510        _ => None,
511    }
512}
513
514/// Returns a sorted slice of all registered error codes.
515#[rustfmt::skip]
516pub fn all_codes() -> &'static [&'static str] {
517    static CODES: &[&str] = &[
518        "AUTHS-E1001",
519        "AUTHS-E1002",
520        "AUTHS-E1003",
521        "AUTHS-E1004",
522        "AUTHS-E1005",
523        "AUTHS-E1101",
524        "AUTHS-E1102",
525        "AUTHS-E1103",
526        "AUTHS-E1104",
527        "AUTHS-E1201",
528        "AUTHS-E1202",
529        "AUTHS-E1203",
530        "AUTHS-E1204",
531        "AUTHS-E1301",
532        "AUTHS-E1302",
533        "AUTHS-E2001",
534        "AUTHS-E2002",
535        "AUTHS-E2003",
536        "AUTHS-E2004",
537        "AUTHS-E2005",
538        "AUTHS-E2006",
539        "AUTHS-E2007",
540        "AUTHS-E2008",
541        "AUTHS-E2009",
542        "AUTHS-E2010",
543        "AUTHS-E2011",
544        "AUTHS-E2012",
545        "AUTHS-E2013",
546        "AUTHS-E2014",
547        "AUTHS-E2015",
548        "AUTHS-E2016",
549        "AUTHS-E2017",
550        "AUTHS-E2018",
551        "AUTHS-E2019",
552        "AUTHS-E2020",
553        "AUTHS-E2021",
554        "AUTHS-E2022",
555        "AUTHS-E2101",
556        "AUTHS-E2102",
557        "AUTHS-E2103",
558        "AUTHS-E2104",
559        "AUTHS-E2105",
560        "AUTHS-E2106",
561        "AUTHS-E2107",
562        "AUTHS-E2108",
563        "AUTHS-E2109",
564        "AUTHS-E2201",
565        "AUTHS-E2202",
566        "AUTHS-E2203",
567        "AUTHS-E2204",
568        "AUTHS-E2205",
569        "AUTHS-E2206",
570        "AUTHS-E2301",
571        "AUTHS-E2302",
572        "AUTHS-E2303",
573        "AUTHS-E3001",
574        "AUTHS-E3002",
575        "AUTHS-E3003",
576        "AUTHS-E3004",
577        "AUTHS-E3005",
578        "AUTHS-E3006",
579        "AUTHS-E3007",
580        "AUTHS-E3008",
581        "AUTHS-E3009",
582        "AUTHS-E3010",
583        "AUTHS-E3011",
584        "AUTHS-E3012",
585        "AUTHS-E3013",
586        "AUTHS-E3014",
587        "AUTHS-E3015",
588        "AUTHS-E3016",
589        "AUTHS-E3017",
590        "AUTHS-E3018",
591        "AUTHS-E3019",
592        "AUTHS-E3020",
593        "AUTHS-E3021",
594        "AUTHS-E3022",
595        "AUTHS-E3023",
596        "AUTHS-E3024",
597        "AUTHS-E3025",
598        "AUTHS-E3101",
599        "AUTHS-E3102",
600        "AUTHS-E3103",
601        "AUTHS-E3104",
602        "AUTHS-E3105",
603        "AUTHS-E3106",
604        "AUTHS-E3107",
605        "AUTHS-E3201",
606        "AUTHS-E3202",
607        "AUTHS-E3203",
608        "AUTHS-E3204",
609        "AUTHS-E3205",
610        "AUTHS-E3206",
611        "AUTHS-E3207",
612        "AUTHS-E3301",
613        "AUTHS-E3302",
614        "AUTHS-E3303",
615        "AUTHS-E3304",
616        "AUTHS-E3305",
617        "AUTHS-E3401",
618        "AUTHS-E3402",
619        "AUTHS-E3403",
620        "AUTHS-E3404",
621        "AUTHS-E3405",
622        "AUTHS-E3406",
623        "AUTHS-E3407",
624        "AUTHS-E3408",
625        "AUTHS-E3409",
626        "AUTHS-E3501",
627        "AUTHS-E3502",
628        "AUTHS-E3503",
629        "AUTHS-E3504",
630        "AUTHS-E3505",
631        "AUTHS-E3601",
632        "AUTHS-E3602",
633        "AUTHS-E3603",
634        "AUTHS-E3604",
635        "AUTHS-E3605",
636        "AUTHS-E3606",
637        "AUTHS-E3701",
638        "AUTHS-E3702",
639        "AUTHS-E3703",
640        "AUTHS-E3704",
641        "AUTHS-E3801",
642        "AUTHS-E3802",
643        "AUTHS-E3803",
644        "AUTHS-E3804",
645        "AUTHS-E3805",
646        "AUTHS-E3806",
647        "AUTHS-E3901",
648        "AUTHS-E3902",
649        "AUTHS-E3903",
650        "AUTHS-E3951",
651        "AUTHS-E3952",
652        "AUTHS-E3961",
653        "AUTHS-E3962",
654        "AUTHS-E3963",
655        "AUTHS-E3964",
656        "AUTHS-E3965",
657        "AUTHS-E3966",
658        "AUTHS-E3967",
659        "AUTHS-E3968",
660        "AUTHS-E4001",
661        "AUTHS-E4002",
662        "AUTHS-E4003",
663        "AUTHS-E4004",
664        "AUTHS-E4101",
665        "AUTHS-E4102",
666        "AUTHS-E4103",
667        "AUTHS-E4104",
668        "AUTHS-E4105",
669        "AUTHS-E4106",
670        "AUTHS-E4107",
671        "AUTHS-E4201",
672        "AUTHS-E4202",
673        "AUTHS-E4203",
674        "AUTHS-E4204",
675        "AUTHS-E4205",
676        "AUTHS-E4206",
677        "AUTHS-E4207",
678        "AUTHS-E4208",
679        "AUTHS-E4209",
680        "AUTHS-E4401",
681        "AUTHS-E4402",
682        "AUTHS-E4403",
683        "AUTHS-E4404",
684        "AUTHS-E4405",
685        "AUTHS-E4406",
686        "AUTHS-E4407",
687        "AUTHS-E4408",
688        "AUTHS-E4409",
689        "AUTHS-E4410",
690        "AUTHS-E4411",
691        "AUTHS-E4601",
692        "AUTHS-E4602",
693        "AUTHS-E4603",
694        "AUTHS-E4604",
695        "AUTHS-E4605",
696        "AUTHS-E4606",
697        "AUTHS-E4607",
698        "AUTHS-E4801",
699        "AUTHS-E4802",
700        "AUTHS-E4803",
701        "AUTHS-E4804",
702        "AUTHS-E4805",
703        "AUTHS-E4806",
704        "AUTHS-E4807",
705        "AUTHS-E4821",
706        "AUTHS-E4822",
707        "AUTHS-E4823",
708        "AUTHS-E4824",
709        "AUTHS-E4825",
710        "AUTHS-E4826",
711        "AUTHS-E4827",
712        "AUTHS-E4828",
713        "AUTHS-E4829",
714        "AUTHS-E4830",
715        "AUTHS-E4831",
716        "AUTHS-E4851",
717        "AUTHS-E4852",
718        "AUTHS-E4853",
719        "AUTHS-E4861",
720        "AUTHS-E4862",
721        "AUTHS-E4863",
722        "AUTHS-E4864",
723        "AUTHS-E4865",
724        "AUTHS-E4866",
725        "AUTHS-E4867",
726        "AUTHS-E4868",
727        "AUTHS-E4869",
728        "AUTHS-E4870",
729        "AUTHS-E4871",
730        "AUTHS-E4872",
731        "AUTHS-E4873",
732        "AUTHS-E4874",
733        "AUTHS-E4875",
734        "AUTHS-E4876",
735        "AUTHS-E4877",
736        "AUTHS-E4901",
737        "AUTHS-E4902",
738        "AUTHS-E4903",
739        "AUTHS-E4904",
740        "AUTHS-E4905",
741        "AUTHS-E4906",
742        "AUTHS-E4951",
743        "AUTHS-E4952",
744        "AUTHS-E4953",
745        "AUTHS-E4954",
746        "AUTHS-E4955",
747        "AUTHS-E4956",
748        "AUTHS-E4957",
749        "AUTHS-E4961",
750        "AUTHS-E4962",
751        "AUTHS-E4963",
752        "AUTHS-E4964",
753        "AUTHS-E4965",
754        "AUTHS-E4966",
755        "AUTHS-E4967",
756        "AUTHS-E4968",
757        "AUTHS-E4971",
758        "AUTHS-E4972",
759        "AUTHS-E4973",
760        "AUTHS-E4974",
761        "AUTHS-E4975",
762        "AUTHS-E4981",
763        "AUTHS-E4982",
764        "AUTHS-E4983",
765        "AUTHS-E4984",
766        "AUTHS-E4986",
767        "AUTHS-E4987",
768        "AUTHS-E4988",
769        "AUTHS-E4991",
770        "AUTHS-E4992",
771        "AUTHS-E5001",
772        "AUTHS-E5002",
773        "AUTHS-E5004",
774        "AUTHS-E5006",
775        "AUTHS-E5007",
776        "AUTHS-E5008",
777        "AUTHS-E5101",
778        "AUTHS-E5102",
779        "AUTHS-E5103",
780        "AUTHS-E5105",
781        "AUTHS-E5106",
782        "AUTHS-E5201",
783        "AUTHS-E5202",
784        "AUTHS-E5203",
785        "AUTHS-E5204",
786        "AUTHS-E5301",
787        "AUTHS-E5302",
788        "AUTHS-E5303",
789        "AUTHS-E5304",
790        "AUTHS-E5305",
791        "AUTHS-E5306",
792        "AUTHS-E5307",
793        "AUTHS-E5311",
794        "AUTHS-E5312",
795        "AUTHS-E5313",
796        "AUTHS-E5314",
797        "AUTHS-E5315",
798        "AUTHS-E5316",
799        "AUTHS-E5317",
800        "AUTHS-E5318",
801        "AUTHS-E5400",
802        "AUTHS-E5401",
803        "AUTHS-E5402",
804        "AUTHS-E5403",
805        "AUTHS-E5404",
806        "AUTHS-E5405",
807        "AUTHS-E5406",
808        "AUTHS-E5501",
809        "AUTHS-E5502",
810        "AUTHS-E5503",
811        "AUTHS-E5504",
812        "AUTHS-E5551",
813        "AUTHS-E5552",
814        "AUTHS-E5553",
815        "AUTHS-E5554",
816        "AUTHS-E5601",
817        "AUTHS-E5602",
818        "AUTHS-E5603",
819        "AUTHS-E5604",
820        "AUTHS-E5605",
821        "AUTHS-E5606",
822        "AUTHS-E5607",
823        "AUTHS-E5608",
824        "AUTHS-E5609",
825        "AUTHS-E5610",
826        "AUTHS-E5611",
827        "AUTHS-E5612",
828        "AUTHS-E5613",
829        "AUTHS-E5614",
830        "AUTHS-E5615",
831        "AUTHS-E5616",
832        "AUTHS-E5617",
833        "AUTHS-E5618",
834        "AUTHS-E5622",
835        "AUTHS-E5623",
836        "AUTHS-E5624",
837        "AUTHS-E5625",
838        "AUTHS-E5626",
839        "AUTHS-E5627",
840        "AUTHS-E5628",
841        "AUTHS-E5701",
842        "AUTHS-E5702",
843        "AUTHS-E5703",
844        "AUTHS-E5704",
845        "AUTHS-E5705",
846        "AUTHS-E5706",
847        "AUTHS-E5850",
848        "AUTHS-E5851",
849        "AUTHS-E5852",
850        "AUTHS-E5853",
851        "AUTHS-E5854",
852        "AUTHS-E5855",
853        "AUTHS-E5856",
854        "AUTHS-E5857",
855        "AUTHS-E5858",
856        "AUTHS-E5901",
857        "AUTHS-E5902",
858        "AUTHS-E5903",
859        "AUTHS-E5904",
860        "AUTHS-E5905",
861        "AUTHS-E5906",
862        "AUTHS-E5907",
863        "AUTHS-E5908",
864        "AUTHS-E5909",
865        "AUTHS-E5910",
866        "AUTHS-E5911",
867        "AUTHS-E6001",
868        "AUTHS-E6002",
869        "AUTHS-E6003",
870        "AUTHS-E6101",
871        "AUTHS-E6102",
872        "AUTHS-E6103",
873        "AUTHS-E6104",
874        "AUTHS-E6105",
875        "AUTHS-E6106",
876        "AUTHS-E6107",
877        "AUTHS-E6301",
878        "AUTHS-E8001",
879        "AUTHS-E8002",
880        "AUTHS-E8003",
881        "AUTHS-E8004",
882        "AUTHS-E8005",
883        "AUTHS-E8006",
884        "AUTHS-E8007",
885        "AUTHS-E8008",
886        "AUTHS-E9001",
887        "AUTHS-E9002",
888        "AUTHS-E9003",
889        "AUTHS-E9004",
890        "AUTHS-E9005",
891        "AUTHS-E9006",
892        "AUTHS-E9007",
893    ];
894    CODES
895}
896
897#[cfg(test)]
898mod tests {
899    use super::*;
900
901    #[test]
902    fn explain_returns_content_for_known_code() {
903        assert!(explain("AUTHS-E1001").is_some());
904    }
905
906    #[test]
907    fn explain_returns_none_for_unknown_code() {
908        assert!(explain("AUTHS-E9999").is_none());
909    }
910
911    #[test]
912    fn all_codes_is_sorted() {
913        let codes = all_codes();
914        assert!(!codes.is_empty());
915        for window in codes.windows(2) {
916            assert!(
917                window[0] < window[1],
918                "codes not sorted: {} >= {}",
919                window[0],
920                window[1]
921            );
922        }
923    }
924
925    #[test]
926    fn all_codes_count_matches_registry() {
927        assert_eq!(all_codes().len(), 375);
928    }
929}