Reuse the scheduling engine as the instance scheduler. Schedules and runs move to State Store tables; a run publishes a schedule-fired event that workflow bindings match; daemon maintenance moves from the poll cycle into built-in schedules; the dashboard gets a schedules table, a runs page and a Schedule trigger node.
Decisions: times stored in UTC and shown in the user's zone; cron evaluated in an instance time zone (default UTC). Missed runs fire once at next opportunity (systemd Persistent=true); next run computed from the schedule grid, not the late start. Failed run is recorded and the schedule advances, no tick retries. Instance schedules only, admins only, run as the system identity; data carries an owner reference so org schedules can follow. Built-in job work runs inside archied.
Imported from beads archie-core-k4snu · GitHub #1868 · type epic · priority P1 · created 2026-10-25
Reuse the scheduling engine as the instance scheduler. Schedules and runs move to State Store tables; a run publishes a schedule-fired event that workflow bindings match; daemon maintenance moves from the poll cycle into built-in schedules; the dashboard gets a schedules table, a runs page and a Schedule trigger node.
Decisions: times stored in UTC and shown in the user's zone; cron evaluated in an instance time zone (default UTC). Missed runs fire once at next opportunity (systemd Persistent=true); next run computed from the schedule grid, not the late start. Failed run is recorded and the schedule advances, no tick retries. Instance schedules only, admins only, run as the system identity; data carries an owner reference so org schedules can follow. Built-in job work runs inside archied.
---
_Imported from beads `archie-core-k4snu` · GitHub #1868 · type epic · priority P1 · created 2026-10-25_
Triaged: no code change is needed for this. No code change needed. Issue #1411 is an epic whose every deliverable is already in this tree and released in 1.56.0 (tree is at 1.61.2).
Checked item by item against the issue body:
"Reuse the scheduling engine as the instance scheduler": internal/domain/scheduling/{engine,ticker,cron,schedule}.go plus the boot wiring in internal/app/archied/scheduling.go (setupScheduling, scheduleSource, scheduleRunner).
"Schedules and runs move to State Store tables": internal/infrastructure/postgres/migrations/0065_schedules.sql creates schedules and schedule_runs (with a UNIQUE(schedule_id, scheduled_for) slot guard) and deletes the old resources rows of kind 'schedules'; store is internal/infrastructure/postgres/schedules.go (ClaimDue), RPC is internal/infrastructure/staterpc/schedules.go over proto/state/v1/schedule.proto.
"A run publishes a schedule-fired event that workflow bindings match": migrations/0064_schedule_fired.sql seeds the schedule-fired event type and mapping; internal/infrastructure/schedulecapture/firer.go + internal/domain/source/schedule.go; documented in WORKFLOWS.md ("What starts a workflow" → Schedules).
"Daemon maintenance moves from the poll cycle into built-in schedules": internal/daemon/builtin_jobs.go lists volume-cleanup, issue-discovery, pr-reconcile, pr-review-scan, mirror-prune; they run inside archied via builtinJob in internal/app/archied/scheduling.go.
"Dashboard gets a schedules table, a runs page and a Schedule trigger node": ui/src/schedules/SchedulesPage.vue (DataTable of schedules), ScheduleRunsPage.vue (runs table with scheduled/started/duration/result/error/linked tasks, Run now), and ui/src/workflows/ScheduleTrigger.vue wired through TriggerSettings.vue; routes at /org/schedules and /org/schedules/:id/runs in ui/src/router/index.ts.
The stated decisions are also encoded: times are UTC instants and rendered in the viewer's zone (ui/src/schedules/schedule.ts toWallTime/fromWallTime); cron is read in the instance schedule-settings zone with UTC default (staterpc location(), schedule.go Timing.Next); a missed slot fires once and next run comes from the grid, not the late start (ClaimDue in postgres/schedules.go, Timing.Next on the interval grid); a failed run is recorded and the schedule advances with no retry; failed-run streaks of 3 raise an alert; the old "instance/admins only" limitation has since been superseded by org-owned schedules (owner_kind instance|org, access-policy tests in internal/webui/schedules_test.go, e2e/checks/org-schedule-trigger.cjs).
CHANGELOG.md [1.56.0] states it outright: "Schedules run from the State Store with run history, fire into their own organisation, and can trigger workflows. Daemon maintenance runs as built-in schedules."
Verified by reading code and migrations; not verified by running the test suites, since this was a read-only analysis with no execution tool. The only thing I would flag for the operator is that the epic's issue should be closed as already delivered rather than worked again.
Triaged: no code change is needed for this. No code change needed. Issue #1411 is an epic whose every deliverable is already in this tree and released in 1.56.0 (tree is at 1.61.2).
Checked item by item against the issue body:
- "Reuse the scheduling engine as the instance scheduler": internal/domain/scheduling/{engine,ticker,cron,schedule}.go plus the boot wiring in internal/app/archied/scheduling.go (setupScheduling, scheduleSource, scheduleRunner).
- "Schedules and runs move to State Store tables": internal/infrastructure/postgres/migrations/0065_schedules.sql creates `schedules` and `schedule_runs` (with a UNIQUE(schedule_id, scheduled_for) slot guard) and deletes the old `resources` rows of kind 'schedules'; store is internal/infrastructure/postgres/schedules.go (ClaimDue), RPC is internal/infrastructure/staterpc/schedules.go over proto/state/v1/schedule.proto.
- "A run publishes a schedule-fired event that workflow bindings match": migrations/0064_schedule_fired.sql seeds the `schedule-fired` event type and mapping; internal/infrastructure/schedulecapture/firer.go + internal/domain/source/schedule.go; documented in WORKFLOWS.md ("What starts a workflow" → Schedules).
- "Daemon maintenance moves from the poll cycle into built-in schedules": internal/daemon/builtin_jobs.go lists volume-cleanup, issue-discovery, pr-reconcile, pr-review-scan, mirror-prune; they run inside archied via builtinJob in internal/app/archied/scheduling.go.
- "Dashboard gets a schedules table, a runs page and a Schedule trigger node": ui/src/schedules/SchedulesPage.vue (DataTable of schedules), ScheduleRunsPage.vue (runs table with scheduled/started/duration/result/error/linked tasks, Run now), and ui/src/workflows/ScheduleTrigger.vue wired through TriggerSettings.vue; routes at /org/schedules and /org/schedules/:id/runs in ui/src/router/index.ts.
The stated decisions are also encoded: times are UTC instants and rendered in the viewer's zone (ui/src/schedules/schedule.ts toWallTime/fromWallTime); cron is read in the instance schedule-settings zone with UTC default (staterpc location(), schedule.go Timing.Next); a missed slot fires once and next run comes from the grid, not the late start (ClaimDue in postgres/schedules.go, Timing.Next on the interval grid); a failed run is recorded and the schedule advances with no retry; failed-run streaks of 3 raise an alert; the old "instance/admins only" limitation has since been superseded by org-owned schedules (owner_kind instance|org, access-policy tests in internal/webui/schedules_test.go, e2e/checks/org-schedule-trigger.cjs).
CHANGELOG.md [1.56.0] states it outright: "Schedules run from the State Store with run history, fire into their own organisation, and can trigger workflows. Daemon maintenance runs as built-in schedules."
Verified by reading code and migrations; not verified by running the test suites, since this was a read-only analysis with no execution tool. The only thing I would flag for the operator is that the epic's issue should be closed as already delivered rather than worked again.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Reuse the scheduling engine as the instance scheduler. Schedules and runs move to State Store tables; a run publishes a schedule-fired event that workflow bindings match; daemon maintenance moves from the poll cycle into built-in schedules; the dashboard gets a schedules table, a runs page and a Schedule trigger node.
Decisions: times stored in UTC and shown in the user's zone; cron evaluated in an instance time zone (default UTC). Missed runs fire once at next opportunity (systemd Persistent=true); next run computed from the schedule grid, not the late start. Failed run is recorded and the schedule advances, no tick retries. Instance schedules only, admins only, run as the system identity; data carries an owner reference so org schedules can follow. Built-in job work runs inside archied.
Imported from beads
archie-core-k4snu· GitHub #1868 · type epic · priority P1 · created 2026-10-25Triaged: no code change is needed for this. No code change needed. Issue #1411 is an epic whose every deliverable is already in this tree and released in 1.56.0 (tree is at 1.61.2).
Checked item by item against the issue body:
schedulesandschedule_runs(with a UNIQUE(schedule_id, scheduled_for) slot guard) and deletes the oldresourcesrows of kind 'schedules'; store is internal/infrastructure/postgres/schedules.go (ClaimDue), RPC is internal/infrastructure/staterpc/schedules.go over proto/state/v1/schedule.proto.schedule-firedevent type and mapping; internal/infrastructure/schedulecapture/firer.go + internal/domain/source/schedule.go; documented in WORKFLOWS.md ("What starts a workflow" → Schedules).The stated decisions are also encoded: times are UTC instants and rendered in the viewer's zone (ui/src/schedules/schedule.ts toWallTime/fromWallTime); cron is read in the instance schedule-settings zone with UTC default (staterpc location(), schedule.go Timing.Next); a missed slot fires once and next run comes from the grid, not the late start (ClaimDue in postgres/schedules.go, Timing.Next on the interval grid); a failed run is recorded and the schedule advances with no retry; failed-run streaks of 3 raise an alert; the old "instance/admins only" limitation has since been superseded by org-owned schedules (owner_kind instance|org, access-policy tests in internal/webui/schedules_test.go, e2e/checks/org-schedule-trigger.cjs).
CHANGELOG.md [1.56.0] states it outright: "Schedules run from the State Store with run history, fire into their own organisation, and can trigger workflows. Daemon maintenance runs as built-in schedules."
Verified by reading code and migrations; not verified by running the test suites, since this was a read-only analysis with no execution tool. The only thing I would flag for the operator is that the epic's issue should be closed as already delivered rather than worked again.