Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

Implemented the Governance Verification Loop (Phase 4).

  1. Validator & Sandbox: Added CodeValidator to run language-specific syntax checks (e.g., python -m py_compile) and tests. Added Sandbox to execute these commands securely with timeouts.
  2. Auto-Rollback: Leveraged PatchManager's backup capability and added revert logic. If validation fails, the file is restored to its original state.
  3. Orchestration Loop: Modified TaskOrchestrator.execute_task to include a loop that attempts to fix issues, validates the fix, and retries with error feedback if validation fails.
  4. Configuration: Added ValidationConfig to GovernanceConfig for defining validation commands.
  5. Tests: Added integration tests simulating the loop (fail then success) and unit tests for backup/restore.

PR created automatically by Jules for task 5361315251232767388 started by @turtacn

…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`.
@google-labs-jules
Copy link
Contributor Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@turtacn turtacn merged commit 1d9570b into master Nov 23, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants