Skip to content

[P2] Output schema validation as a first-class gate #8

@escapeboy

Description

@escapeboy

Reported by FleetQ as a P2 power feature. Allow scripts to declare an output JSON Schema; Boruna validates the return value before yielding it. Saves every integrator from re-implementing this in their host language.

Ask

fn main() -> Map<String, String> !{out_schema=schema.json} {
    ...
}

Or, less invasive: a boruna_run parameter output_schema: object that runs the validator after execution and returns a structured validation_failed error if the result doesn't match.

Notes for implementers

  • The simpler MCP-parameter form does not require any compiler change.
  • Use jsonschema crate (Rust) for validation; behavior matches the JSON Schema 2020-12 spec used in docs/reference/policy.schema.json.
  • The compiler-annotation form is a larger language design question — defer until the runtime mechanism exists.

Source: FleetQ implementer feedback letter, 2026-04-25 (P2 #8).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions