feat: validate workflow agent output schemas #373

Merged
dries merged 2 commits from fix/workflow-json-output-hardening into main 2026-07-18 10:11:05 +02:00
Owner

Summary

  • add optional agent.outputSchema to JSON/YAML workflow definitions and MCP authoring guidance
  • compile schemas during validate/publish and reject external references
  • include required schemas in agent prompts and validate final responses at runtime
  • accept any completed response when no schema is declared
  • silently unwrap Markdown-fenced JSON before schema validation and allow one corrective retry
  • add schemas to the migration workflow outputs consumed downstream

Testing

  • failing-first schema/no-schema runtime tests
  • make lint
  • make test
  • go test -cover ./internal/workflows ./internal/mcp
  • pnpm exec tsc -b
## Summary - add optional `agent.outputSchema` to JSON/YAML workflow definitions and MCP authoring guidance - compile schemas during validate/publish and reject external references - include required schemas in agent prompts and validate final responses at runtime - accept any completed response when no schema is declared - silently unwrap Markdown-fenced JSON before schema validation and allow one corrective retry - add schemas to the migration workflow outputs consumed downstream ## Testing - failing-first schema/no-schema runtime tests - `make lint` - `make test` - `go test -cover ./internal/workflows ./internal/mcp` - `pnpm exec tsc -b`
fix: harden workflow JSON output handling
Some checks are pending
CI / Build Desktop (macOS arm64) (pull_request) Successful in 2m8s
CI / Frontend (pull_request) Successful in 5m58s
CI / Backend (pull_request) Successful in 6m6s
CI / Playwright E2E (pull_request) Successful in 9m3s
CI / Build (pull_request) Successful in 6m22s
CI / Semantic Tag (pull_request) Waiting to run
CI / Coverage Results (pull_request) Successful in 32s
a6281c63f6
Append a JSON-output instruction to every agent prompt and silently
strip a surrounding Markdown code fence from agent and command output
before validation, so a fenced JSON result no longer triggers a
correction round-trip or a hard failure.

Coverage ratchet: pass

Suite Baseline This PR Δ
frontend 65.73% 65.73% +0.00
go 77.40% 77.50% +0.10

Tolerance: -0.1%. Baseline stored on gh-pages.

<!-- coverage-ratchet --> ### Coverage ratchet: ✅ pass | Suite | Baseline | This PR | Δ | | |---|---|---|---|---| | frontend | 65.73% | 65.73% | +0.00 | ✅ | | go | 77.40% | 77.50% | +0.10 | ✅ | _Tolerance: -0.1%. Baseline stored on `gh-pages`._
feat: add workflow agent output schemas
All checks were successful
CI / Build Desktop (macOS arm64) (pull_request) Successful in 2m0s
CI / Frontend (pull_request) Successful in 6m20s
CI / Build (pull_request) Successful in 6m55s
CI / Backend (pull_request) Successful in 9m18s
CI / Playwright E2E (pull_request) Successful in 9m17s
CI / Coverage Results (pull_request) Successful in 38s
CI / Semantic Tag (pull_request) Successful in 15s
02a9ee9c5b
dries changed title from fix: harden workflow JSON output handling to feat: validate workflow agent output schemas 2026-07-18 00:04:32 +02:00
dries merged commit 2ad6605423 into main 2026-07-18 10:11:05 +02:00
Sign in to join this conversation.
No description provided.