agentdiff

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 4 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 agentdiff builds the post-run "what did the agent change?" git diff for `tasks -p`. It is the Go counterpart of lib/tasks/agent_diff.rb, and it is separate from the CLI for the same reason: the decision — which files to diff, and how to handle a relocated memory sidecar — can then be exercised against a real sandbox repo without driving an actual agent.

The memory sidecar (agent-memory.md) normally sits beside tasks.jsonl, so it is diffed right alongside the task files. But TASKS_MEMORY or the config `memory` key can put it outside the task-data repo's work tree, where `git -C data_dir diff` cannot see it. In that case it is dropped from the diff and, when it exists (so the agent could have edited it), flagged with a one-line notice rather than silently omitted.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	DataDir string
	Org     string
	Archive string
	Memory  string
	// Color forces ANSI colour in the captured diff. Callers pass "is stdout a
	// terminal", so an interactive run stays coloured and a piped one stays
	// plain — the diff is captured before it is printed, so git cannot decide
	// this for itself.
	Color bool
	// Stderr is where git's own diagnostics go. Ruby's backticks inherit stderr,
	// so a git that complains does so on the CLI's stderr; nil discards.
	Stderr io.Writer
}

Request is one computation's inputs.

type Result

type Result struct {
	Diff   string
	Notice string
}

Result is what the CLI renders. Diff is the captured `git diff` text for the in-repo targets and may be empty; Notice is the path of an out-of-repo memory sidecar to flag, or "".

func Compute

func Compute(request Request) (Result, bool)

Compute answers what changed. The second result is false when DataDir is not a git work tree — the diff is only meaningful for a git-backed task set, and there is nothing honest to show for one that is not.

Jump to

Keyboard shortcuts

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