query

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package query holds domain query structs — pure read intent, processed by finders. Queries are plain data; no methods with side effects.

Index

Constants

View Source
const DefaultMaxDepth = 4

DefaultMaxDepth is the default upstream/downstream expansion depth, applied by the CLI when no --max-depth flag is given.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	Severity    Severity
	Category    string
	Observation string
}

Finding is a single observation from pre-flight validation.

type LintQuery

type LintQuery struct {
	Graph *model.Graph
}

LintQuery captures intent to surface graph integrity issues.

type LintResult

type LintResult struct {
	Entries     []*model.Entry
	TotalIssues int
}

LintResult is the structured output of a LintQuery: every entry that has at least one warning, plus the total warning count for convenience.

type ListQuery

type ListQuery struct {
	Graph  *model.Graph
	Filter model.GraphFilter
}

ListQuery captures intent to filter graph entries.

type ListResult

type ListResult struct {
	Graph   *model.Graph // needed to render derived attributes like status
	Entries []*model.Entry
}

ListResult is the structured output of a ListQuery.

type PreflightQuery

type PreflightQuery struct {
	Entry   *model.Entry
	Graph   *model.Graph
	Model   string        // LLM model identifier (e.g. "claude-haiku-4-5-20251001")
	Timeout time.Duration // hard timeout for the validator call
}

PreflightQuery captures intent to validate an entry against the graph using the pre-flight LLM validator. Pure read — no side effects of its own; the runner dependency injected into the finder handles the LLM call.

type PreflightResult

type PreflightResult struct {
	Findings []Finding
}

PreflightResult holds all findings from a pre-flight validator run. An empty Findings slice means the validator reported no findings.

func (*PreflightResult) HasBlocking

func (r *PreflightResult) HasBlocking() bool

HasBlocking reports whether any finding blocks entry creation. Currently only SeverityHigh blocks; this is the single source of truth for the blocking threshold (handler_new_entry uses it; templates do not).

type Severity

type Severity string

Severity classifies a pre-flight finding. The tooling layer decides what to block on (currently: only SeverityHigh blocks); templates describe severity in purely semantic terms and never name a threshold.

const (
	SeverityHigh   Severity = "high"
	SeverityMedium Severity = "medium"
	SeverityLow    Severity = "low"
)

type ShowGroup

type ShowGroup struct {
	Primary    *model.Entry
	Upstream   []model.ShowTreeItem
	Downstream []model.ShowTreeItem
}

ShowGroup is one primary's full tree: the primary entry, its upstream chain, and its downstream chain. Multiple groups are joined with separators.

type ShowQuery

type ShowQuery struct {
	Graph      *model.Graph
	IDs        []string
	MaxDepth   int  // depth limit for upstream/downstream expansion; 0 = no expansion
	Downstream bool // include downstream entries (refd-by, closed-by, superseded-by)
}

ShowQuery captures intent to render a set of entries with their reference chains. Upstream is always included; downstream requires opt-in.

type ShowResult

type ShowResult struct {
	Graph  *model.Graph // needed to render derived attributes like status
	Groups []ShowGroup
}

ShowResult is the structured output for a ShowQuery — one group per primary.

type StatusQuery

type StatusQuery struct {
	Graph         *model.Graph
	RecentActions int // how many recent actions to include (default 5)
}

StatusQuery captures intent to summarise current graph state.

type StatusResult

type StatusResult struct {
	Graph     *model.Graph // for top-line counts (entries, decisions, signals, actions)
	Contracts []*model.Entry
	Plans     []*model.Entry
	Active    []*model.Entry // active directive decisions
	Open      []*model.Entry // open signals
	Recent    []*model.Entry // recent actions
}

StatusResult is the structured snapshot of graph state for the status view.

type WIPListQuery

type WIPListQuery struct {
	GraphDir string
}

WIPListQuery captures intent to list active WIP markers.

type WIPListResult

type WIPListResult struct {
	Markers []*model.WIPMarker
}

WIPListResult is the structured output of a WIPListQuery.

Jump to

Keyboard shortcuts

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