Documentation
¶
Index ¶
- Constants
- Variables
- func ComputeContentHash(n domain.Node) string
- func ComputeContentHashWithDir(n domain.Node, projectRoot string) string
- func GetCurrentUser() string
- func NewDiffCommand() *cobra.Command
- func NewExportCommand() *cobra.Command
- func NewGraphCommand() *cobra.Command
- func NewHistoryCommand() *cobra.Command
- func NewInitCommand() *cobra.Command
- func NewIssuesCommand() *cobra.Command
- func NewLLMHelpCommand() *cobra.Command
- func NewListCommand() *cobra.Command
- func NewMigrateCommand() *cobra.Command
- func NewNewCommand() *cobra.Command
- func NewQueryCommand() *cobra.Command
- func NewReviewCommand() *cobra.Command
- func NewRootCommand() *cobra.Command
- func NewShowCommand() *cobra.Command
- func NewStatsCommand() *cobra.Command
- func NewSyncCommand() *cobra.Command
- func NewValidateCommand() *cobra.Command
- func RenderBlockMarkdown(block domain.Block) string
- type Config
- type ExitError
- type IssueResult
- type IssuesJSONOutput
- type NodeSummary
Constants ¶
const ( ExitCodeSuccess = 0 ExitCodeError = 1 ExitCodeSchemaMismatch = 2 // Schema version mismatch, migration needed )
Exit code constants for CLI commands.
Variables ¶
var ValidSeverities = []string{"low", "medium", "high", "critical"}
ValidSeverities is the canonical set of valid issue severity values.
var ValidStatuses = []string{"draft", "review", "approved", "deprecated", "archived"}
ValidStatuses is the canonical set of valid node status values.
Functions ¶
func ComputeContentHash ¶
ComputeContentHash computes a SHA-256 hash of the content fields. Returns 16 hex characters (first 64 bits of the hash). Used by all mutation commands to record content state in history.
Included in hash: Kind, Title, Summary, Tags, Refs, Issues, Content, Glossary, Contracts, LLMContext, Constraints, Custom.
Excluded from hash: ID, Version, Status, Reviewers (workflow metadata).
func ComputeContentHashWithDir ¶
ComputeContentHashWithDir computes a content hash that includes referenced doc files. When projectRoot is non-empty, the contents of referenced .md files are included in the hash so that changes to doc files trigger version bumps during sync.
func GetCurrentUser ¶
func GetCurrentUser() string
GetCurrentUser returns the current system username, or "unknown" if unavailable.
func NewDiffCommand ¶
NewDiffCommand creates the diff subcommand
func NewExportCommand ¶
NewExportCommand creates the export subcommand
func NewGraphCommand ¶
NewGraphCommand creates the graph subcommand
func NewHistoryCommand ¶
NewHistoryCommand creates the history subcommand
func NewInitCommand ¶
NewInitCommand creates the init subcommand
func NewIssuesCommand ¶
NewIssuesCommand creates the issues subcommand
func NewLLMHelpCommand ¶
NewLLMHelpCommand creates the llm-help subcommand
func NewListCommand ¶
NewListCommand creates the list subcommand
func NewMigrateCommand ¶
NewMigrateCommand creates the migrate subcommand.
func NewQueryCommand ¶
NewQueryCommand creates the query subcommand
func NewReviewCommand ¶
NewReviewCommand creates the review command with subcommands
func NewRootCommand ¶
NewRootCommand creates and returns the root cobra command
func NewShowCommand ¶
NewShowCommand creates the show subcommand
func NewStatsCommand ¶
NewStatsCommand creates the stats subcommand
func NewSyncCommand ¶
NewSyncCommand creates the sync subcommand
func NewValidateCommand ¶
NewValidateCommand creates the validate subcommand
func RenderBlockMarkdown ¶
RenderBlockMarkdown renders a single content block as markdown. Used by both show --full (terminal) and export (markdown) commands.
Types ¶
type ExitError ¶
ExitError represents an error with a specific exit code.
func NewExitError ¶
NewExitError creates an ExitError with the specified code and message.
func NewExitErrorf ¶
NewExitErrorf creates an ExitError with a formatted message.
type IssueResult ¶
IssueResult holds an issue with its parent node context
type IssuesJSONOutput ¶
type IssuesJSONOutput struct {
Total int `json:"total"`
Open int `json:"open"`
Counts map[string]int `json:"counts"`
Issues []IssueResult `json:"issues,omitempty"`
ByNode map[string]NodeSummary `json:"by_node,omitempty"`
}
IssuesJSONOutput is the structure for JSON output
type NodeSummary ¶
NodeSummary is a per-node issue summary