feat(autonomy): guard enforcement works (denylist, budget caps, tool call limits) #1204
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!1204
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/m6-guard-enforcement"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
GuardScope(StrEnum)for type-safe scope handling.REMEDIATION_DENYLIST,REMEDIATION_ALLOWLIST, etc.) for consistency and testability.Review Fix Round (v2)
Addressed review #2910 by @freemo:
resource_dag.robot— Unrelated Robot SQLite/cycle-detection changes removed from this commit; will be submitted as a separate PR.scopeparameter →GuardScopeenum — CreatedGuardScope(StrEnum)inautomation_guard.pywithPLANandSUBPLANmembers. Updatedcheck_guard()signature and all call sites.scope_label— Now usesscope.valuedirectly.automation_guard.py.Validation
nox -s lint— passednox -s typecheck— passed (0 errors, 0 warnings)nox -s unit_tests— passed (508 features, 12989 scenarios, 0 failures)nox -s coverage_report— passed (97% coverage)master(532ea100)Closes #853
ca701e2ca747d86c77aaReview: REQUEST CHANGES
Issue 1: Unrelated Robot Fix Bundled
The
resource_dag.robotchanges (replacingcreate_enginewithStaticPooland fixing cycle detection test to use distinct resource types) are unrelated to the guard enforcement feature. Per CONTRIBUTING.md §Atomic Commits: "Do not mix concerns. Never bundle cosmetic changes with functional changes in the same commit."Please split the Robot SQLite fix into a separate commit.
Issue 2:
scopeParameter Should Be an Enumcheck_guard()acceptsscopeas a rawstrvalidated withif scope not in {"plan", "subplan"}. Per CONTRIBUTING.md §Type Safety: "Prefer static typing whenever the language supports it." This should be a properEnum:This provides type safety, IDE autocompletion, and prevents typos at call sites.
Minor Notes
scope_labelvariable is redundant — after validation, it's always equal toscopeitself.47d86c77aa45c0242ef5@freemo — All four items from review #2910 have been addressed. Here's a summary:
Issue 1: Unrelated Robot Fix Bundled ✅
Reverted
robot/resource_dag.robotto its master state. The StaticPool migration and distinct resource type changes are no longer in this commit. They'll need a separate PR/issue.Issue 2:
scopeParameter Should Be an Enum ✅Created
GuardScope(StrEnum)inautomation_guard.pywithPLANandSUBPLANmembers. Updatedcheck_guard()signature to acceptGuardScopeinstead ofstr, and updated all call sites (service, Behave steps). The runtimeif scope not in {...}validation is no longer needed since Pyright enforces the type statically, andStrEnumconstruction raisesValueErrorfor invalid values.Minor Notes ✅
scope_labelremoved — now usesscope.valuedirectly throughout the guard messages.REMEDIATION_DENYLIST,REMEDIATION_ALLOWLIST,REMEDIATION_TOOL_CALL_LIMIT,REMEDIATION_BUDGET,REMEDIATION_WRITE_APPROVAL,REMEDIATION_APPLY_APPROVAL) inautomation_guard.py.Validation
All quality gates pass. Branch rebased onto latest master (
532ea100). PR is now mergeable.