diff --git a/src/compaction.ts b/src/compaction.ts index 4645ced..84a2223 100644 --- a/src/compaction.ts +++ b/src/compaction.ts @@ -25,13 +25,18 @@ export function markManualCompactionFromInput(text: string, runtime: CompactionR } } -/** session_before_compact: default to auto unless input already marked manual (SPEC §8). */ -export function markAutoCompactionBeforeCompact(runtime: CompactionRuntime): void { +/** If not explicitly manual, mark compaction source as auto (SPEC §8). */ +export function ensureCompactionSourceMarked(runtime: CompactionRuntime): void { if (runtime.pendingCompactionSource !== "manual") { runtime.pendingCompactionSource = "auto"; } } +/** session_before_compact: default to auto unless input already marked manual (SPEC §8). */ +export function markAutoCompactionBeforeCompact(runtime: CompactionRuntime): void { + ensureCompactionSourceMarked(runtime); +} + /** Gate re-inject on session_compact from enabled layer and compaction source (SPEC §8). */ export function shouldReinjectAfterCompaction( sessionOverride: boolean | null,