status

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package status gathers and renders the index's semantic health: how much of the workspace is actually covered, how confident the edges are, how old the history evidence is, and which integrations are live. Every safety-sensitive answer needs this context to be interpretable — "no effects found" from a half-parsed index is not "no effects" (RFC-001 §5.2). Shared by the CLI command and the MCP status resource.

Index

Constants

View Source
const (
	FreshCurrent = "current"
	FreshStale   = "stale"
	// FreshUnknown means no fingerprint exists to compare — a non-git
	// workspace has no cheap change signal. Unknown is not current.
	FreshUnknown = "unknown"
)

Freshness states: whether the index still matches the workspace.

Variables

This section is empty.

Functions

func Print

func Print(w io.Writer, s *Status)

Print renders the report as aligned text, the RFC's status layout.

Types

type Coverage

type Coverage struct {
	// Known is false for indexes written before coverage was persisted;
	// the renderer must say "unknown", never imply full coverage.
	Known        bool `json:"known"`
	FilesSeen    int  `json:"files_seen,omitempty"`
	FilesParsed  int  `json:"files_parsed,omitempty"`
	FilesSkipped int  `json:"files_skipped,omitempty"`
	ParseErrors  int  `json:"parse_errors"`
}

Coverage is the persisted file summary of the last index run.

type Status

type Status struct {
	SchemaVersion string   `json:"schema_version"`
	IndexedAt     int64    `json:"indexed_at,omitempty"`
	Freshness     string   `json:"freshness"`
	Coverage      Coverage `json:"coverage"`

	Symbols     int            `json:"symbols"`
	Edges       int            `json:"edges"`
	EdgeOrigins map[string]int `json:"edge_origins,omitempty"`

	EffectsDirect     int `json:"effects_direct_symbols"`
	EffectsPropagated int `json:"effects_propagated_symbols"`

	History store.HistoryWindow `json:"history"`

	Lessons        int            `json:"lessons"`
	Findings       map[string]int `json:"findings,omitempty"`
	ReviewsMinedAt int64          `json:"reviews_mined_at,omitempty"`

	// DistillAgent is the resolved agent command line ("" when the
	// config is invalid); external data processing is implied whenever
	// it is set — the CLI is assumed to reach a remote model. The value
	// is sanitized and secret-scrubbed: it comes from repository-
	// controlled config and flows to terminals and MCP clients.
	DistillAgent string `json:"distill_agent,omitempty"`

	// GatePolicyMode is policy.yaml's mode; GateHookMode is what the
	// installed Claude hook does ("" = no operational hook). They can
	// differ, and the difference is exactly what a reader needs to see.
	GatePolicyMode string `json:"gate_policy_mode"`
	GateHookMode   string `json:"gate_hook_mode,omitempty"`
	// GateHookError reports a hook configuration that cannot be read —
	// which is not the same finding as "no hook installed".
	GateHookError string `json:"gate_hook_error,omitempty"`
	// GatePolicyError carries a policy file that fails to load — a state
	// that changes every hook decision.
	GatePolicyError string `json:"gate_policy_error,omitempty"`
}

Status is the gathered health report, JSON-ready.

func Gather

func Gather(st *store.Store, root string) (*Status, error)

Gather assembles the health report from the store and the workspace.

Jump to

Keyboard shortcuts

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