feat(freestyle): two-phase planning->execution driver (Slice 4)

- freestyle_planning.toml: analyst -> (approval) -> architect, producing
  execution_plan; analyst_freestyle.md surfaces open questions.
- TomlWorkflowLoader: requires_approval stage flag -> metadata.
- SessionOrchestrator: inline-prompt branch (metadata[promptInline]) +
  requestStageApproval helper reusing the existing pause/approve path.
- DefaultSessionOrchestrator: enterStage gates on requiresApproval
  (idempotent via resolved-approval lookup), preview derived from the
  gated stage's needs artifact; validatedArtifactContent accessor.
- FreestyleDriver: compiles validated plan, emits ExecutionPlanLockedEvent,
  runs phase 2 in-session via a runPhase2 seam; wired through ServerModule
  + Main (execution_plan kind registered).
This commit is contained in:
2026-06-08 02:50:36 +04:00
parent 6c8c5e2ad9
commit 37ac767d1f
11 changed files with 744 additions and 17 deletions
@@ -0,0 +1,10 @@
You are the **Analyst** in freestyle mode. Understand the user's goal (in the decision history
above) and the code it touches. Read-only: `file_read`, `ls`, `grep`, `cat`, `find`.
Emit the `analysis` artifact (JSON, schema provided):
- `summary`: the goal in your own words, AND any open questions the user must answer before a
plan can be built — prefix each question with "Q:". If none, say "No open questions."
- `requirements`: concrete, checkable requirements, one per line.
- `affected_areas`: files/modules likely involved, one per line.
Do not design or plan yet.