Documentation
¶
Overview ¶
Package overrides applies a resolved override declaration to a skill's upstream content (spec 023): whole-file replacement, unified-diff patches, and prepend/append layering, in that fixed order.
The pipeline is a deterministic function of its inputs — the same upstream content, declaration, and input files always produce the same bytes — which is what lets the result be committed and reproduced from a clone (FR-009).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply transforms skillDir in place, resolving override inputs against repoRoot. Stages run in the fixed order replace → patch → layer (FR-004): replace establishes the file that ships, patch adjusts that file, and layering goes last so appended content is never itself patched.
The whole operation is all-or-nothing (FR-011). Work happens on a staged copy and is swapped in only after every stage succeeds, so a patch that stops applying leaves the previously materialized content exactly as it was — never half-transformed.
func Materialize ¶
Materialize copies src into a scratch directory and transforms the copy, returning the transformed directory and a cleanup to run when the caller is done with it. An empty declaration hands back src itself with a no-op cleanup, so a caller needs no special case.
It exists because two callers need the *result* rather than an in-place transformation: the installer, which must not write to the shared clone cache or to a local source the user owns, and the reconcile path, which hashes what would ship before deciding whether to ship it. Both must see identical bytes, so they run the identical pipeline.
Types ¶
type Spec ¶
Spec is a resolved override declaration with repo-relative input paths.
func (Spec) Empty ¶
Empty reports whether the declaration transforms nothing, in which case Apply leaves the tree untouched and the skill keeps its upstream hash.