Skip to content

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

fix: clarify explainer live-preview boundary

tt-a1i12ff54771722
diff --git a/archify.zip b/archify.zip
index bdb71210..d4ca3fe2 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/bin/archify.mjs b/archify/bin/archify.mjs
index 06c42dee..8b9e5341 100755
--- a/archify/bin/archify.mjs
+++ b/archify/bin/archify.mjs
@@ -2195,7 +2195,7 @@ const COMMAND_USAGE = {
deliver: '<type> <input.json> [output.html] [--json] [--open] [--quality standard|showcase] [--repo-root path]',
patch: 'explainer <artifact.html> <panel-id> <replacement-file> <output.html> [--json] [--quality standard|showcase] [--repo-root path]',
finalize: '<type> <input.json> <output.html> [--json] [--browser-check] [--receipt path] [--out-dir <dir>] [--quality standard|showcase] [--repo-root path] [--candidate-sha256 hex]',
- preview: '<type> <input.json> [output.html] [--no-open] [--quality standard|showcase] [--repo-root path]',
+ preview: '<diagram-type (excludes explainer)> <input.json> [output.html] [--no-open] [--quality standard|showcase] [--repo-root path]',
validate: '<type> <input.json> [--json] [--layout-json] [--quality standard|showcase] [--repo-root path]',
migrate: 'workflow <old.json> <new.json> --to-schema 2 [--output portable.html] [--json] [--repo-root path]',
inspect: '<type> <input.json>',
@@ -5359,6 +5359,7 @@ async function commandPreview(args) {
const positional = repoArgs.rest.filter((arg) => !knownOptions.has(arg));
const [type, input, output] = positional;
if (!type || !input || positional.length > 3) fail(usage());
+ if (type === 'explainer') fail('Live preview supports the ten diagram types only. For explainer, run finalize explainer <draft.md> <output.html>, then open the HTML in your browser.');
rendererPath(type);
try {
diff --git a/test/explainer-cli.test.mjs b/test/explainer-cli.test.mjs
index caae28ec..6dd3ef3b 100644
--- a/test/explainer-cli.test.mjs
+++ b/test/explainer-cli.test.mjs
@@ -89,3 +89,13 @@ test('default explainer finalize succeeds without discovering or launching a bro
const summary=JSON.parse(result.stdout);assert.deepEqual(summary.gates,{validate:'pass',deliver:'pass',check:'pass','browser-check':'not-run'});assert.deepEqual(summary.browserCheck,{requested:false,ran:false});assert.equal(summary.ok,true);
const full=JSON.parse(fs.readFileSync(summary.evidence.receipt,'utf8'));assert.deepEqual(full.browserCheck,summary.browserCheck);assert.equal(full.stages['browser-check'].execution,'not-requested');
});
+
+ test('explainer live preview explains the supported delivery path before reading input', t => {
+ const dir = temporary(t), output = path.join(dir, 'result.html');
+ fs.writeFileSync(output, 'last good artifact');
+ const result = run(['preview', 'explainer', path.join(dir, 'missing.md'), output, '--no-open']);
+ assert.equal(result.status, 1);
+ assert.match(result.stderr, /Live preview supports the ten diagram types only/);
+ assert.match(result.stderr, /finalize explainer/);
+ assert.equal(fs.readFileSync(output, 'utf8'), 'last good artifact');
+});