Engineering/AI documentation
Loop Schedules
Schedules configure recurring loop timing, including cron-style recurrence controls.
Concepts: a2a
Implementation Summary
Schedules configure recurring loop timing, including cron-style recurrence controls.
Frontend Surface
frontend/src/components/loops/SchedulesTab.tsxfrontend/src/components/loops/CronBuilder.tsxbackend/app/api/routes/scheduler.pybackend/app/core/scheduler.pybackend/app/services/loop_execution_service.pybackend/app/models/loop_execution.py
State, API, And Backend Contracts
Stores
frontend/src/stores/loopsStore.ts
API And Backend
backend/app/api/routes/scheduler.pybackend/app/api/routes/loops.py- Schedule listing and creation operate only in the active project context; the project-facing UI does not expose a cross-project selector.
- Schedule detail, enable/disable, cron edits, and deletion require the active
project_id; missing project scope returns 400, and a schedule id from another project returns 404 rather than falling back to the schedule's owning project. - Creating a schedule, re-enabling a schedule, or editing a schedule that remains enabled requires an unpaused project. Disabling a schedule in a paused project remains allowed so teams can stop queued work.
- The scheduler selects due work only for non-paused projects and treats missing project ownership as a permanent schedule error instead of executing against a dangling project id.
- Scheduler execution records persist the schedule's project id before they appear in loop history or loop statistics.
- Simulation scenario 49 creates, lists, verifies, and deletes test schedules with the active simulation
project_id; when no active project id exists, it records scoped skips instead of hitting schedule endpoints globally. - Simulation scheduler smoke and architecture/event-wiring audit probes in scenarios 01, 22, and 30 also pass the active simulation
project_id; when no active project id exists, they record scoped skips instead of probing/api/schedulesglobally.
Architecture Notes
- The feature is mounted through
frontend/src/components/loops/SchedulesTab.tsxand the UI navigation path recorded in the inventory. CronBuilderpreviews five future occurrences for sparse daily, weekly, and monthly expressions with a bounded multi-year search guard; impossible expressions resolve to an explicit unavailable state instead of a partial "Next 5 runs" list.- Pausing a project prevents scheduled skills and reminders from mutating task state, broadcasting project suggestions, or consuming model resources for that project.
- The frontmatter and manifest entries are the durable contract for agents updating this page after code changes.
- When the referenced component, store, route, agent, skill, or test behavior changes, regenerate and validate the feature documentation.
Agents, Skills, LLM, MCP, And Permissions
- Agent-to-agent behavior should be traced through agent stores, A2A routes, permissions, and review surfaces before changing assumptions.
- Scheduled skill execution is project content processing; it must remain bound to the schedule's project id and active pause state.
Tests And Verification
tests/test_loops.pytests/test_project_scope_contracts.pytests/test_simulation_project_scope_contracts.pytests/simulation/scenarios/01-health-check.mjstests/simulation/scenarios/22-architecture-evaluation.mjstests/simulation/scenarios/30-event-wiring-audit.mjstests/simulation/scenarios/49-loops-schedule.mjs
Related Features
Related Concepts
Compass Evidence
- Spec/task: CF-SPEC-61 / CF-779; CF-SPEC-68 / CF-870; CF-SPEC-97 / CF-1237; CF-SPEC-107 / CF-1351; CF-SPEC-108 / CF-1365
- Inventory source:
docs/features/inventory.json
When To Update
- Update this page whenever the listed UI components, stores, routes, model behavior, permissions, or tests change.
- Regenerate the site and machine manifests with
python scripts/feature_docs.py --seed-missing --generate-site --check.