Documentation
¶
Overview ¶
Package specgraph provides requirement graph extraction from visionspec specs. It integrates with graphize to build knowledge graphs from spec documents.
Index ¶
Constants ¶
const ( NodeTypeRequirement = "requirement" NodeTypeUserStory = "user_story" NodeTypeConstraint = "constraint" NodeTypeAcceptanceCrit = "acceptance_criteria" NodeTypeDecision = "decision" NodeTypeTradeoff = "tradeoff" NodeTypeCapability = "capability" NodeTypeSection = "section" NodeTypeSpec = "spec" )
Node types for spec graphs.
const ( EdgeTypeTracesTo = "traces_to" EdgeTypeDerivedFrom = "derived_from" EdgeTypeConflictsWith = "conflicts_with" EdgeTypeSatisfies = "satisfies" EdgeTypeDependsOn = "depends_on" EdgeTypeBlocks = "blocks" EdgeTypeSupersedes = "supersedes" EdgeTypeContains = "contains" )
Edge types for spec relationships.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExportFormat ¶
type ExportFormat string
ExportFormat specifies the output format for graph export.
const ( FormatHTML ExportFormat = "html" FormatGraphML ExportFormat = "graphml" FormatJSON ExportFormat = "json" )
type ExportOptions ¶
type ExportOptions struct {
Format ExportFormat
OutputDir string
Title string
}
ExportOptions configures graph export behavior.
type ExportResult ¶
type ExportResult struct {
OutputPath string
Format ExportFormat
NodeCount int
EdgeCount int
}
ExportResult contains information about the export operation.
func Export ¶
func Export(g *graph.Graph, opts ExportOptions) (*ExportResult, error)
Export exports a graph to the specified format.
type ExtractedContent ¶
ExtractedContent holds nodes and edges extracted from a section.
type Metrics ¶
type Metrics struct {
TotalRequirements int
TotalUserStories int
TotalConstraints int
TotalDecisions int
TraceCoverage float64 // Percentage of requirements traced to TRD
ConflictCount int
}
Metrics contains computed statistics from a spec graph.
func ComputeMetrics ¶
ComputeMetrics computes metrics from a graph.
type QueryFilter ¶
type QueryFilter struct {
NodeType string // Filter by node type (e.g., "requirement", "user_story")
SpecType string // Filter by spec type (e.g., "prd", "trd")
}
QueryFilter specifies filtering criteria for graph queries.
type QueryResult ¶
QueryResult contains filtered nodes from a query.
func Query ¶
func Query(g *graph.Graph, filter QueryFilter) *QueryResult
Query filters nodes in a graph based on the provided filter criteria.
type SpecExtractor ¶
type SpecExtractor struct {
// contains filtered or unexported fields
}
SpecExtractor extracts requirement graphs from visionspec projects.
func NewSpecExtractor ¶
func NewSpecExtractor(projectPath string) *SpecExtractor
NewSpecExtractor creates a new spec extractor for a project.