fix(notepad-guard,start-work): wire dispatch and match .omo paths
notepad-write-guard: - The hook was created by create-tool-guard-hooks but tool-execute-before never invoked it, so the guard was inert. - It also only matched .sisyphus/notepads, missing the current .omo/notepads layout introduced by the workspace migration. - Add the dispatch call alongside writeExistingFileGuard, and extend NOTEPAD_ROOTS to cover both paths via normalize() + sep. New integration test pins the wire and the .omo block; the existing unit test now asserts both paths. start-work session-plan-affinity: - PLAN_PATH_PATTERN only matched .sisyphus/plans, so sessions referring to plans under .omo/plans returned null and start-work missed the current session's own plan. - Extend the regex to .(sisyphus|omo)/plans and add findPrometheusPlans in packages/boulder-state to scan both directories during the transition. New regression test pins .omo/plans matching; legacy .sisyphus/plans coverage preserved.
This commit is contained in:
@@ -11,19 +11,23 @@ const UNCHECKED_CHECKBOX_PATTERN = /^(\s*)[-*]\s*\[\s*\]\s*(.+)$/
|
||||
const CHECKED_CHECKBOX_PATTERN = /^(\s*)[-*]\s*\[[xX]\]\s*(.+)$/
|
||||
const TODO_TASK_PATTERN = /^\d+\.\s+/
|
||||
const FINAL_WAVE_TASK_PATTERN = /^F\d+\.\s+/i
|
||||
const LEGACY_PROMETHEUS_PLANS_DIR = ".sisyphus/plans"
|
||||
const PROMETHEUS_PLAN_DIRS = [PROMETHEUS_PLANS_DIR, LEGACY_PROMETHEUS_PLANS_DIR] as const
|
||||
|
||||
type ProgressSection = "todo" | "final-wave" | "other"
|
||||
|
||||
export function findPrometheusPlans(directory: string): string[] {
|
||||
const plansDir = join(directory, PROMETHEUS_PLANS_DIR)
|
||||
if (!existsSync(plansDir)) {
|
||||
return []
|
||||
}
|
||||
|
||||
try {
|
||||
return readdirSync(plansDir)
|
||||
.filter((file) => file.endsWith(".md"))
|
||||
.map((file) => join(plansDir, file))
|
||||
return PROMETHEUS_PLAN_DIRS.flatMap((planDir) => {
|
||||
const plansDir = join(directory, planDir)
|
||||
if (!existsSync(plansDir)) {
|
||||
return []
|
||||
}
|
||||
|
||||
return readdirSync(plansDir)
|
||||
.filter((file) => file.endsWith(".md"))
|
||||
.map((file) => join(plansDir, file))
|
||||
})
|
||||
.sort((left, right) => statSync(right).mtimeMs - statSync(left).mtimeMs)
|
||||
} catch {
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user