Issue/13 plan risk#47
Merged
Merged
Conversation
Add risk.go with ActionSuggestsWriteSideEffects heuristic and summarizeRisks wired from ComputePlan. RiskSummary.Messages covers cost ceiling increases, removed policy approvals, agent model changes, and new write-like tool permissions (including baseline creates). Extend FormatPlan with a Risk delta section (issue #13). Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
internal/plan/risk.go—summarizeRiskswalks plan operations and compares priorNormalizedSpecJSONvs desired JSON for Policy, Agent, and Tool:spec.execution.maxTotalCostUsd→ message containing “cost ceiling increased”; anyspec.approvals.requiredForentry dropped → “Approval requirements removed…”permissions.allowentries vs old → ifActionSuggestsWriteSideEffectsmatches any addition → “New write-like tool permissions added…”; create → same style when any allow matches the heuristicActionSuggestsWriteSideEffects— documented MVP heuristic: case-insensitive substring checks forwrite,delete,merge,.send,.post(see comment on the function).internal/plan/plan.go—RiskSummarynow hasMessages []string(deduped, sorted).internal/plan/planner.go—ComputePlansetsRisk: summarizeRisks(...).internal/plan/output.go—FormatPlanappends a Risk delta section when there are messages.internal/plan/risk_test.go—TestRiskSummary_costCeilingIncreased,TestRiskSummary_newWriteLikeToolPermissions, baselineTestRiskSummary_newToolCreate_flagsWriteLikeWhenNoPriorState, plus table test forActionSuggestsWriteSideEffects.Acceptance
maxTotalCostUsd→ “cost ceiling increased”TestRiskSummary_costCeilingIncreasedTestRiskSummary_newWriteLikeToolPermissionsCloses #13.