Generate Archify cards from registry descriptions for model diagrams

An architecture diagram inside a model that defines no cards gets one card
per drawn shared element with a description, as the extension does. Test
covers the resolved JSON; formats.md and SKILL.md describe the rule.
This commit is contained in:
root-at-skic committed 2026-10-19 12:53:40 +03:00
1 parent 55894fbade
commit c68f7df108
4 files changed
+26 -1

No files matched your search

+4 -1
View File
@@ -80,7 +80,10 @@ try {
assert(json.model === undefined, 'model block leaked into the resolved JSON');
const api = json.components.find((c) => c.id === 'api');
assert(api && api.type === 'backend' && api.brand === 'node-js' && api.description === undefined && api.diagram === undefined, 'api was not resolved from the registry');
notes.push(`${json.components.length} components, refs expanded`);
const cards = json.cards ?? [];
assert(cards.length === 7 && cards.every((c) => c.dot && c.title && c.items.length === 1), `expected 7 generated cards, got ${JSON.stringify(cards).slice(0, 200)}`);
assert(cards.find((c) => c.title === 'API')?.dot === 'emerald', 'API card has the backend colour');
notes.push(`${json.components.length} components, refs expanded, ${cards.length} cards from the registry`);
});
check('model-resolve prints the JSON inline without --out', ['--action', 'model-resolve', '--file', path.join(example, 'main.archify')], (r) => {