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 ¶
- func Age(t, now time.Time) string
- func Body(rep string, raw bool) string
- func Budget(d *printer.Doc, p v1alpha1.AgentParameters, st *v1alpha1.StageResult)
- func Cost(st *v1alpha1.StageResult) string
- func Dash(s string) string
- func FindingDetail(d *printer.Doc, f *v1alpha1.Finding, now time.Time, spend string)
- func FindingSummary(d *printer.Doc, f *v1alpha1.Finding)
- func FindingTracking(d *printer.Doc, f *v1alpha1.Finding, now time.Time)
- func FindingURL(f *v1alpha1.Finding) string
- func InvestigationDetail(d *printer.Doc, inv *v1alpha1.Investigation, now time.Time)
- func InvestigationReview(d *printer.Doc, inv *v1alpha1.Investigation, raw bool)
- func Outcome(st *v1alpha1.StageResult) string
- func Rating(a *v1alpha1.Analysis) string
- func RemediationDetail(d *printer.Doc, rem *v1alpha1.Remediation, now time.Time)
- func RemediationReview(d *printer.Doc, rem *v1alpha1.Remediation, raw bool)
- func SkewPercent(predicted, actual int64) string
- func Stage(d *printer.Doc, st *v1alpha1.StageResult, now time.Time)
- func Timestamp(t *metav1.Time, now time.Time) string
- func Transcript(w io.Writer, turns []transcript.Turn) error
- func Usage(u v1alpha1.UsageSummary) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Body ¶
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
func Budget(d *printer.Doc, p v1alpha1.AgentParameters, st *v1alpha1.StageResult)
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 Dash ¶
Dash renders an empty value inside a composed line, where omitting it would leave a confusing gap.
func FindingDetail ¶
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 ¶
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 ¶
FindingTracking renders the projected tracking item and the remediation pull request.
func FindingURL ¶
FindingURL is a finding's human destination: its tracking issue.
func InvestigationDetail ¶
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 ¶
Rating renders one investigation analysis dimension: the grade, plus the agent's one-line justification when it gave one.
func RemediationDetail ¶
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
SkewPercent renders how far actual ran over (+) or under (-) predicted. The sign says which way the estimate was wrong.
func Timestamp ¶
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.