fixbrief

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acceptance

type Acceptance struct {
	Metric    string `json:"metric"`
	Current   string `json:"current"`
	Direction string `json:"direction"`
	Window    string `json:"window"`
	Report    string `json:"report"`
	Tool      string `json:"tool"`
	Args      string `json:"args"`
}

Acceptance is the falsifiable half of the brief. Without it "fix with your agent" is a wish.

type Brief

type Brief struct {
	Fingerprint string          `json:"fingerprint"`
	Finding     insight.Finding `json:"finding"`
	ComputedBy  string          `json:"computed_by"`
	Evidence    []Evidence      `json:"evidence"`
	Where       []Where         `json:"where,omitempty"`
	Do          []string        `json:"do"`
	Acceptance  Acceptance      `json:"acceptance"`
	Note        string          `json:"note,omitempty"`
	Prompt      string          `json:"prompt"`
	Ask         string          `json:"ask"`
}

Brief is the whole artifact. Prompt is the paste-anywhere rendering of every other field — derived, never independently written, so the copy block cannot say something the structured fields do not. Ask is the short form for a deeplink, where 8k of URL is the ceiling.

func ComputeAll

func ComputeAll(evs []event.Event, steps []funnel.Step, asof time.Time) []Brief

ComputeAll builds a brief for every finding in ONE pass. The dashboard renders all of them (the sheet has to open instantly — a spinner on the verdict's second action would make the most important control on the page feel broken), and computing them one at a time would re-run the funnel and the whole web overview once per card on every page load.

type Evidence

type Evidence struct {
	Label  string `json:"label"`
	Value  string `json:"value"`
	N      int    `json:"n,omitempty"` // the base behind a rate; 0 when the value is a raw count
	Report string `json:"report"`
	Tool   string `json:"tool"`
	Args   string `json:"args"`
}

Evidence is one computed fact plus the two ways to re-derive it. Report is a real path on this instance (the dashboard renders it as a link — clicking it IS the audit), Tool/Args are the same question through MCP.

type Item

type Item struct {
	Fingerprint string `json:"fingerprint"`
	Severity    string `json:"severity"`
	Title       string `json:"title"`
}

Item is one line of the picker: enough to choose a finding, not enough to act on it.

type Result

type Result struct {
	Available []Item `json:"available"`
	Brief     *Brief `json:"brief"`
	Note      string `json:"note,omitempty"`
}

Result always lists what IS available, so a caller that asked for a finding that has since stopped being true gets a real next step instead of an empty object.

func Compute

func Compute(evs []event.Event, steps []funnel.Step, want string, asof time.Time) Result

Compute is the single-finding surface behind GET /v1/fix-brief and the fix_brief MCP tool. `want` matches a fingerprint or a title (case-insensitive); empty picks the lead finding, which is findings[0] because GenerateForFunnel already sorts warnings first.

type Where

type Where struct {
	Path  string `json:"path"`
	Users int    `json:"users"`
	Why   string `json:"why"`
}

Where is a MEASURED location, not a guess about a repo. The engine has never seen the code and must never pretend otherwise: it names the pages, and the agent maps pages to files.

Jump to

Keyboard shortcuts

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