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

@@ -240,6 +240,7 @@ function parseTaskItems(repoRoot) {
const fs = require("fs");
const path = require("path");
const tasksDir = findTasksDir(repoRoot);
console.log(`[Orchestrator] repoRoot: "${repoRoot}", resolved tasksDir: "${tasksDir}"`);
if (!tasksDir)
return [];
const items = [];
@@ -247,19 +248,23 @@ function parseTaskItems(repoRoot) {
const files = fs
.readdirSync(tasksDir)
.filter((f) => 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, lineIndex) => {
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,
});
}