Files
weatherreporter/docs/internal/promptkit-adapter.md

1.2 KiB

Promptkit Adapter Internals

internal/adapters/promptkit maps Weatherreporter's project-owned executor contract to Promptkit. The CLI maps promptkit configuration to a PromptExecutorConfig and constructs one executor per action. Promptkit dependency types do not escape the adapter.

The adapter exposes exact prompt and profile inspection plus prepared execution. It maps Promptkit inspection values to project-owned prompt input, output-contract, profile, preparation, execution, validation, and optional debug values. It classifies adapter failures without copying provider secrets or unbounded response bodies into application errors or normal state.

The app calls the executor's preparation callback before provider execution to persist safe preparation provenance. Completed executions are then persisted as safe execution provenance and raw generated text is validated by internal/generatedtext. The adapter does not write workspace state, render Markdown, choose report definitions, or send Distributor notifications.

Focused tests:

go test ./internal/adapters/promptkit ./internal/cli ./internal/app

The public logical prompt/profile/schema contract is owned by the Promptkit integration guide.