view

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 12 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=CP-270; FEATURE="RequirementView"; ASPECT=CLI; STATUS=TESTED; TEST=TestCANARY_CBIN_204_BuildView; UPDATED=2026-08-28 CANARY: REQ=ENG-4325; FEATURE="MigrateNotesView"; ASPECT=CLI; STATUS=TESTED; TEST=TestCANARY_CBIN_301_BuildView_MigrateNotes,TestCANARY_CBIN_301_BuildView_MigrateNotesCap; UPDATED=2026-08-29 CANARY: REQ=CP-278; FEATURE="DriftedView"; ASPECT=CLI; STATUS=TESTED; TEST=TestCANARY_CBIN_305_BuildView_Drifted,TestCANARY_CBIN_305_BuildView_NotDrifted,TestCANARY_CBIN_305_BuildView_NonGitRootSoftSkip; UPDATED=2026-08-29

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"`
	MigrateNotes      []string       `json:"migrate_notes,omitempty"` // "file:line: text"
	MigrateNotesTotal int            `json:"migrate_notes_total,omitempty"`
	Drifted           bool           `json:"drifted,omitempty"`
	DriftReason       string         `json:"drift_reason,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