Documentation
¶
Overview ¶
Package render materialises the embedded defaults against a resolved selection. It renders skill templates (text/template with AST-level identifier validation against the catalog), prunes pipeline nodes whose agents have been deselected, and computes fingerprints used by the drift-detection path in `internal/workspace`.
Index ¶
- Constants
- func Fingerprint(data []byte) string
- func IsDrifted(workspaceRoot, pipelinePath string) (bool, error)
- func Pipeline(src []byte, cat *catalog.Catalog, sel map[string]bool) ([]byte, []string, error)
- func ReadFingerprint(workspaceRoot string) (string, error)
- func Skill(src []byte, ctx Ctx, cat *catalog.Catalog) ([]byte, error)
- func WriteFingerprint(workspaceRoot, hex string) error
- type ComponentCtx
- type Ctx
Constants ¶
const FingerprintFileName = ".bender/.pipeline.fingerprint"
FingerprintFileName is the hidden sidecar where init records the SHA-256 of the last-generated `.bender/pipeline.yaml`, relative to workspace root.
const TemplateSuffix = ".tmpl"
TemplateSuffix identifies a file that must be rendered rather than copied verbatim. Shipped files under `defaults/claude/skills/**` are either `SKILL.md` (verbatim) or `SKILL.md.tmpl` (templated).
Variables ¶
This section is empty.
Functions ¶
func Fingerprint ¶
Fingerprint returns the lowercase-hex SHA-256 of the given bytes. Used to compare "what init would write now" against "what's on disk" to decide whether the user has edited the file.
func IsDrifted ¶
IsDrifted returns true when the pipeline.yaml at pipelinePath differs from the bytes whose fingerprint was recorded in the sidecar. A missing sidecar is treated as "user-edited" (safe default).
func Pipeline ¶
Pipeline re-renders pipeline.yaml against the resolved selection, dropping nodes whose agent belongs to a deselected component and pruning `depends_on` references to dropped nodes. Returns the marshalled bytes and the set of dropped node ids (for the init summary + conflict report).
func ReadFingerprint ¶
ReadFingerprint returns the sidecar's recorded hex (empty string if absent — callers treat "no sidecar" as "user-edited" by default).
func Skill ¶
Skill parses the given template source, validates that every referenced component id exists in the catalog (AST pre-pass; fails before any file is written), and renders the template against `ctx`. Returns the rendered bytes and a slice of WARNINGS: empty on a clean render; non-empty when the template parsed but referenced identifiers that should be surfaced.
func WriteFingerprint ¶
WriteFingerprint writes the sidecar to workspaceRoot, creating the `.bender/` dir if needed.
Types ¶
type ComponentCtx ¶
ComponentCtx is the per-component view exposed to templates.