Skip to content

Commit cb15e48

Browse files
Fix citation validator missing backslash-rooted paths on POSIX
The absolute-path rejection relied on path.isAbsolute(), which is platform-dependent: on Linux, backslash-rooted paths like \src\a.ts are not considered absolute, so Windows-generated artifacts with such evidence paths slipped past validation when the server runs on POSIX. Drive prefixes (C:/) were already covered by DRIVE_PREFIX; this adds the explicit leading-backslash check. Caught by CI on ubuntu (tests pass on Windows); verified on both Windows and Linux Node 22 before pushing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent ed587c2 commit cb15e48

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/validation/citation-validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function validateEvidenceShape(evidence: Evidence, location: string): Cit
3737

3838
if (file.trim().length === 0) {
3939
issues.push({ location, message: "evidence file path must not be empty" });
40-
} else if (isAbsolute(file) || DRIVE_PREFIX.test(file) || file.startsWith("/")) {
40+
} else if (isAbsolute(file) || DRIVE_PREFIX.test(file) || file.startsWith("/") || file.startsWith("\\")) {
4141
issues.push({
4242
location,
4343
message: `evidence file path must be relative to the repository root, got "${file}"`,

0 commit comments

Comments
 (0)