feat(orchestration): plan grounding, positive-pattern mining, stage-prompt audition rig

Vikunja #167/#168/#169.

#167 PlanGrounder (infrastructure/workflow): build-prereq + touches-scope
existence grounding, emits PlanGroundingEvaluatedEvent. Deterministic fold
over recorded workspace/plan events (invariants #8/#9).

#168 positive-pattern mining (SessionOrchestratorPlanPatterns): mine
SuccessfulPlanShape from cross-session log — a locked plan whose own
workflow later completed — and inject the closest-resembling plan shape as
L0/SYSTEM advisory context for the planning stage. Keyword-Jaccard
resemblance, no LLM/embedder, replays identically. Advisory only (#3).

#169 stage-prompt audit + CORREX_STAGE_GUIDANCE ON/OFF toggle in
SessionOrchestratorExecution. RunCommand gains --intent to seed a
freestyle session over REST.

Also: workspace verification events + concept-compiler wiring. ./gradlew
check green.
This commit is contained in:
2026-07-16 14:55:56 +04:00
parent ed7efb6072
commit 53d8108189
27 changed files with 1379 additions and 53 deletions
@@ -29,7 +29,7 @@ import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
@Serializable
private data class StartSessionRequest(val workflowId: String, val sessionId: String?)
private data class StartSessionRequest(val workflowId: String, val sessionId: String?, val intent: String? = null)
@Serializable
private data class StartSessionResponse(val sessionId: String)
@@ -60,6 +60,7 @@ class RunCommand : CliktCommand(name = "run") {
private val workflow by option("--workflow", help = "Path to workflow definition").required()
private val sessionId by option("--session", help = "Existing session ID to resume")
private val autoApprove by option("--auto-approve", help = "Auto-approve all approval requests").flag()
private val intent by option("--intent", help = "Freestyle intent to seed a new session")
private val host by option("--host", help = "Server host").default("localhost")
private val port by option("--port", help = "Server port").default("$DEFAULT_PORT")
@@ -108,7 +109,7 @@ class RunCommand : CliktCommand(name = "run") {
): String? = runCatching {
val resp = client.post("http://$host:$portInt/sessions") {
contentType(ContentType.Application.Json)
setBody(StartSessionRequest(workflowId = resolveWorkflowId(workflow), sessionId = sessionId))
setBody(StartSessionRequest(resolveWorkflowId(workflow), sessionId, intent))
}
resp.body<StartSessionResponse>().sessionId
}.getOrElse { e ->