Verify self-contained schema preparation and submission

This commit is contained in:
2026-11-05 13:59:40 +00:00
parent cddb2b389c
commit 0aceff8c08
8 changed files with 118 additions and 15 deletions

View File

@@ -884,6 +884,12 @@ secret-handling policies.
## Extension Interfaces
JSON Schema validation and native structured output use a self-contained root
document. Internal references are supported; references to other files or
network resources fail during preparation. `WithSchemaFile` selects one root
file, while `WithSchemaFS` and `SchemaDir` select a root source. Prepared
executions retain their captured schema even if the source later changes.
Inject an [`LLMClient` or `ArtifactReader`](../../types.go) when the built-in
behavior does not fit the application. Their GoDoc defines concurrent use,
context handling, ownership of copied values, nil responses, and preservation

View File

@@ -418,8 +418,9 @@ generic inheritance and layer mechanics, consult
## Schemas
Schemas are JSON documents selected by a prompt or request `schema_path`.
Directory and `fs.FS` schema paths resolve within the configured root;
referenced nested schemas resolve relative to the owning schema document.
Directory and `fs.FS` schema paths resolve within the configured root. Each
schema must be self-contained: in-document references, IDs, and anchors are
supported, but references requiring another file or network resource fail.
`WithSchemaFile` exposes one schema under its base name. An unreadable,
invalid, or unresolvable schema causes an operational validation error.
Valid JSON that fails the schema instead yields a failed validation result.

View File

@@ -216,10 +216,10 @@ instead of first making a response-sized string copy.
Every preparation operation creates one operation-local validation plan. None,
basic, and JSON modes retain the effective output contract without source
access. JSON Schema mode loads the root document once, resolves and compiles
each transitive reference, and retains the compiled validator. Schema compiler
resources use canonical escaped file or private-scheme URLs; loaders decode
their paths once and enforce the configured source boundary. The
access. JSON Schema mode loads the root document once, compiles its declared
schema locations, and retains the compiled root validator. External resources
are rejected without file or network loading; in-document references remain
supported. Root resources use canonical escaped file or private-scheme URLs. The
provider-facing structured-output metadata uses the root document captured by
the same plan.

View File

@@ -375,6 +375,10 @@ recursive/dynamic references, embedded dialects, and independent instances.
validate/engine tests finish the schema transition. No local-only mode, bundler,
new dialect, or release/publication prerequisite is introduced.
Completion: schema-file option, frozen preparation, native submission, and
external-reference rejection are covered through public APIs. Root, validation,
and engine tests pass on Go 1.27.3; current schema guidance is aligned.
## Stage 14: Merge Provider Maps Into One Owned Lower Copy
**Catalog:** 19. **Files:** configuration targets and focused overlay tests.