render

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 9 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, which is what lets `patchy get` 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`.

They share this package's helpers rather than each verb growing its own copy, which is what previously let two spellings of "render an analysis rating" 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 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 comes off unless asked for.

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 — so the grant is shown beside it: without both, a run that finished well inside a generous grant looks identical to one that scraped 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. Worth surfacing next to the report because it explains an empty one far better than the empty report does.

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 is the point — it 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 wants both: "when" and "how long ago" answer different questions.

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