Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveCatalog ¶
SaveCatalog writes the catalog to a YAML file.
Types ¶
type Capability ¶
type Capability struct {
Verbs []string `yaml:"verbs"`
Params []string `yaml:"params"`
Source string `yaml:"source,omitempty"` // "seed" or "llm"
Added string `yaml:"added,omitempty"` // timestamp for LLM-generated entries
}
Capability represents a single atomic capability in the IR taxonomy.
type Catalog ¶
type Catalog struct {
Version int `yaml:"version"`
Domains map[string]map[string]Capability `yaml:"domains"`
}
Catalog is the top-level IR catalog structure.
func DefaultCatalog ¶
DefaultCatalog returns the built-in seed IR catalog.
func LoadCatalog ¶
LoadCatalog reads an IR catalog from a YAML file.
func (*Catalog) AllEntries ¶
func (c *Catalog) AllEntries() []CatalogEntry
AllEntries returns a flat list of all capabilities across all domains.
type CatalogEntry ¶
type CatalogEntry struct {
Domain string
CapabilityID string
Capability
}
CatalogEntry is a flattened view of a single capability with its domain and ID.
type IRMatch ¶
type IRMatch struct {
Domain string
CapabilityID string
Params []string // parameter spec from the capability
VerbLen int // number of words in the matched verb
}
IRMatch is the result of matching a command against the IR catalog.
func (*IRMatch) IRNodeID ¶
IRNodeID computes a stable hash for an IR match, analogous to trace.NodeID.
func (*IRMatch) ParamShape ¶
ParamShape returns a normalized string representing the structural shape of this match. Used for NodeID generation — commands with same capability and same number of remaining args produce the same shape.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher matches preprocessed Bash commands against the IR catalog.
func NewMatcher ¶
NewMatcher builds a Matcher from a catalog. It precomputes a sorted verb index for efficient longest-prefix matching.