diff --git a/src/core/cycle.ts b/src/core/cycle.ts index 5d38e6cc1..2441bc72d 100644 --- a/src/core/cycle.ts +++ b/src/core/cycle.ts @@ -999,7 +999,18 @@ async function runPhaseExtract( const { loadConfig } = await import('./config.ts'); // Default off: the incremental cycle extracts body links only unless the // operator opts in to keeping externally-edited frontmatter links fresh too. - const includeFrontmatter = loadConfig()?.autopilot?.incremental_extract_include_frontmatter === true; + // Both planes, file wins (env > file > DB precedence, per loadConfigWithEngine): + // `gbrain config set autopilot.incremental_extract_include_frontmatter true` + // writes the DB plane (engine.setConfig), so a file-plane-only read here + // would make the documented enable command a silent no-op (#2120 class). + const fileVal = loadConfig()?.autopilot?.incremental_extract_include_frontmatter; + let includeFrontmatter = fileVal === true; + if (fileVal === undefined) { + try { + includeFrontmatter = + (await engine.getConfig('autopilot.incremental_extract_include_frontmatter')) === 'true'; + } catch { /* config table unreadable → default off */ } + } // Extract is read-mostly against the filesystem + write to links table. // Honor dryRun by skipping with a 'skipped' entry: extract doesn't have // a clean dry-run mode today and runCycle should be honest about it.