From 81f63c7779bef383ae35f7ccfc3020d45da9e1dd Mon Sep 17 00:00:00 2001 From: Coco Sheng Date: Tue, 19 May 2026 10:52:07 -0400 Subject: [PATCH] refactor: fix path validation integration test by supporting log markers at component starts --- packages/core/src/utils/path-validator.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/core/src/utils/path-validator.ts b/packages/core/src/utils/path-validator.ts index 8c29554719..be234ad4e8 100644 --- a/packages/core/src/utils/path-validator.ts +++ b/packages/core/src/utils/path-validator.ts @@ -39,15 +39,15 @@ export function validatePath(pathStr: string): PathValidationResult { }; } - // Check for common log/error patterns that are definitely not paths - // We use anchored regex to ensure we only block if these appear at the start, - // which is typical for misinterpreted log lines. + // Check for common log/error patterns that are definitely not paths. + // We check for these at the start of the string OR at the start of any path component. + // This ensures we catch them in both raw model output and resolved absolute paths. const logMarkerRegexes = [ - /^AssertionError:/, - /^FAIL /, - /^✓ /, - /^× /, - /^TestingLibraryElementError:/, + /(^|[/\\])AssertionError:/, + /(^|[/\\])FAIL /, + /(^|[/\\])✓ /, + /(^|[/\\])× /, + /(^|[/\\])TestingLibraryElementError:/, ]; for (const regex of logMarkerRegexes) { if (regex.test(pathStr)) {