fix(research): refuse re-granting an active grant; add a revoked grant's new budget once #251
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 399 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.358
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #251"
general
weight: 0.35
abendrothj
What and why
Fixes #235.
POST /api/v1/grantsreturned 200 and kept the old budget when the steward had already granted the researcher the connector, active or revoked: the grant id is reused andBudgetLedger::openonly inserts. A steward re-granting an exhausted researcher got 0 remaining with no sign why.tenant.provisioneddenied,reason=already_granted). The body says to raise the budget withPOST /api/v1/grants/{grant_id}/budget.research.budget. If re-activation fails, nothing changed and a retry adds its own amount. If funding fails after it, the grant is active with its old budget and a retry gets 409: nothing is added twice or dropped.top_up_oncethat creates the entry if it is missing, so a failed approval leaves no placeholder entry and "has an entry" means "funded". Zero budgets stay grantable.revoked_sincestill refuses a stale approval retry after a second revoke.research.budgetwith the actual change.How it was tested
- a re-grant after a failed one adds its own amount (38, not 78);
- a failed re-grant leaves 28, and a later approval of 5 gives 33;
- a second revoke still refuses a stale approval retry (404);
- a failed approval leaves no entry, so a direct grant funds it;
- a revoke queued before an approval lands before its decision;
- a steward top-up racing an approval isn't audited as the approval's;
- a zero re-grant audits nothing.
audit_coverage.rs: thealready_granteddenial, the re-grant and follow-up-approval top-ups, and nothing for a retry.cannot_reset_budget_spend_by_regranting(#241) now expects the re-grant's budget to be added and the spend kept (limit 102, spent 1).Checklist
scripts/check.shpasses locallySECURITY_AUDIT_EVENTcovered byaudit_coverage.rsdocs/DATA_POLICY.md)CHANGELOG.mdupdated for user-visible changesdocs/adr/if one was made: n/a