feat(kdo): integrate H5-R3B active guarded tool pipeline - #74
Conversation
|
Warning Review limit reached
Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
PR Summary by QodoIntegrate H5-R3B active guarded tool pipeline with serialized plan enforcement
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
Code Review by Qodo
1.
|
Implements canonical
KDO-H5-R3B — ACTIVE MONOTONIC GUARDED TOOL PIPELINEplus canonical C1 plan-module boundary correction frommain@b76da457eab307904841d1097ff5a1cbcab6eaa7.This is a Draft pre-ledger diagnostic candidate. The evidence ledger is absent and forbidden until a fresh exact-head pre-ledger PASS.
Current implementation paths
packages/kodac-runtime/src/agent/guarded-tool-plan.ts— new pure serialized plan companion; all actual narrowing/block/rewrite fold goes through canonical R3A.packages/kodac-runtime/src/model/turn.ts— filtered H2/provider tool exposure, defensive provider-call normalization, R3A evaluation, immutable trusted-host veto seam, effective-call execution/history.packages/kodac-runtime/src/agent/loop.ts— propagates one staticguardPlanJson; existing hard duplicate/R2B observation sees effective post-rewrite calls.packages/kodac-runtime/src/protocol/event.ts— addstool.guard.evaluatedandtool.guard.execution_observedstructural events.packages/kodac-runtime/test/kdo-h5-r3b-active-guarded-tool-pipeline.test.ts— focused active-integration proof.Historical regression reconciliations authorized by R3B are not yet committed; they will be applied only after current TypeScript/runtime diagnostics identify the final active blobs. The ledger remains absent.
Core invariants under test
Explicit boundaries
No dynamic/workspace hook discovery, shell/command hooks, plugin/user module execution, Agentica runtime import, K2/approval/confinement override, free-form H2 guard feedback, result/receipt rewrite, H5-R1 pruning integration, subagents/delegation/worktrees/background jobs/writable memory, Done Gate override, H5 completion, or H6 readiness.
No auto-merge.
Summary by cubic
Integrates the H5‑R3B active guarded tool pipeline to hide non‑permitted tools and execute only guard‑approved, JSON‑normalized tool calls, and records its pre‑ledger evidence. Previously all registry tools were exposed and provider call objects could pass through; now a pure plan preflights via R3A, filters exposure, can rewrite inputs, blocks disallowed/unknown calls, and emits structured guard evidence.
guarded-tool-planmodule: canonicalizes JSON, enforces limits, validates exact name/capability pairs, preflights exposure and per‑call rules through R3A, and returns stable plan/tool‑set identities.AgentTurnRunner: accepts optionalguardPlanJson; rejects invalid/stale plans before request snapshot/provider invocation; filters provider‑visible tools without mutating registry; normalizes provider responses; freezesbeforeToolCall; preflights batches and aborts if any call is blocked; emitstool.guard.evaluatedandtool.guard.execution_observed; throwsGuardedToolCallBlockedError(unknown_tool,guard_blocked); returns only effective calls.BoundedAgentLoop: forwardsguardPlanJson; duplicate detection and R2B advisories use effective rewritten inputs.tool.guard.evaluatedandtool.guard.execution_observed.Migration
beforeToolCallas read‑only; its return value is ignored.tool.guard.evaluatedandtool.guard.execution_observed; missing the execution observation fails the turn.GuardedToolCallBlockedError; unknown provider tools now fail with codeunknown_tool.toolCallsor provider stream events; do not rely on provider‑original inputs or the unfiltered tool set.Written for commit 09298a9. Summary will update on new commits.