Help us shape the future of Go! Take the 2026 Go Developer Survey

status

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 18 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"`
	// FilesDeleted counts the tracked paths that git status shows as
	// deleted and not staged. It is not a parse error. An index from
	// before this field reads 0.
	FilesDeleted int `json:"files_deleted"`
	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 the mode of policy.yaml. GateHookMode is the mode
	// of the Claude Code gate hook that setup manages, or "" when none
	// runs. The two can differ, and a reader must see the difference.
	// Both hook fields come from the reader of the Claude Code inspection,
	// so they agree with the Claude Code entry of Clients.
	GatePolicyMode string `json:"gate_policy_mode"`
	GateHookMode   string `json:"gate_hook_mode,omitempty"`
	// GateHookError names a hook document that cannot be read. That 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"`

	// Skills is the agent-skills state per client directory. A stale copy
	// after an upgrade must be visible here, beside the hook and MCP
	// state, because a client would load text that no longer matches the
	// binary's tool surface.
	Skills []skills.ClientState `json:"skills,omitempty"`

	// Approvals is the tool-approval configuration per client: whether
	// the seamark MCP tools can run without prompts. Project
	// configuration only; user or managed policy can still prompt.
	Approvals []approve.ClientApproval `json:"approvals,omitempty"`

	// DistillClient names the invoker DistillAgent resolves to: a
	// registered client ("claude", "codex") or "custom" for agent.argv.
	// The invoker is configured apart from the clients that are set up,
	// so a reader must not infer it from Clients.
	DistillClient string `json:"distill_client,omitempty"`

	// Clients is the per-client integration view, in registry order:
	// which capabilities each client declares, the configuration state
	// of each, the project trust seamark can read, the native
	// compatibility evidence, and the limitations the adapter reports.
	// Additive: the fields above keep their Claude Code meaning.
	Clients []integration.Inspection `json:"clients,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