da07c39ca8ad2d348339a1e94faddd754a93f8e0
Adds internal/domain/scheduling, the timing half of the cron/scheduling epic (archie-core-1786637496320-249-be6d9a20): a tick loop that asks a JobSource what is due at a configurable cadence and dispatches each due job to the pool it declares. The package owns *when* a scheduled job runs and nothing else. The job store, blueprints and delivery routing are separate issues in that epic, so the engine declares the two contracts it needs from them (JobSource, Runner) and names no implementation. That is what lets the timing behaviour be tested against a fake clock with no store, no NATS and no model. Behaviour worth stating explicitly, because each is load-bearing: - The source is authoritative about what is due. The engine applies no schedule arithmetic of its own, so cron expressions, fixed intervals and catch-up windows stay the store's decision. - A job never overlaps itself. While a run is queued or in flight, later ticks reporting the same ID are skipped rather than stacked, so a job slower than the interval runs back-to-back instead of fanning out. - The pools do not interfere: a blocked sequential job cannot delay a parallel one, and a saturated parallel cap cannot delay the sequential worker. They share only the tick. - An empty Pool means sequential, not parallel. Wrongly serialising a job costs latency; wrongly parallelising one costs correctness. - Every failure is contained and reported: source error, job error, job panic and job timeout each emit an event and leave the loop running. - Stop drains gracefully. Run contexts descend from Background rather than the loop context, so halting the loop stops new work without yanking the context out from under a run already in progress; the caller's deadline is what eventually cancels those. - An engine is single-use. Restarting after Stop is refused because Stop leaves the dropped backlog and the claims of runs it did not wait for behind, and a restart would re-run stale queued jobs while permanently suppressing the claimed ones. internal/events gains job_run/job_error: a scheduled run has no task and no chat turn behind it, so without those kinds a job that fired, stalled or failed is invisible everywhere.
Description
Archie connects events from your systems to agents that can investigate, reason, and act.
Define what an event means, map its data into a workflow, and give that workflow an agent equipped for the job: its own execution environment, tools, and identity.
https://archie.catlow.cloud
133 MiB
0 Stars
1 Watchers
0 Forks
Releases
11
Archie v1.62.0
Latest
Languages
Go
76.8%
Vue
13.1%
TypeScript
7.8%
JavaScript
1.2%
Shell
0.6%
Other
0.4%