diff --git a/src/resources/extensions/gsd/pre-execution-checks.ts b/src/resources/extensions/gsd/pre-execution-checks.ts index 1e49a3909..2719cb746 100644 --- a/src/resources/extensions/gsd/pre-execution-checks.ts +++ b/src/resources/extensions/gsd/pre-execution-checks.ts @@ -280,6 +280,38 @@ function extractPathFromAnnotation(raw: string): string { return trimmed.replace(/`/g, ""); } +/** + * Planning units sometimes use task.inputs for prose like "Current enum shape" + * instead of concrete file paths. Those entries should not fail path checks. + * Keep validation for anything that still looks like a real file reference: + * explicit backticks, globs, separators, dot-paths, or single-token basenames + * like Dockerfile. + */ +function shouldValidateInputAsPath(raw: string): boolean { + const trimmed = raw.trim(); + if (!trimmed) return false; + + if (/^`+[^`]+`+/.test(trimmed)) { + return true; + } + + const candidate = extractPathFromAnnotation(trimmed); + if (!candidate) return false; + + if (!/\s/.test(candidate)) { + return true; + } + + return ( + candidate.startsWith("/") || + candidate.startsWith("./") || + candidate.startsWith("../") || + candidate.startsWith("~/") || + /[\\/]/.test(candidate) || + /[*?[\]{}]/.test(candidate) + ); +} + /** * Build a set of files that will be created by tasks up to (but not including) taskIndex. * All paths are normalized for consistent comparison. @@ -318,6 +350,7 @@ export function checkFilePathConsistency( for (const file of filesToCheck) { // Skip empty strings if (!file.trim()) continue; + if (!shouldValidateInputAsPath(file)) continue; // Normalize path for consistent comparison const normalizedFile = normalizeFilePath(file); @@ -378,6 +411,8 @@ export function checkTaskOrdering( const filesToCheck = [...task.inputs]; for (const file of filesToCheck) { + if (!shouldValidateInputAsPath(file)) continue; + const normalizedFile = normalizeFilePath(file); const creator = fileCreators.get(normalizedFile); if (creator && creator.index > i) { diff --git a/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts b/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts index 79ac6a692..e7cf2a70c 100644 --- a/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +++ b/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts @@ -1175,6 +1175,23 @@ describe("checkFilePathConsistency additional edge cases", () => { assert.equal(results![0].blocking, true); }); + test("multi-word prose inputs are ignored by path consistency checks", () => { + const tasks = [ + createTask({ + id: "T01", + files: [], + inputs: [ + "Current WIZARD_PRODUCTS enum", + "Existing test patterns in wizard.test.ts", + ], + expected_output: [], + }), + ]; + + const results = checkFilePathConsistency(tasks, "/tmp"); + assert.equal(results.length, 0, "Prose planning hints should not be treated as missing file paths"); + }); + test("empty inputs array produces no results", () => { // A task with no inputs and only files should produce zero results from // consistency check — files are not checked (#3626).