Documentation
¶
Overview ¶
Package rules defines Fort's deterministic routing-rule schema and a strict parser for it (backlog AO-012). A ruleset is ordered; the matcher engine (package router) applies first-match-wins with a default fallback.
No model/LLM calls ever happen here — routing reads only deterministic signals on a task.
Index ¶
Constants ¶
const SupportedVersion = 1
SupportedVersion is the only ruleset schema version this build understands.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Defaults ¶
type Defaults struct {
Route string `yaml:"route"`
}
Defaults holds the fallback route used when no rule matches.
type Matcher ¶
type Matcher struct {
// Leaf signals.
Label []string `yaml:"label,omitempty"`
Path []string `yaml:"path,omitempty"`
Repo string `yaml:"repo,omitempty"`
Agent string `yaml:"agent,omitempty"`
Size []string `yaml:"size,omitempty"`
Time *TimeWindow `yaml:"time,omitempty"`
// Composition.
Any []Matcher `yaml:"any,omitempty"`
All []Matcher `yaml:"all,omitempty"`
}
Matcher is either a leaf (one or more of the signal fields, ANDed together) or a composition (Any / All of sub-matchers). A leaf with multiple fields requires all of them to hold.
type Ruleset ¶
type Ruleset struct {
Version int `yaml:"version"`
Defaults Defaults `yaml:"defaults"`
Rules []Rule `yaml:"rules"`
}
Ruleset is a parsed, validated routing ruleset.
type TimeWindow ¶
TimeWindow is a time-of-day window [After, Before) in 24h "HH:MM". When After > Before the window wraps midnight (e.g. 18:00–06:00).