Skip to content

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

fix(evidence): let the verification loop keep every diagnostic in order

goatliamia789d838f892f
diff --git a/archify.zip b/archify.zip
index b39361fd..07d5c840 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 c434de74..d11acd9b 100644
--- a/archify/renderers/shared/repository-evidence.mjs
+++ b/archify/renderers/shared/repository-evidence.mjs
@@ -218,32 +218,19 @@ export function verifyRepositoryEvidence(diagramType, diagram, repoRootInput) {
});
}
+ // The batch is an optimization only: every path, line-range, file and line
+ // check still runs in source order in the verification loop below, so a
+ // citation the batch cannot answer for never reorders the first diagnostic.
const citedObjects = [];
for (const [nodeIndex, node] of authoredNodes.entries()) {
if (!Array.isArray(node.sources) || node.sources.length === 0) continue;
for (const [sourceIndex, authored] of node.sources.entries()) {
const at = `/${collection}/${nodeIndex}/sources/${sourceIndex}`;
- const sourcePath = verifiedSourcePath(authored.path, `${at}/path`);
- // The same cheap line checks the verification loop makes, in the same
- // order, so batching never reorders the first diagnostic.
- if (authored.end_line && !authored.line) {
- const nodeSubject = collection === 'components'
- ? { diagramType, collection, nodeId: node.id, componentId: node.id }
- : { diagramType, collection, nodeId: node.id };
- evidenceFailure('repository-evidence/line-required', `${at}/end_line requires line.`, {
- subject: { path: `${at}/end_line`, ...nodeSubject },
- supportedFixes: ['add line or remove end_line'],
- });
- }
- if (authored.end_line && authored.end_line < authored.line) {
- const nodeSubject = collection === 'components'
- ? { diagramType, collection, nodeId: node.id, componentId: node.id }
- : { diagramType, collection, nodeId: node.id };
- evidenceFailure('repository-evidence/line-range-invalid', `${at}/end_line must be greater than or equal to line.`, {
- subject: { path: at, ...nodeSubject },
- evidence: { line: authored.line, endLine: authored.end_line },
- supportedFixes: ['use an end_line greater than or equal to line'],
- });
+ let sourcePath;
+ try {
+ sourcePath = verifiedSourcePath(authored.path, `${at}/path`);
+ } catch {
+ continue;
}
citedObjects.push(`${revision}:${sourcePath}`);
}