Documentation
¶
Overview ¶
Package profile computes the risk profile and a working-tree fingerprint (docs/spec/workflow.md §5).
Index ¶
- func Commits(p *project.Project, since, id string) []string
- func CommitsFull(p *project.Project, since, id string) []string
- func Compute(p *project.Project, changes []Change) string
- func EmptyTree(p *project.Project) string
- func Fingerprint(p *project.Project) string
- func Fresh(p *project.Project, recorded string) bool
- func Managed(rel string) bool
- func ManagedIn(p *project.Project, rel string) bool
- type Change
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Commits ¶
Commits returns the short hashes of the task's commits: made after it was created (RFC 3339) and naming it, or no task, in their AI-Task trailer. Commit times are read per commit, so a commit with a skewed date does not hide the others.
func CommitsFull ¶ added in v2.5.1
CommitsFull is Commits with full hashes.
func EmptyTree ¶ added in v2.5.1
EmptyTree is git's empty tree object (for the object format of this repository): the base to diff from when the work starts with the very first commit.
func Fingerprint ¶
Fingerprint identifies the content of the code, aitk metadata excluded: the git tree the working tree would commit to. It changes with any edit and stays the same when the same content is committed, so committing after a passing check does not make the check stale. Symlink targets and submodule commits are part of it. When git cannot write objects (a sandbox with a read-only .git), it falls back to HEAD plus the changed files' content.
func Fresh ¶ added in v2.5.1
Fresh reports whether a fingerprint recorded earlier still describes the code. Both kinds are accepted, so a check recorded where .git could not be written (or the other way round) still matches.
Types ¶
type Change ¶
type Change struct {
Path string `json:"path"`
Lines int `json:"lines"`
From string `json:"from,omitempty"`
}
Change is a changed file with its line count. From is the old path of a rename.
func Diff ¶
Diff lists files changed between the merge base with the default branch and the working tree (including untracked files), excluding aitk metadata. Paths come from NUL-separated git output, so non-ASCII names are exact.