feat(server,kernel): post-plan approval gate — operator reviews plan before lock

After a freestyle plan compiles successfully, requestPlanApproval is invoked
before ExecutionPlanLockedEvent is emitted. Rejection emits
ExecutionPlanRejectedEvent(source="operator") with no lock and no phase-2 run.
Adds public SessionOrchestrator.requestPlanApproval seam delegating to
requestStageApproval, wired in Main.kt. Two new tests cover the reject and
approve paths; existing tests stay green via the default passthrough param.
This commit is contained in:
2026-06-10 21:36:17 +04:00
parent 3d43f34d3b
commit 0de02bb3a7
4 changed files with 86 additions and 0 deletions
@@ -1560,6 +1560,10 @@ abstract class SessionOrchestrator(
}
}
/** Public seam for out-of-band gates (e.g. freestyle plan review) that reuse the stage-approval flow. */
suspend fun requestPlanApproval(sessionId: SessionId, preview: String): Boolean =
requestStageApproval(sessionId, StageId("plan_review"), preview)
// --- private functions ---
private suspend fun handleApproval(