chore(sf): final minor cleanup — auto-post-unit + milestone-framing-check
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d1be5d9b74
commit
4238c033fb
2 changed files with 7 additions and 9 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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 <sfDir>/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 [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue