Skip to main content

Module config

Module config 

Source
Expand description

Configuration, and the agent presets that make a new CLI a data change rather than a code change.

Presets are compiled into the binary. That is not an optimisation: a cargo installed binary has no source tree beside it, so a preset read from a relative path would work for the author and fail for everyone else. Files on disk still win over the built in copies, so a preset can be overridden or a new one added without rebuilding.

Structs§

AgentSpec
Everything needed to drive one CLI. An agent is data, not a class: supporting a new tool is a preset file.
Config
EffortSchedule
ListenCfg
What spar listen watches for and what it does about it. As with LoopCfg, every field takes its value from ListenCfg::default() when a config does not mention it.
LoopCfg
Every field takes its value from LoopCfg::default() when a config does not mention it, rather than from a per-field function saying the same thing in a second place. Two places is how a default goes stale.
OptionInfo
One option the parser accepts, with the value it takes when unset.
StyleCfg

Enums§

Call
Which call is about to be made.
CheckCommand
A command spar runs itself, before it pushes.
CommandPart
One element of a command template: a bare argument, or a group that is dropped whole when its placeholder is unset.
Drafts
Whether a pull request spar opens starts as a draft, and when it stops being one.
Followups
Where an out of scope finding goes. On your own repository an issue is the right home. On a large repository that is not yours it is somebody else’s notification and somebody else’s triage queue.
OutputMode
How to read the answer out of what a CLI printed.
OwnPr
What spar listen does when somebody speaks on a pull request you wrote. GitHub will not let the same account approve it, so the choice is between spar checkin with and without the power to push.
PrComments
How much of its own working spar narrates into a pull request thread.
ReviewOrIgnore
What spar listen does with a pull request somebody put in front of you.
StateStore
Where resume state lives. Local keeps the PR clean and costs no API calls; writing to the PR only buys anything if a run might be resumed from a different checkout.
SystemVia
Where the style rules go when a CLI has a system prompt flag.
Trust
Whose comments spar checkin will act on, and whose comments under an issue reach a prompt.

Constants§

BUILTIN_PRESETS
Presets that ship inside the binary.
CONFIG_NAMES

Functions§

available_presets
Every preset name available, built in and on disk, sorted.
find_config
Find a config: an explicit path, then the working directory, then ~/.config/spar/spar.toml.
known_options
Every option a config file may set, with its default.
load
load_preset
Load a preset. A file on disk wins over the built in copy of the same name, so a drifting CLI can be corrected without waiting for a release.
mentions
Whether a config file mentions an option at all, set or commented out.
parse
preset_dirs
Directories searched for preset overrides, nearest first.
resolve_search_path
Resolve a configured search path, expanding a leading ~.
unmentioned_options
Options this config file has never heard of, which is what somebody who upgraded wants to know.