Cron/scheduling: job store, ticker, blueprints #774

Open
opened 2026-10-27 13:37:41 +00:00 by sam · 0 comments
Owner

Remaining: (1) blueprints - parameterised automation templates with typed slots (time, enum, text, weekdays) plus a form schema for CLI/gateway consumption, replacing the hard-coded daily-summary template; (2) lifecycle guard - reject job specs whose payload carries dangerous commands (gateway restart, systemctl/launchctl, pkill) at creation time; (3) wire the chat delivery kind in production, since setupScheduling currently registers KindWorkflow only.

Already shipped (do not rebuild): JSON job store with cross-process flock and CRUD in internal/infrastructure/cronstore; ticker engine with configurable interval and parallel/sequential pools in internal/domain/scheduling/ticker.go; delivery routing in internal/infrastructure/crondelivery/router.go; and persistence across restarts.

Corrections to the earlier text: the router type is crondelivery.Router, not DeliveryRouter; the store path is caller-injected and production no longer opens cronstore directly (scheduling reads through the control plane, with cronstore.Open used for legacy migration). Reworded 2026-09-22 from an acceptance check; the original text is in Dolt history.

Notes

docs/prds/hermes-gap-analysis.md (referenced above) was intentionally deleted in commit 65aa5b4 ('chore: cleanup', 2026-07-28) after it had already spawned this and ~14 sibling beads issues from its 60 identified gaps — it is not a broken link to restore. This issue's description is the surviving record of its slice of that analysis.
Maintainer 2026-09-22: needs a FULL REVIEW to validate completion. Evidence: the job store with cross-process file locking exists (internal/infrastructure/cronstore/, incl. lock_unix.go), and the legacy cron/jobs.json migration was just fixed (553330df); ticker engine, blueprints and lifecycle guard are unverified. Next: acceptance-check each criterion, then reword.
Acceptance check 2026-09-22 (read-only, file:line): store SHIPPED cronstore/store.go:160 (Open), :217/:268/:296/:320/:401 (CRUD), :531 withLock, lock_unix.go:13 flock; ticker SHIPPED domain/scheduling/ticker.go:38/:119, started at app/archied/bootstrap.go:1503, pools at domain/scheduling/contract.go:22-30; delivery router SHIPPED infrastructure/crondelivery/router.go:25, wired app/archied/scheduling.go:80. Blueprints ABSENT: no FormSchema or SlotType anywhere, only forward-looking comments at crondelivery/runner.go:14. Lifecycle guard ABSENT: no dangerous-command rejection in domain/scheduling, cronstore or app/controlplane/schedules.go - the dangerous.go files are chat-tool approval, unrelated. Chat daily-summary path is test-only (router_test.go:243-279) while production wires KindWorkflow only (scheduling.go:78-84).


Imported from beads archie-core-1786637496320-249-be6d9a20 · GitHub #270 · type feature · priority P2 · created 2026-08-08

Remaining: (1) blueprints - parameterised automation templates with typed slots (time, enum, text, weekdays) plus a form schema for CLI/gateway consumption, replacing the hard-coded daily-summary template; (2) lifecycle guard - reject job specs whose payload carries dangerous commands (gateway restart, systemctl/launchctl, pkill) at creation time; (3) wire the chat delivery kind in production, since setupScheduling currently registers KindWorkflow only. Already shipped (do not rebuild): JSON job store with cross-process flock and CRUD in internal/infrastructure/cronstore; ticker engine with configurable interval and parallel/sequential pools in internal/domain/scheduling/ticker.go; delivery routing in internal/infrastructure/crondelivery/router.go; and persistence across restarts. Corrections to the earlier text: the router type is crondelivery.Router, not DeliveryRouter; the store path is caller-injected and production no longer opens cronstore directly (scheduling reads through the control plane, with cronstore.Open used for legacy migration). Reworded 2026-09-22 from an acceptance check; the original text is in Dolt history. ### Notes docs/prds/hermes-gap-analysis.md (referenced above) was intentionally deleted in commit 65aa5b4 ('chore: cleanup', 2026-07-28) after it had already spawned this and ~14 sibling beads issues from its 60 identified gaps — it is not a broken link to restore. This issue's description is the surviving record of its slice of that analysis. Maintainer 2026-09-22: needs a FULL REVIEW to validate completion. Evidence: the job store with cross-process file locking exists (internal/infrastructure/cronstore/, incl. lock_unix.go), and the legacy cron/jobs.json migration was just fixed (553330df); ticker engine, blueprints and lifecycle guard are unverified. Next: acceptance-check each criterion, then reword. Acceptance check 2026-09-22 (read-only, file:line): store SHIPPED cronstore/store.go:160 (Open), :217/:268/:296/:320/:401 (CRUD), :531 withLock, lock_unix.go:13 flock; ticker SHIPPED domain/scheduling/ticker.go:38/:119, started at app/archied/bootstrap.go:1503, pools at domain/scheduling/contract.go:22-30; delivery router SHIPPED infrastructure/crondelivery/router.go:25, wired app/archied/scheduling.go:80. Blueprints ABSENT: no FormSchema or SlotType anywhere, only forward-looking comments at crondelivery/runner.go:14. Lifecycle guard ABSENT: no dangerous-command rejection in domain/scheduling, cronstore or app/controlplane/schedules.go - the dangerous.go files are chat-tool approval, unrelated. Chat daily-summary path is test-only (router_test.go:243-279) while production wires KindWorkflow only (scheduling.go:78-84). --- _Imported from beads `archie-core-1786637496320-249-be6d9a20` · GitHub #270 · type feature · priority P2 · created 2026-08-08_
sam added the mediumfeature labels 2026-10-27 13:37:41 +00:00
sam self-assigned this 2026-10-27 13:37:41 +00:00
sam added the deferred label 2026-11-15 17:26:23 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#774