chore(runner): add diagnostic console logs inside task parser
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user