chore(runner): add diagnostic console logs inside task parser

This commit is contained in:
2026-06-03 15:08:54 -07:00
parent 3c0d3d5175
commit a42eaa4e40
2 changed files with 19 additions and 2 deletions

View File

@@ -333,6 +333,9 @@ function parseTaskItems(repoRoot: string): TaskItem[] {
const fs = require("fs") as typeof import("fs");
const path = require("path") as typeof import("path");
const tasksDir = findTasksDir(repoRoot);
console.log(
`[Orchestrator] repoRoot: "${repoRoot}", resolved tasksDir: "${tasksDir}"`,
);
if (!tasksDir) return [];
const items: TaskItem[] = [];
@@ -340,20 +343,29 @@ function parseTaskItems(repoRoot: string): TaskItem[] {
const files = fs
.readdirSync(tasksDir)
.filter((f: string) => f.endsWith(".md"));
console.log(`[Orchestrator] Found task files:`, files);
files.sort();
for (const file of files) {
const filePath = path.join(tasksDir, file);
const content = fs.readFileSync(filePath, "utf8");
console.log(
`[Orchestrator] Reading ${file} (length: ${content.length} bytes). Head:\n${content.slice(0, 500)}`,
);
const lines = content.split("\n");
lines.forEach((line: string, lineIndex: number) => {
const match = line.match(/^(\s*)(?:-\s*)?\[([ xX])\]\s+(.+)$/);
if (match && match[2] !== undefined && match[3] !== undefined) {
const checked = match[2].toLowerCase() === "x";
console.log(
`[Orchestrator] Parsed line ${lineIndex + 1}: isChecked=${checked}, text="${match[3].trim()}"`,
);
items.push({
text: match[3].trim(),
filePath,
lineIndex,
isChecked: match[2].toLowerCase() === "x",
isChecked: checked,
fileName: file,
});
}