Documentation
¶
Overview ¶
Package intent reads the proposals an agent writes and checks them against the closed catalogue (docs/spec/role-contract.md, "Intentions").
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Catalogue = map[string]bool{ "commit-message": true, "patch": true, "comment": true, "label": true, "issue": true, "release": true, "handoff": true, "note": true, "claim": true, }
Catalogue is every kind of intention the engine knows how to apply.
Functions ¶
func NormalizeDiff ¶
NormalizeDiff adds the `diff --git` line each file of a diff needs, when an agent left it out. git apply --recount relies on it to tell where a file ends: without it, a new file's `--- /dev/null` is read as a line removed from the file before. A file created or deleted also gets its mode line.
func PatchFiles ¶
PatchFiles lists the files a patch names: its `file`, or the `+++` lines of its diff. It reads names only; whether the diff applies is checked later.
func SortForApply ¶
func SortForApply(in []Intention)
SortForApply puts intentions in apply order, keeping the proposed order within a kind.
Types ¶
type Intention ¶
Intention is one proposal: its kind and its value.
func Merge ¶
Merge returns the fallback proposals with the agent's in place of those of the same kind (docs/spec/role-contract.md, "One run"). A patch replaces only the fallback patches of the files it touches: the agent fixing one doc does not drop what the role regenerated in another. A fallback patch given as a diff replaces nothing and is never replaced: it holds only the lines it changes, and is applied after the agent's, beside them.