gitidentity

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package gitidentity holds what a run's commits carry and leave out: the signature shared by codeaf's own commits and the commands a program runs on its behalf, the identity senior-dev's engine commits under, and the caches a run's own tests leave behind.

IT BUILDS ON EVERY PLATFORM. internal/seniordev does not build on Windows (its own law says so), and codeaf's side of a run still has to know these facts there, so they live here rather than in the engine.

Index

Constants

View Source
const (
	Name  = "codeaf"
	Email = "agentfield-bot@users.noreply.github.com"
)
View Source
const (
	EngineName  = "senior-dev"
	EngineEmail = "senior-dev@localhost"
)

The identity senior-dev's engine commits under: its starting tree, every write it checkpoints and the candidate it submits (internal/seniordev/util says why it carries one of its own).

View Source
const GeneratedRunPaths = "__pycache__/,.pytest_cache/,*.pyc"

GeneratedRunPaths is the one narrow list of test droppings a run is known to create. A general guess would hide a person's actual deliverable.

View Source
const InputsEnv = "SENIOR_DEV_INPUTS_AT_START"

InputsEnv names, in the program's environment, the file listing its copy's inputs and their fingerprints (WriteInputs). It is senior-dev's name beside SENIOR_DEV_IGNORED_AT_START, which codeaf sets the same way.

Variables

This section is empty.

Functions

func Environment

func Environment() []string

Environment makes Git attribute a model-written commit to the run even when the repository carries the person's user.name and user.email.

func Fingerprint

func Fingerprint(path string) (string, bool)

Fingerprint is a file's fingerprint: the SHA-256 of its bytes, or of its target for a symbolic link, and false when there is no file there.

func GeneratedRunPath

func GeneratedRunPath(path string) bool

GeneratedRunPath reports whether a path is one of GeneratedRunPaths.

func WriteInputs

func WriteInputs(file string, in Inputs) error

WriteInputs writes the inputs to file as NUL-separated fingerprint and path pairs, readable by ReadInputs; a path may hold any byte but NUL.

Types

type Inputs

type Inputs map[string]string

Inputs is a copy's inputs: each path, relative to the copy's top and slash-separated, with its fingerprint when it was copied in. An empty fingerprint is an input whose copying had not finished, which is kept out.

func ReadInputs

func ReadInputs(file string) (Inputs, error)

ReadInputs reads what WriteInputs wrote. An empty name is no list at all, which is every run codeaf did not start in a copy.

func (Inputs) Changed

func (in Inputs) Changed(root string) []string

Changed is the inputs the run changed in the copy at root, in no order.

func (Inputs) LeftAlone

func (in Inputs) LeftAlone(root, path string) bool

LeftAlone says path is one of the inputs and the run has not changed it in the copy at root: it still has the fingerprint it was copied in with, it is gone (an untracked file's deletion is nothing a branch can hold), or its fingerprint was never taken. A path that is not an input is never left alone in this sense — it is the run's, or the repository's.

Jump to

Keyboard shortcuts

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