view

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Overview

Package view aggregates everything known about one requirement — tokens, files, tests, dependencies, spec/plan, diagrams, ticket link — into one bounded, agent-friendly answer. CANARY: REQ=CBIN-204; FEATURE="RequirementView"; ASPECT=CLI; STATUS=TESTED; TEST=TestCANARY_CBIN_204_BuildView; UPDATED=2026-08-28

Index

Constants

View Source
const DefaultViewLimit = 10

DefaultViewLimit bounds list sections (files, diagrams) by default; agents raise it with --limit when they need the full list.

Variables

This section is empty.

Functions

func CreateViewCommand

func CreateViewCommand() *cobra.Command

CreateViewCommand returns the `canary view` command.

Types

type View

type View struct {
	ReqID         string         `json:"req_id"`
	Source        string         `json:"source,omitempty"`
	TicketURL     string         `json:"ticket_url,omitempty"`
	Statuses      map[string]int `json:"statuses"`       // status -> token count
	Completion    int            `json:"completion_pct"` // TESTED+BENCHED tokens / total
	Features      []string       `json:"features"`       // "Feature (ASPECT, STATUS)"
	Files         []string       `json:"files"`          // capped at limit
	FilesTotal    int            `json:"files_total"`
	Tests         []string       `json:"tests"`
	Benches       []string       `json:"benches,omitempty"`
	DependsOn     []string       `json:"depends_on,omitempty"`
	Blocks        []string       `json:"blocks,omitempty"`
	RelatedTo     []string       `json:"related_to,omitempty"`
	SpecPath      string         `json:"spec_path,omitempty"`
	PlanPath      string         `json:"plan_path,omitempty"`
	Diagrams      []string       `json:"diagrams,omitempty"` // "file:line"
	DiagramsTotal int            `json:"diagrams_total,omitempty"`
}

View is the aggregate answer for one requirement: everything an agent or a human needs to orient on CANARY tokens, files, tests, dependencies, spec/plan location, diagram refs, and (when configured) the owning ticket system — in one bounded call.

func BuildView

func BuildView(dbPath, root, reqID string, limit int) (*View, error)

BuildView assembles the view from the index DB plus filesystem conventions. It assumes dbPath is already migrated (the CLI's PersistentPreRunE handles this before any command runs); callers such as tests that open a fresh database must migrate it themselves first.

Jump to

Keyboard shortcuts

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