Add framework documentation and offline example

This commit is contained in:
2026-07-28 04:53:51 +00:00
parent e4899fb54d
commit 9e68a2bbf7
15 changed files with 454 additions and 68 deletions

View File

@@ -7,13 +7,14 @@ rendering, and output-validation behavior. The
[architecture policy](../policy/architecture.md) owns the library boundary and
dependency rules. None of these internal packages is a supported consumer API,
and the root engine assembles them behind its public source options and values.
The [framework format reference](../formats.md) owns the exact file fields,
validation modes, built-in catalog, and source precedence.
## Prompt Definitions
`internal/promptdef` loads prompt definitions from an operating-system
filesystem or an `fs.FS`. It discovers YAML deterministically, decodes fields
strictly, validates definitions, selects an ID and optional version, and
resolves file-backed message content within the selected source.
`internal/promptdef` discovers YAML deterministically, decodes and validates
definitions, selects an ID and optional version, and resolves file-backed
message content within the selected operating-system or `fs.FS` source.
Its package tests own prompt selection, strict decoding, definition validation,
duplicate detection, and source containment:
@@ -21,10 +22,9 @@ duplicate detection, and source containment:
## Profiles And Built-Ins
`internal/profile` loads strictly decoded execution profiles from an
operating-system filesystem or an `fs.FS`. It validates required profile data,
rejects raw API keys, and supports a primary repository with fallback only
when the primary reports that a profile is absent.
`internal/profile` loads and validates execution profiles from an
operating-system filesystem or an `fs.FS`. It supports a primary repository
with fallback only when the primary reports that a profile is absent.
`internal/profile/builtin` embeds the maintained built-in profile catalog and
can place a caller-selected repository ahead of that catalog. Profile behavior
@@ -57,10 +57,9 @@ control into the rendered prompt. The
## Schemas And Output Validation
`internal/validate` provides validators backed by an operating-system
filesystem or an `fs.FS`. Validation can be skipped, require non-empty output,
require JSON, or apply a JSON Schema loaded with the source's path semantics.
Invalid generated content is returned as a validation result; inability to
load, register, or compile a schema is an operational error.
filesystem or an `fs.FS`. Invalid generated content is returned as a validation
result; inability to load, register, or compile a schema is an operational
error.
The [validator tests](../../internal/validate/standard_validator_test.go) own
basic, JSON, JSON Schema, source resolution, schema loading, compilation, and