Skip to content

Comments

gate: enforce destructive budget for script step targets#63

Merged
davidahmann merged 1 commit intomainfrom
codex/pr62-destructive-budget-script-targets
Feb 24, 2026
Merged

gate: enforce destructive budget for script step targets#63
davidahmann merged 1 commit intomainfrom
codex/pr62-destructive-budget-script-targets

Conversation

@davidahmann
Copy link
Collaborator

Problem

PR #62 review feedback identified a policy gap: destructive-budget enforcement only checked top-level intent.targets, which allowed scripted destructive targets in intent.script.steps[*].targets to avoid budget accounting.

Changes

  • Route destructive-budget eligibility through a new helper that inspects script step targets first and falls back to top-level targets when script targets are absent.
  • Keep behavior unchanged for non-script intents and script intents without per-step targets.
  • Add unit coverage for helper behavior:
    • script targets are detected
    • fallback to top-level targets still works
  • Add CLI regression coverage to confirm repeated scripted destructive calls trip destructive_budget_exceeded.

Validation

  • go test ./cmd/gait -run 'GateIntent|DestructiveBudgetAppliesToScriptTargets' -count=1
  • make prepush-full
  • pre-push hook make prepush on git push

@davidahmann davidahmann merged commit b27c6c9 into main Feb 24, 2026
7 checks passed
@davidahmann davidahmann deleted the codex/pr62-destructive-budget-script-targets branch February 24, 2026 13:23
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.

1 participant