feat(config): add [scheduling] config block
The cron ticker engine had no path from operator input to runtime. Add the four settings its EngineConfig is built from, as a declared type rather than loose root fields: interval, max_parallel, job_timeout, events_sink Every field is optional and defaults independently, so an absent section is valid and resolves to the engine's own documented constants. Zero means "unset, give me the default", which is why a negative value is a startup error rather than a clamp -- it is the only way an operator can name an unusable value deliberately, and running something other than what was written is how a misconfiguration stays invisible. events_sink is a simple on/off, "bus" or "none": the engine's Sink contract is the bus's emitter shape and there is exactly one bus in the process, so a named-sink registry would be scaffolding with one entry. Absent resolves to "none", the same shape applyMemoryDefaults and applyNATSDefaults use, so a resolved config has one spelling for "not publishing" rather than two that happen to mean the same thing. config.example.toml documents the block in the house style, commented out like [[repos]] and [capture]: a live example would be a default the operator never chose.
This commit is contained in:
1 parent
2ef5327cd8
commit
0f463d84ae
2 files changed
+93
No files matched your search
@@ -516,6 +516,12 @@ type Config struct {
|
||||
Capture CaptureConfig `toml:"capture" yaml:"capture"`
|
||||
Bindings BindingsConfig `toml:"bindings" yaml:"bindings"`
|
||||
|
||||
// Scheduling configures the cron/scheduling ticker engine
|
||||
// (internal/domain/scheduling). Absent is valid: every field
|
||||
// defaults independently, so an empty section and no section at
|
||||
// all produce the same resolved engine configuration.
|
||||
Scheduling SchedulingConfig `toml:"scheduling" yaml:"scheduling"`
|
||||
|
||||
// Memory holds memory provider configuration (from config.memory.yaml).
|
||||
Memory MemoryConfig `toml:"memory" yaml:"memory"`
|
||||
|
||||
@@ -777,6 +783,57 @@ type CaptureConfig struct {
|
||||
RateBurst int `toml:"rate_burst" yaml:"rate_burst"`
|
||||
}
|
||||
|
||||
// SchedulingConfig configures the cron/scheduling ticker engine
|
||||
// (internal/domain/scheduling, epic
|
||||
// archie-core-1786637496320-249-be6d9a20). Every field is optional and
|
||||
// defaults independently, so an absent [scheduling] section is valid and
|
||||
// resolves to the engine's own documented defaults.
|
||||
//
|
||||
// Zero and negative are therefore NOT the same thing here, the same
|
||||
// distinction config.ToolPolicy and config.CaptureConfig make: zero is
|
||||
// "unset, give me the default", which leaves negative as the only way an
|
||||
// operator can name an unusable value deliberately. A negative value is a
|
||||
// startup error -- a negative interval cannot be a tick cadence, and the
|
||||
// values are rejected rather than clamped because silently running
|
||||
// something other than what was written is how a misconfiguration stays
|
||||
// invisible.
|
||||
type SchedulingConfig struct {
|
||||
// Interval is the tick cadence: how often the engine asks its job
|
||||
// source what is due. Zero or absent means the engine's own
|
||||
// scheduling.DefaultInterval (one minute); a configured value is
|
||||
// used as-is. Negative is a startup error.
|
||||
Interval Duration `toml:"interval" yaml:"interval"`
|
||||
// MaxParallel caps simultaneous parallel-pool runs. Zero or absent
|
||||
// means scheduling.DefaultMaxParallel. It does not bound the
|
||||
// sequential pool, which is one by definition. Negative is a
|
||||
// startup error.
|
||||
MaxParallel int `toml:"max_parallel" yaml:"max_parallel"`
|
||||
// JobTimeout bounds one run via context deadline. Zero or absent
|
||||
// means scheduling.DefaultJobTimeout. Negative is a startup error.
|
||||
JobTimeout Duration `toml:"job_timeout" yaml:"job_timeout"`
|
||||
// EventsSink selects whether the engine's run and error events are
|
||||
// published on the daemon's event stream. "bus" publishes them;
|
||||
// absent resolves to "none", which leaves the engine's Events nil --
|
||||
// a configuration the engine documents as valid: it still runs, it
|
||||
// is just unobservable. Any other value is a startup error, so a
|
||||
// typo cannot silently disable observability.
|
||||
EventsSink string `toml:"events_sink" yaml:"events_sink"`
|
||||
}
|
||||
|
||||
// EventsSink mode values for SchedulingConfig.EventsSink. The zero value
|
||||
// (empty) resolves to EventsSinkNone; these are the explicit spellings,
|
||||
// shared with validation so the two cannot drift.
|
||||
const (
|
||||
// EventsSinkBus publishes the engine's run and error events on the
|
||||
// daemon's in-process event bus, which is what the dashboard's
|
||||
// timeline reads.
|
||||
EventsSinkBus = "bus"
|
||||
// EventsSinkNone disables emission. It is the documented way to say
|
||||
// that without relying on an absent key, and it leaves the engine's
|
||||
// Events nil -- valid, and unobservable.
|
||||
EventsSinkNone = "none"
|
||||
)
|
||||
|
||||
// BindingsConfig configures the playbook-binding store (t2db). When
|
||||
// EncryptionKey is unset, binding secrets are persisted as plaintext
|
||||
// (legacy behaviour); when set, they are AES-256-GCM encrypted at rest
|
||||
|
||||
Reference in new issue
Block a user