Skip to content

Schema-driven generation and typed-outputs hardening (follow-on to #272) #275

Description

@anticomputer

Follow-on work after the typed-outputs / grammar-maturity PR (#272). Now that the outputs contract is standard JSON Schema (Draft 2020-12) and capture selects tool-result vs response text, the schema-driven pieces below are the natural next steps. Split out of #272 to keep that PR reviewable as a coherent unit.

Schema-driven generation (highest value)

  • Pass the outputs JSON Schema to each backend's native structured-output surface (OpenAI response_format, Anthropic tool input_schema; copilot_sdk falls back to validate-only) so the model is constrained to emit conforming output instead of relying on prompt prose. This is what makes capture: response + outputs reliable rather than best-effort.

Retry-to-repair

  • On strict-validation failure, re-prompt the model with the validation error (bounded) so strict validation is robust rather than brittle. Knob: outputs_retries.

Reusable schemas

  • A shared-schema mechanism (top-level schemas: / document type) so a contract can be defined once and referenced across tasks.

format policy

  • Decide whether to enforce JSON Schema format (jsonschema does not by default) and enable a FormatChecker if so.

Multi-model fan-in observability

  • Surface per-branch validation errors (not just result: null) and add a consensus/merge helper over per-model typed results.

Friendlier validation errors

  • Wrap jsonschema pointer-path messages into field-oriented messages for YAML authors.

CLI mode-flag ergonomics

  • Reject ambiguous combinations of the mutually-exclusive terminal modes (--schema / --manifest / --lint / --list-models) with a clear error, instead of silently applying precedence, while still allowing each mode's legitimate modifiers (e.g. --lint with -t/-m).

Deferred (not planned)

An opt-in coercing mode: strict validation is intentional; the preferred path is generation + repair above.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions