focus

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Overview

Package focus is what an audit of the changes tells its hunters: which files changed, which sit near them, and the change itself.

sec-af's PR mode filtered findings to the changed files only AFTER every hunter had scanned the whole repository, so an audit of a ten-line change cost a whole audit. Here the scan step is told the change up front and reports only what the change touches or makes reachable; the filter after the hunt stays, as the backstop it was.

IT RIDES THE CONTEXT, because the hunters are reached through sec-af's own tree of calls between reasoners, which carry the context in process and nothing else that the algorithm does not already read. An audit of the whole repository carries none, and its hunters' prompts are byte for byte the prompts sec-af wrote.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func With

func With(ctx context.Context, f Focus) context.Context

With is ctx carrying f.

Types

type Focus

type Focus struct {
	// Base is how the change's starting point is said: `origin/dev`.
	Base string
	// Changed is the files the change touched; Nearby the files that name
	// one of them.
	Changed, Nearby []string
	// Diff is the change itself, already cut to a size a prompt holds.
	Diff string
}

Focus is the change an audit is about.

func From

func From(ctx context.Context) (Focus, bool)

From is the focus ctx carries, and false for an audit of the whole repository.

func (Focus) Section

func (f Focus) Section() string

Section is the words appended to a hunter's scan prompt.

Jump to

Keyboard shortcuts

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