contextq

package
v0.36.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package contextq answers context and coverage questions over one assembled context state: path classification, request assembly, universe assembly, topic and claim and pending projection, artifact records, the context and uncovered result vocabulary, and the human rendering of those results (ADR-0195).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeContextPaths

func NormalizeContextPaths(paths []string) []string

NormalizeContextPaths slash-normalizes, path-cleans, de-duplicates, and sorts the queried paths so the assembly is deterministic.

func RenderContextText

func RenderContextText(res ContextResult, header string, facets []ContextFacet) string

RenderContextText maps the typed context result into the shared Detail shape. Contextq owns this semantic mapping; presentation owns syntax and rendering.

func RenderUncoveredText

func RenderUncoveredText(res UncoveredResult, header string) string

RenderUncoveredText maps coverage result semantics into the shared Detail shape.

Types

type ContextFacet

type ContextFacet string
const (
	FacetRelationships ContextFacet = "relationships"
	FacetInvariants    ContextFacet = "invariants"
	FacetAllRules      ContextFacet = "all-rules"
	FacetEvidence      ContextFacet = "evidence"
	FacetSelectors     ContextFacet = "selectors"
	FacetReferences    ContextFacet = "references"
	FacetPending       ContextFacet = "pending"
	FacetArtifacts     ContextFacet = "artifacts"
)

func ParseContextFacets

func ParseContextFacets(values []string, full bool) ([]ContextFacet, error)

type ContextFacetError

type ContextFacetError struct{ Value string }

func (*ContextFacetError) Error

func (e *ContextFacetError) Error() string

type ContextOptions

type ContextOptions struct {
	Selection ContextSelection
	Range     string
	Facets    []ContextFacet
}

type ContextResult

type ContextResult struct {
	Selection ContextSelection
	Range     string
	Requests  []contextRequestReport
	Topics    []topicImpact
}

ContextResult is the assembled context report. Its request and topic rows are projection detail the command binary renders through this package rather than reads, so only the report itself and its selection are exported vocabulary.

type ContextSelection

type ContextSelection string
const (
	SelectionExplicit ContextSelection = "explicit"
	SelectionStaged   ContextSelection = "staged"
	SelectionRange    ContextSelection = "range"
)

type Query

type Query struct {
	// contains filtered or unexported fields
}

Query answers context questions over one assembled context state. It is the package's only construction path: every entry point is a method, so a query can never run against a partially-assembled universe.

func New

func New(state project.ContextState) *Query

New binds a query to one assembled context state. The state is produced by one of the core's two constructors - Project.ContextState for the working tree, project.StagedContextState for the index - and is read, never written.

func (*Query) ContextForOptions

func (q *Query) ContextForOptions(queries []string, options ContextOptions) ContextResult

ContextForOptions assembles the full context report for the queried paths. It writes nothing and cannot fail: every fallible step already happened while the state was loaded.

func (*Query) Uncovered

func (q *Query) Uncovered(scanRoots []string) UncoveredResult

Uncovered assembles the coverage report over the state's eligible paths: those neither generated nor contextIgnore-matched (ADR-0134). scanRoots restrict the report to paths at or beneath them on slash-separated segment boundaries; empty scanRoots scans everything. It writes nothing.

type UncoveredResult

type UncoveredResult struct {
	ScanRoots []string
	Unowned   []unownedEntry
	Uncovered []uncoveredTopic
}

UncoveredResult is the read-only coverage report for a set of scan roots: the eligible paths owned by no domain (collapsed to a topmost trailing-slash node) and the domain-owned paths with no claim-bearing scoped topic (ADR-0134). ScanRoots echoes the requested roots (empty = whole repository).

Jump to

Keyboard shortcuts

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