Plan prompt-owned schema support
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
# Prompt-Owned Inline And Source-Relative Schemas
|
||||
|
||||
Status: accepted design decisions and implementation roadmap. All three decisions
|
||||
are settled. Examples describe target, not implemented, syntax.
|
||||
Status: accepted feature roadmap. All three decisions are settled. Examples
|
||||
describe target, not implemented, syntax. The companion
|
||||
[implementation plan](implementation.md) owns staged execution and concrete API
|
||||
and migration details.
|
||||
This document authorizes no code changes and selects no release number.
|
||||
|
||||
## Purpose And Boundary
|
||||
@@ -137,9 +139,9 @@ a root or migrate their schema selection.
|
||||
Retain the ability to supply explicit schema directories and filesystems through
|
||||
Go configuration helpers, but fit those helpers into ConfigKit's normal source
|
||||
composition. Do not give Go options a special precedence rule or retain a second
|
||||
runtime override pass. API planning must spell out the helper adaptation and any
|
||||
migration required; unchanged legacy option behavior is not a requirement where
|
||||
it conflicts with this decision.
|
||||
runtime override pass. The companion implementation plan specifies helper
|
||||
adaptation and migration; unchanged legacy option behavior is not a requirement
|
||||
where it conflicts with this decision.
|
||||
|
||||
### Effective Source Context And Composition
|
||||
|
||||
@@ -223,7 +225,7 @@ schema pipeline. Do not treat `false` as absence or impose an object-only rule
|
||||
merely for a convenient Go representation. Use existing JSON-compatible handling
|
||||
rather than introduce a numeric-conversion adapter or precision guarantees beyond
|
||||
those of the selected input path. File-backed JSON decoding retains its existing
|
||||
behavior. Exact public Go types remain API-planning work.
|
||||
behavior. The companion implementation plan selects concrete public Go types.
|
||||
|
||||
Preserve existing structured-output naming, validation/repair semantics, and hash
|
||||
responsibilities. Account for new configured fields in existing projections and
|
||||
@@ -240,37 +242,6 @@ the existing independence from the retrieval filename. Use the same schema value
|
||||
for local validation and provider constraints. Schema bundling, remote loading,
|
||||
and new provider-specific dialects are outside this work.
|
||||
|
||||
## Work From The Baseline
|
||||
|
||||
1. **Specify concrete API shapes.** Translate the accepted decisions into YAML,
|
||||
typed prompt sources, and request-level overrides. Define the Go representation
|
||||
of inline values, preserving absence, empty objects, and boolean schemas.
|
||||
Specify helper migration without changing ConfigKit's composition rules.
|
||||
2. **Capture schema ownership.** Extend configuration decoding, normalization,
|
||||
domain selection, and inspection. Share the existing effective-field resource
|
||||
resolution mechanics where useful, but separate resource binding from file
|
||||
reading so schema bytes remain preparation-time data. Capture optional roots
|
||||
and their effective contexts, then apply the accepted scope-selection rule.
|
||||
3. **Unify schema preparation.** Extend the validator's input route to consume
|
||||
the selected inline value or file source. Retain one compilation/plan path for
|
||||
local checks, provider metadata, and repairs. Adapt explicit-root source helpers
|
||||
to native ConfigKit composition and remove the implicit root; avoid parallel
|
||||
validators with divergent semantics.
|
||||
4. **Complete public integration.** Update output-contract conversion, typed
|
||||
helpers, prompt inspection, preparation details, and ordinary/prepared runs.
|
||||
Check request replacement, continuation, and smoke-test paths that use output
|
||||
contracts. Preserve detachment and avoid leaking filesystem capabilities into
|
||||
generically renderable inspection values.
|
||||
5. **Verify and document.** Add focused offline coverage below; update the format
|
||||
reference, GoDoc, consumer examples, and internal source/validation documentation
|
||||
when implementation lands. Show embedded and operator collections coexisting,
|
||||
switching forms, and configuring optional roots. Document migration from the
|
||||
implicit root and any Go helper/API changes without selecting a release here.
|
||||
|
||||
Internal refactoring is permitted; these steps specify behavior and ownership,
|
||||
not a permanent package layout. No interim application asset assembly layer is
|
||||
needed to make the feature usable.
|
||||
|
||||
## Validation Targets
|
||||
|
||||
Use the consumer request's scenarios with real configuration composition and
|
||||
@@ -375,10 +346,3 @@ runtime-selected bundles by reusing PromptKit's reading, decoding, diagnostics,
|
||||
and preparation lifecycle. It adds a public resource type and ownership/lifetime
|
||||
semantics. Revisit only for a concrete consumer need; configured collections do
|
||||
not require it. Neither approach needs implicit working-directory lookup.
|
||||
|
||||
## Remaining Planning Work
|
||||
|
||||
No product decisions remain open among Decisions 1–3. Implementation planning
|
||||
still needs concrete public Go shapes and the adaptation/migration of existing
|
||||
schema-source helpers within the accepted ConfigKit composition model. These
|
||||
details must preserve the accepted scope and selection rules.
|
||||
|
||||
Reference in New Issue
Block a user