Make validation cancellation authoritative
This commit is contained in:
@@ -130,6 +130,16 @@ their paths once and enforce the configured source boundary. The
|
||||
provider-facing structured-output metadata uses the root document captured by
|
||||
the same plan.
|
||||
|
||||
Schema preparation and execution remain synchronous. Promptkit checks
|
||||
cancellation before and after source resolution, JSON decoding, compilation,
|
||||
and validation, and between bounded schema-read chunks. Once cancellation is
|
||||
observed it returns the context error without publishing a partial plan or
|
||||
validation result, even when a compiler or validator has just returned a
|
||||
different error or a successful result. An `fs.FS` method or JSON Schema
|
||||
dependency call already in progress cannot be preempted; Promptkit waits for
|
||||
that call to return and then gives cancellation precedence. Validation does
|
||||
not detach dependency work into background goroutines.
|
||||
|
||||
`Prepare` discards its validation plan after returning metadata. `Run` retains
|
||||
its plan for initial and repaired-output validation, then discards it with the
|
||||
operation. `PrepareExecution` retains the plan in its private frozen payload;
|
||||
@@ -139,6 +149,7 @@ performs fresh source resolution and preparation.
|
||||
|
||||
The [validator tests](../../internal/validate/standard_validator_test.go) own
|
||||
basic, JSON, JSON Schema, source resolution, schema loading, compilation,
|
||||
frozen-reference behavior, and content-failure behavior. Prepared execution
|
||||
frozen-reference behavior, content-failure behavior, and the synchronous
|
||||
cancellation boundary. Prepared execution
|
||||
orchestration is owned by the
|
||||
[use-case tests](../../internal/usecase/prepared_execution_test.go).
|
||||
|
||||
Reference in New Issue
Block a user