Documentation
¶
Overview ¶
Package prompt renders a stage's model prompt from templates. The defaults are embedded so the binary is self-contained; a repo may override any stage by dropping a same-named template under .adh/prompts (SPEC-ADDITIONS §18.1, the editable guiding artifact). It is a pure renderer: data in, string out, no I/O beyond the read-only embedded and override filesystems handed to New.
Index ¶
Constants ¶
const RepoOverrideDir = ".adh/prompts"
RepoOverrideDir is the conventional repo path a project drops stage templates into to override the embedded defaults (SPEC-ADDITIONS §18.5 artifact_roots).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer renders a stage's prompt. Templates are keyed by "<stage>.tmpl"; embedded defaults are overlaid by any override filesystems, later ones winning.
func Default ¶
Default builds a Renderer from the embedded defaults, overlaid with the repo's RepoOverrideDir templates when that directory exists. A missing directory is not an error: fs.Glob over it matches nothing, so the defaults stand.
func New ¶
New builds a Renderer from the embedded default templates, then overlays each override filesystem (a *.tmpl set, e.g. os.DirFS(".adh/prompts")). A nil or template-free override is skipped; a malformed template is an EINVALID error.
func (*Renderer) Render ¶
Render produces the prompt for arc's current stage. ground is the stage's routed working set (§10, §19.1); it may be nil (an ungrounded stage). Ops has no prompt (it ships via close, not a model step) and an unknown stage has no template; both return EINVALID rather than a silent empty prompt.
The view is checked against ground.Denied (`[critic] deny`, §19.4) once built. The deny list rides on the grounding rather than arriving as a parameter because `prompt` must not import `config`, and threading a policy argument through Emit and Request to reach one assertion would widen two signatures in two packages for it.