Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

fix: identify Windows local paths in repository URL diagnostics

tt-a1i4eb4bbb9ec95
diff --git a/archify.zip b/archify.zip
index e0570f54..0ae3bb8e 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/renderers/shared/repository-evidence.mjs b/archify/renderers/shared/repository-evidence.mjs
index ed0dc70b..3b3a6c58 100644
--- a/archify/renderers/shared/repository-evidence.mjs
+++ b/archify/renderers/shared/repository-evidence.mjs
@@ -112,7 +112,7 @@ export function verifyRepositoryEvidence(diagramType, diagram, repoRootInput) {
if (!location) {
// A filesystem path is the common authoring mistake: the field carries the
// remote origin identity, which `git remote get-url origin` reports.
- const filesystemPath = /^(?:\/|~|\.{1,2}(?:\/|$)|[A-Za-z]:[\\/])/.test(String(repository.url ?? ''));
+ const filesystemPath = /^(?:[\\/]|~|\.{1,2}(?:[\\/]|$)|[A-Za-z]:[\\/])/.test(String(repository.url ?? ''));
evidenceFailure('repository-evidence/url-invalid', '/meta/repository/url must be a credential-free HTTP(S) or Git SSH repository address without query, fragment, or dot segments.', {
subject: { path: '/meta/repository/url' },
evidence: filesystemPath ? { authoredValueLooksLike: 'local filesystem path; the expected value is the remote origin address' } : {},
diff --git a/archify/test/repository-evidence.test.mjs b/archify/test/repository-evidence.test.mjs
index 6e158c14..adf12cd2 100644
--- a/archify/test/repository-evidence.test.mjs
+++ b/archify/test/repository-evidence.test.mjs
@@ -117,6 +117,24 @@ test('repository url carrying a local path names the origin-discovery fix', () =
);
});
+test('repository URL diagnostics identify Windows local paths without echoing them', () => {
+ const data = fixture();
+ for (const localPath of [String.raw`\\server\share\repo`, String.raw`C:\work\repo`, String.raw`.\repo`, String.raw`..\repo`]) {
+ data.diagram.meta.repository.url = localPath;
+ assert.throws(
+ () => verifyRepositoryEvidence('architecture', data.diagram, data.root),
+ (error) => {
+ const diagnostic = error?.archifyDiagnostics?.find(({ code }) => code === 'repository-evidence/url-invalid');
+ assert.ok(diagnostic);
+ assert.match(diagnostic.evidence.authoredValueLooksLike, /local filesystem path/);
+ assert.ok(diagnostic.supportedFixes.some((fix) => fix.includes('git remote get-url origin')));
+ assert.equal(JSON.stringify(diagnostic).includes(JSON.stringify(localPath).slice(1, -1)), false);
+ return true;
+ },
+ );
+ }
+});
+
test('repository root fails closed when physical identity is indeterminate', (t) => {
const data = fixture();
const inaccessible = Object.assign(new Error('synthetic identity failure'), { code: 'EACCES' });