feat: community governance layer — task state, undo, policy, audit, health, isolation - #518
Draft
isair wants to merge 7 commits into
Draft
feat: community governance layer — task state, undo, policy, audit, health, isolation#518isair wants to merge 7 commits into
isair wants to merge 7 commits into
Conversation
Owner
Author
|
Multi-agent adversarial review completed (five specialists + verifier). All must-fix findings have been addressed in 2da83bd: Fixed
Follow-ups to file as issues (not blockers)
Test status: all 183 governance tests pass; full suite shows zero regressions against the develop baseline. |
isair
force-pushed
the
feat/task-state-undo
branch
from
July 20, 2026 01:45
2da83bd to
dd765af
Compare
Add session-scoped task state machine for tracking execution progress, risk-based approval with voice-first undo model (act-then-undo instead of blocking gates), and a language-agnostic UndoTool that replaces English-only regex detection. Includes tool base class extensions for classify() and assess_risk(), reply engine integration with policy evaluation and audit recording, and comprehensive test coverage. Co-Authored-By: Baris Sencan <[email protected]>
Add a centralised policy engine that evaluates every tool call through classify → assess risk → path guard → MCP check → approval pipeline. Includes workspace confinement via configurable roots and blocked paths, tool classification delegated to each tool's classify() method, and formal error types for the agent loop. Co-Authored-By: Baris Sencan <[email protected]>
Add opt-in audit system (configured via audit_db_path) that records task lifecycle, policy decisions, and tool execution steps. Includes redaction of sensitive data before storage, parameterised status updates to avoid hardcoded values, and comprehensive test coverage for the recorder. Co-Authored-By: Baris Sencan <[email protected]>
Add health registry for tracking service status (ready/degraded/ unavailable), graceful shutdown manager with configurable diary timeout (default 5s), and remove dead bootstrap/service_container code. Includes critical failure detection and service-level health summaries. Co-Authored-By: Baris Sencan <[email protected]>
Add subprocess-based tool execution for write operations with retry logic that distinguishes transient errors (TimeoutExpired, ConnectionError, OSError) from permanent failures. Includes zombie process prevention via proc.wait(timeout=5) after kill, and configurable subprocess mode via use_subprocess_for_writes config option. Co-Authored-By: Baris Sencan <[email protected]>
- Drop references to the removed recallConversation tool (deleted on develop in #255) from approval, classification, and risk tests. - Use a home-directory path in policy path-guard tests so the home_only mode assertion holds on every platform (/tmp is outside the user home and is correctly denied). Co-Authored-By: Claude Fable 5 <[email protected]>
…ayer Correctness: - Gate step completion and undo registration on result.success, not on the presence of reply_text; failed or policy-denied actions no longer register undo entries or claim reversibility. Audit uses the same predicate. - Capture undo snapshots via a direct bounded file read instead of the localFiles read operation, whose 10k-char display truncation would have made undo restore corrupted content; files over the cap get no undo entry rather than a lying one. - The planner direct-exec fast path now runs only SAFE-risk, policy-allowed steps; write/destructive plan steps defer to the governed loop (policy -> snapshot -> undo -> audit). Fail-closed. - Finalise the audit TaskRecord on the stop-tool path. Security/privacy: - Default blocked roots now cover home credential stores (~/.ssh, ~/.aws, ~/.gnupg, ~/.kube, ~/.docker, ~/.netrc, ~/.npmrc, ~/.pypirc, ~/.git-credentials); blocked roots are expanduser-ed. - Path containment falls back to device+inode identity so differently-cased paths cannot evade blocked/read-only roots on case-insensitive filesystems. Language-agnostic UX: - Irreversibility warnings and undo notes are no longer hardcoded English spliced into the spoken reply; they ride the tool-result message as model instructions so the reply LLM phrases them in the user's language. Docs/specs: - reply.spec.md governance section rewritten to match the act-then-undo implementation (the approval-gate halt flow never existed in code). - execution.spec.md and runtime.spec.md now state plainly that ToolRunner and ShutdownManager are not yet integrated, with the preconditions for wiring them in; the inert config keys say so. - policy_mode docstring corrected to the real enum (active | deny). - policy.spec.md documents the new blocked defaults and case handling. Co-Authored-By: Claude Fable 5 <[email protected]>
isair
force-pushed
the
feat/task-state-undo
branch
from
July 21, 2026 01:10
dd765af to
ed24796
Compare
isair
marked this pull request as draft
August 4, 2026 14:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings sjackson0109's community governance work (the
develop-communitybranch) intodevelop, rebased onto the current head with original authorship preserved. The five feature commits are cherry-picked verbatim under Simon Jackson's authorship; only conflict resolution and a small test-adaptation commit were added on top.undotool (replaces English-only regex detection).home_onlydefault), kill-switch policy mode, formal error taxonomy for the reply loop.Integration notes
reply/engine.py(task steps, undo registration, and audit recording now coexist with the pre-flight planner, toolSearchTool allow-list widening, and tool-result digest), thellm/package refactor, and the removal ofrecallConversation(fix(reply): small-model robustness — weather location, JSON leak scrub, router follow-ups, remove broken recallConversation #255).undoregistered alongsidetoolSearchToolin the builtin registry.reply.spec.mdmerged to describe classification, approval checking, and task-state transitions alongside the current TTS/planner flow.docs/llm_contexts.mdis unchanged.recallConversationreferences; path-guard tests now use a home-directory path sohome_onlyassertions hold on every platform.Tests
origin/develop).Closes #130
Closes #131
Closes #132
Closes #133
Closes #134
🤖 Generated with Claude Code