Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MutatingTools = map[string]bool{ "edit_file": true, "write_file": true, "create_file": true, "delete_file": true, }
MutatingTools are tool names that change the filesystem. A turn that issues one of these (or a final answer that ships no tool calls) is counted as "productive" under BroCode's north-star efficiency metric (see internal/tokens/ratio.go and docs/PHILOSOPHY.md).
Functions ¶
This section is empty.
Types ¶
type AggregateReport ¶
type AggregateReport struct {
SessionCount int `json:"session_count"`
TotalTurns int `json:"total_assistant_turns"`
TotalToolCalls int `json:"total_tool_calls"`
TotalFileChanges int `json:"total_file_changes"`
TotalTokens int `json:"total_tokens"`
TotalCostUSD float64 `json:"total_estimated_cost_usd"`
MeanProductivePct int `json:"mean_productive_ratio_pct"`
SessionsWithAnomalies int `json:"sessions_with_anomalies"`
Models []string `json:"models"`
AnomalyFreq map[string]int `json:"anomaly_frequency"`
}
AggregateReport summarizes a set of SessionReports — the cross-session benchmark view. Like SessionReport it contains only aggregate signals.
func Summarize ¶
func Summarize(reports []*SessionReport) *AggregateReport
Summarize folds a set of reports into a single cross-session benchmark view.
func (*AggregateReport) RenderJSON ¶
func (a *AggregateReport) RenderJSON() (string, error)
RenderJSON returns the indented JSON form.
func (*AggregateReport) RenderMarkdown ¶
func (a *AggregateReport) RenderMarkdown() string
RenderMarkdown returns a compact cross-session summary.
type SessionReport ¶
type SessionReport struct {
SessionID string `json:"session_id"`
ProjectPath string `json:"project_path"`
Mode string `json:"mode"`
Models []string `json:"models"`
CreatedAt time.Time `json:"created_at"`
DurationSec float64 `json:"duration_sec"`
UserMsgs int `json:"user_msgs"`
AssistantTurns int `json:"assistant_turns"`
ToolCalls int `json:"tool_calls"`
ToolResults int `json:"tool_results"`
ToolFailures int `json:"tool_failures"`
Compactions int `json:"compactions"`
FileChanges int `json:"file_changes"`
DistinctTools int `json:"distinct_tools"`
TotalTokens int `json:"total_tokens"`
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
CostUSD float64 `json:"estimated_cost_usd"`
ProductivePct int `json:"productive_ratio_pct"`
Anomalies []string `json:"anomalies,omitempty"`
}
SessionReport is a fully aggregated, privacy-safe summary of one agent session. It intentionally contains NO message text, file contents, or secrets — only counts, token metrics, and heuristic anomaly flags. That makes it safe to export (md/json) as a real-world usage/benchmark dataset.
func Build ¶
func Build(st *store.Store, sessionID string) (*SessionReport, error)
Build reconstructs a SessionReport from the persisted session + event log. It never reads message contents into the report — only numeric/structural signals — so the output is safe to share as a benchmark dataset.
func BuildAll ¶
BuildAll reconstructs reports for every session, optionally filtered to sessions created at or after `since` (zero time = no filter). Sessions that fail to load are skipped so one corrupt row never aborts a bulk export.
func (*SessionReport) RenderJSON ¶
func (r *SessionReport) RenderJSON() (string, error)
RenderJSON returns the indented JSON form of the report.
func (*SessionReport) RenderMarkdown ¶
func (r *SessionReport) RenderMarkdown() string
RenderMarkdown returns a human-readable report. It contains only aggregate metrics — never message text or file contents.