Extract prompt sources and rendering internals

This commit is contained in:
2026-07-28 04:18:09 +00:00
parent ad1f2674ab
commit ebc1f3e919
69 changed files with 2844 additions and 13 deletions

View File

@@ -15,10 +15,14 @@ contributor workflow and validation.
| `internal/domain` | Defines internal framework values for requests, artifacts, prompt definitions, profiles, execution targets, rendering, generation, and validation. | [Domain declarations](../../internal/domain/domain.go) |
| `internal/defaults` | Defines application-neutral framework constants and constructs the default execution target. It contains no CLI, server, or inbound HTTP limits. | [Framework defaults](../../internal/defaults/defaults.go) |
| `internal/filecatalog` | Provides deterministic YAML discovery and path helpers for operating-system filesystems and `fs.FS` sources. | [File catalog](../../internal/filecatalog/catalog.go) |
| `internal/promptdef` | Loads strictly decoded, validated prompt definitions from filesystem and `fs.FS` sources, including version selection and contained file-backed message content. | [Prompt-definition repository](../../internal/promptdef/filesystem_repository.go) |
| `internal/profile` | Loads strictly decoded, validated execution profiles from filesystem and `fs.FS` sources and composes repositories with error-preserving fallback. | [Profile repositories](../../internal/profile/filesystem_repository.go) |
| `internal/profile/builtin` | Embeds the built-in execution profile catalog and combines it with an optional primary repository. | [Built-in profile repository](../../internal/profile/builtin/repository.go) |
| `internal/prompt` | Renders prompt messages from Go templates with artifact, variable, session, and cache-control data. | [Go-template renderer](../../internal/prompt/go_renderer.go) |
These packages form the internal extraction foundation. Prompt and profile
sources, rendering, artifact reading, validation, model clients, orchestration,
and a usable public engine are not implemented in Promptkit yet.
These packages provide the internal model, source, and rendering foundation.
Artifact reading, output validation, model clients, orchestration, and a usable
public engine are not implemented in Promptkit yet.
## Maintenance

View File

@@ -16,19 +16,27 @@ The module root contains package `promptkit`, which is the public facade. It
declares the module's public package boundary but does not yet provide a usable
exported framework API.
The implemented internal foundation consists of:
The implemented internal components consist of:
- `internal/domain`, which owns framework data values shared by later internal
components;
- `internal/defaults`, which owns application-neutral framework defaults and
constructs the default execution target; and
- `internal/filecatalog`, which discovers YAML files and provides source-path
helpers for filesystem and `fs.FS` consumers.
helpers for filesystem and `fs.FS` consumers;
- `internal/promptdef`, which loads and validates prompt definitions from
filesystem and `fs.FS` sources;
- `internal/profile`, which loads, validates, and overlays execution profiles
from filesystem and `fs.FS` sources;
- `internal/profile/builtin`, which embeds the built-in execution profile
catalog; and
- `internal/prompt`, which renders prompt messages from Go templates.
`internal/defaults` depends on `internal/domain`; the file catalog is
independent and uses only the standard library. Prompt and profile sources,
rendering, artifact reading, validation, model clients, orchestration, and the
public engine have not yet been extracted.
The defaults and renderer depend on the domain model. Prompt-definition and
profile repositories use the domain model, file catalog, and YAML decoder. The
built-in profile repository supplies an embedded `fs.FS` to the profile
package. Artifact reading, output validation, model clients, orchestration, and
the public engine have not yet been extracted.
Future framework extraction must follow this dependency direction: