safety: implement PLAN_AGENT_SAFETY_NOW#62
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9375d485d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| result.Violations = mergeUniqueSorted(result.Violations, []string{"rate_limit_exceeded"}) | ||
| } | ||
| } | ||
| if outcome.DestructiveBudget.Requests > 0 && gate.IntentContainsDestructiveTarget(intent.Targets) { |
There was a problem hiding this comment.
Enforce destructive budget for script step targets
runGateEval only applies outcome.DestructiveBudget when IntentContainsDestructiveTarget(intent.Targets) is true, but script evaluations put destructive operations in intent.script.steps[*].targets and often leave top-level intent.targets empty. In that common script context, the destructive budget is computed by policy (evaluateScriptPolicyDetailed aggregates it) but never enforced here, so repeated destructive script executions can bypass the configured destructive budget guard.
Useful? React with 👍 / 👎.
Problem
Implement
product/PLAN_AGENT_SAFETY_NOW.mdend-to-end: emergency stop preemption, destructive safety budgets/phases, scoped approvals, compaction-resilient invariants, and stop-latency SLO hardening.Changes
gait job stopCLI path and MCP emergency-stop preemption with stable reason codes.max_targetsandmax_opsclaims.Validation
./gait doctor --jsongo test ./core/jobruntime ./core/mcp ./cmd/gait -run 'Stop|Cancel|Resume|Preempt' -count=1go test ./core/gate -run 'Budget|RateLimit|Destructive|ReasonCode' -count=1go test ./core/gate ./cmd/gait -run 'Policy|Template|RequireApproval' -count=1go test ./core/gate ./core/mcp ./cmd/gait -run 'Plan|Apply|ApprovalToken' -count=1go test ./core/gate ./cmd/gait -run 'Approval|Scope|Bulk|TTL' -count=1go test ./core/jobruntime ./core/runpack ./core/pack -run 'Invariant|Compaction|Resume|Determinism' -count=1go test ./internal/integration ./internal/e2e -run 'StopLatency|EmergencyStop' -count=1make test-runtime-slomake test-chaosmake bench-checkmake test-v2-5-acceptancemake test-contractsmake test-context-conformancemake test-context-chaosmake test-hardening-acceptancemake test-docs-consistencymake test-release-smokemake prepush-fullAll commands above passed locally.