untrackedallowance

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 8 Imported by: 0

Documentation

Overview

Package untrackedallowance decides which untracked worktree paths a committed-content result may tolerate without degrading (decision 0142).

Paths excluded by ignore rules never reach this package: Git status does not list them. A listed untracked path is allowed only when it is provably disjoint from the Go build that the result depends on; everything else still degrades. The allowed set is bound into the result as a count and digest.

Index

Constants

View Source
const Rule = "corvint-untracked-allowance/1"

Rule names the disjointness rule and the digest domain.

Variables

This section is empty.

Functions

func GoPackageDirectories

func GoPackageDirectories(trackedPaths []string) map[string]struct{}

GoPackageDirectories returns the directory of every tracked `.go` path.

func OverlapsGoBuild

func OverlapsGoBuild(untracked string, packageDirectories map[string]struct{}) bool

OverlapsGoBuild reports whether an untracked path can change a Go build, test, or Git evaluation over the committed tree. It is conservative: an untracked directory entry, any `.go` file, any Go or Git control file, any `vendor` segment, and anything inside a tracked Go package directory (where `//go:embed` and `testdata` reach) all overlap. The control-name and `vendor` checks fold case: on a case-insensitive filesystem (e.g. macOS APFS) an untracked path whose basename or segment differs from the control name only in case is the same directory entry the Go toolchain and Git resolve, so refusing the allowance is the safe reading on every host, including a case-sensitive one where folding merely loses an allowance.

func ParseStatus

func ParseStatus(raw []byte) (untracked, tracked []string, err error)

ParseStatus splits `git status --porcelain=v1 -z` output into the untracked (`??`) paths and every other changed path, each sorted.

func Partition

func Partition(untracked []string, overlaps func(string) bool) ([]string, string)

Partition splits untracked paths into the allowed set and the first overlapping path, which is empty when every path is allowed.

Types

type Allowance

type Allowance struct {
	Rule   string `json:"rule"`
	Count  int    `json:"count"`
	SHA256 string `json:"sha256"`
}

Allowance is the receipt binding of the untracked paths a result tolerated.

func Bind

func Bind(allowed []string) Allowance

Bind digests the sorted allowed set under the rule's domain.

Jump to

Keyboard shortcuts

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