feat: add an optional pre-dispatch tool policy hook #225
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.32) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.32 · 135 lines diff across 1 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.294
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #225"
general
weight: 0.35
aramase
Hosts had no place to apply their own policy right before a host tool runs. This adds an optional hook at both dispatch sites, with the refusal semantics agreed in #127.
controller.WithToolPolicy/placement.WithToolPolicyrun right before the executor, for ordinary and approved calls. The hook gets a copy of the call rebuilt from its journaled form, the verified caller and the committed decision. A number the journal would round (2^53 or above) is refused transiently without asking the hook.FAILED_PRECONDITIONand stays recoverable.POLICY_DENIEDreceipt that recovery and replay serve as written. An executor returning that code is rejected.0.4.0-draft), docs, CHANGELOG. The schema stays at v7. An older build refuses an affected session on verification (DATA_LOSS), but its raw Replay RPC still streams the record.Tested with
go test -race ./..., golangci-lint, and an upstream/main build reading a journal from this branch.Fixes #168