{"record":{"id":"75a6daf6d099b604","repo":"zeroclaw-labs/zeroclaw","slug":"run-run-id-has-reached-this-gate-s-revision-limi","errorCode":null,"errorMessage":"Run {run_id} has reached this gate's revision limit ({MAX_GATE_REVISIONS}); approve, edit, or deny the current draft","messagePattern":"Run (.+?) has reached this gate's revision limit \\((.+?)\\); approve, edit, or deny the current draft","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/sop/engine.rs","lineNumber":2845,"sourceCode":"            .rev()\n            .find(|r| r.status == SopStepStatus::Completed && r.step_number < run.current_step)?\n            .step_number;\n        let (_, sop) = self.resolve_active_run_sop(run_id).ok()?;\n        let step = self.resolve_sop_step(&sop, pred).ok()?;\n        (step.kind == SopStepKind::Capability && step.capability_id() == Some(\"llm.generate\"))\n            .then_some(pred)\n    }\n\n    /// Pre-flight a `Revise` WITHOUT mutating anything: the revision cap has not\n    /// been reached and the gate has an `llm.generate` predecessor to re-run.\n    fn can_revise_checkpoint(&self, run_id: &str) -> Result<()> {\n        let run = self\n            .get_run(run_id)\n            .ok_or_else(|| anyhow::Error::msg(format!(\"Active run not found: {run_id}\")))?;\n        // Per-GATE budget: presentations spent at THIS gate, not run-wide\n        // (`revision` also advances when a later gate first parks).\n        if run.revision.saturating_sub(run.revision_base) >= MAX_GATE_REVISIONS {\n            bail!(\n                \"Run {run_id} has reached this gate's revision limit ({MAX_GATE_REVISIONS}); \\\n                 approve, edit, or deny the current draft\"\n            );\n        }\n        if self.revisable_predecessor(run_id).is_none() {\n            bail!(\n                \"Run {run_id} has no llm.generate predecessor step to re-run; \\\n                 this gate is not revisable\"\n            );\n        }\n        Ok(())\n    }\n\n    /// Re-run the checkpoint's predecessor `llm.generate` step with the operator's\n    /// guidance framed as reviewer feedback, replace the recorded draft, bump the\n    /// gate revision, and re-present the gate. The run never leaves\n    /// `PausedCheckpoint`: a failed re-draft keeps the OLD draft parked and\n    /// answerable. The caller commits the new snapshot and ledger event together.","sourceCodeStart":2827,"sourceCodeEnd":2863,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/sop/engine.rs#L2827-L2863","documentation":"Error \"Run {run_id} has reached this gate's revision limit ({MAX_GATE_REVISIONS}); approve, edit, or deny the current draft\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-runtime/src/sop/engine.rs:2845 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Approve, edit, or deny the current draft; the revision limit for this gate is reached."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}