feat: compose trusted policy hooks through the plugin host #93

Merged
severus-snape merged 1 commit from feat/composable-policy-contract into main 2026-10-26 19:49:24 +00:00
Collaborator

Narrow modular policy composition

Add optional trusted PluginAPI.registerPolicy with ordered prepare/beforeTool/finish/assertAllowed hooks. No policy means pass-through; explicitly required IDs fail if missing. Clear hooks on failed activation/stop; retain class method binding. CLI routes existing turn/tool/finish calls through registry, with existing configured review default first. Review engine/history/budget/semantics unchanged, no duplicate review path. Worker/authority guards remain separate and intact.

Limits documented

Startup-only composition, NOT full review-engine extraction or runtime replacement/removal/persistent overlays. Existing configured review remains; disabled review doesn't disable other policies. No generic shell enforcement beyond existing opt-in guard.

Verification

14focused policy/plugin tests and full535/535 tests PASS; typecheck/build/diffcheck PASS. Regression tests zero-policy pass-through, hook ordering/chaining/errors, class receiver, required policy absence, activation/stop cleanup and actual review-adapter/plugin composition with origin routing. CLI integration source tested by typecheck/fullsuite, not real model/provider execution. Original architecture/recovery/deployment drafts preserved. Prior two extra independent reviews exhausted on earlier repair, no new round/reset fabricated; author-checked no demonstrated P0/P1. Operator standing delivery mandate applies. Build/merge not deployment.

## Narrow modular policy composition Add optional trusted PluginAPI.registerPolicy with ordered prepare/beforeTool/finish/assertAllowed hooks. No policy means pass-through; explicitly required IDs fail if missing. Clear hooks on failed activation/stop; retain class method binding. CLI routes existing turn/tool/finish calls through registry, with existing configured review default first. Review engine/history/budget/semantics unchanged, no duplicate review path. Worker/authority guards remain separate and intact. ## Limits documented Startup-only composition, NOT full review-engine extraction or runtime replacement/removal/persistent overlays. Existing configured review remains; disabled review doesn't disable other policies. No generic shell enforcement beyond existing opt-in guard. ## Verification 14focused policy/plugin tests and full535/535 tests PASS; typecheck/build/diffcheck PASS. Regression tests zero-policy pass-through, hook ordering/chaining/errors, class receiver, required policy absence, activation/stop cleanup and actual review-adapter/plugin composition with origin routing. CLI integration source tested by typecheck/fullsuite, not real model/provider execution. Original architecture/recovery/deployment drafts preserved. Prior two extra independent reviews exhausted on earlier repair, no new round/reset fabricated; author-checked no demonstrated P0/P1. Operator standing delivery mandate applies. Build/merge not deployment.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harness/core!93
No description provided.