// detection-schedule.mjs — Spor C / C1: opt-in session-anchored detection. // // The DETECTION layer (poll → report → discover → detect-skill-lifecycle) is // pure node: it polls Microsoft Learn sitemaps and writes JSON reports, and // NEVER contacts Anthropic/Claude. It is therefore OUTSIDE the ToS surface — // Consumer Terms §3.7 restricts automated access to "our Services" (Anthropic), // not running local scripts. The APPLY layer (which invokes Claude) stays // manual, in-session, and gated. This module is the pure decision core for the // SessionStart hook + the run-detection.mjs executor. // // Zero dependencies beyond node:fs/path. parseScheduleConfig is pure. import { readFileSync, existsSync } from 'node:fs'; import { join } from 'node:path'; // Opt-in: detection is OFF until the user sets enabled:true. "Frivillig å sette // opp — men gjøres det, skal det virke." (operator 2026-06-20) export const DEFAULT_SCHEDULE_CONFIG = Object.freeze({ enabled: false, interval_days: 7, include_skill_lifecycle: true, }); // The ordered, Claude-FREE detection pipeline. Every step is a local node // script that produces a JSON report; none invoke Claude. run-detection.mjs // resolves each as `node /scripts//