Skip to content

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

Merge remote-tracking branch 'upstream/dev' into merge-654-dev

momoyeyu4b9c5dc93505
diff --cc test/render-failure-diagnostics.test.mjs
index 46dfb4b0,f0e2baef..0110440a
--- a/test/render-failure-diagnostics.test.mjs
+++ b/test/render-failure-diagnostics.test.mjs
@@@ -161,27 -161,9 +161,27 @@@ test('a recorded layout diagnostic cann
assert.deepEqual(JSON.parse(classified.stderr).diagnostics.map(d => d.message), ['earlier layout problem', 'final layout problem']);
});
+test('repeated problem messages keep their own subject and evidence', t => {
+ const cwd = workspace(t);
+ const message = 'Connection "ghost" references unknown target "ghost".';
+ const script = `${installBoundary} import { throwDiagnosticProblems } from ${JSON.stringify(diagnosticModule)};
+ throwDiagnosticProblems('architecture rejected', [${JSON.stringify(message)}, ${JSON.stringify(message)}], {
+ diagnostics: [
+ { code: 'architecture/unknown-endpoint', message: ${JSON.stringify(message)}, subject: { path: '/connections/0/to' }, evidence: { connection: 0 }, supportedFixes: ['set /connections/0/to to verified node id "a"'] },
+ { code: 'architecture/unknown-endpoint', message: ${JSON.stringify(message)}, subject: { path: '/connections/1/to' }, evidence: { connection: 1 }, supportedFixes: ['set /connections/1/to to verified node id "b"'] },
+ ],
+ });`;
+ const machine = run(['--input-type=module', '-e', script], cwd, true);
+ assert.equal(machine.status, 1, machine.stderr);
+ const failure = JSON.parse(machine.stderr);
+ assert.equal(failure.diagnostics.length, 2);
+ assert.deepEqual(failure.diagnostics.map((entry) => entry.subject.path), ['/connections/0/to', '/connections/1/to']);
+ assert.deepEqual(failure.diagnostics.map((entry) => entry.evidence.connection), [0, 1]);
+});
+
test('invalid output arguments keep their implementation error instead of a filesystem repair', t => {
const cwd = workspace(t);
- const helper = new URL('../renderers/shared/cli.mjs', import.meta.url).href;
+ const helper = new URL('../archify/renderers/shared/cli.mjs', import.meta.url).href;
const templatePath = path.join(skillRoot, 'assets/template.html');
const script = `${installBoundary} import fs from 'node:fs'; import { writeDiagram } from ${JSON.stringify(helper)};
writeDiagram({ outPath: undefined, template: fs.readFileSync(${JSON.stringify(templatePath)}, 'utf8'), diagramType: 'architecture', meta: { title: 'Test' }, svg: '', cards: [] });`;