feat(FN-1715): add scope-aware automation and routine scheduling

- Add scope field to automations and routines for granular control
- Update automation-store and routine-store with scope-aware query methods
- Extend database schema with scope column for automations and routines
- Update cron-runner and routine-scheduler to respect scope boundaries
- Add project context injection to in-process runtime for scoped execution
- Include changeset for minor version bump
This commit is contained in:
Fusion
2026-04-15 16:32:16 -07:00
committed by gsxdsm
parent e0cc066b42
commit 03863986bf
18 changed files with 208 additions and 49 deletions

View File

@@ -135,6 +135,8 @@ export interface Routine {
catchUpLimit?: number;
/** Optional cron expression stored directly for due-routine queries (derived from trigger). */
cronExpression?: string;
/** Scope of this routine: "global" (shared) or "project" (isolated). */
scope?: "global" | "project";
/** ISO-8601 timestamp of when this routine was created. */
createdAt: string;
/** ISO-8601 timestamp of when this routine was last updated. */
@@ -159,6 +161,8 @@ export interface RoutineCreateInput {
executionPolicy?: RoutineExecutionPolicy;
/** Whether enabled. Default: true. */
enabled?: boolean;
/** Scope of this routine: "global" (shared) or "project" (isolated). Default: "project". */
scope?: "global" | "project";
}
/** Input for updating an existing routine. */
@@ -175,6 +179,8 @@ export interface RoutineUpdateInput {
executionPolicy?: RoutineExecutionPolicy;
/** Whether enabled. */
enabled?: boolean;
/** Scope of this routine: "global" (shared) or "project" (isolated). */
scope?: "global" | "project";
}
// ── Constants ─────────────────────────────────────────────────────────