render

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Overview

Package render holds the terminal output formatters for the discovery / scroll / browse shapes. Pure formatters over the view-layer structs; no engine dependencies. Writers are passed in (not os.Stdout) so output is testable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugSearchJSON

func DebugSearchJSON(hits []retrieve.Hit, explains []retrieve.ScoreExplain) ([]byte, error)

DebugSearchJSON marshals the explained hits for --debug-search --json. It returns indented JSON so an agent (or a human) can read the breakdown. A hit with no matching explain gets a zero-value score with an empty Method, which is honestly distinguishable from a real regime.

func FmtScoreExplain

func FmtScoreExplain(e retrieve.ScoreExplain) string

FmtScoreExplain renders one honest ScoreExplain as a compact two-line block. It states the regime (Method) and the REAL inputs — it never invents a composite score, because RawClaw's ranking has none. The leading rank is the hit's actual ordinal position (Final).

func PrintBrowse

func PrintBrowse(w io.Writer, rows []view.BrowseRow, project string)

PrintBrowse renders the recent-sessions list for a project.

func PrintBrowseAll added in v0.5.0

func PrintBrowseAll(w io.Writer, rows []view.BrowseAllRow, scope string)

PrintBrowseAll renders the cross-project recent-sessions list: the same row shape as PrintBrowse, each row additionally naming its project.

scope names the universe the rows came from ("all projects", or the narrower one the caller's scope flags left). The header states it rather than assuming "all projects", which stops being true the moment --include-path narrows the run — a header naming a scope nobody asked for is how a browse passes off one question's answer as another's.

func PrintDebugSearch

func PrintDebugSearch(w io.Writer, hits []retrieve.Hit, explains []retrieve.ScoreExplain)

PrintDebugSearch renders the scoring explainer: one hit header + its honest ScoreExplain block, in result order. It is the clean entrypoint the cli calls behind --debug-search. hits[i] is explained by explains[i]; any tail with no matching explain is rendered with a "(no breakdown)" marker rather than panicking on a short slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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