docs(FN-1744): document scoped scheduling semantics in README and settings reference
- Add scheduling scope section to README explaining global vs project execution scopes - Document scope resolution rules: scope=global for cross-project, scope=project for per-project - Add operational guidance for multi-project setups (backups, insight extraction vs CI, deployments) - Update architecture.md to mention scoped automations/routines in store and API descriptions - Add scheduling scope section to settings-reference.md covering cron defaults and interaction with autoBackup and insightExtraction settings - Add changeset for @gsxdsm/fusion minor release documenting scoped scheduling feature
This commit is contained in:
12
.changeset/scoped-scheduling-docs.md
Normal file
12
.changeset/scoped-scheduling-docs.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
"@gsxdsm/fusion": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Add scoped scheduling support for automations and routines
|
||||||
|
|
||||||
|
Schedules and routines now support `global` and `project` execution scopes:
|
||||||
|
- **Global** schedules run across all projects (e.g., backups, cross-project maintenance)
|
||||||
|
- **Project** schedules run within a single project only (e.g., per-project CI, deployments)
|
||||||
|
- Backward-compatible default: omitted scope resolves to `project` with `projectId="default"`
|
||||||
|
- Dashboard Scheduled Tasks modal includes a Global/Project scope toggle
|
||||||
|
- API endpoints accept `?scope=global` or `?scope=project&projectId=<id>`
|
||||||
31
README.md
31
README.md
@@ -158,7 +158,30 @@ For full settings documentation, see [Settings Reference](./docs/settings-refere
|
|||||||
|
|
||||||
Fusion supports scheduled task automation via the `/api/automations` endpoints. Automations can run shell commands or multi-step workflows on a configurable schedule.
|
Fusion supports scheduled task automation via the `/api/automations` endpoints. Automations can run shell commands or multi-step workflows on a configurable schedule.
|
||||||
|
|
||||||
**Scope:** Automations support scope-aware routing with `?scope=global` or `?scope=project` query parameter (or `scope` field in request body). When scope is omitted, the legacy default behavior applies (backward compatible).
|
#### Scheduling Scope
|
||||||
|
|
||||||
|
Automations and routines can run in two scopes:
|
||||||
|
|
||||||
|
- **Global** — Runs across all projects. Use this for cross-project maintenance, backups, or unified reporting.
|
||||||
|
- **Project** — Runs only within a specific project. Use this for project-specific CI, testing, or deployment tasks.
|
||||||
|
|
||||||
|
When you create a schedule without choosing a scope, Fusion defaults to **project scope** with the `default` project ID for backward compatibility. This ensures existing setups keep working exactly as before.
|
||||||
|
|
||||||
|
To explicitly target a scope:
|
||||||
|
- In the dashboard **Scheduled Tasks** modal, use the **Global / Project** toggle.
|
||||||
|
- Via the API, pass `?scope=global` or `?scope=project&projectId=<id>` on automation/routine endpoints.
|
||||||
|
|
||||||
|
**Scope resolution rules:**
|
||||||
|
- `scope=global` always resolves to the global automation/routine lane, independent of the active project.
|
||||||
|
- `scope=project` requires a `projectId`. If omitted, it falls back to `"default"`.
|
||||||
|
- CRUD, run, toggle, and webhook operations are strictly scope-isolated: a global schedule cannot be mutated from a project-scoped request, and vice versa.
|
||||||
|
|
||||||
|
**Operational guidance for multi-project setups:**
|
||||||
|
- Prefer **global** schedules for shared infrastructure (e.g., nightly backups, memory insight extraction).
|
||||||
|
- Prefer **project** schedules for per-repository automation (e.g., per-project test runners, deployment hooks).
|
||||||
|
- Global and project lanes are polled independently by the engine, so due runs in one lane do not block the other.
|
||||||
|
|
||||||
|
#### Automations
|
||||||
|
|
||||||
**Dashboard UI:** The Scheduled Tasks modal in the dashboard provides a Global/Project scope toggle in the header. When a project is active, the scope defaults to "Project"; otherwise it defaults to "Global". Schedules display a scope badge indicating their scope (global vs project). Project-scoped entries require an active project context.
|
**Dashboard UI:** The Scheduled Tasks modal in the dashboard provides a Global/Project scope toggle in the header. When a project is active, the scope defaults to "Project"; otherwise it defaults to "Global". Schedules display a scope badge indicating their scope (global vs project). Project-scoped entries require an active project context.
|
||||||
|
|
||||||
@@ -173,11 +196,9 @@ Fusion supports scheduled task automation via the `/api/automations` endpoints.
|
|||||||
| `/api/automations/:id/toggle` | POST | Toggle enabled/disabled |
|
| `/api/automations/:id/toggle` | POST | Toggle enabled/disabled |
|
||||||
| `/api/automations/:id/steps/reorder` | POST | Reorder automation steps |
|
| `/api/automations/:id/steps/reorder` | POST | Reorder automation steps |
|
||||||
|
|
||||||
### Routines
|
#### Routines
|
||||||
|
|
||||||
Routines are AI agent tasks triggered by cron schedules, webhooks, or manual execution.
|
Routines are AI agent tasks triggered by cron schedules, webhooks, or manual execution. Routines share the same global/project scope model as automations.
|
||||||
|
|
||||||
**Scope:** Routines support scope-aware routing with `?scope=global` or `?scope=project` query parameter (or `scope` field in request body). When scope is omitted, the legacy default behavior applies (backward compatible).
|
|
||||||
|
|
||||||
**Dashboard UI:** The Scheduled Tasks modal in the dashboard provides a Global/Project scope toggle in the header. When a project is active, the scope defaults to "Project"; otherwise it defaults to "Global". Routines display a scope badge indicating their scope (global vs project). Project-scoped entries require an active project context.
|
**Dashboard UI:** The Scheduled Tasks modal in the dashboard provides a Global/Project scope toggle in the header. When a project is active, the scope defaults to "Project"; otherwise it defaults to "Global". Routines display a scope badge indicating their scope (global vs project). Project-scoped entries require an active project context.
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ Concrete references:
|
|||||||
- **Specialized stores**:
|
- **Specialized stores**:
|
||||||
- `AgentStore` (`agent-store.ts`) — filesystem-based agent metadata + heartbeat run history
|
- `AgentStore` (`agent-store.ts`) — filesystem-based agent metadata + heartbeat run history
|
||||||
- `MissionStore` (`mission-store.ts`) — mission/milestone/slice/feature hierarchy
|
- `MissionStore` (`mission-store.ts`) — mission/milestone/slice/feature hierarchy
|
||||||
- `AutomationStore` (`automation-store.ts`) — scheduled jobs
|
- `AutomationStore` (`automation-store.ts`) — scheduled jobs with global/project scope isolation
|
||||||
- `MessageStore` (`message-store.ts`) — mailbox/inbox/outbox messaging
|
- `MessageStore` (`message-store.ts`) — mailbox/inbox/outbox messaging
|
||||||
- `RoadmapStore` (`roadmap-store.ts`) — standalone roadmap CRUD with deterministic ordering and atomic reorder/move operations
|
- `RoadmapStore` (`roadmap-store.ts`) — standalone roadmap CRUD with deterministic ordering and atomic reorder/move operations
|
||||||
|
|
||||||
@@ -310,7 +310,7 @@ Implemented in `agent-heartbeat.ts`:
|
|||||||
- API routes: `createApiRoutes()` in `packages/dashboard/src/routes.ts`
|
- API routes: `createApiRoutes()` in `packages/dashboard/src/routes.ts`
|
||||||
|
|
||||||
Key server capabilities:
|
Key server capabilities:
|
||||||
- REST APIs for tasks, git, GitHub, agents, missions, planning, automations, settings
|
- REST APIs for tasks, git, GitHub, agents, missions, planning, scoped automations/routines, settings
|
||||||
- Project-scoped store reuse via `project-store-resolver.ts`
|
- Project-scoped store reuse via `project-store-resolver.ts`
|
||||||
- Rate limiting (`rate-limit.ts`)
|
- Rate limiting (`rate-limit.ts`)
|
||||||
- Static SPA hosting (Vite build output)
|
- Static SPA hosting (Vite build output)
|
||||||
|
|||||||
@@ -443,3 +443,19 @@ Standard cron format: `minute hour day-of-month month day-of-week`
|
|||||||
| `0 2 * * *` | Daily at 2:00 AM (default) |
|
| `0 2 * * *` | Daily at 2:00 AM (default) |
|
||||||
| `0 */6 * * *` | Every 6 hours |
|
| `0 */6 * * *` | Every 6 hours |
|
||||||
| `0 9 * * 1` | Weekly on Monday at 9:00 AM |
|
| `0 9 * * 1` | Weekly on Monday at 9:00 AM |
|
||||||
|
|
||||||
|
### Scheduling Scope
|
||||||
|
|
||||||
|
Fusion supports scoped automations and routines:
|
||||||
|
|
||||||
|
- **Global scope** (`scope: "global"`) — Executes across all projects. Useful for backups, insight extraction, and cross-project maintenance.
|
||||||
|
- **Project scope** (`scope: "project"`) — Executes within a single project only. Useful for project-specific CI, tests, and deployments.
|
||||||
|
|
||||||
|
**Defaults and resolution:**
|
||||||
|
- When `scope` is omitted, Fusion treats the entry as `project` scope with `projectId: "default"`.
|
||||||
|
- Global-scope entries ignore `projectId`.
|
||||||
|
- Project-scope lookups require `projectId`; missing values fall back to `"default"`.
|
||||||
|
|
||||||
|
**Settings that interact with scheduling:**
|
||||||
|
- `autoBackupEnabled` / `autoBackupSchedule` — Backup automation respects scope like any other scheduled task.
|
||||||
|
- `insightExtractionEnabled` / `insightExtractionSchedule` — Insight extraction can be configured as global or project-scoped.
|
||||||
|
|||||||
Reference in New Issue
Block a user