{"record":{"id":"640d2f032574bfb5","repo":"Hmbown/CodeWhale","slug":"telemetry-permission-changed-before-arming","errorCode":null,"errorMessage":"telemetry permission changed before arming","messagePattern":"telemetry permission changed before arming","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/telemetry/src/buffer.rs","lineNumber":466,"sourceCode":"}\n\n/// Clear the tombstone and drop anything buffered before this process was\n/// permitted.\n///\n/// Called by `init` on every arming. Both the exact tombstone generation and a\n/// fresh durable permission check must still match while the wipe lock is held.\n/// A stale buffer left by an earlier run or by a bug cannot enter the new\n/// process's batch.\npub(crate) fn arm(\n    root: &Path,\n    observed_generation: Option<&TombstoneGeneration>,\n    permission_still_enabled: impl FnOnce() -> bool,\n) -> Result<()> {\n    ensure_dir(root)?;\n    with_lock(root, || {\n        let current_generation = tombstone_generation(root)?;\n        if current_generation.as_ref() != observed_generation {\n            anyhow::bail!(\"telemetry permission changed before arming\");\n        }\n        if !permission_still_enabled() {\n            anyhow::bail!(\"telemetry permission is no longer enabled\");\n        }\n        let tombstone = tombstone_path(root);\n        if tombstone.exists() {\n            fs::remove_file(&tombstone)\n                .with_context(|| format!(\"failed to remove {}\", tombstone.display()))?;\n        }\n        truncate(&buffer_path(root))\n    })\n}\n","sourceCodeStart":448,"sourceCodeEnd":479,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/telemetry/src/buffer.rs#L448-L479","documentation":"Error \"telemetry permission changed before arming\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/telemetry/src/buffer.rs:466 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}