render

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 11 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 render turns one patchy resource into a printer document.

It is organised by noun (one file per kind) because a kind is what changes together: add a field to InvestigationStatus and exactly one file here needs editing. The verb commands stay noun-agnostic, so `patchy get` can serve every kind through the resource registry without a per-kind branch.

Each kind offers two depths, because the two verbs ask different questions:

  • Detail: everything known, for `describe`.
  • Review: the verdict and the report, for `review`.

Both depths share this package's helpers rather than each verb keeping its own copy, so the two cannot drift apart.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Age

func Age(t, now time.Time) string

Age renders a duration the way kubectl does: one or two units, largest first.

func BackfillOutcome added in v0.16.0

func BackfillOutcome(b *v1alpha1.BackfillRequest) string

BackfillOutcome summarises the walk's counts on one line, or "" before the walk has run.

func BackfillRepositories added in v0.16.0

func BackfillRepositories(b *v1alpha1.BackfillRequest) string

BackfillRepositories renders the request's repository filter. No filter means the credential's whole scope, which is worth saying out loud.

func BackfillRequestDetail added in v0.16.0

func BackfillRequestDetail(d *printer.Doc, b *v1alpha1.BackfillRequest, now time.Time)

BackfillRequestDetail renders everything known about one backfill request: what was asked for and by whom, the operator's decision when the request needed one, and the outcome of the walk.

func BackfillVia added in v0.16.0

func BackfillVia(b *v1alpha1.BackfillRequest) string

BackfillVia names the grant that authorized the request. An empty via is the backfill grant itself.

func Body

func Body(rep string, raw bool) string

Body is the report as a human should read it. The machine frontmatter is a contract between stages, not prose, so it is stripped unless raw is set.

func Budget added in v0.8.0

Budget renders predicted against granted against actual. The estimate never limits a run; it only decides whether a human had to approve it. The grant is shown beside it because without both, a run that finished well inside a generous grant looks identical to one that barely fit a tight estimate.

func Cost

func Cost(st *v1alpha1.StageResult) string

Cost renders a run's spend on one line.

func Dash

func Dash(s string) string

Dash renders an empty value inside a composed line, where omitting it would leave a confusing gap.

func FindingDetail

func FindingDetail(d *printer.Doc, f *v1alpha1.Finding, now time.Time, spend string)

FindingDetail renders everything known about one finding. spend is the cross-attempt total, which lives on the child runs rather than the finding. The caller queries it and passes it in, so this package performs no I/O.

func FindingSummary

func FindingSummary(d *printer.Doc, f *v1alpha1.Finding)

FindingSummary renders the header `review` puts above the agent reports: enough to know which finding this is, and where its human artefacts live.

func FindingTracking

func FindingTracking(d *printer.Doc, f *v1alpha1.Finding, now time.Time)

FindingTracking renders the projected tracking item and the remediation pull request.

func FindingURL

func FindingURL(f *v1alpha1.Finding) string

FindingURL is a finding's human destination: its tracking issue.

func InvestigationDetail

func InvestigationDetail(d *printer.Doc, inv *v1alpha1.Investigation, now time.Time)

InvestigationDetail renders everything known about one analysis attempt.

func InvestigationReview

func InvestigationReview(d *printer.Doc, inv *v1alpha1.Investigation, raw bool)

InvestigationReview renders the verdict and the report: what a human reads when deciding whether to act on the agent's conclusion.

func Outcome

func Outcome(st *v1alpha1.StageResult) string

Outcome reports how an agent run ended. It sits next to the report because it explains an empty report.

func Rating

func Rating(a *v1alpha1.Analysis) string

Rating renders one investigation analysis dimension: the grade, plus the agent's one-line justification when it gave one.

func RemediationDetail

func RemediationDetail(d *printer.Doc, rem *v1alpha1.Remediation, now time.Time)

RemediationDetail renders everything known about one remediation attempt.

func RemediationReview

func RemediationReview(d *printer.Doc, rem *v1alpha1.Remediation, raw bool)

RemediationReview renders the result and the report.

func SkewPercent added in v0.8.0

func SkewPercent(predicted, actual int64) string

SkewPercent renders how far actual ran over (+) or under (-) predicted. The sign says which way the estimate was wrong.

func Stage

func Stage(d *printer.Doc, st *v1alpha1.StageResult, now time.Time)

Stage adds the agent accounting both run kinds carry.

func Timestamp

func Timestamp(t *metav1.Time, now time.Time) string

Timestamp renders an absolute time with its age. A detail view needs both, because "when" and "how long ago" answer different questions.

func Transcript added in v0.14.0

func Transcript(w io.Writer, turns []transcript.Turn) error

Transcript writes an agent conversation as plain text: one header line per turn (sequence, time, who, and the tool for a tool call), then the turn's text indented beneath it. It is for reading in a pager; --raw gives the JSONL instead.

func Usage

func Usage(u v1alpha1.UsageSummary) string

Usage renders the token and cost accounting.

Types

This section is empty.

Jump to

Keyboard shortcuts

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