feat(workflow): execution_plan artifact kind + schema + architect prompt
Add docs/schemas/execution_plan.json (goal/stages/edges), the architect_freestyle prompt that instructs emitting the execution pipeline as JSON, and register the execution_plan llm-emitted kind in both artifacts.config.toml and sample-config.toml. Validated via ExecutionPlanSchemaValidationTest (minimal plan passes; missing stages rejected).
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
package com.correx.core.validation.artifact
|
||||
|
||||
import com.correx.core.artifacts.kind.JsonSchema
|
||||
import com.correx.core.artifacts.kind.JsonSchemaProperty
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.junit.jupiter.api.Assertions.assertTrue
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class ExecutionPlanSchemaValidationTest {
|
||||
|
||||
private val schema = JsonSchema(
|
||||
type = "object",
|
||||
properties = mapOf(
|
||||
"goal" to JsonSchemaProperty(type = "string"),
|
||||
"stages" to JsonSchemaProperty(type = "array"),
|
||||
"edges" to JsonSchemaProperty(type = "array"),
|
||||
),
|
||||
required = listOf("goal", "stages", "edges"),
|
||||
additionalProperties = true,
|
||||
)
|
||||
|
||||
private fun errors(json: String) =
|
||||
JsonSchemaValidator.validate(schema, Json.parseToJsonElement(json))
|
||||
|
||||
@Test
|
||||
fun `minimal valid execution plan passes`() {
|
||||
val plan = """
|
||||
{
|
||||
"goal": "g",
|
||||
"stages": [{"id": "s", "prompt": "p", "produces": "x"}],
|
||||
"edges": []
|
||||
}
|
||||
""".trimIndent()
|
||||
assertTrue(errors(plan).isEmpty())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `plan missing stages is rejected`() {
|
||||
val plan = """{"goal": "g", "edges": []}"""
|
||||
assertTrue(errors(plan).any { it.contains("stages") })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user