MissionBudgetHook class
Policy hook that enforces four-dimension mission budgets (FR-005, FR-006). On breach, emits a typed BudgetBreach event via onBreach and cancels the mission by returning a HookDecisionCancelMission.
- Inheritance
-
- Object
- PolicyHook
- MissionBudgetHook
Constructors
- MissionBudgetHook({required MissionBudget budget, required BudgetBreachCallback onBreach, BudgetDegradeCallback? degradeCallback})
Properties
- budget → MissionBudget
-
final
- degradeCallback → BudgetDegradeCallback?
-
final
- enabled ↔ bool
-
Whether this hook is currently active. Disabled hooks are skipped by
the PolicyShell.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Stable identifier for this hook (e.g.
tool_gating,mission_budget,mission_trace).no setteroverride - onBreach → BudgetBreachCallback
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
afterToolCall(
ToolCallContext ctx, ToolResult result) → Future< ToolResult> -
Called after a tool has returned. May modify
result(e.g., the oversized-result guard swaps in an ArtifactReference).override -
beforeToolCall(
ToolCallContext ctx) → Future< HookDecision> -
Called before a tool is invoked. Returns a HookDecision that the
shell uses to allow / deny / cancel the call.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onMissionEnd(
String missionId) → Future< void> -
Called once when the mission ends (terminal state).
override
-
onMissionStart(
String missionId) → Future< void> -
Called once before the mission starts.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
trackerFor(
String missionId) → BudgetTracker
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited