Skip to content

Issue/13 plan risk#47

Merged
leo-aa88 merged 2 commits into
mainfrom
issue/13-plan-risk
Apr 11, 2026
Merged

Issue/13 plan risk#47
leo-aa88 merged 2 commits into
mainfrom
issue/13-plan-risk

Conversation

@leo-aa88
Copy link
Copy Markdown
Member

Changes

  • internal/plan/risk.gosummarizeRisks walks plan operations and compares prior NormalizedSpecJSON vs desired JSON for Policy, Agent, and Tool:
    • Policy (update): higher spec.execution.maxTotalCostUsd → message containing “cost ceiling increased”; any spec.approvals.requiredFor entry dropped → “Approval requirements removed…”
    • Policy (create, no prior row): conservative lines when a cost ceiling or approvals are defined
    • Agent (update): model change → “Agent model changed…”; create → note when a model is bound
    • Tool (update): new permissions.allow entries vs old → if ActionSuggestsWriteSideEffects matches any addition → “New write-like tool permissions added…”; create → same style when any allow matches the heuristic
  • ActionSuggestsWriteSideEffects — documented MVP heuristic: case-insensitive substring checks for write, delete, merge, .send, .post (see comment on the function).
  • internal/plan/plan.goRiskSummary now has Messages []string (deduped, sorted).
  • internal/plan/planner.goComputePlan sets Risk: summarizeRisks(...).
  • internal/plan/output.goFormatPlan appends a Risk delta section when there are messages.
  • internal/plan/risk_test.goTestRiskSummary_costCeilingIncreased, TestRiskSummary_newWriteLikeToolPermissions, baseline TestRiskSummary_newToolCreate_flagsWriteLikeWhenNoPriorState, plus table test for ActionSuggestsWriteSideEffects.

Acceptance

Criterion Test
Raising maxTotalCostUsd → “cost ceiling increased” TestRiskSummary_costCeilingIncreased
Adding a tool allow that matches the heuristic → write-permission style risk TestRiskSummary_newWriteLikeToolPermissions

Closes #13.

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
@leo-aa88 leo-aa88 merged commit 3500c3b into main Apr 11, 2026
4 checks passed
@leo-aa88 leo-aa88 deleted the issue/13-plan-risk branch April 11, 2026 21:06
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.

[MVP] Risk summary for plans (internal/plan/risk.go)

1 participant