Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
HTML agent-skillsai-agentsarchitecture-diagramclaude-codeclaude-skillscodexcoding-agentsdeepseek-harnessdeveloper-toolsdiagramsdiagrams-as-codedsh-pluginflowchartllmmermaidopencodesequence-diagramsoftware-architecturesystem-designvisualization
Allow readable vertical scroll for tall diagrams
tt-a1ia7c7e6271e8c
diff --git a/archify/SKILL.md b/archify/SKILL.mdindex 4f46310e..131e5db5 100644--- a/archify/SKILL.md+++ b/archify/SKILL.md@@ -81,7 +81,7 @@ Read Mermaid for topology and meaning, then author fresh Archify JSON; do not me- One obvious main path; side branches leave the nearest main-path node. Remove low-value edges before adding routing controls.- Omit `meta.visual_preset` by default so every diagram opens in `classic`, regardless of whether its resolved color mode is light or dark. Color mode and visual preset are independent: switching Light / Dark must preserve the current preset. Set `signal-flow`, `blueprint`, or `editorial` only when the user explicitly requests that visual style.- Omit `meta.subtitle` by default. Never invent a subtitle that restates the title, nodes, or cards; include one short supporting line only when the user explicitly asks for it.-- Treat the standalone desktop viewer as a first-screen artifact by default, not a shallow strip. Generate one responsive artifact for laptops and external displays—never device-specific HTML or alternate topology. The viewer may adapt only the outer reading width from the live viewport height; it must preserve the authored SVG/viewBox, proportions, semantic geometry, and normal document flow. On a wide or tall desktop, use enough authored vertical rhythm that the diagram panel and its necessary conclusion cards occupy the screen as a balanced whole; runtime scaling cannot repair an over-compressed Y layout or an undersized explicit `meta.viewBox`. Before handoff, open the real HTML at 1440×900, 1600×1000, and 1920×1080; additionally check 2048×1320 whenever the composition is intended for a large desktop display. Require `document.documentElement.scrollWidth <= window.innerWidth` and `scrollHeight <= window.innerHeight` at every checked size, while visually checking that the diagram remains comfortably readable and vertically balanced at the largest checked viewport. Repair overflow by removing only genuinely redundant content or compacting spacing before shrinking nodes, labels, or the main panel. If the largest viewport still has a conspicuous empty lower band at the viewer's width cap, redistribute authored Y positions and increase the viewBox height proportionally; do not add filler copy or decorative cards. Never counterfeit a pass with `overflow: hidden`, clipped content, an internal diagram scroller, stretched SVG height, or smaller typography. Narrow/mobile layouts may scroll vertically when containment requires it.+- Treat the standalone desktop viewer as a first-screen artifact by default, not a shallow strip. Generate one responsive artifact for laptops and external displays—never device-specific HTML or alternate topology. The viewer may adapt only the outer reading width from the live viewport height; it must preserve the authored SVG/viewBox, proportions, semantic geometry, and normal document flow. On a wide or tall desktop, use enough authored vertical rhythm that the diagram panel and its necessary conclusion cards occupy the screen as a balanced whole; runtime scaling cannot repair an over-compressed Y layout or an undersized explicit `meta.viewBox`. Before handoff, run the real browser check at 1440×900, 1600×1000, 1920×1080, and 2048×1320, then inspect both endpoint themes. Require zero horizontal overflow. Prefer full first-screen containment, but when an intrinsic-height diagram cannot fit without crossing the Viewer readability floor, preserve readable sizing and allow only the Reader-declared vertical page scroll recorded by `visual-check`; do not rewrite valid semantic geometry merely to remove that scroll. Repair every other overflow by removing only genuinely redundant content or compacting spacing before shrinking nodes, labels, or the main panel. If the largest viewport still has a conspicuous empty lower band at the viewer's width cap, redistribute authored Y positions and increase the viewBox height proportionally; do not add filler copy or decorative cards. Never counterfeit a pass with `overflow: hidden`, clipped content, an internal diagram scroller, stretched SVG height, or smaller typography. See [Automated browser evidence](references/delivery-contract.md#automated-browser-evidence) for the authoritative acceptance rule.- Omit `meta.legend` for the truthful `auto` default. When needed, use only `mode: auto|all|hidden` and renderer-supported `entries.<kind>.label|visible`; labels never change semantics.- Choose one primary authored language from an explicit user choice; otherwise follow the request or conversation's dominant language. `meta.locale` controls only renderer-owned Viewer UI: use `"en"`, `"zh-CN"`, or `"es"` for the corresponding supported primary language. For every other language, omit `meta.locale` and explicitly disclose that the fixed Viewer UI and `<html lang>` fall back to English. The renderer never translates authored content. See `references/authoring-contract.md` for details.- Preserve exact product names, code identifiers, commands, protocols, API paths, and environment names. They may remain English inside localized copy, but never justify leaving the surrounding explanatory prose in another language.diff --git a/archify/assets/template.html b/archify/assets/template.htmlindex d9569274..f7b8da47 100644--- a/archify/assets/template.html+++ b/archify/assets/template.html@@ -11259,8 +11259,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11276,8 +11276,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11307,11 +11307,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/archify/bin/visual-check.mjs b/archify/bin/visual-check.mjsindex 45092762..147a2376 100644--- a/archify/bin/visual-check.mjs+++ b/archify/bin/visual-check.mjs@@ -1682,6 +1682,9 @@ export class ChromeVisualBrowser {scrollWidth: Math.ceil(document.documentElement.scrollWidth),scrollHeight: Math.ceil(document.documentElement.scrollHeight),resolvedTheme: document.documentElement.getAttribute('data-theme') || '',+ readerLayout: document.documentElement.getAttribute('data-reader-layout') || null,+ readerOverflow: document.documentElement.getAttribute('data-reader-overflow') || null,+ readerFit: svg ? svg.getAttribute('data-reader-fit') : null,readerWidth: reader ? reader.getBoundingClientRect().width : 0,diagramWidth: diagramWidth,viewBoxWidth: viewBoxWidth,@@ -1754,6 +1757,19 @@ function observation({ width, height, theme, metrics }) {: Number(metrics.minimumProjectedNodeTextPx);const readabilityOk = minimumProjectedNodeTextPx == null|| minimumProjectedNodeTextPx >= MIN_PROJECTED_NODE_TEXT_PX;+ const readerLayout = metrics.readerLayout || null;+ const readerOverflow = metrics.readerOverflow || null;+ const readerFit = metrics.readerFit || null;+ const verticalScrollAccepted = Boolean(+ overflowY+ && !overflowX+ && readabilityOk+ && Number.isFinite(minimumProjectedNodeTextPx)+ && readerLayout === 'adaptive'+ && readerOverflow === 'authored'+ && readerFit === 'intrinsic-height'+ );+ const containmentOk = !overflowX && (!overflowY || verticalScrollAccepted);const legendDockIntersectionArea = Number(metrics.legendDockIntersectionArea) || 0;const dockStageIntersectionArea = Number(metrics.dockStageIntersectionArea) || 0;const dockStageGap = metrics.dockStageGap == null ? null : Number(metrics.dockStageGap);@@ -1777,7 +1793,14 @@ function observation({ width, height, theme, metrics }) {scrollHeight,overflowX,overflowY,- ok: !overflowX && !overflowY,+ verticalScrollAccepted,+ overflowDisposition: overflowX || (overflowY && !verticalScrollAccepted)+ ? 'unexpected-overflow'+ : verticalScrollAccepted ? 'readable-vertical-scroll' : 'contained',+ readerLayout,+ readerOverflow,+ readerFit,+ ok: containmentOk,readerWidth: Number(metrics.readerWidth) || null,diagramWidth: Number(metrics.diagramWidth) || null,viewBoxWidth: Number(metrics.viewBoxWidth) || null,@@ -1805,7 +1828,7 @@ function contactSheetHtml({ artifactPath, receipt, screenshots }) {const cards = screenshots.map((entry) => `<figure><img src="${htmlEscape(entry.file)}" alt="${htmlEscape(`${entry.theme} ${entry.width} by ${entry.height}`)}">- <figcaption><strong>${htmlEscape(entry.theme.toUpperCase())}</strong> · ${entry.width}×${entry.height} · containment ${entry.ok ? 'pass' : 'fail'}</figcaption>+ <figcaption><strong>${htmlEscape(entry.theme.toUpperCase())}</strong> · ${entry.width}×${entry.height} · containment ${entry.ok ? 'pass' : 'fail'}${entry.verticalScrollAccepted ? ' · readable vertical scroll' : ''}</figcaption></figure>`).join('');return `<!doctype html><html lang="en">@@ -1885,6 +1908,10 @@ function observationDiagnostics({ artifact, allObservations, readabilityObservatscrollHeight: entry.scrollHeight,overflowX: entry.overflowX,overflowY: entry.overflowY,+ overflowDisposition: entry.overflowDisposition,+ readerLayout: entry.readerLayout,+ readerOverflow: entry.readerOverflow,+ readerFit: entry.readerFit,...(entry.overflowY && entry.workflowLanes?.length ? {workflowLanes: entry.workflowLanes,measurement: 'CSS pixels; rendered node boxes geometrically contained in each lane frame; spaces include headers and routing, not guaranteed removable space',@@ -1969,7 +1996,11 @@ function baseReceipt({ artifactPath, artifact, sidecars, chrome, deliveryProvenastate: { detail: 'read', motion: 'still' },chrome,diagnostics: [],- containment: { status: 'fail', viewports: [] },+ containment: {+ status: 'fail',+ policy: 'fit-or-reader-declared-readable-vertical-scroll',+ viewports: [],+ },readability: { status: 'fail', minimumProjectedNodeTextPx: MIN_PROJECTED_NODE_TEXT_PX, viewports: [] },viewerChrome: { status: 'fail', viewports: [] },captures: { status: 'fail', screenshots: [], contactSheet: null },@@ -2071,7 +2102,11 @@ export function persistVisualCheckFailure(bytes: artifactBytes.byteLength,},} : {}),- containment: { status: 'fail', viewports: [] },+ containment: {+ status: 'fail',+ policy: 'fit-or-reader-declared-readable-vertical-scroll',+ viewports: [],+ },captures: { status: 'fail', screenshots: [], contactSheet: null },sidecars: { ...directory.sidecars, files: [] },};diff --git a/archify/examples/dataflow-product-analytics.html b/archify/examples/dataflow-product-analytics.htmlindex cfa2ee9d..5121ce5b 100644--- a/archify/examples/dataflow-product-analytics.html+++ b/archify/examples/dataflow-product-analytics.html@@ -11370,8 +11370,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11387,8 +11387,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11418,11 +11418,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/archify/examples/lifecycle-agent-run.html b/archify/examples/lifecycle-agent-run.htmlindex 3ec60898..fe40254e 100644--- a/archify/examples/lifecycle-agent-run.html+++ b/archify/examples/lifecycle-agent-run.html@@ -11305,8 +11305,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11322,8 +11322,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11353,11 +11353,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/archify/examples/sequence-cache-miss-request.html b/archify/examples/sequence-cache-miss-request.htmlindex e041031e..ef9f36cc 100644--- a/archify/examples/sequence-cache-miss-request.html+++ b/archify/examples/sequence-cache-miss-request.html@@ -11385,8 +11385,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11402,8 +11402,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11433,11 +11433,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/archify/examples/web-app-rendered.html b/archify/examples/web-app-rendered.htmlindex 9ff7b527..50afafa8 100644--- a/archify/examples/web-app-rendered.html+++ b/archify/examples/web-app-rendered.html@@ -11334,8 +11334,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11351,8 +11351,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11382,11 +11382,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/archify/examples/workflow-agent-tool-call-rendered.html b/archify/examples/workflow-agent-tool-call-rendered.htmlindex 009fec9b..d0a6d66c 100644--- a/archify/examples/workflow-agent-tool-call-rendered.html+++ b/archify/examples/workflow-agent-tool-call-rendered.html@@ -11376,8 +11376,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11393,8 +11393,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11424,11 +11424,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/archify/recipes/scenarios.mjs b/archify/recipes/scenarios.mjsindex 53971995..137cce05 100644--- a/archify/recipes/scenarios.mjs+++ b/archify/recipes/scenarios.mjs@@ -273,7 +273,7 @@ const RAW_RECIPES = ['desktop viewport budget for the complete page, including header and necessary cards','validate after each edit, then inspect the final HTML in a browser',],- prompt: 'Use Archify to repair this existing diagram while preserving its diagram type, topology, meaningful labels, and presentation settings. Follow references/authoring-contract.md in this order: (1) schema and missing/invalid meta.quality_profile; (2) node overlap or out-of-range placement; (3) edge-through-node and endpoint-direction errors; (4) crossings, ambiguous corridors, border runs, and route rhythm; (5) labels: label-to-node, label-to-label, then label-to-route clearance. Run validate after every edit and use diagnostics[] code, subject, evidence, and supportedFixes; apply one diagnosed geometry control at a time. Where the current schema supports via, it is an ordered array of absolute SVG [x, y] intermediate points: the route is [start, ...via, end], with start/end supplied by the node anchors. Explicit via points override automatic routing; they are not offsets or a request for automatic obstacle avoidance. For an orthogonal repair, align adjacent points on the same x or y and make the first/final segment respect fromSide/toSide; use only controls supported by the current diagram mode. Follow references/delivery-contract.md for the viewport budget: at 1440×900, 1600×1000, and 1920×1080 (also 2048×1320 for a large desktop), require document.documentElement.scrollWidth <= window.innerWidth and document.documentElement.scrollHeight <= window.innerHeight. Budget the entire page, including header, diagram, and necessary cards. Remove only redundant content or compact spacing first; do not hide overflow, clip content, introduce an internal diagram scroller, stretch the SVG, or shrink typography to force a pass. Inspect readability and vertical balance at the largest viewport; narrow/mobile layouts may scroll vertically. Validate, then deliver and inspect the final HTML; report browser evidence and visual review truthfully.',+ prompt: 'Use Archify to repair this existing diagram while preserving its diagram type, topology, meaningful labels, and presentation settings. Follow references/authoring-contract.md in this order: (1) schema and missing/invalid meta.quality_profile; (2) node overlap or out-of-range placement; (3) edge-through-node and endpoint-direction errors; (4) crossings, ambiguous corridors, border runs, and route rhythm; (5) labels: label-to-node, label-to-label, then label-to-route clearance. Run validate after every edit and use diagnostics[] code, subject, evidence, and supportedFixes; apply one diagnosed geometry control at a time. Where the current schema supports via, it is an ordered array of absolute SVG [x, y] intermediate points: the route is [start, ...via, end], with start/end supplied by the node anchors. Explicit via points override automatic routing; they are not offsets or a request for automatic obstacle avoidance. For an orthogonal repair, align adjacent points on the same x or y and make the first/final segment respect fromSide/toSide; use only controls supported by the current diagram mode. Follow references/delivery-contract.md for the viewport budget: check 1440×900, 1600×1000, 1920×1080, and 2048×1320; require document.documentElement.scrollWidth <= window.innerWidth. Prefer document.documentElement.scrollHeight <= window.innerHeight, but preserve a Reader-declared readable vertical page scroll when visual-check explicitly accepts it after reaching the projected-text floor. Budget the entire page, including header, diagram, and necessary cards. Repair every other overflow by removing only redundant content or compacting spacing first; do not hide overflow, clip content, introduce an internal diagram scroller, stretch the SVG, or shrink typography to force a pass. Inspect readability and vertical balance at the largest viewport. Validate, then deliver and inspect the final HTML; report browser evidence and visual review truthfully.',},zh: {title: '布局修复', question: '现有图为什么仍然溢出、重叠或连线穿过节点,应该先修什么?',@@ -286,7 +286,7 @@ const RAW_RECIPES = ['包含标题和必要卡片的整页桌面视口预算','每次修改后 validate,最终在浏览器中检查 HTML',],- prompt: '用 Archify 修复这张现有图,保留图表类型、拓扑、有意义的标签和表现设置。遵循 references/authoring-contract.md 的顺序:(1) schema 错误及缺失或无效的 meta.quality_profile;(2) 节点重叠或越界;(3) 连线穿过节点及端点方向错误;(4) 交叉、含混的共享通道、贴边走线和转弯节奏;(5) 标签与节点、标签与标签、标签与连线的间距。每次修改后运行 validate,依据 diagnostics[] 的 code、subject、evidence 和 supportedFixes,每次只应用一项有诊断依据的几何控制。当前 schema 支持 via 时,它是按顺序排列的绝对 SVG [x, y] 中间点数组:路径为 [start, ...via, end],起终点由节点锚点提供。显式 via 会覆盖自动路由,不是偏移量,也不会请求自动绕障。修复正交走线时,相邻点应共享 x 或 y,首尾线段应遵守 fromSide/toSide;只使用当前模式支持的控制字段。视口预算遵循 references/delivery-contract.md:在 1440×900、1600×1000、1920×1080 检查,大桌面还要检查 2048×1320;要求 document.documentElement.scrollWidth <= window.innerWidth 且 document.documentElement.scrollHeight <= window.innerHeight。预算覆盖整页,包括标题、主图和必要卡片。先移除冗余内容或压缩间距,不得靠隐藏溢出、裁切、内部滚动区、拉伸 SVG 或缩小字体强行通过。在最大视口检查可读性和纵向平衡;窄屏或移动端允许纵向滚动。验证后执行 deliver 并检查最终 HTML,如实报告浏览器证据和视觉检查结果。',+ prompt: '用 Archify 修复这张现有图,保留图表类型、拓扑、有意义的标签和表现设置。遵循 references/authoring-contract.md 的顺序:(1) schema 错误及缺失或无效的 meta.quality_profile;(2) 节点重叠或越界;(3) 连线穿过节点及端点方向错误;(4) 交叉、含混的共享通道、贴边走线和转弯节奏;(5) 标签与节点、标签与标签、标签与连线的间距。每次修改后运行 validate,依据 diagnostics[] 的 code、subject、evidence 和 supportedFixes,每次只应用一项有诊断依据的几何控制。当前 schema 支持 via 时,它是按顺序排列的绝对 SVG [x, y] 中间点数组:路径为 [start, ...via, end],起终点由节点锚点提供。显式 via 会覆盖自动路由,不是偏移量,也不会请求自动绕障。修复正交走线时,相邻点应共享 x 或 y,首尾线段应遵守 fromSide/toSide;只使用当前模式支持的控制字段。视口预算遵循 references/delivery-contract.md:检查 1440×900、1600×1000、1920×1080 和 2048×1320,要求 document.documentElement.scrollWidth <= window.innerWidth。优先满足 document.documentElement.scrollHeight <= window.innerHeight;如果 visual-check 明确确认 Reader 已达到投影文字下限并接受可读的页面纵向滚动,则保留该滚动。预算覆盖整页,包括标题、主图和必要卡片。其他溢出先通过移除冗余内容或压缩间距修复,不得靠隐藏溢出、裁切、内部滚动区、拉伸 SVG 或缩小字体强行通过。在最大视口检查可读性和纵向平衡。验证后执行 deliver 并检查最终 HTML,如实报告浏览器证据和视觉检查结果。',},},];diff --git a/archify/references/delivery-contract.md b/archify/references/delivery-contract.mdindex 61b00fb9..ca10faa4 100644--- a/archify/references/delivery-contract.md+++ b/archify/references/delivery-contract.md@@ -298,6 +298,18 @@ byte count, identifies `evidenceKind: "automated-browser"`, records READ plusStill runtime state, and always reports `visualReview: "pending"`; automatedbrowser evidence cannot claim perceptual review.+Horizontal overflow always fails. Vertical overflow normally fails as well. One+bounded exception preserves readability for compiler-measured intrinsic-height+diagrams: after the adaptive Reader reaches its projected text floor and exposes+`data-reader-layout="adaptive"` with `data-reader-overflow="authored"`, normal+page-level vertical scrolling may pass. The SVG must also expose+`data-reader-fit="intrinsic-height"`, projected text must still pass, and the+receipt records `verticalScrollAccepted: true` with+`overflowDisposition: "readable-vertical-scroll"`. Missing declarations,+explicit authored viewBoxes, horizontal overflow, unreadable text, clipping, and+Viewer chrome collisions remain failures. Do not add an internal diagram+scroller or hide overflow.+`browser_evidence` in the handoff records only the outcome of this automated command:- `passed` maps from exit 0 and receipt `status: "pass"` only after every required measurement and capture completes and passes.@@ -377,7 +389,7 @@ Never start it by default. Do not use it for CI, unattended agents, remote shariAutomated validation and browser evidence cannot prove visual polish. After deterministic delivery, inspect the actual HTML in a capable browser or render the evidence screenshots with an image reader. Check both themes when changed, the default READ view, line crossings/corridors, label masks, node/card fit, focus/search/passport closure, and export cleanliness.-For the default standalone desktop viewer, measure 1440×900, 1600×1000, and 1920×1080. When the artifact is intended for a large desktop display, also measure 2048×1320. A first-screen pass requires `document.documentElement.scrollWidth <= window.innerWidth` and `scrollHeight <= window.innerHeight` at every checked size. At the largest checked viewport, inspect the rendered composition for a conspicuous empty lower band: the main panel and necessary conclusion cards should use the available height as a balanced whole, not collapse into a shallow strip. If a desktop viewport overflows, repair the authored composition by removing only genuinely redundant content or compacting spacing before shrinking nodes, labels, or the main panel. Do not hide overflow, clip content, introduce an internal diagram scroller, or reduce node/label typography to make the measurement pass. Narrow/mobile containment may retain vertical page scrolling.+For the default standalone desktop viewer, measure 1440×900, 1600×1000, 1920×1080, and 2048×1320. Require `document.documentElement.scrollWidth <= window.innerWidth` at every checked size. Prefer `scrollHeight <= window.innerHeight`; accept page-level vertical scrolling only through the Reader-declared readable exception defined above. At the largest checked viewport, inspect the rendered composition for a conspicuous empty lower band: the main panel and necessary conclusion cards should use the available height as a balanced whole, not collapse into a shallow strip. For unexpected overflow, repair the authored composition by removing only genuinely redundant content or compacting spacing before shrinking nodes, labels, or the main panel. Do not hide overflow, clip content, introduce an internal diagram scroller, or reduce node/label typography to make the measurement pass. Narrow/mobile containment may retain vertical page scrolling.A manual browser record is supplementary to the automated status. Reproducing the same coverage requires all four exact viewport measurements, both endpoint themes, and an artifact-bound record of the inspected SHA-256 and byte count. It never changes `browser_evidence`: when Chrome/Chromium is unavailable, that status remains `skipped` even when the manual browser record is complete and `visual_review: passed`; an automated `failed` result likewise remains `failed`. An unconstrained browser glance can support perceptual review only.diff --git a/archify/test/adaptive-reader-layout.test.mjs b/archify/test/adaptive-reader-layout.test.mjsindex 2a4ca1cf..59b9ccef 100644--- a/archify/test/adaptive-reader-layout.test.mjs+++ b/archify/test/adaptive-reader-layout.test.mjs@@ -39,6 +39,8 @@ test('compiler-measured intrinsic tall workflows reuse the height budget withoutassert.match(reader, /var MIN_PROJECTED_NODE_TEXT_PX = 6/);assert.match(reader, /viewBox\.width \* minimumReadableScale\(\) \+ chrome\.diagramX/);assert.match(reader, /measuredHeightFit && ratio < WIDE_RATIO \? readableWidth : MIN_READER_WIDTH/);+ assert.match(reader, /Math\.max\(Math\.ceil\(minWidth \|\| 0\), Math\.round\(width\)\)/);+ assert.match(reader, /lastWidth > Math\.ceil\(minWidth\)/);assert.doesNotMatch(reader, /function eligible\(\)[\s\S]{0,240}ratio > 0/);});@@ -79,8 +81,8 @@ test('reader remeasures real content and reduces width before allowing desktop passert.match(reader, /new MutationObserver\(schedule\)/);assert.match(reader, /document\.documentElement\.scrollHeight/);assert.match(reader, /lastWidth - overflow \* ratio - 4/);- assert.match(skill, /1440×900, 1600×1000, and 1920×1080/);- assert.match(skill, /2048×1320/);+ assert.match(skill, /1440×900, 1600×1000, 1920×1080, and 2048×1320/);+ assert.match(skill, /Reader-declared vertical page scroll/);assert.match(skill, /Generate one responsive artifact for laptops and external displays/);assert.match(skill, /preserve the authored SVG\/viewBox, proportions, semantic geometry/);});diff --git a/archify/test/cli.test.mjs b/archify/test/cli.test.mjsindex 9aadbe3f..33e64390 100644--- a/archify/test/cli.test.mjs+++ b/archify/test/cli.test.mjs@@ -330,7 +330,7 @@ test('cli: guide returns repair steps, via semantics, and viewport checks as JSOassert.match(prompt, /absolute.*\[x, y\]/);assert.match(prompt, /1440×900.*1600×1000.*1920×1080.*2048×1320/);assert.match(prompt, /scrollWidth <= window\.innerWidth/);- assert.match(prompt, /scrollHeight <= window\.innerHeight/);+ assert.match(prompt, /Reader-declared readable vertical page scroll/);assert.match(prompt, /validate.*diagnostics\[\].*supportedFixes/);});@@ -344,7 +344,7 @@ test('cli: guide prints localized repair advice, including an explicit languageassert.match(result.stdout, /推荐: 布局修复/);assert.match(result.stdout, /schema.*重叠.*方向.*交叉.*标签/s);assert.match(result.stdout, /\[start, \.\.\.via, end\]/);- assert.match(result.stdout, /scrollHeight <= window\.innerHeight/);+ assert.match(result.stdout, /Reader 已达到投影文字下限并接受可读的页面纵向滚动/);assert.match(result.stdout, /validate/);}});diff --git a/archify/test/desktop-reader-browser.test.mjs b/archify/test/desktop-reader-browser.test.mjsindex 16bb8b13..4b77d53e 100644--- a/archify/test/desktop-reader-browser.test.mjs+++ b/archify/test/desktop-reader-browser.test.mjs@@ -171,6 +171,62 @@ test('route-expanded intrinsic architecture fits every required desktop viewport}});+test('extreme intrinsic architecture keeps readable page scroll below first-screen fit', {+ skip: chromePath ? false : 'Set ARCHIFY_CHROME to run the real browser regression.',+}, async () => {+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-readable-scroll-reader-'));+ const input = path.join(+ skillRoot,+ 'test/fixtures/architecture-viewport/readable-scroll-worldscope.architecture.json',+ );+ const artifact = path.join(tmp, 'readable-scroll-worldscope.html');+ try {+ execFileSync(process.execPath, [+ path.join(skillRoot, 'bin', 'archify.mjs'),+ 'deliver',+ 'architecture',+ input,+ artifact,+ '--quality',+ 'showcase',+ '--json',+ ], { cwd: skillRoot, encoding: 'utf8' });++ const html = fs.readFileSync(artifact, 'utf8');+ const svgRoot = html.match(/<svg\b[^>]*>/)?.[0];+ assert.ok(svgRoot, 'expected an SVG root');+ assert.match(svgRoot, /viewBox="0 0 980 1188"/);+ assert.match(svgRoot, /data-reader-fit="intrinsic-height"/);++ const result = await runVisualCheck({ artifactPath: artifact, chromePath });+ assert.equal(result.exitCode, 0, JSON.stringify(result.receipt, null, 2));+ assert.equal(result.receipt.containment.status, 'pass');+ assert.equal(result.receipt.containment.policy, 'fit-or-reader-declared-readable-vertical-scroll');+ assert.equal(result.receipt.readability.status, 'pass');+ assert.equal(result.receipt.viewerChrome.status, 'pass');+ assert.equal(result.receipt.diagnostics.length, 0, JSON.stringify(result.receipt, null, 2));++ for (const viewport of result.receipt.containment.viewports) {+ assert.equal(viewport.overflowX, false, JSON.stringify(viewport, null, 2));+ assert.ok(viewport.minimumProjectedNodeTextPx >= MIN_PROJECTED_NODE_TEXT_PX);+ if (viewport.width < 2048) {+ assert.equal(viewport.overflowY, true, JSON.stringify(viewport, null, 2));+ assert.equal(viewport.verticalScrollAccepted, true, JSON.stringify(viewport, null, 2));+ assert.equal(viewport.overflowDisposition, 'readable-vertical-scroll');+ assert.equal(viewport.readerLayout, 'adaptive');+ assert.equal(viewport.readerOverflow, 'authored');+ assert.equal(viewport.readerFit, 'intrinsic-height');+ } else {+ assert.equal(viewport.overflowY, false, JSON.stringify(viewport, null, 2));+ assert.equal(viewport.verticalScrollAccepted, false);+ assert.equal(viewport.overflowDisposition, 'contained');+ }+ }+ } finally {+ fs.rmSync(tmp, { recursive: true, force: true });+ }+});+test('offline intrinsic workflows fit while authored overflow still identifies lane frames', {skip: chromePath ? false : 'Set ARCHIFY_CHROME to run the real browser regression.',}, async () => {diff --git a/archify/test/fixtures/architecture-viewport/readable-scroll-worldscope.architecture.json b/archify/test/fixtures/architecture-viewport/readable-scroll-worldscope.architecture.jsonnew file mode 100644index 00000000..f31d061a--- /dev/null+++ b/archify/test/fixtures/architecture-viewport/readable-scroll-worldscope.architecture.json@@ -0,0 +1,222 @@+{+ "schema_version": 1,+ "diagram_type": "architecture",+ "meta": {+ "title": "WorldScope 极高路线可读滚动",+ "locale": "zh-CN",+ "quality_profile": "showcase"+ },+ "components": [+ {+ "id": "browser",+ "type": "frontend",+ "label": "React 工作台",+ "sublabel": "浏览器端交互界面",+ "pos": [+ 60,+ 110+ ],+ "size": [+ 150,+ 64+ ]+ },+ {+ "id": "api",+ "type": "backend",+ "label": "读取模型 API",+ "sublabel": "FastAPI",+ "pos": [+ 290,+ 110+ ],+ "size": [+ 150,+ 64+ ]+ },+ {+ "id": "agent",+ "type": "backend",+ "label": "地图 Agent",+ "sublabel": "Agent 编排",+ "pos": [+ 530,+ 110+ ],+ "size": [+ 150,+ 64+ ]+ },+ {+ "id": "llm",+ "type": "external",+ "label": "模型端点",+ "sublabel": "外部 LLM 服务",+ "pos": [+ 790,+ 110+ ],+ "size": [+ 150,+ 64+ ]+ },+ {+ "id": "sources",+ "type": "external",+ "label": "公开数据源",+ "sublabel": "外部公开数据",+ "pos": [+ 60,+ 300+ ],+ "size": [+ 150,+ 64+ ]+ },+ {+ "id": "worker",+ "type": "backend",+ "label": "采集 Worker",+ "sublabel": "定时采集任务",+ "pos": [+ 410,+ 300+ ],+ "size": [+ 150,+ 64+ ]+ },+ {+ "id": "cache",+ "type": "database",+ "label": "Redis",+ "sublabel": "缓存 / last-good",+ "pos": [+ 290,+ 480+ ],+ "size": [+ 150,+ 64+ ]+ },+ {+ "id": "context",+ "type": "database",+ "label": "World Context",+ "sublabel": "PostgreSQL + PostGIS",+ "pos": [+ 560,+ 480+ ],+ "size": [+ 170,+ 64+ ]+ }+ ],+ "connections": [+ {+ "id": "browser-to-api",+ "from": "browser",+ "to": "api",+ "label": "REST / SSE"+ },+ {+ "id": "api-to-agent",+ "from": "api",+ "to": "agent",+ "label": "受信附件身份"+ },+ {+ "id": "agent-to-llm",+ "from": "agent",+ "to": "llm",+ "label": "流式回答"+ },+ {+ "id": "api-to-context",+ "from": "api",+ "to": "context",+ "label": "事实检索"+ },+ {+ "id": "agent-to-context",+ "from": "agent",+ "to": "context",+ "label": "证据检索"+ },+ {+ "id": "api-to-cache",+ "from": "api",+ "to": "cache",+ "label": "读取缓存"+ },+ {+ "id": "sources-to-worker",+ "from": "sources",+ "to": "worker",+ "label": "定时采集",+ "fromSide": "bottom",+ "toSide": "bottom",+ "via": [+ [+ 135,+ 1120+ ],+ [+ 485,+ 1120+ ]+ ]+ },+ {+ "id": "worker-to-context",+ "from": "worker",+ "to": "context",+ "label": "写入证据"+ },+ {+ "id": "worker-to-cache",+ "from": "worker",+ "to": "cache",+ "label": "刷新 last-good"+ }+ ],+ "boundaries": [+ {+ "kind": "region",+ "label": "后端服务",+ "wraps": [+ "api",+ "agent",+ "worker"+ ]+ }+ ],+ "cards": [+ {+ "dot": "cyan",+ "title": "读取路径",+ "items": [+ "React 工作台经 REST / SSE 访问 FastAPI",+ "API 直查 World Context 事实库并读穿 Redis 缓存",+ "地图 Agent 携受信附件身份向模型端点流式提问"+ ]+ },+ {+ "dot": "emerald",+ "title": "采集路径",+ "items": [+ "Worker 定时从公开数据源采集证据",+ "证据写入 PostgreSQL + PostGIS 持久事实库",+ "同时刷新 Redis 的 last-good 快照"+ ]+ }+ ]+}diff --git a/archify/test/visual-check.test.mjs b/archify/test/visual-check.test.mjsindex 5e1be74c..d82fe7c7 100644--- a/archify/test/visual-check.test.mjs+++ b/archify/test/visual-check.test.mjs@@ -44,7 +44,15 @@ function stagingDirectories(directory) {return fs.readdirSync(directory).filter((name) => name.startsWith('.archify-visual-check-'));}-function fakeBrowser({ overflowAt, unreadableAt, chromeCollisionAt, stageCollisionAt, stageGapAt, screenshotFailure } = {}) {+function fakeBrowser({+ overflowAt,+ readableScrollAt,+ unreadableAt,+ chromeCollisionAt,+ stageCollisionAt,+ stageGapAt,+ screenshotFailure,+} = {}) {const calls = [];return {calls,@@ -58,6 +66,7 @@ function fakeBrowser({ overflowAt, unreadableAt, chromeCollisionAt, stageCollisielse fs.writeFileSync(screenshotPath, png, { flag: 'wx' });}const overflow = overflowAt?.({ width, height, theme }) || false;+ const readableScroll = readableScrollAt?.({ width, height, theme }) || false;const unreadable = unreadableAt?.({ width, height, theme }) || false;const chromeCollision = chromeCollisionAt?.({ width, height, theme }) || false;const stageCollision = stageCollisionAt?.({ width, height, theme }) || false;@@ -67,8 +76,11 @@ function fakeBrowser({ overflowAt, unreadableAt, chromeCollisionAt, stageCollisiinnerWidth: width,innerHeight: height,scrollWidth: width + (overflow ? 1 : 0),- scrollHeight: height,+ scrollHeight: height + (readableScroll ? 240 : 0),resolvedTheme: theme,+ readerLayout: readableScroll ? 'adaptive' : null,+ readerOverflow: readableScroll ? 'authored' : null,+ readerFit: readableScroll ? 'intrinsic-height' : null,readerWidth: 960,diagramWidth: 930,viewBoxWidth: 1300,@@ -2542,6 +2554,56 @@ test('visual-check returns 1 and preserves evidence when any viewport overflows'assert.equal(fs.existsSync(sidecarPaths(input).contactSheet), true);});+test('visual-check accepts only Reader-declared readable vertical page scrolling', async () => {+ const input = artifact('readable-scroll.html');+ const target = ({ width, theme }) => width === 1440 && theme === 'light';+ const result = await runVisualCheck({+ artifactPath: input,+ chromePath: '/fake/chrome',+ browserFactory: async () => fakeBrowser({ readableScrollAt: target }),+ });++ assert.equal(result.exitCode, 0);+ assert.equal(result.receipt.status, 'pass');+ assert.equal(result.receipt.containment.status, 'pass');+ assert.equal(result.receipt.containment.policy, 'fit-or-reader-declared-readable-vertical-scroll');+ const viewport = result.receipt.containment.viewports.find(({ width }) => width === 1440);+ assert.equal(viewport.overflowY, true);+ assert.equal(viewport.verticalScrollAccepted, true);+ assert.equal(viewport.overflowDisposition, 'readable-vertical-scroll');+ assert.equal(viewport.readerLayout, 'adaptive');+ assert.equal(viewport.readerOverflow, 'authored');+ assert.equal(viewport.readerFit, 'intrinsic-height');+ assert.equal(result.receipt.diagnostics.some(({ code }) => code === 'viewer/viewport-overflow'), false);+});++test('visual-check still rejects horizontal overflow and unreadable text in Reader scroll state', async () => {+ const input = artifact('invalid-readable-scroll.html');+ const target = ({ width, theme }) => width === 1440 && theme === 'light';+ const horizontal = await runVisualCheck({+ artifactPath: input,+ chromePath: '/fake/chrome',+ browserFactory: async () => fakeBrowser({ overflowAt: target, readableScrollAt: target }),+ });+ const horizontalViewport = horizontal.receipt.containment.viewports.find(({ width }) => width === 1440);+ assert.equal(horizontal.exitCode, 1);+ assert.equal(horizontalViewport.verticalScrollAccepted, false);+ assert.equal(horizontalViewport.overflowDisposition, 'unexpected-overflow');+ assert.ok(horizontal.receipt.diagnostics.some(({ code }) => code === 'viewer/viewport-overflow'));++ const unreadable = await runVisualCheck({+ artifactPath: input,+ chromePath: '/fake/chrome',+ browserFactory: async () => fakeBrowser({ readableScrollAt: target, unreadableAt: target }),+ });+ const unreadableViewport = unreadable.receipt.containment.viewports.find(({ width }) => width === 1440);+ assert.equal(unreadable.exitCode, 1);+ assert.equal(unreadableViewport.verticalScrollAccepted, false);+ assert.equal(unreadableViewport.overflowDisposition, 'unexpected-overflow');+ assert.ok(unreadable.receipt.diagnostics.some(({ code }) => code === 'viewer/viewport-overflow'));+ assert.ok(unreadable.receipt.diagnostics.some(({ code }) => code === 'viewer/projected-text-readability'));+});+test('visual-check refuses changed delivery evidence before launching a browser', async () => {const input = artifact('changed-before-browser.html');const outDir = path.join(tmp, 'changed-before-browser-evidence');diff --git a/docs/gallery/artifacts/agent-run.lifecycle.html b/docs/gallery/artifacts/agent-run.lifecycle.htmlindex 3ec60898..fe40254e 100644--- a/docs/gallery/artifacts/agent-run.lifecycle.html+++ b/docs/gallery/artifacts/agent-run.lifecycle.html@@ -11305,8 +11305,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11322,8 +11322,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11353,11 +11353,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/gallery/artifacts/agent-tool-call.workflow.html b/docs/gallery/artifacts/agent-tool-call.workflow.htmlindex 009fec9b..d0a6d66c 100644--- a/docs/gallery/artifacts/agent-tool-call.workflow.html+++ b/docs/gallery/artifacts/agent-tool-call.workflow.html@@ -11376,8 +11376,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11393,8 +11393,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11424,11 +11424,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/gallery/artifacts/async-job-roundtrip.sequence.html b/docs/gallery/artifacts/async-job-roundtrip.sequence.htmlindex 9b36b40e..c4049ce4 100644--- a/docs/gallery/artifacts/async-job-roundtrip.sequence.html+++ b/docs/gallery/artifacts/async-job-roundtrip.sequence.html@@ -11397,8 +11397,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11414,8 +11414,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11445,11 +11445,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/gallery/artifacts/cache-miss.sequence.html b/docs/gallery/artifacts/cache-miss.sequence.htmlindex e041031e..ef9f36cc 100644--- a/docs/gallery/artifacts/cache-miss.sequence.html+++ b/docs/gallery/artifacts/cache-miss.sequence.html@@ -11385,8 +11385,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11402,8 +11402,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11433,11 +11433,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/gallery/artifacts/deployment-release.lifecycle.html b/docs/gallery/artifacts/deployment-release.lifecycle.htmlindex 699abee9..e985809a 100644--- a/docs/gallery/artifacts/deployment-release.lifecycle.html+++ b/docs/gallery/artifacts/deployment-release.lifecycle.html@@ -11331,8 +11331,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11348,8 +11348,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11379,11 +11379,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/gallery/artifacts/event-stream.dataflow.html b/docs/gallery/artifacts/event-stream.dataflow.htmlindex 7551d1de..9b3ad496 100644--- a/docs/gallery/artifacts/event-stream.dataflow.html+++ b/docs/gallery/artifacts/event-stream.dataflow.html@@ -11409,8 +11409,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11426,8 +11426,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11457,11 +11457,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/gallery/artifacts/incident-response.workflow.html b/docs/gallery/artifacts/incident-response.workflow.htmlindex 39b8d939..b6caa4e8 100644--- a/docs/gallery/artifacts/incident-response.workflow.html+++ b/docs/gallery/artifacts/incident-response.workflow.html@@ -11336,8 +11336,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11353,8 +11353,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11384,11 +11384,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/gallery/artifacts/product-analytics.dataflow.html b/docs/gallery/artifacts/product-analytics.dataflow.htmlindex cfa2ee9d..5121ce5b 100644--- a/docs/gallery/artifacts/product-analytics.dataflow.html+++ b/docs/gallery/artifacts/product-analytics.dataflow.html@@ -11370,8 +11370,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11387,8 +11387,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11418,11 +11418,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/gallery/artifacts/production-deployment.architecture.html b/docs/gallery/artifacts/production-deployment.architecture.htmlindex 7c05b4ca..8575b863 100644--- a/docs/gallery/artifacts/production-deployment.architecture.html+++ b/docs/gallery/artifacts/production-deployment.architecture.html@@ -11401,8 +11401,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11418,8 +11418,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11449,11 +11449,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/gallery/artifacts/release-delivery.workflow.html b/docs/gallery/artifacts/release-delivery.workflow.htmlindex 4dff011f..5d7ac225 100644--- a/docs/gallery/artifacts/release-delivery.workflow.html+++ b/docs/gallery/artifacts/release-delivery.workflow.html@@ -11362,8 +11362,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11379,8 +11379,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11410,11 +11410,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/gallery/artifacts/web-app.architecture.html b/docs/gallery/artifacts/web-app.architecture.htmlindex 9ff7b527..50afafa8 100644--- a/docs/gallery/artifacts/web-app.architecture.html+++ b/docs/gallery/artifacts/web-app.architecture.html@@ -11334,8 +11334,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11351,8 +11351,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11382,11 +11382,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/docs/guide.html b/docs/guide.htmlindex b5138e39..05aee21a 100644--- a/docs/guide.html+++ b/docs/guide.html@@ -240,7 +240,7 @@<footer><div class="shell"><span data-i18n="footerLeft">Generated from the same recipe source as the Archify CLI.</span><span>archify guide "your scenario"</span><span data-i18n="versionLabel">Scenario guide / development / v2.17.0-dev.1</span></div></footer>- <script id="guide-data" type="application/json">[{"id":"system-overview","type":"architecture","proof":"web-app","presentation":{"preset":"classic","motion":"static","views":"optional"},"title":"System overview","question":"What exists, who owns it, and how is it connected?","summary":"A bounded map of core components, external dependencies, primary paths, and trust boundaries.","useWhen":"Onboarding, design reviews, repository orientation, or explaining a service landscape.","avoidWhen":"The audience needs exact call order, state transitions, or row-level data lineage.","include":["8–12 core components","one primary path","external dependencies","trust boundaries"],"prompt":"Analyze this repository, then use Archify to create a high-level architecture diagram. Show 8–12 core runtime components, one primary request or data path, external dependencies, ownership or trust boundaries, and put supporting detail in cards instead of adding more edges.","en":{"title":"System overview","question":"What exists, who owns it, and how is it connected?","summary":"A bounded map of core components, external dependencies, primary paths, and trust boundaries.","useWhen":"Onboarding, design reviews, repository orientation, or explaining a service landscape.","avoidWhen":"The audience needs exact call order, state transitions, or row-level data lineage.","include":["8–12 core components","one primary path","external dependencies","trust boundaries"],"prompt":"Analyze this repository, then use Archify to create a high-level architecture diagram. Show 8–12 core runtime components, one primary request or data path, external dependencies, ownership or trust boundaries, and put supporting detail in cards instead of adding more edges."},"zh":{"title":"系统总览","question":"系统里有什么、归谁负责、彼此如何连接?","summary":"用一张有边界的图展示核心组件、外部依赖、主路径和信任边界。","useWhen":"适合新人上手、方案评审、仓库梳理和服务全景说明。","avoidWhen":"如果重点是精确调用顺序、状态流转或字段级血缘,请换其他配方。","include":["8–12 个核心组件","一条主路径","外部依赖","归属或信任边界"],"prompt":"分析这个仓库,然后用 Archify 生成高层系统架构图。展示 8–12 个核心运行时组件、一条主要请求或数据路径、外部依赖、归属或信任边界;支持性细节放进卡片,不要继续堆连线。"},"signals":[["system overview",12],["architecture",10],["components",6],["services",4],["repository",5],["trust boundary",8],["架构",10],["系统总览",12],["组件",6],["服务",4],["仓库",5],["信任边界",8]]},{"id":"deployment-ownership","type":"architecture","proof":"deployment-ownership","presentation":{"preset":"blueprint","motion":"trace","views":"recommended"},"title":"Deployment ownership","question":"Where does each workload run, and what crosses a boundary?","summary":"A deployment-focused map of regions, networks, clusters, workloads, stores, and cross-boundary mechanisms.","useWhen":"Cloud reviews, production readiness, multi-region planning, or infrastructure ownership handoffs.","avoidWhen":"Deployment facts are unknown or the real question is application behavior rather than placement.","include":["regions and networks","workload ownership","stateful services","named boundary crossings"],"prompt":"Use Archify to draw the production deployment topology. Group resources by region, network, cluster, and owner; show workloads and stateful services; label every cross-boundary mechanism. Do not invent deployment facts—mark unknown areas explicitly. If the user wants a fail-closed deployment review, ask before setting meta.engineering_profile to deployment-ownership; otherwise leave the engineering profile unset.","en":{"title":"Deployment ownership","question":"Where does each workload run, and what crosses a boundary?","summary":"A deployment-focused map of regions, networks, clusters, workloads, stores, and cross-boundary mechanisms.","useWhen":"Cloud reviews, production readiness, multi-region planning, or infrastructure ownership handoffs.","avoidWhen":"Deployment facts are unknown or the real question is application behavior rather than placement.","include":["regions and networks","workload ownership","stateful services","named boundary crossings"],"prompt":"Use Archify to draw the production deployment topology. Group resources by region, network, cluster, and owner; show workloads and stateful services; label every cross-boundary mechanism. Do not invent deployment facts—mark unknown areas explicitly. If the user wants a fail-closed deployment review, ask before setting meta.engineering_profile to deployment-ownership; otherwise leave the engineering profile unset."},"zh":{"title":"部署与归属","question":"每个工作负载运行在哪里,哪些连接跨越了边界?","summary":"围绕 Region、网络、集群、工作负载、存储和跨边界机制组织部署图。","useWhen":"适合云上评审、生产就绪、多区域规划和基础设施交接。","avoidWhen":"部署事实不清楚,或真正问题是应用行为而不是资源位置时不要使用。","include":["区域与网络","工作负载归属","有状态服务","明确的跨边界机制"],"prompt":"用 Archify 绘制生产部署拓扑。按区域、网络、集群和负责人分组,展示工作负载与有状态服务,并标注每一种跨边界机制。不要编造部署事实,不确定的区域要明确标出。如果用户需要失败即阻断的部署评审,先征得确认,再把 meta.engineering_profile 设为 deployment-ownership;否则不要启用工程画像。"},"signals":[["deployment topology",14],["region",7],["vpc",9],["cluster",6],["availability zone",8],["ownership",7],["cloud deployment",12],["部署拓扑",14],["区域",6],["集群",6],["可用区",8],["资源归属",9],["跨区",8]]},{"id":"agent-tool-call","type":"workflow","proof":"agent-tool-call","presentation":{"preset":"signal-flow","motion":"trace","views":"recommended"},"title":"Agent tool-call loop","question":"How does an agent plan, get permission, act, recover, and report?","summary":"A lane-based agent loop with policy gates, tool execution, exception recovery, evidence, and final response.","useWhen":"Explaining agent runtimes, MCP/tool orchestration, approvals, retries, or observability.","avoidWhen":"The goal is only to show static agent components or exact API message timing.","include":["request and planning","policy or approval gate","tool execution","exception and evidence paths"],"prompt":"Use Archify workflow mode to explain this agent tool-call loop. Separate user surface, agent runtime, policy boundary, exception handling, tool execution, and observability into lanes. Make the successful path primary and show approval, retry, blocked, and evidence paths explicitly.","en":{"title":"Agent tool-call loop","question":"How does an agent plan, get permission, act, recover, and report?","summary":"A lane-based agent loop with policy gates, tool execution, exception recovery, evidence, and final response.","useWhen":"Explaining agent runtimes, MCP/tool orchestration, approvals, retries, or observability.","avoidWhen":"The goal is only to show static agent components or exact API message timing.","include":["request and planning","policy or approval gate","tool execution","exception and evidence paths"],"prompt":"Use Archify workflow mode to explain this agent tool-call loop. Separate user surface, agent runtime, policy boundary, exception handling, tool execution, and observability into lanes. Make the successful path primary and show approval, retry, blocked, and evidence paths explicitly."},"zh":{"title":"智能体工具调用","question":"智能体如何规划、获批、执行、恢复并汇报?","summary":"用泳道表达策略门、工具执行、异常恢复、证据和最终回复。","useWhen":"适合解释 Agent Runtime、MCP/工具编排、审批、重试和可观测性。","avoidWhen":"如果只想看静态组件,或重点是精确 API 消息时序,请换其他配方。","include":["请求与规划","策略或审批门","工具执行","异常与证据路径"],"prompt":"用 Archify 工作流模式解释这段智能体工具调用。把用户界面、Agent Runtime、策略边界、异常处理、工具执行和可观测性分成泳道;突出成功主路径,并明确展示审批、重试、阻塞和证据路径。"},"signals":[["agent tool call",16],["tool call",12],["approval gate",10],["human in the loop",9],["mcp",7],["planner",6],["agent loop",10],["智能体工具调用",16],["工具调用",12],["审批门",10],["人在回路",9],["规划器",6],["智能体循环",10]]},{"id":"delivery-workflow","type":"workflow","proof":"delivery-workflow","presentation":{"preset":"classic","motion":"trace","views":"optional"},"title":"Delivery workflow","question":"How does a change move safely from commit to production?","summary":"A delivery flow with build, checks, environments, approvals, smoke tests, rollback, and ownership lanes.","useWhen":"CI/CD design, release reviews, deployment governance, or onboarding developers to delivery.","avoidWhen":"The question is where infrastructure runs or what states a deployment object can occupy.","include":["trigger and build","blocking checks","approval and environments","rollback and verification"],"prompt":"Use Archify workflow mode to draw this delivery process from commit to production. Separate developer, CI, approval, environment, and exception lanes; mark blocking checks, smoke tests, ownership, and the rollback path. Keep one unmistakable happy path.","en":{"title":"Delivery workflow","question":"How does a change move safely from commit to production?","summary":"A delivery flow with build, checks, environments, approvals, smoke tests, rollback, and ownership lanes.","useWhen":"CI/CD design, release reviews, deployment governance, or onboarding developers to delivery.","avoidWhen":"The question is where infrastructure runs or what states a deployment object can occupy.","include":["trigger and build","blocking checks","approval and environments","rollback and verification"],"prompt":"Use Archify workflow mode to draw this delivery process from commit to production. Separate developer, CI, approval, environment, and exception lanes; mark blocking checks, smoke tests, ownership, and the rollback path. Keep one unmistakable happy path."},"zh":{"title":"研发交付流程","question":"一次变更如何安全地从提交走到生产?","summary":"展示构建、检查、环境、审批、冒烟、回滚和负责人泳道。","useWhen":"适合 CI/CD 设计、发布评审、部署治理和研发新人上手。","avoidWhen":"如果重点是基础设施位置或部署对象的状态集合,请换架构图或生命周期图。","include":["触发与构建","阻断检查","审批与环境","回滚与验证"],"prompt":"用 Archify 工作流模式绘制从代码提交到生产发布的流程。拆分开发者、CI、审批、环境和异常泳道;标出阻断检查、冒烟测试、负责人和回滚路径,并保留一条一眼可见的成功主路径。"},"signals":[["ci/cd",14],["release workflow",14],["deployment pipeline",11],["pull request",7],["staging",7],["rollback",8],["发布流程",14],["流水线",9],["上线",7],["预发",7],["回滚",8],["审批发布",10]]},{"id":"incident-runbook","type":"workflow","proof":"incident-runbook","presentation":{"preset":"signal-flow","motion":"trace","views":"recommended"},"title":"Incident runbook","question":"How do responders detect, triage, mitigate, verify, and escalate?","summary":"An operational workflow that separates signals, responders, mitigation, communications, and recovery proof.","useWhen":"Incident playbooks, on-call handoffs, reliability reviews, and tabletop exercises.","avoidWhen":"The audience needs live metrics or a post-incident component topology instead of response actions.","include":["detection signal","triage owner","mitigation and rollback","verification and communication"],"prompt":"Use Archify workflow mode to turn this incident runbook into responder lanes. Show detection, triage, mitigation, escalation, communication, rollback, and recovery verification. Separate decision gates from actions and make missing ownership visible.","en":{"title":"Incident runbook","question":"How do responders detect, triage, mitigate, verify, and escalate?","summary":"An operational workflow that separates signals, responders, mitigation, communications, and recovery proof.","useWhen":"Incident playbooks, on-call handoffs, reliability reviews, and tabletop exercises.","avoidWhen":"The audience needs live metrics or a post-incident component topology instead of response actions.","include":["detection signal","triage owner","mitigation and rollback","verification and communication"],"prompt":"Use Archify workflow mode to turn this incident runbook into responder lanes. Show detection, triage, mitigation, escalation, communication, rollback, and recovery verification. Separate decision gates from actions and make missing ownership visible."},"zh":{"title":"事故处置 Runbook","question":"响应者如何发现、分诊、缓解、验证并升级?","summary":"把信号、响应者、缓解动作、沟通和恢复证据拆成可执行流程。","useWhen":"适合故障预案、On-call 交接、稳定性评审和桌面演练。","avoidWhen":"如果受众需要实时指标仪表盘或事故后的组件拓扑,而不是响应动作,请换其他视图。","include":["发现信号","分诊负责人","缓解与回滚","恢复验证与沟通"],"prompt":"用 Archify 工作流模式把事故处置预案画成响应者泳道。展示发现、分诊、缓解、升级、沟通、回滚和恢复验证;把决策门与操作分开,并让缺失的负责人清晰可见。"},"signals":[["incident response",15],["runbook",12],["outage",9],["triage",8],["mitigation",8],["escalation",7],["事故处置",15],["故障",9],["应急预案",12],["排障",9],["缓解",7],["升级响应",8]]},{"id":"api-request","type":"sequence","proof":"cache-miss","presentation":{"preset":"classic","motion":"trace","views":"optional"},"title":"API request chain","question":"Who calls whom, in what order, and what returns?","summary":"A time-ordered request path with authentication, cache fallback, persistence, return traffic, and async trace.","useWhen":"API documentation, debugging request latency, auth reviews, or explaining cache fallback.","avoidWhen":"Order is unimportant and the audience only needs the stable service topology.","include":["callers and callees","request and return messages","fallback or error path","async side effects"],"prompt":"Use Archify sequence mode to show this request from caller to final response. Include authentication, cache hit or miss, persistence fallback, return messages, and asynchronous trace or event emission. Keep message labels short and order unambiguous.","en":{"title":"API request chain","question":"Who calls whom, in what order, and what returns?","summary":"A time-ordered request path with authentication, cache fallback, persistence, return traffic, and async trace.","useWhen":"API documentation, debugging request latency, auth reviews, or explaining cache fallback.","avoidWhen":"Order is unimportant and the audience only needs the stable service topology.","include":["callers and callees","request and return messages","fallback or error path","async side effects"],"prompt":"Use Archify sequence mode to show this request from caller to final response. Include authentication, cache hit or miss, persistence fallback, return messages, and asynchronous trace or event emission. Keep message labels short and order unambiguous."},"zh":{"title":"API 请求链","question":"谁调用谁、顺序如何、最终返回什么?","summary":"按时间展示鉴权、缓存回退、持久化、返回流量和异步追踪。","useWhen":"适合 API 文档、请求耗时排查、鉴权评审和缓存回退说明。","avoidWhen":"如果顺序不重要,受众只需要稳定的服务拓扑,请用架构图。","include":["调用方与被调用方","请求与返回消息","回退或错误路径","异步副作用"],"prompt":"用 Archify 时序模式展示从调用方到最终响应的完整请求。包含鉴权、缓存命中或未命中、持久化回退、返回消息,以及异步 Trace 或事件上报;消息标签保持简短,顺序必须明确。"},"signals":[["api request",14],["request response",12],["call chain",11],["cache miss",13],["jwt",8],["who calls whom",12],["api 请求",14],["请求响应",12],["调用链",11],["缓存未命中",13],["谁调用谁",12],["鉴权链路",9]]},{"id":"async-roundtrip","type":"sequence","proof":"async-roundtrip","presentation":{"preset":"signal-flow","motion":"trace","views":"recommended"},"title":"Async roundtrip","question":"What happens after the initial request returns?","summary":"A sequence view of enqueue, acknowledgement, background work, callbacks, retries, timeout, and final consistency.","useWhen":"Webhooks, jobs, queues, payment callbacks, eventual consistency, or async API contracts.","avoidWhen":"The primary question is topic topology and consumer ownership rather than time order.","include":["initial acknowledgement","queue or scheduler","background work","callback, retry, and timeout"],"prompt":"Use Archify sequence mode to explain this asynchronous roundtrip. Show the initial acknowledgement, enqueue or scheduling step, background processing, callback or polling, retry and timeout behavior, and the point where the caller can observe final consistency.","en":{"title":"Async roundtrip","question":"What happens after the initial request returns?","summary":"A sequence view of enqueue, acknowledgement, background work, callbacks, retries, timeout, and final consistency.","useWhen":"Webhooks, jobs, queues, payment callbacks, eventual consistency, or async API contracts.","avoidWhen":"The primary question is topic topology and consumer ownership rather than time order.","include":["initial acknowledgement","queue or scheduler","background work","callback, retry, and timeout"],"prompt":"Use Archify sequence mode to explain this asynchronous roundtrip. Show the initial acknowledgement, enqueue or scheduling step, background processing, callback or polling, retry and timeout behavior, and the point where the caller can observe final consistency."},"zh":{"title":"异步往返链路","question":"初始请求返回之后,后台还会发生什么?","summary":"按时间展示入队、确认、后台处理、回调、重试、超时和最终一致。","useWhen":"适合 Webhook、后台任务、队列、支付回调、最终一致和异步 API 契约。","avoidWhen":"如果重点是 Topic 拓扑和消费者归属,而不是时间顺序,请用事件数据流配方。","include":["初始确认","队列或调度器","后台处理","回调、重试与超时"],"prompt":"用 Archify 时序模式解释这段异步往返链路。展示初始确认、入队或调度、后台处理、回调或轮询、重试与超时,以及调用方何时能观察到最终一致结果。"},"signals":[["async roundtrip",14],["webhook",10],["callback",10],["acknowledgement",8],["timeout",7],["retry message",8],["异步回调",14],["回调",10],["确认消息",8],["超时",7],["消息重试",9],["webhook",10]]},{"id":"data-lineage","type":"dataflow","proof":"product-analytics","presentation":{"preset":"classic","motion":"trace","views":"recommended"},"title":"Data lineage","question":"Where does data come from, how does it change, and who consumes it?","summary":"A governed path from sources through consent, transforms, sensitive stores, warehouse, and consumers.","useWhen":"Analytics architecture, ETL/ELT review, PII assessment, warehouse design, or model feature lineage.","avoidWhen":"The audience needs request timing or operational task ownership rather than data assets.","include":["sources and assets","transform stages","classification or consent","stores and consumers"],"prompt":"Use Archify dataflow mode to map this data lineage. Name every data asset and transform, show consent or classification boundaries, distinguish streaming from batch paths, and identify stores plus downstream consumers. Do not use unlabeled flows.","en":{"title":"Data lineage","question":"Where does data come from, how does it change, and who consumes it?","summary":"A governed path from sources through consent, transforms, sensitive stores, warehouse, and consumers.","useWhen":"Analytics architecture, ETL/ELT review, PII assessment, warehouse design, or model feature lineage.","avoidWhen":"The audience needs request timing or operational task ownership rather than data assets.","include":["sources and assets","transform stages","classification or consent","stores and consumers"],"prompt":"Use Archify dataflow mode to map this data lineage. Name every data asset and transform, show consent or classification boundaries, distinguish streaming from batch paths, and identify stores plus downstream consumers. Do not use unlabeled flows."},"zh":{"title":"数据血缘","question":"数据从哪里来、如何变化、最终被谁消费?","summary":"从来源经过同意、转换、敏感存储、数仓直到消费者的治理路径。","useWhen":"适合分析架构、ETL/ELT 评审、PII 评估、数仓设计和特征血缘。","avoidWhen":"如果受众需要请求时序或操作负责人,而不是数据资产,请换其他配方。","include":["数据来源与资产","转换阶段","分类或同意边界","存储与消费者"],"prompt":"用 Archify 数据流模式梳理这段数据血缘。为每个数据资产和转换命名,展示用户同意或数据分类边界,区分流式与批处理路径,并标明存储和下游消费者;所有数据流都必须有标签。"},"signals":[["data lineage",15],["etl",12],["warehouse",9],["pii",11],["governance",9],["analytics pipeline",12],["数据血缘",15],["数据管道",11],["数仓",9],["治理",9],["隐私数据",10],["用户同意",9]]},{"id":"event-stream","type":"dataflow","proof":"event-stream","presentation":{"preset":"signal-flow","motion":"trace","views":"recommended"},"title":"Event-stream topology","question":"Which events move through which topics, processors, groups, and failure paths?","summary":"A stream map of producers, topics, ordered processors, consumer groups, state, replay, and DLQ.","useWhen":"Kafka/event-platform design, stream processing reviews, ownership, replay, and failure handling.","avoidWhen":"Topic names, consumer groups, and delivery semantics are not known—use a generic workflow instead.","include":["producers and event names","topics and ordering","processors and consumer groups","state, replay, and DLQ"],"prompt":"Use Archify dataflow mode to draw this event-stream topology. Name producers, events, topics, ordered processors, consumer groups, state stores, replay paths, and the DLQ. Show ownership and delivery semantics only when supported by evidence.","en":{"title":"Event-stream topology","question":"Which events move through which topics, processors, groups, and failure paths?","summary":"A stream map of producers, topics, ordered processors, consumer groups, state, replay, and DLQ.","useWhen":"Kafka/event-platform design, stream processing reviews, ownership, replay, and failure handling.","avoidWhen":"Topic names, consumer groups, and delivery semantics are not known—use a generic workflow instead.","include":["producers and event names","topics and ordering","processors and consumer groups","state, replay, and DLQ"],"prompt":"Use Archify dataflow mode to draw this event-stream topology. Name producers, events, topics, ordered processors, consumer groups, state stores, replay paths, and the DLQ. Show ownership and delivery semantics only when supported by evidence."},"zh":{"title":"事件流拓扑","question":"哪些事件经过哪些 Topic、处理器、消费者组和失败路径?","summary":"展示生产者、Topic、有序处理器、消费者组、状态、重放和 DLQ。","useWhen":"适合 Kafka/事件平台设计、流处理评审、归属、重放和失败处理。","avoidWhen":"如果 Topic、消费者组和投递语义都不清楚,请先用通用工作流,不要编造事件拓扑。","include":["生产者与事件名","Topic 与顺序","处理器与消费者组","状态、重放与 DLQ"],"prompt":"用 Archify 数据流模式绘制这段事件流拓扑。命名生产者、事件、Topic、有序处理器、消费者组、状态存储、重放路径和 DLQ;只有在证据充分时才标注归属和投递语义。"},"signals":[["event stream",15],["kafka topology",14],["topic",8],["consumer group",11],["dead letter",10],["dlq",10],["事件流",15],["kafka 拓扑",14],["主题",7],["消费者组",11],["死信",10],["事件地铁图",12]]},{"id":"object-lifecycle","type":"lifecycle","proof":"agent-run","presentation":{"preset":"classic","motion":"trace","views":"optional"},"title":"Object lifecycle","question":"Which states exist, what events move between them, and how does it end?","summary":"A state model with active work, waits, retries, cancellation, failure, and explicit terminal outcomes.","useWhen":"Tasks, orders, tickets, subscriptions, jobs, agent runs, or any durable object with status.","avoidWhen":"The object has no durable state and the real question is participant interaction over time.","include":["start and active states","event-labelled transitions","wait and retry states","all terminal outcomes"],"prompt":"Use Archify lifecycle mode to model this object. Separate main progress, waiting or interruption states, and terminal outcomes. Label transitions with events, include retry, cancellation, timeout, success, and failure where real, and never hide an ending.","en":{"title":"Object lifecycle","question":"Which states exist, what events move between them, and how does it end?","summary":"A state model with active work, waits, retries, cancellation, failure, and explicit terminal outcomes.","useWhen":"Tasks, orders, tickets, subscriptions, jobs, agent runs, or any durable object with status.","avoidWhen":"The object has no durable state and the real question is participant interaction over time.","include":["start and active states","event-labelled transitions","wait and retry states","all terminal outcomes"],"prompt":"Use Archify lifecycle mode to model this object. Separate main progress, waiting or interruption states, and terminal outcomes. Label transitions with events, include retry, cancellation, timeout, success, and failure where real, and never hide an ending."},"zh":{"title":"对象生命周期","question":"有哪些状态、什么事件触发流转、最终如何结束?","summary":"展示执行、等待、重试、取消、失败以及明确终态的状态模型。","useWhen":"适合任务、订单、工单、订阅、作业、Agent Run 等带持久状态的对象。","avoidWhen":"对象没有持久状态,真正问题是参与者随时间的交互时,请使用时序图。","include":["开始与执行态","带事件的转换","等待与重试态","所有终态"],"prompt":"用 Archify 生命周期模式建模这个对象。分开主进度、等待或中断状态和终态;用事件标注转换,并在真实存在时展示重试、取消、超时、成功和失败,不能隐藏任何结束方式。"},"signals":[["state machine",15],["object lifecycle",14],["status transition",11],["terminal state",9],["retry state",8],["状态机",15],["生命周期",13],["状态流转",11],["终态",9],["等待态",8],["重试状态",8]]},{"id":"deployment-lifecycle","type":"lifecycle","proof":"deployment-lifecycle","presentation":{"preset":"signal-flow","motion":"trace","views":"recommended"},"title":"Deployment lifecycle","question":"What state is a release in, and what can happen next?","summary":"A deployment state model covering queued, building, verifying, approval, promotion, rollback, and terminal outcomes.","useWhen":"Release controllers, GitOps reconciliation, environment promotion, or deployment status APIs.","avoidWhen":"The question is the human/CI sequence of delivery actions rather than the deployment object state.","include":["queued and running states","verification and approval","promotion and rollback","success, failure, cancellation"],"prompt":"Use Archify lifecycle mode to model the deployment object. Show queued, building, verifying, waiting for approval, promoting, rolling back, and every terminal outcome. Label the events and guards that permit each transition.","en":{"title":"Deployment lifecycle","question":"What state is a release in, and what can happen next?","summary":"A deployment state model covering queued, building, verifying, approval, promotion, rollback, and terminal outcomes.","useWhen":"Release controllers, GitOps reconciliation, environment promotion, or deployment status APIs.","avoidWhen":"The question is the human/CI sequence of delivery actions rather than the deployment object state.","include":["queued and running states","verification and approval","promotion and rollback","success, failure, cancellation"],"prompt":"Use Archify lifecycle mode to model the deployment object. Show queued, building, verifying, waiting for approval, promoting, rolling back, and every terminal outcome. Label the events and guards that permit each transition."},"zh":{"title":"部署生命周期","question":"一次发布当前处于什么状态,下一步可能发生什么?","summary":"覆盖排队、构建、验证、审批、晋级、回滚和终态的部署状态模型。","useWhen":"适合发布控制器、GitOps 对账、环境晋级和部署状态 API。","avoidWhen":"如果重点是人员与 CI 的交付动作顺序,而不是部署对象状态,请用交付工作流。","include":["排队与执行态","验证与审批","晋级与回滚","成功、失败与取消"],"prompt":"用 Archify 生命周期模式建模部署对象。展示排队、构建、验证、等待审批、晋级、回滚以及所有终态,并标注允许每次状态转换的事件和守卫条件。"},"signals":[["deployment lifecycle",15],["release state",10],["promotion state",9],["approval status",8],["rollback state",10],["部署生命周期",15],["发布状态",10],["晋级",7],["审批状态",8],["回滚状态",10]]},{"id":"layout-repair","type":"architecture","proof":"web-app","presentation":{"preset":"classic","motion":"static","views":"optional"},"title":"Layout repair","question":"Why does the existing diagram overflow, overlap, or route through nodes, and what should be fixed first?","summary":"Repair an existing diagram in its current mode using validation diagnostics, explicit waypoint semantics, and a measured desktop viewport budget.","useWhen":"An existing architecture, workflow, sequence, dataflow, or lifecycle diagram needs layout repair; keep its diagram type and presentation settings.","avoidWhen":"The task is choosing a new diagram type. Do not change topology, delete meaningful labels, or hide overflow just to pass checks.","include":["repair order: schema → overlap → direction → crossings → labels","via contract: absolute [x, y] intermediate points; route = [start, ...via, end]","desktop viewport budget for the complete page, including header and necessary cards","validate after each edit, then inspect the final HTML in a browser"],"prompt":"Use Archify to repair this existing diagram while preserving its diagram type, topology, meaningful labels, and presentation settings. Follow references/authoring-contract.md in this order: (1) schema and missing/invalid meta.quality_profile; (2) node overlap or out-of-range placement; (3) edge-through-node and endpoint-direction errors; (4) crossings, ambiguous corridors, border runs, and route rhythm; (5) labels: label-to-node, label-to-label, then label-to-route clearance. Run validate after every edit and use diagnostics[] code, subject, evidence, and supportedFixes; apply one diagnosed geometry control at a time. Where the current schema supports via, it is an ordered array of absolute SVG [x, y] intermediate points: the route is [start, ...via, end], with start/end supplied by the node anchors. Explicit via points override automatic routing; they are not offsets or a request for automatic obstacle avoidance. For an orthogonal repair, align adjacent points on the same x or y and make the first/final segment respect fromSide/toSide; use only controls supported by the current diagram mode. Follow references/delivery-contract.md for the viewport budget: at 1440×900, 1600×1000, and 1920×1080 (also 2048×1320 for a large desktop), require document.documentElement.scrollWidth \u003c= window.innerWidth and document.documentElement.scrollHeight \u003c= window.innerHeight. Budget the entire page, including header, diagram, and necessary cards. Remove only redundant content or compact spacing first; do not hide overflow, clip content, introduce an internal diagram scroller, stretch the SVG, or shrink typography to force a pass. Inspect readability and vertical balance at the largest viewport; narrow/mobile layouts may scroll vertically. Validate, then deliver and inspect the final HTML; report browser evidence and visual review truthfully.","en":{"title":"Layout repair","question":"Why does the existing diagram overflow, overlap, or route through nodes, and what should be fixed first?","summary":"Repair an existing diagram in its current mode using validation diagnostics, explicit waypoint semantics, and a measured desktop viewport budget.","useWhen":"An existing architecture, workflow, sequence, dataflow, or lifecycle diagram needs layout repair; keep its diagram type and presentation settings.","avoidWhen":"The task is choosing a new diagram type. Do not change topology, delete meaningful labels, or hide overflow just to pass checks.","include":["repair order: schema → overlap → direction → crossings → labels","via contract: absolute [x, y] intermediate points; route = [start, ...via, end]","desktop viewport budget for the complete page, including header and necessary cards","validate after each edit, then inspect the final HTML in a browser"],"prompt":"Use Archify to repair this existing diagram while preserving its diagram type, topology, meaningful labels, and presentation settings. Follow references/authoring-contract.md in this order: (1) schema and missing/invalid meta.quality_profile; (2) node overlap or out-of-range placement; (3) edge-through-node and endpoint-direction errors; (4) crossings, ambiguous corridors, border runs, and route rhythm; (5) labels: label-to-node, label-to-label, then label-to-route clearance. Run validate after every edit and use diagnostics[] code, subject, evidence, and supportedFixes; apply one diagnosed geometry control at a time. Where the current schema supports via, it is an ordered array of absolute SVG [x, y] intermediate points: the route is [start, ...via, end], with start/end supplied by the node anchors. Explicit via points override automatic routing; they are not offsets or a request for automatic obstacle avoidance. For an orthogonal repair, align adjacent points on the same x or y and make the first/final segment respect fromSide/toSide; use only controls supported by the current diagram mode. Follow references/delivery-contract.md for the viewport budget: at 1440×900, 1600×1000, and 1920×1080 (also 2048×1320 for a large desktop), require document.documentElement.scrollWidth \u003c= window.innerWidth and document.documentElement.scrollHeight \u003c= window.innerHeight. Budget the entire page, including header, diagram, and necessary cards. Remove only redundant content or compact spacing first; do not hide overflow, clip content, introduce an internal diagram scroller, stretch the SVG, or shrink typography to force a pass. Inspect readability and vertical balance at the largest viewport; narrow/mobile layouts may scroll vertically. Validate, then deliver and inspect the final HTML; report browser evidence and visual review truthfully."},"zh":{"title":"布局修复","question":"现有图为什么仍然溢出、重叠或连线穿过节点,应该先修什么?","summary":"保留现有图表模式,依据验证诊断、途经点语义和实测桌面视口预算修复布局。","useWhen":"已有架构图、工作流、时序图、数据流或生命周期图需要修复布局;保留原来的图表类型和表现设置。","avoidWhen":"任务是为新图选择类型时不要使用。不要为了通过检查改变拓扑、删除有意义的标签或隐藏溢出。","include":["修复顺序:schema → 重叠 → 方向 → 交叉 → 标签","via 契约:绝对 [x, y] 中间点;路径 = [start, ...via, end]","包含标题和必要卡片的整页桌面视口预算","每次修改后 validate,最终在浏览器中检查 HTML"],"prompt":"用 Archify 修复这张现有图,保留图表类型、拓扑、有意义的标签和表现设置。遵循 references/authoring-contract.md 的顺序:(1) schema 错误及缺失或无效的 meta.quality_profile;(2) 节点重叠或越界;(3) 连线穿过节点及端点方向错误;(4) 交叉、含混的共享通道、贴边走线和转弯节奏;(5) 标签与节点、标签与标签、标签与连线的间距。每次修改后运行 validate,依据 diagnostics[] 的 code、subject、evidence 和 supportedFixes,每次只应用一项有诊断依据的几何控制。当前 schema 支持 via 时,它是按顺序排列的绝对 SVG [x, y] 中间点数组:路径为 [start, ...via, end],起终点由节点锚点提供。显式 via 会覆盖自动路由,不是偏移量,也不会请求自动绕障。修复正交走线时,相邻点应共享 x 或 y,首尾线段应遵守 fromSide/toSide;只使用当前模式支持的控制字段。视口预算遵循 references/delivery-contract.md:在 1440×900、1600×1000、1920×1080 检查,大桌面还要检查 2048×1320;要求 document.documentElement.scrollWidth \u003c= window.innerWidth 且 document.documentElement.scrollHeight \u003c= window.innerHeight。预算覆盖整页,包括标题、主图和必要卡片。先移除冗余内容或压缩间距,不得靠隐藏溢出、裁切、内部滚动区、拉伸 SVG 或缩小字体强行通过。在最大视口检查可读性和纵向平衡;窄屏或移动端允许纵向滚动。验证后执行 deliver 并检查最终 HTML,如实报告浏览器证据和视觉检查结果。"},"signals":[["layout repair",20],["repair order",20],["fix order",20],["viewport overflow",20],["overflow",16],["scrollheight",16],["scrollwidth",16],["overlap",16],["label overlap",20],["edge through node",20],["crossing",8],["via",7],["waypoint",14],["布局修复",20],["修复顺序",20],["视口溢出",20],["溢出",16],["滚动高度",16],["滚动宽度",16],["重叠",16],["标签重叠",20],["连线穿过节点",20],["连线穿节点",20],["交叉",8],["途经点",14],["路径点",14],["拐点",14]]}]</script>+ <script id="guide-data" type="application/json">[{"id":"system-overview","type":"architecture","proof":"web-app","presentation":{"preset":"classic","motion":"static","views":"optional"},"title":"System overview","question":"What exists, who owns it, and how is it connected?","summary":"A bounded map of core components, external dependencies, primary paths, and trust boundaries.","useWhen":"Onboarding, design reviews, repository orientation, or explaining a service landscape.","avoidWhen":"The audience needs exact call order, state transitions, or row-level data lineage.","include":["8–12 core components","one primary path","external dependencies","trust boundaries"],"prompt":"Analyze this repository, then use Archify to create a high-level architecture diagram. Show 8–12 core runtime components, one primary request or data path, external dependencies, ownership or trust boundaries, and put supporting detail in cards instead of adding more edges.","en":{"title":"System overview","question":"What exists, who owns it, and how is it connected?","summary":"A bounded map of core components, external dependencies, primary paths, and trust boundaries.","useWhen":"Onboarding, design reviews, repository orientation, or explaining a service landscape.","avoidWhen":"The audience needs exact call order, state transitions, or row-level data lineage.","include":["8–12 core components","one primary path","external dependencies","trust boundaries"],"prompt":"Analyze this repository, then use Archify to create a high-level architecture diagram. Show 8–12 core runtime components, one primary request or data path, external dependencies, ownership or trust boundaries, and put supporting detail in cards instead of adding more edges."},"zh":{"title":"系统总览","question":"系统里有什么、归谁负责、彼此如何连接?","summary":"用一张有边界的图展示核心组件、外部依赖、主路径和信任边界。","useWhen":"适合新人上手、方案评审、仓库梳理和服务全景说明。","avoidWhen":"如果重点是精确调用顺序、状态流转或字段级血缘,请换其他配方。","include":["8–12 个核心组件","一条主路径","外部依赖","归属或信任边界"],"prompt":"分析这个仓库,然后用 Archify 生成高层系统架构图。展示 8–12 个核心运行时组件、一条主要请求或数据路径、外部依赖、归属或信任边界;支持性细节放进卡片,不要继续堆连线。"},"signals":[["system overview",12],["architecture",10],["components",6],["services",4],["repository",5],["trust boundary",8],["架构",10],["系统总览",12],["组件",6],["服务",4],["仓库",5],["信任边界",8]]},{"id":"deployment-ownership","type":"architecture","proof":"deployment-ownership","presentation":{"preset":"blueprint","motion":"trace","views":"recommended"},"title":"Deployment ownership","question":"Where does each workload run, and what crosses a boundary?","summary":"A deployment-focused map of regions, networks, clusters, workloads, stores, and cross-boundary mechanisms.","useWhen":"Cloud reviews, production readiness, multi-region planning, or infrastructure ownership handoffs.","avoidWhen":"Deployment facts are unknown or the real question is application behavior rather than placement.","include":["regions and networks","workload ownership","stateful services","named boundary crossings"],"prompt":"Use Archify to draw the production deployment topology. Group resources by region, network, cluster, and owner; show workloads and stateful services; label every cross-boundary mechanism. Do not invent deployment facts—mark unknown areas explicitly. If the user wants a fail-closed deployment review, ask before setting meta.engineering_profile to deployment-ownership; otherwise leave the engineering profile unset.","en":{"title":"Deployment ownership","question":"Where does each workload run, and what crosses a boundary?","summary":"A deployment-focused map of regions, networks, clusters, workloads, stores, and cross-boundary mechanisms.","useWhen":"Cloud reviews, production readiness, multi-region planning, or infrastructure ownership handoffs.","avoidWhen":"Deployment facts are unknown or the real question is application behavior rather than placement.","include":["regions and networks","workload ownership","stateful services","named boundary crossings"],"prompt":"Use Archify to draw the production deployment topology. Group resources by region, network, cluster, and owner; show workloads and stateful services; label every cross-boundary mechanism. Do not invent deployment facts—mark unknown areas explicitly. If the user wants a fail-closed deployment review, ask before setting meta.engineering_profile to deployment-ownership; otherwise leave the engineering profile unset."},"zh":{"title":"部署与归属","question":"每个工作负载运行在哪里,哪些连接跨越了边界?","summary":"围绕 Region、网络、集群、工作负载、存储和跨边界机制组织部署图。","useWhen":"适合云上评审、生产就绪、多区域规划和基础设施交接。","avoidWhen":"部署事实不清楚,或真正问题是应用行为而不是资源位置时不要使用。","include":["区域与网络","工作负载归属","有状态服务","明确的跨边界机制"],"prompt":"用 Archify 绘制生产部署拓扑。按区域、网络、集群和负责人分组,展示工作负载与有状态服务,并标注每一种跨边界机制。不要编造部署事实,不确定的区域要明确标出。如果用户需要失败即阻断的部署评审,先征得确认,再把 meta.engineering_profile 设为 deployment-ownership;否则不要启用工程画像。"},"signals":[["deployment topology",14],["region",7],["vpc",9],["cluster",6],["availability zone",8],["ownership",7],["cloud deployment",12],["部署拓扑",14],["区域",6],["集群",6],["可用区",8],["资源归属",9],["跨区",8]]},{"id":"agent-tool-call","type":"workflow","proof":"agent-tool-call","presentation":{"preset":"signal-flow","motion":"trace","views":"recommended"},"title":"Agent tool-call loop","question":"How does an agent plan, get permission, act, recover, and report?","summary":"A lane-based agent loop with policy gates, tool execution, exception recovery, evidence, and final response.","useWhen":"Explaining agent runtimes, MCP/tool orchestration, approvals, retries, or observability.","avoidWhen":"The goal is only to show static agent components or exact API message timing.","include":["request and planning","policy or approval gate","tool execution","exception and evidence paths"],"prompt":"Use Archify workflow mode to explain this agent tool-call loop. Separate user surface, agent runtime, policy boundary, exception handling, tool execution, and observability into lanes. Make the successful path primary and show approval, retry, blocked, and evidence paths explicitly.","en":{"title":"Agent tool-call loop","question":"How does an agent plan, get permission, act, recover, and report?","summary":"A lane-based agent loop with policy gates, tool execution, exception recovery, evidence, and final response.","useWhen":"Explaining agent runtimes, MCP/tool orchestration, approvals, retries, or observability.","avoidWhen":"The goal is only to show static agent components or exact API message timing.","include":["request and planning","policy or approval gate","tool execution","exception and evidence paths"],"prompt":"Use Archify workflow mode to explain this agent tool-call loop. Separate user surface, agent runtime, policy boundary, exception handling, tool execution, and observability into lanes. Make the successful path primary and show approval, retry, blocked, and evidence paths explicitly."},"zh":{"title":"智能体工具调用","question":"智能体如何规划、获批、执行、恢复并汇报?","summary":"用泳道表达策略门、工具执行、异常恢复、证据和最终回复。","useWhen":"适合解释 Agent Runtime、MCP/工具编排、审批、重试和可观测性。","avoidWhen":"如果只想看静态组件,或重点是精确 API 消息时序,请换其他配方。","include":["请求与规划","策略或审批门","工具执行","异常与证据路径"],"prompt":"用 Archify 工作流模式解释这段智能体工具调用。把用户界面、Agent Runtime、策略边界、异常处理、工具执行和可观测性分成泳道;突出成功主路径,并明确展示审批、重试、阻塞和证据路径。"},"signals":[["agent tool call",16],["tool call",12],["approval gate",10],["human in the loop",9],["mcp",7],["planner",6],["agent loop",10],["智能体工具调用",16],["工具调用",12],["审批门",10],["人在回路",9],["规划器",6],["智能体循环",10]]},{"id":"delivery-workflow","type":"workflow","proof":"delivery-workflow","presentation":{"preset":"classic","motion":"trace","views":"optional"},"title":"Delivery workflow","question":"How does a change move safely from commit to production?","summary":"A delivery flow with build, checks, environments, approvals, smoke tests, rollback, and ownership lanes.","useWhen":"CI/CD design, release reviews, deployment governance, or onboarding developers to delivery.","avoidWhen":"The question is where infrastructure runs or what states a deployment object can occupy.","include":["trigger and build","blocking checks","approval and environments","rollback and verification"],"prompt":"Use Archify workflow mode to draw this delivery process from commit to production. Separate developer, CI, approval, environment, and exception lanes; mark blocking checks, smoke tests, ownership, and the rollback path. Keep one unmistakable happy path.","en":{"title":"Delivery workflow","question":"How does a change move safely from commit to production?","summary":"A delivery flow with build, checks, environments, approvals, smoke tests, rollback, and ownership lanes.","useWhen":"CI/CD design, release reviews, deployment governance, or onboarding developers to delivery.","avoidWhen":"The question is where infrastructure runs or what states a deployment object can occupy.","include":["trigger and build","blocking checks","approval and environments","rollback and verification"],"prompt":"Use Archify workflow mode to draw this delivery process from commit to production. Separate developer, CI, approval, environment, and exception lanes; mark blocking checks, smoke tests, ownership, and the rollback path. Keep one unmistakable happy path."},"zh":{"title":"研发交付流程","question":"一次变更如何安全地从提交走到生产?","summary":"展示构建、检查、环境、审批、冒烟、回滚和负责人泳道。","useWhen":"适合 CI/CD 设计、发布评审、部署治理和研发新人上手。","avoidWhen":"如果重点是基础设施位置或部署对象的状态集合,请换架构图或生命周期图。","include":["触发与构建","阻断检查","审批与环境","回滚与验证"],"prompt":"用 Archify 工作流模式绘制从代码提交到生产发布的流程。拆分开发者、CI、审批、环境和异常泳道;标出阻断检查、冒烟测试、负责人和回滚路径,并保留一条一眼可见的成功主路径。"},"signals":[["ci/cd",14],["release workflow",14],["deployment pipeline",11],["pull request",7],["staging",7],["rollback",8],["发布流程",14],["流水线",9],["上线",7],["预发",7],["回滚",8],["审批发布",10]]},{"id":"incident-runbook","type":"workflow","proof":"incident-runbook","presentation":{"preset":"signal-flow","motion":"trace","views":"recommended"},"title":"Incident runbook","question":"How do responders detect, triage, mitigate, verify, and escalate?","summary":"An operational workflow that separates signals, responders, mitigation, communications, and recovery proof.","useWhen":"Incident playbooks, on-call handoffs, reliability reviews, and tabletop exercises.","avoidWhen":"The audience needs live metrics or a post-incident component topology instead of response actions.","include":["detection signal","triage owner","mitigation and rollback","verification and communication"],"prompt":"Use Archify workflow mode to turn this incident runbook into responder lanes. Show detection, triage, mitigation, escalation, communication, rollback, and recovery verification. Separate decision gates from actions and make missing ownership visible.","en":{"title":"Incident runbook","question":"How do responders detect, triage, mitigate, verify, and escalate?","summary":"An operational workflow that separates signals, responders, mitigation, communications, and recovery proof.","useWhen":"Incident playbooks, on-call handoffs, reliability reviews, and tabletop exercises.","avoidWhen":"The audience needs live metrics or a post-incident component topology instead of response actions.","include":["detection signal","triage owner","mitigation and rollback","verification and communication"],"prompt":"Use Archify workflow mode to turn this incident runbook into responder lanes. Show detection, triage, mitigation, escalation, communication, rollback, and recovery verification. Separate decision gates from actions and make missing ownership visible."},"zh":{"title":"事故处置 Runbook","question":"响应者如何发现、分诊、缓解、验证并升级?","summary":"把信号、响应者、缓解动作、沟通和恢复证据拆成可执行流程。","useWhen":"适合故障预案、On-call 交接、稳定性评审和桌面演练。","avoidWhen":"如果受众需要实时指标仪表盘或事故后的组件拓扑,而不是响应动作,请换其他视图。","include":["发现信号","分诊负责人","缓解与回滚","恢复验证与沟通"],"prompt":"用 Archify 工作流模式把事故处置预案画成响应者泳道。展示发现、分诊、缓解、升级、沟通、回滚和恢复验证;把决策门与操作分开,并让缺失的负责人清晰可见。"},"signals":[["incident response",15],["runbook",12],["outage",9],["triage",8],["mitigation",8],["escalation",7],["事故处置",15],["故障",9],["应急预案",12],["排障",9],["缓解",7],["升级响应",8]]},{"id":"api-request","type":"sequence","proof":"cache-miss","presentation":{"preset":"classic","motion":"trace","views":"optional"},"title":"API request chain","question":"Who calls whom, in what order, and what returns?","summary":"A time-ordered request path with authentication, cache fallback, persistence, return traffic, and async trace.","useWhen":"API documentation, debugging request latency, auth reviews, or explaining cache fallback.","avoidWhen":"Order is unimportant and the audience only needs the stable service topology.","include":["callers and callees","request and return messages","fallback or error path","async side effects"],"prompt":"Use Archify sequence mode to show this request from caller to final response. Include authentication, cache hit or miss, persistence fallback, return messages, and asynchronous trace or event emission. Keep message labels short and order unambiguous.","en":{"title":"API request chain","question":"Who calls whom, in what order, and what returns?","summary":"A time-ordered request path with authentication, cache fallback, persistence, return traffic, and async trace.","useWhen":"API documentation, debugging request latency, auth reviews, or explaining cache fallback.","avoidWhen":"Order is unimportant and the audience only needs the stable service topology.","include":["callers and callees","request and return messages","fallback or error path","async side effects"],"prompt":"Use Archify sequence mode to show this request from caller to final response. Include authentication, cache hit or miss, persistence fallback, return messages, and asynchronous trace or event emission. Keep message labels short and order unambiguous."},"zh":{"title":"API 请求链","question":"谁调用谁、顺序如何、最终返回什么?","summary":"按时间展示鉴权、缓存回退、持久化、返回流量和异步追踪。","useWhen":"适合 API 文档、请求耗时排查、鉴权评审和缓存回退说明。","avoidWhen":"如果顺序不重要,受众只需要稳定的服务拓扑,请用架构图。","include":["调用方与被调用方","请求与返回消息","回退或错误路径","异步副作用"],"prompt":"用 Archify 时序模式展示从调用方到最终响应的完整请求。包含鉴权、缓存命中或未命中、持久化回退、返回消息,以及异步 Trace 或事件上报;消息标签保持简短,顺序必须明确。"},"signals":[["api request",14],["request response",12],["call chain",11],["cache miss",13],["jwt",8],["who calls whom",12],["api 请求",14],["请求响应",12],["调用链",11],["缓存未命中",13],["谁调用谁",12],["鉴权链路",9]]},{"id":"async-roundtrip","type":"sequence","proof":"async-roundtrip","presentation":{"preset":"signal-flow","motion":"trace","views":"recommended"},"title":"Async roundtrip","question":"What happens after the initial request returns?","summary":"A sequence view of enqueue, acknowledgement, background work, callbacks, retries, timeout, and final consistency.","useWhen":"Webhooks, jobs, queues, payment callbacks, eventual consistency, or async API contracts.","avoidWhen":"The primary question is topic topology and consumer ownership rather than time order.","include":["initial acknowledgement","queue or scheduler","background work","callback, retry, and timeout"],"prompt":"Use Archify sequence mode to explain this asynchronous roundtrip. Show the initial acknowledgement, enqueue or scheduling step, background processing, callback or polling, retry and timeout behavior, and the point where the caller can observe final consistency.","en":{"title":"Async roundtrip","question":"What happens after the initial request returns?","summary":"A sequence view of enqueue, acknowledgement, background work, callbacks, retries, timeout, and final consistency.","useWhen":"Webhooks, jobs, queues, payment callbacks, eventual consistency, or async API contracts.","avoidWhen":"The primary question is topic topology and consumer ownership rather than time order.","include":["initial acknowledgement","queue or scheduler","background work","callback, retry, and timeout"],"prompt":"Use Archify sequence mode to explain this asynchronous roundtrip. Show the initial acknowledgement, enqueue or scheduling step, background processing, callback or polling, retry and timeout behavior, and the point where the caller can observe final consistency."},"zh":{"title":"异步往返链路","question":"初始请求返回之后,后台还会发生什么?","summary":"按时间展示入队、确认、后台处理、回调、重试、超时和最终一致。","useWhen":"适合 Webhook、后台任务、队列、支付回调、最终一致和异步 API 契约。","avoidWhen":"如果重点是 Topic 拓扑和消费者归属,而不是时间顺序,请用事件数据流配方。","include":["初始确认","队列或调度器","后台处理","回调、重试与超时"],"prompt":"用 Archify 时序模式解释这段异步往返链路。展示初始确认、入队或调度、后台处理、回调或轮询、重试与超时,以及调用方何时能观察到最终一致结果。"},"signals":[["async roundtrip",14],["webhook",10],["callback",10],["acknowledgement",8],["timeout",7],["retry message",8],["异步回调",14],["回调",10],["确认消息",8],["超时",7],["消息重试",9],["webhook",10]]},{"id":"data-lineage","type":"dataflow","proof":"product-analytics","presentation":{"preset":"classic","motion":"trace","views":"recommended"},"title":"Data lineage","question":"Where does data come from, how does it change, and who consumes it?","summary":"A governed path from sources through consent, transforms, sensitive stores, warehouse, and consumers.","useWhen":"Analytics architecture, ETL/ELT review, PII assessment, warehouse design, or model feature lineage.","avoidWhen":"The audience needs request timing or operational task ownership rather than data assets.","include":["sources and assets","transform stages","classification or consent","stores and consumers"],"prompt":"Use Archify dataflow mode to map this data lineage. Name every data asset and transform, show consent or classification boundaries, distinguish streaming from batch paths, and identify stores plus downstream consumers. Do not use unlabeled flows.","en":{"title":"Data lineage","question":"Where does data come from, how does it change, and who consumes it?","summary":"A governed path from sources through consent, transforms, sensitive stores, warehouse, and consumers.","useWhen":"Analytics architecture, ETL/ELT review, PII assessment, warehouse design, or model feature lineage.","avoidWhen":"The audience needs request timing or operational task ownership rather than data assets.","include":["sources and assets","transform stages","classification or consent","stores and consumers"],"prompt":"Use Archify dataflow mode to map this data lineage. Name every data asset and transform, show consent or classification boundaries, distinguish streaming from batch paths, and identify stores plus downstream consumers. Do not use unlabeled flows."},"zh":{"title":"数据血缘","question":"数据从哪里来、如何变化、最终被谁消费?","summary":"从来源经过同意、转换、敏感存储、数仓直到消费者的治理路径。","useWhen":"适合分析架构、ETL/ELT 评审、PII 评估、数仓设计和特征血缘。","avoidWhen":"如果受众需要请求时序或操作负责人,而不是数据资产,请换其他配方。","include":["数据来源与资产","转换阶段","分类或同意边界","存储与消费者"],"prompt":"用 Archify 数据流模式梳理这段数据血缘。为每个数据资产和转换命名,展示用户同意或数据分类边界,区分流式与批处理路径,并标明存储和下游消费者;所有数据流都必须有标签。"},"signals":[["data lineage",15],["etl",12],["warehouse",9],["pii",11],["governance",9],["analytics pipeline",12],["数据血缘",15],["数据管道",11],["数仓",9],["治理",9],["隐私数据",10],["用户同意",9]]},{"id":"event-stream","type":"dataflow","proof":"event-stream","presentation":{"preset":"signal-flow","motion":"trace","views":"recommended"},"title":"Event-stream topology","question":"Which events move through which topics, processors, groups, and failure paths?","summary":"A stream map of producers, topics, ordered processors, consumer groups, state, replay, and DLQ.","useWhen":"Kafka/event-platform design, stream processing reviews, ownership, replay, and failure handling.","avoidWhen":"Topic names, consumer groups, and delivery semantics are not known—use a generic workflow instead.","include":["producers and event names","topics and ordering","processors and consumer groups","state, replay, and DLQ"],"prompt":"Use Archify dataflow mode to draw this event-stream topology. Name producers, events, topics, ordered processors, consumer groups, state stores, replay paths, and the DLQ. Show ownership and delivery semantics only when supported by evidence.","en":{"title":"Event-stream topology","question":"Which events move through which topics, processors, groups, and failure paths?","summary":"A stream map of producers, topics, ordered processors, consumer groups, state, replay, and DLQ.","useWhen":"Kafka/event-platform design, stream processing reviews, ownership, replay, and failure handling.","avoidWhen":"Topic names, consumer groups, and delivery semantics are not known—use a generic workflow instead.","include":["producers and event names","topics and ordering","processors and consumer groups","state, replay, and DLQ"],"prompt":"Use Archify dataflow mode to draw this event-stream topology. Name producers, events, topics, ordered processors, consumer groups, state stores, replay paths, and the DLQ. Show ownership and delivery semantics only when supported by evidence."},"zh":{"title":"事件流拓扑","question":"哪些事件经过哪些 Topic、处理器、消费者组和失败路径?","summary":"展示生产者、Topic、有序处理器、消费者组、状态、重放和 DLQ。","useWhen":"适合 Kafka/事件平台设计、流处理评审、归属、重放和失败处理。","avoidWhen":"如果 Topic、消费者组和投递语义都不清楚,请先用通用工作流,不要编造事件拓扑。","include":["生产者与事件名","Topic 与顺序","处理器与消费者组","状态、重放与 DLQ"],"prompt":"用 Archify 数据流模式绘制这段事件流拓扑。命名生产者、事件、Topic、有序处理器、消费者组、状态存储、重放路径和 DLQ;只有在证据充分时才标注归属和投递语义。"},"signals":[["event stream",15],["kafka topology",14],["topic",8],["consumer group",11],["dead letter",10],["dlq",10],["事件流",15],["kafka 拓扑",14],["主题",7],["消费者组",11],["死信",10],["事件地铁图",12]]},{"id":"object-lifecycle","type":"lifecycle","proof":"agent-run","presentation":{"preset":"classic","motion":"trace","views":"optional"},"title":"Object lifecycle","question":"Which states exist, what events move between them, and how does it end?","summary":"A state model with active work, waits, retries, cancellation, failure, and explicit terminal outcomes.","useWhen":"Tasks, orders, tickets, subscriptions, jobs, agent runs, or any durable object with status.","avoidWhen":"The object has no durable state and the real question is participant interaction over time.","include":["start and active states","event-labelled transitions","wait and retry states","all terminal outcomes"],"prompt":"Use Archify lifecycle mode to model this object. Separate main progress, waiting or interruption states, and terminal outcomes. Label transitions with events, include retry, cancellation, timeout, success, and failure where real, and never hide an ending.","en":{"title":"Object lifecycle","question":"Which states exist, what events move between them, and how does it end?","summary":"A state model with active work, waits, retries, cancellation, failure, and explicit terminal outcomes.","useWhen":"Tasks, orders, tickets, subscriptions, jobs, agent runs, or any durable object with status.","avoidWhen":"The object has no durable state and the real question is participant interaction over time.","include":["start and active states","event-labelled transitions","wait and retry states","all terminal outcomes"],"prompt":"Use Archify lifecycle mode to model this object. Separate main progress, waiting or interruption states, and terminal outcomes. Label transitions with events, include retry, cancellation, timeout, success, and failure where real, and never hide an ending."},"zh":{"title":"对象生命周期","question":"有哪些状态、什么事件触发流转、最终如何结束?","summary":"展示执行、等待、重试、取消、失败以及明确终态的状态模型。","useWhen":"适合任务、订单、工单、订阅、作业、Agent Run 等带持久状态的对象。","avoidWhen":"对象没有持久状态,真正问题是参与者随时间的交互时,请使用时序图。","include":["开始与执行态","带事件的转换","等待与重试态","所有终态"],"prompt":"用 Archify 生命周期模式建模这个对象。分开主进度、等待或中断状态和终态;用事件标注转换,并在真实存在时展示重试、取消、超时、成功和失败,不能隐藏任何结束方式。"},"signals":[["state machine",15],["object lifecycle",14],["status transition",11],["terminal state",9],["retry state",8],["状态机",15],["生命周期",13],["状态流转",11],["终态",9],["等待态",8],["重试状态",8]]},{"id":"deployment-lifecycle","type":"lifecycle","proof":"deployment-lifecycle","presentation":{"preset":"signal-flow","motion":"trace","views":"recommended"},"title":"Deployment lifecycle","question":"What state is a release in, and what can happen next?","summary":"A deployment state model covering queued, building, verifying, approval, promotion, rollback, and terminal outcomes.","useWhen":"Release controllers, GitOps reconciliation, environment promotion, or deployment status APIs.","avoidWhen":"The question is the human/CI sequence of delivery actions rather than the deployment object state.","include":["queued and running states","verification and approval","promotion and rollback","success, failure, cancellation"],"prompt":"Use Archify lifecycle mode to model the deployment object. Show queued, building, verifying, waiting for approval, promoting, rolling back, and every terminal outcome. Label the events and guards that permit each transition.","en":{"title":"Deployment lifecycle","question":"What state is a release in, and what can happen next?","summary":"A deployment state model covering queued, building, verifying, approval, promotion, rollback, and terminal outcomes.","useWhen":"Release controllers, GitOps reconciliation, environment promotion, or deployment status APIs.","avoidWhen":"The question is the human/CI sequence of delivery actions rather than the deployment object state.","include":["queued and running states","verification and approval","promotion and rollback","success, failure, cancellation"],"prompt":"Use Archify lifecycle mode to model the deployment object. Show queued, building, verifying, waiting for approval, promoting, rolling back, and every terminal outcome. Label the events and guards that permit each transition."},"zh":{"title":"部署生命周期","question":"一次发布当前处于什么状态,下一步可能发生什么?","summary":"覆盖排队、构建、验证、审批、晋级、回滚和终态的部署状态模型。","useWhen":"适合发布控制器、GitOps 对账、环境晋级和部署状态 API。","avoidWhen":"如果重点是人员与 CI 的交付动作顺序,而不是部署对象状态,请用交付工作流。","include":["排队与执行态","验证与审批","晋级与回滚","成功、失败与取消"],"prompt":"用 Archify 生命周期模式建模部署对象。展示排队、构建、验证、等待审批、晋级、回滚以及所有终态,并标注允许每次状态转换的事件和守卫条件。"},"signals":[["deployment lifecycle",15],["release state",10],["promotion state",9],["approval status",8],["rollback state",10],["部署生命周期",15],["发布状态",10],["晋级",7],["审批状态",8],["回滚状态",10]]},{"id":"layout-repair","type":"architecture","proof":"web-app","presentation":{"preset":"classic","motion":"static","views":"optional"},"title":"Layout repair","question":"Why does the existing diagram overflow, overlap, or route through nodes, and what should be fixed first?","summary":"Repair an existing diagram in its current mode using validation diagnostics, explicit waypoint semantics, and a measured desktop viewport budget.","useWhen":"An existing architecture, workflow, sequence, dataflow, or lifecycle diagram needs layout repair; keep its diagram type and presentation settings.","avoidWhen":"The task is choosing a new diagram type. Do not change topology, delete meaningful labels, or hide overflow just to pass checks.","include":["repair order: schema → overlap → direction → crossings → labels","via contract: absolute [x, y] intermediate points; route = [start, ...via, end]","desktop viewport budget for the complete page, including header and necessary cards","validate after each edit, then inspect the final HTML in a browser"],"prompt":"Use Archify to repair this existing diagram while preserving its diagram type, topology, meaningful labels, and presentation settings. Follow references/authoring-contract.md in this order: (1) schema and missing/invalid meta.quality_profile; (2) node overlap or out-of-range placement; (3) edge-through-node and endpoint-direction errors; (4) crossings, ambiguous corridors, border runs, and route rhythm; (5) labels: label-to-node, label-to-label, then label-to-route clearance. Run validate after every edit and use diagnostics[] code, subject, evidence, and supportedFixes; apply one diagnosed geometry control at a time. Where the current schema supports via, it is an ordered array of absolute SVG [x, y] intermediate points: the route is [start, ...via, end], with start/end supplied by the node anchors. Explicit via points override automatic routing; they are not offsets or a request for automatic obstacle avoidance. For an orthogonal repair, align adjacent points on the same x or y and make the first/final segment respect fromSide/toSide; use only controls supported by the current diagram mode. Follow references/delivery-contract.md for the viewport budget: check 1440×900, 1600×1000, 1920×1080, and 2048×1320; require document.documentElement.scrollWidth \u003c= window.innerWidth. Prefer document.documentElement.scrollHeight \u003c= window.innerHeight, but preserve a Reader-declared readable vertical page scroll when visual-check explicitly accepts it after reaching the projected-text floor. Budget the entire page, including header, diagram, and necessary cards. Repair every other overflow by removing only redundant content or compacting spacing first; do not hide overflow, clip content, introduce an internal diagram scroller, stretch the SVG, or shrink typography to force a pass. Inspect readability and vertical balance at the largest viewport. Validate, then deliver and inspect the final HTML; report browser evidence and visual review truthfully.","en":{"title":"Layout repair","question":"Why does the existing diagram overflow, overlap, or route through nodes, and what should be fixed first?","summary":"Repair an existing diagram in its current mode using validation diagnostics, explicit waypoint semantics, and a measured desktop viewport budget.","useWhen":"An existing architecture, workflow, sequence, dataflow, or lifecycle diagram needs layout repair; keep its diagram type and presentation settings.","avoidWhen":"The task is choosing a new diagram type. Do not change topology, delete meaningful labels, or hide overflow just to pass checks.","include":["repair order: schema → overlap → direction → crossings → labels","via contract: absolute [x, y] intermediate points; route = [start, ...via, end]","desktop viewport budget for the complete page, including header and necessary cards","validate after each edit, then inspect the final HTML in a browser"],"prompt":"Use Archify to repair this existing diagram while preserving its diagram type, topology, meaningful labels, and presentation settings. Follow references/authoring-contract.md in this order: (1) schema and missing/invalid meta.quality_profile; (2) node overlap or out-of-range placement; (3) edge-through-node and endpoint-direction errors; (4) crossings, ambiguous corridors, border runs, and route rhythm; (5) labels: label-to-node, label-to-label, then label-to-route clearance. Run validate after every edit and use diagnostics[] code, subject, evidence, and supportedFixes; apply one diagnosed geometry control at a time. Where the current schema supports via, it is an ordered array of absolute SVG [x, y] intermediate points: the route is [start, ...via, end], with start/end supplied by the node anchors. Explicit via points override automatic routing; they are not offsets or a request for automatic obstacle avoidance. For an orthogonal repair, align adjacent points on the same x or y and make the first/final segment respect fromSide/toSide; use only controls supported by the current diagram mode. Follow references/delivery-contract.md for the viewport budget: check 1440×900, 1600×1000, 1920×1080, and 2048×1320; require document.documentElement.scrollWidth \u003c= window.innerWidth. Prefer document.documentElement.scrollHeight \u003c= window.innerHeight, but preserve a Reader-declared readable vertical page scroll when visual-check explicitly accepts it after reaching the projected-text floor. Budget the entire page, including header, diagram, and necessary cards. Repair every other overflow by removing only redundant content or compacting spacing first; do not hide overflow, clip content, introduce an internal diagram scroller, stretch the SVG, or shrink typography to force a pass. Inspect readability and vertical balance at the largest viewport. Validate, then deliver and inspect the final HTML; report browser evidence and visual review truthfully."},"zh":{"title":"布局修复","question":"现有图为什么仍然溢出、重叠或连线穿过节点,应该先修什么?","summary":"保留现有图表模式,依据验证诊断、途经点语义和实测桌面视口预算修复布局。","useWhen":"已有架构图、工作流、时序图、数据流或生命周期图需要修复布局;保留原来的图表类型和表现设置。","avoidWhen":"任务是为新图选择类型时不要使用。不要为了通过检查改变拓扑、删除有意义的标签或隐藏溢出。","include":["修复顺序:schema → 重叠 → 方向 → 交叉 → 标签","via 契约:绝对 [x, y] 中间点;路径 = [start, ...via, end]","包含标题和必要卡片的整页桌面视口预算","每次修改后 validate,最终在浏览器中检查 HTML"],"prompt":"用 Archify 修复这张现有图,保留图表类型、拓扑、有意义的标签和表现设置。遵循 references/authoring-contract.md 的顺序:(1) schema 错误及缺失或无效的 meta.quality_profile;(2) 节点重叠或越界;(3) 连线穿过节点及端点方向错误;(4) 交叉、含混的共享通道、贴边走线和转弯节奏;(5) 标签与节点、标签与标签、标签与连线的间距。每次修改后运行 validate,依据 diagnostics[] 的 code、subject、evidence 和 supportedFixes,每次只应用一项有诊断依据的几何控制。当前 schema 支持 via 时,它是按顺序排列的绝对 SVG [x, y] 中间点数组:路径为 [start, ...via, end],起终点由节点锚点提供。显式 via 会覆盖自动路由,不是偏移量,也不会请求自动绕障。修复正交走线时,相邻点应共享 x 或 y,首尾线段应遵守 fromSide/toSide;只使用当前模式支持的控制字段。视口预算遵循 references/delivery-contract.md:检查 1440×900、1600×1000、1920×1080 和 2048×1320,要求 document.documentElement.scrollWidth \u003c= window.innerWidth。优先满足 document.documentElement.scrollHeight \u003c= window.innerHeight;如果 visual-check 明确确认 Reader 已达到投影文字下限并接受可读的页面纵向滚动,则保留该滚动。预算覆盖整页,包括标题、主图和必要卡片。其他溢出先通过移除冗余内容或压缩间距修复,不得靠隐藏溢出、裁切、内部滚动区、拉伸 SVG 或缩小字体强行通过。在最大视口检查可读性和纵向平衡。验证后执行 deliver 并检查最终 HTML,如实报告浏览器证据和视觉检查结果。"},"signals":[["layout repair",20],["repair order",20],["fix order",20],["viewport overflow",20],["overflow",16],["scrollheight",16],["scrollwidth",16],["overlap",16],["label overlap",20],["edge through node",20],["crossing",8],["via",7],["waypoint",14],["布局修复",20],["修复顺序",20],["视口溢出",20],["溢出",16],["滚动高度",16],["滚动宽度",16],["重叠",16],["标签重叠",20],["连线穿过节点",20],["连线穿节点",20],["交叉",8],["途经点",14],["路径点",14],["拐点",14]]}]</script><script src="assets/site-language.js"></script><script>(function () {diff --git a/examples/checkout-platform-delta.html b/examples/checkout-platform-delta.htmlindex d1a58f89..ee980760 100644--- a/examples/checkout-platform-delta.html+++ b/examples/checkout-platform-delta.html@@ -16131,8 +16131,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -16148,8 +16148,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -16179,11 +16179,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};@@ -31608,8 +31608,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -31625,8 +31625,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -31656,11 +31656,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/examples/dataflow-product-analytics.html b/examples/dataflow-product-analytics.htmlindex cfa2ee9d..5121ce5b 100644--- a/examples/dataflow-product-analytics.html+++ b/examples/dataflow-product-analytics.html@@ -11370,8 +11370,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11387,8 +11387,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11418,11 +11418,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/examples/lifecycle-agent-run.html b/examples/lifecycle-agent-run.htmlindex 3ec60898..fe40254e 100644--- a/examples/lifecycle-agent-run.html+++ b/examples/lifecycle-agent-run.html@@ -11305,8 +11305,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11322,8 +11322,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11353,11 +11353,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/examples/sequence-cache-miss-request.html b/examples/sequence-cache-miss-request.htmlindex e041031e..ef9f36cc 100644--- a/examples/sequence-cache-miss-request.html+++ b/examples/sequence-cache-miss-request.html@@ -11385,8 +11385,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11402,8 +11402,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11433,11 +11433,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/examples/web-app-rendered.html b/examples/web-app-rendered.htmlindex 9ff7b527..50afafa8 100644--- a/examples/web-app-rendered.html+++ b/examples/web-app-rendered.html@@ -11334,8 +11334,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11351,8 +11351,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11382,11 +11382,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/examples/web-app.html b/examples/web-app.htmlindex 4d901dfb..50afafa8 100644--- a/examples/web-app.html+++ b/examples/web-app.html@@ -5167,7 +5167,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.<!-- Main Diagram --><div class="diagram-container" data-detail-level="read"data-preset-badge-editorial-plate="ARCHIFY / PLATE 04">- <svg viewBox="0 0 1080 588" role="img" lang="en" aria-labelledby="archify-diagram-title archify-diagram-description" data-preset="classic" data-quality-profile="showcase">+ <svg viewBox="0 0 1080 588" role="img" lang="en" aria-labelledby="archify-diagram-title archify-diagram-description" data-preset="classic" data-quality-profile="showcase" data-reader-fit="intrinsic-height"><title id="archify-diagram-title">Sample Web App</title><desc id="archify-diagram-description">An architecture diagram generated by Archify.</desc><!-- Definitions -->@@ -11334,8 +11334,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11351,8 +11351,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11382,11 +11382,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/examples/workflow-agent-tool-call-rendered.html b/examples/workflow-agent-tool-call-rendered.htmlindex 009fec9b..d0a6d66c 100644--- a/examples/workflow-agent-tool-call-rendered.html+++ b/examples/workflow-agent-tool-call-rendered.html@@ -11376,8 +11376,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -11393,8 +11393,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -11424,11 +11424,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};diff --git a/viewer/reader-layout.js b/viewer/reader-layout.jsindex c3a4ad10..5b63f8a8 100644--- a/viewer/reader-layout.js+++ b/viewer/reader-layout.js@@ -79,8 +79,8 @@number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)};}- function applyWidth(width) {- var rounded = Math.round(width);+ function applyWidth(width, minWidth) {+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));if (Math.abs(rounded - lastWidth) < 1) return false;lastWidth = rounded;html.style.setProperty('--archify-reader-width', rounded + 'px');@@ -96,8 +96,8 @@document.documentElement.scrollHeight,document.body.scrollHeight) - window.innerHeight;- if (overflow > 1 && lastWidth > minWidth) {- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);html.setAttribute('data-reader-overflow', 'reduced');} else if (overflow > 1) {html.setAttribute('data-reader-overflow', 'authored');@@ -127,11 +127,11 @@var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));- applyWidth(width);+ applyWidth(width, minWidth);settleOverflow(minWidth);return {ratio: ratio,- width: Math.round(width),+ width: lastWidth,availableSvgHeight: Math.round(availableSvgHeight),fixedHeight: Math.round(fixedHeight)};