profile

package
v2.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package profile computes the risk profile and a working-tree fingerprint (docs/spec/workflow.md §5).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commits

func Commits(p *project.Project, since, id string) []string

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

func CommitsFull(p *project.Project, since, id string) []string

CommitsFull is Commits with full hashes.

func Compute

func Compute(p *project.Project, changes []Change) string

Compute returns the profile for the current changes ("lite", "standard", "strict").

func EmptyTree added in v2.5.1

func EmptyTree(p *project.Project) string

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

func Fingerprint(p *project.Project) string

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

func Fresh(p *project.Project, recorded string) bool

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.

func Managed

func Managed(rel string) bool

Managed reports whether rel is aitk's own metadata rather than project code. Such files do not count toward the risk profile and do not make a passing check stale.

func ManagedIn added in v2.11.0

func ManagedIn(p *project.Project, rel string) bool

ManagedIn is Managed for a path as git reports it: aitk's own directories may sit behind a symlink inside the repository (docs -> documentation), where git names the target's path.

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

func Diff(p *project.Project) []Change

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.

func DiffSince added in v2.5.1

func DiffSince(p *project.Project, base string) []Change

DiffSince is Diff that also includes everything changed since base (the commit a task started from). On the default branch the merge base is HEAD, so without base, work the task already committed would drop out of its risk profile.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL