diff --git a/src/resources/extensions/sf/auto-post-unit.ts b/src/resources/extensions/sf/auto-post-unit.ts index 814314d2d..83b84967d 100644 --- a/src/resources/extensions/sf/auto-post-unit.ts +++ b/src/resources/extensions/sf/auto-post-unit.ts @@ -87,6 +87,7 @@ import { } from "./sf-db.js"; import { deriveState } from "./state.js"; import { parseUnitId } from "./unit-id.js"; +import { isAwaitingUserInput } from "./user-input-boundary.js"; import { resolveUokFlags } from "./uok/flags.js"; import { UokGateRunner } from "./uok/gate-runner.js"; import { writeTurnGitTransaction } from "./uok/gitops.js"; diff --git a/src/resources/extensions/sf/milestone-framing-check.ts b/src/resources/extensions/sf/milestone-framing-check.ts index 8cc805e14..fb419ff08 100644 --- a/src/resources/extensions/sf/milestone-framing-check.ts +++ b/src/resources/extensions/sf/milestone-framing-check.ts @@ -251,18 +251,15 @@ function titlesOverlap(a: string, b: string): boolean { } /** - * Minimal synchronous readdirSync wrapper to enable overriding in tests - * and to keep the try/catch tidy in the caller. + * List milestone subdirectory names under /milestones/. + * Returns empty array when the directory does not exist or cannot be read. */ -function await_readdirSync(sfDir: string): { readdirSync: string[] } { - const { readdirSync: rds } = require("node:fs") as typeof import("node:fs"); +function listMilestoneDirs(sfDir: string): string[] { const milestonesDir = join(sfDir, "milestones"); - if (!existsSync(milestonesDir)) return { readdirSync: [] }; + if (!existsSync(milestonesDir)) return []; try { - return { - readdirSync: rds(milestonesDir, { withFileTypes: false }) as string[], - }; + return readdirSync(milestonesDir, { withFileTypes: false }) as string[]; } catch { - return { readdirSync: [] }; + return []; } }