← ClaudeAtlas

mycopower-management-scheduled-taskslisted

Comprehensive procedures for authoring, configuring, and maintaining Myco's PowerManager infrastructure and scheduled task system. Covers PowerManager job registration and lifecycle, task scheduler architecture and configuration, per-project power state tracking implementation, scheduled task fan-out across Groves, cold-project gating and threshold management, and fire-and-forget dispatch patterns for long-running tasks.
goondocks-co/myco · ★ 13 · AI & Automation · score 79
Install: claude install-skill goondocks-co/myco
# Power Management and Scheduled Task Development Comprehensive procedures for authoring, configuring, and maintaining Myco's PowerManager infrastructure and scheduled task system within Grove multi-tenant architecture, including the new portable project identity model. ## PowerManager Job Registration and Lifecycle ### Registering New PowerManager Jobs PowerManager jobs are registered through `registerPowerJobs()` in `packages/myco/src/daemon/power-jobs.ts`. The function signature takes a `JobRunner` instance (not `PowerManager`): ```typescript import { registerPowerJobs } from './power-jobs.js'; // Register all power-managed jobs during daemon startup const powerJobs = registerPowerJobs(jobRunner, { registry, logger, liveConfig, machineId, cache: runtimeCache, embeddingRuntimeFactory: buildGroveEmbeddingRuntime, onCanopyMassAdd: (groveId, projectId) => scheduledTaskKicker.kick('canopy-describe', { groveId, projectId }), daemonVaultDir: vaultDir, }); ``` ### Implementing New PowerManager Jobs Add new job implementations to `packages/myco/src/daemon/power-jobs.ts` within the `registerPowerJobs()` function using the `JobRunner` API. The `kind` field controls two-lane fair scheduling — `'drain'` for time-sensitive jobs (embedding drain, outbox), `'housekeeping'` for background maintenance: ```typescript export function registerPowerJobs(runner: JobRunner, deps: PowerJobDeps): PowerJobsResult { // Register existing jobs (embedding-reconcile, sessio