Documentation
¶
Overview ¶
Package smelter batches pending warden rules into PRs. The Smelter periodically queries pending_warden_rules from the state DB, groups them by anvil, appends them to each anvil's .forge/warden-rules.yaml (deduping by rule ID), commits the change, and creates or updates a PR on the forge/warden-learn-batch/<anvil> branch.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Smelter ¶
type Smelter struct {
// contains filtered or unexported fields
}
Smelter batches pending warden rules into PRs on a schedule.
func New ¶
New creates a Smelter. interval controls how often Flush is called; pass 0 to disable scheduled runs (Flush can still be called directly).
func (*Smelter) Flush ¶
Flush queries all pending warden rules, groups them by anvil, and for each anvil: creates a worktree, appends rules to warden-rules.yaml (deduping by rule ID), commits, force-pushes to the batch branch, and creates/updates a PR. Flushed rules are deleted from the DB on success.
func (*Smelter) Run ¶
Run starts the periodic flush loop. Blocks until ctx is canceled. If interval <= 0 at startup, scheduled flushes are paused until UpdateInterval is called with a positive value.
func (*Smelter) UpdateAnvilPaths ¶
UpdateAnvilPaths replaces the set of anvils. Safe to call while Run is active.
func (*Smelter) UpdateInterval ¶
UpdateInterval signals the Run loop to reset its ticker with d. If d <= 0 the ticker is paused until a positive interval is sent. Safe to call concurrently while Run is active.