Governance Verification Loop with Auto-Rollback#35
Conversation
…uto-rollback This change introduces the Phase 4 Governance Verification Loop, ensuring that code patches generated by the LLM are automatically validated before being finalized. Key changes: - Added `CodeValidator` in `codesage/governance/validator.py` to run syntax checks and tests. - Added `Sandbox` in `codesage/governance/sandbox.py` for safe execution of validation commands (subprocess with timeout, shell=False). - Enhanced `PatchManager` in `codesage/governance/patch_manager.py` with `revert` and `cleanup_backup` methods (backup logic was already present). - Updated `TaskOrchestrator` in `codesage/governance/task_orchestrator.py` to implement the retry loop: Apply -> Validate -> Commit or Revert/Retry. - Updated `GovernanceConfig` in `codesage/config/governance.py` to include validation command templates. - Added integration tests in `tests/test_governance_loop.py` and unit tests in `tests/test_patch_rollback.py`.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
Implemented the Governance Verification Loop (Phase 4).
CodeValidatorto run language-specific syntax checks (e.g.,python -m py_compile) and tests. AddedSandboxto execute these commands securely with timeouts.PatchManager's backup capability and addedrevertlogic. If validation fails, the file is restored to its original state.TaskOrchestrator.execute_taskto include a loop that attempts to fix issues, validates the fix, and retries with error feedback if validation fails.ValidationConfigtoGovernanceConfigfor defining validation commands.PR created automatically by Jules for task 5361315251232767388 started by @turtacn