Skip to content

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

fix(renderers): keep automatic routes clear and boundary composition readable (#96)

sunsunsun-java98648ce928d2
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cc4d4070..b5b3c28a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -45,6 +45,12 @@ jobs:
working-directory: archify
env:
ARCHIFY_CHROME: ${{ steps.setup-chrome.outputs.chrome-path }}
+ - name: Verify the real 1440x900 adaptive reader remains readable
+ run: node --test test/desktop-reader-browser.test.mjs
+ working-directory: archify
+ env:
+ ARCHIFY_CHROME: ${{ steps.setup-chrome.outputs.chrome-path }}
+ ARCHIFY_CHROME_NO_SANDBOX: '1'
zip-freshness:
runs-on: ubuntu-latest
diff --git a/archify.zip b/archify.zip
index 53b4980e..f3f1b4e2 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/assets/template.html b/archify/assets/template.html
index 02388157..20e1b360 100644
--- a/archify/assets/template.html
+++ b/archify/assets/template.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -10589,6 +10590,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10608,6 +10663,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/archify/bin/archify.mjs b/archify/bin/archify.mjs
index f3c43f73..13a782f9 100755
--- a/archify/bin/archify.mjs
+++ b/archify/bin/archify.mjs
@@ -190,6 +190,7 @@ const COMPOSITION_FIXES = {
'composition/ambiguous-corridor': ['adjust route/via or channel coordinates so unrelated relationships do not visually merge'],
'composition/container-border-run': ['route across the frame perpendicularly through a clear opening'],
'composition/label-route-clearance': ['adjust labelAt, labelDx, labelDy, labelSegment, message y, or the other relationship route'],
+ 'composition/desktop-readability': ['reduce the viewBox width, shorten node copy, widen affected nodes, or split the diagram so node context remains at least 6px at a 1440px desktop viewport'],
'composition/micro-segment': ['move the route/channel/via point so every visible segment is at least 8px'],
'composition/short-interior-segment': ['move the route/channel/via point so every interior turn has at least 16px'],
};
diff --git a/archify/bin/visual-check.mjs b/archify/bin/visual-check.mjs
index 97b59cfb..28a780b5 100644
--- a/archify/bin/visual-check.mjs
+++ b/archify/bin/visual-check.mjs
@@ -4,6 +4,7 @@ import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { pathToFileURL } from 'node:url';
+import { MIN_PROJECTED_NODE_TEXT_PX } from '../renderers/shared/desktop-readability.mjs';
export const VISUAL_CHECK_VIEWPORTS = Object.freeze([
Object.freeze({ width: 1440, height: 900 }),
@@ -18,6 +19,7 @@ const CAPTURE_VIEWPORTS = Object.freeze([
]);
const THEMES = Object.freeze(['light', 'dark']);
const EXIT = Object.freeze({ pass: 0, fail: 1, skipped: 2 });
+export const CHROME_NO_SANDBOX_ENV = 'ARCHIFY_CHROME_NO_SANDBOX';
function sha256(buffer) {
return createHash('sha256').update(buffer).digest('hex');
@@ -134,16 +136,33 @@ export function findChrome({ env = process.env, platform = process.platform } =
}
class PipeCdp {
- constructor(child) {
+ constructor(child, { failureDetails = () => '' } = {}) {
this.child = child;
+ this.failureDetails = failureDetails;
this.nextId = 1;
this.buffer = '';
this.pending = new Map();
this.waiters = [];
- child.stdio[4].setEncoding('utf8');
- child.stdio[4].on('data', (chunk) => this.consume(chunk));
- child.once('error', (error) => this.failAll(error));
- child.once('exit', (code) => this.failAll(new Error(`Chrome exited before visual-check completed (${code})`)));
+ this.writePipe = child.stdio[3];
+ this.readPipe = child.stdio[4];
+ this.readPipe.setEncoding('utf8');
+ this.readPipe.on('data', (chunk) => this.consume(chunk));
+ this.writePipe.on('error', (error) => this.failAll(this.failure('write pipe', error)));
+ this.readPipe.on('error', (error) => this.failAll(this.failure('read pipe', error)));
+ child.once('error', (error) => this.failAll(this.failure('process launch', error)));
+ child.once('close', (code, signal) => {
+ const ending = signal ? `signal ${signal}` : `exit code ${code}`;
+ this.failAll(this.failure('process exit', new Error(`Chrome closed with ${ending}`)));
+ });
+ }
+
+ failure(stage, error) {
+ const code = error?.code ? ` [${error.code}]` : '';
+ const details = this.failureDetails();
+ return new Error([
+ `Chrome DevTools ${stage} failed: ${error?.message || String(error)}${code}`,
+ details,
+ ].filter(Boolean).join('\n'));
}
consume(chunk) {
@@ -189,7 +208,13 @@ class PipeCdp {
reject(new Error(`${method}: timed out after ${timeoutMs}ms`));
}, timeoutMs);
this.pending.set(id, { method, resolve, reject, timer });
- this.child.stdio[3].write(`${JSON.stringify(message)}\0`);
+ try {
+ this.writePipe.write(`${JSON.stringify(message)}\0`, (error) => {
+ if (error) this.failAll(this.failure('write pipe', error));
+ });
+ } catch (error) {
+ this.failAll(this.failure('write pipe', error));
+ }
});
}
@@ -218,6 +243,35 @@ class PipeCdp {
}
}
+export function chromeVisualBrowserArgs(profileRoot, {
+ env = process.env,
+ getuid = typeof process.getuid === 'function' ? () => process.getuid() : null,
+} = {}) {
+ const args = [
+ '--headless=new',
+ '--remote-debugging-pipe',
+ '--disable-gpu',
+ '--hide-scrollbars',
+ '--disable-background-networking',
+ '--disable-component-update',
+ '--disable-default-apps',
+ '--disable-sync',
+ '--metrics-recording-only',
+ '--no-first-run',
+ '--no-default-browser-check',
+ '--disable-background-timer-throttling',
+ '--disable-backgrounding-occluded-windows',
+ '--disable-renderer-backgrounding',
+ '--force-device-scale-factor=1',
+ `--user-data-dir=${profileRoot}`,
+ 'about:blank',
+ ];
+ const rootUser = typeof getuid === 'function' && getuid() === 0;
+ const sandboxOptOut = env?.[CHROME_NO_SANDBOX_ENV] === '1';
+ if (rootUser || sandboxOptOut) args.unshift('--no-sandbox');
+ return args;
+}
+
async function evaluate(cdp, sessionId, expression, awaitPromise = false) {
const response = await cdp.send('Runtime.evaluate', {
expression,
@@ -232,36 +286,35 @@ async function evaluate(cdp, sessionId, expression, awaitPromise = false) {
return response.result?.value;
}
-class ChromeVisualBrowser {
- constructor(chromePath) {
+export class ChromeVisualBrowser {
+ constructor(chromePath, {
+ env = process.env,
+ getuid = typeof process.getuid === 'function' ? () => process.getuid() : null,
+ spawnImpl = spawn,
+ } = {}) {
this.profileRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-visual-check-profile-'));
- const args = [
- '--headless=new',
- '--remote-debugging-pipe',
- '--disable-gpu',
- '--hide-scrollbars',
- '--disable-background-networking',
- '--disable-component-update',
- '--disable-default-apps',
- '--disable-sync',
- '--metrics-recording-only',
- '--no-first-run',
- '--no-default-browser-check',
- '--disable-background-timer-throttling',
- '--disable-backgrounding-occluded-windows',
- '--disable-renderer-backgrounding',
- '--force-device-scale-factor=1',
- `--user-data-dir=${this.profileRoot}`,
- 'about:blank',
- ];
- if (typeof process.getuid === 'function' && process.getuid() === 0) args.unshift('--no-sandbox');
- this.child = spawn(chromePath, args, { stdio: ['ignore', 'ignore', 'pipe', 'pipe', 'pipe'] });
this.stderr = '';
+ const args = chromeVisualBrowserArgs(this.profileRoot, { env, getuid });
+ this.child = spawnImpl(chromePath, args, { stdio: ['ignore', 'ignore', 'pipe', 'pipe', 'pipe'] });
this.child.stderr.setEncoding('utf8');
this.child.stderr.on('data', (chunk) => {
this.stderr = `${this.stderr}${chunk}`.slice(-8000);
});
- this.cdp = new PipeCdp(this.child);
+ this.child.stderr.on('error', (error) => {
+ this.stderr = `${this.stderr}\nChrome stderr stream failed: ${error.message}`.trim().slice(-8000);
+ });
+ this.cdp = new PipeCdp(this.child, {
+ failureDetails: () => {
+ const exit = this.child.signalCode
+ ? `signal ${this.child.signalCode}`
+ : this.child.exitCode == null ? 'still running' : `exit code ${this.child.exitCode}`;
+ const stderr = this.stderr.trim();
+ return [
+ `Chrome process: ${exit}.`,
+ stderr ? `Chrome stderr:\n${stderr}` : '',
+ ].filter(Boolean).join('\n');
+ },
+ });
this.sessionPromise = this.attach();
}
@@ -296,20 +349,65 @@ class ChromeVisualBrowser {
const navigation = await this.cdp.send('Page.navigate', { url: url.href }, sessionId);
if (navigation.errorText) throw new Error(`Chrome navigation failed: ${navigation.errorText}`);
await loaded;
- await evaluate(this.cdp, sessionId, `new Promise(function (resolve) {
+ await evaluate(this.cdp, sessionId, `(function () {
document.documentElement.setAttribute('data-motion', 'still');
var panel = document.querySelector('.diagram-container');
if (panel) panel.setAttribute('data-detail-level', 'read');
- requestAnimationFrame(function () { requestAnimationFrame(resolve); });
- })`, true);
-
- const metrics = await evaluate(this.cdp, sessionId, `({
- innerWidth: window.innerWidth,
- innerHeight: window.innerHeight,
- scrollWidth: Math.ceil(document.documentElement.scrollWidth),
- scrollHeight: Math.ceil(document.documentElement.scrollHeight),
- resolvedTheme: document.documentElement.getAttribute('data-theme') || ''
- })`);
+ if (window.Archify && window.Archify.readerLayout && typeof window.Archify.readerLayout.whenStable === 'function') {
+ return window.Archify.readerLayout.whenStable();
+ }
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ return new Promise(function (resolve) {
+ requestAnimationFrame(function () { requestAnimationFrame(resolve); });
+ });
+ });
+ })()`, true);
+
+ const metrics = await evaluate(this.cdp, sessionId, `(function () {
+ var reader = document.querySelector('.container');
+ var diagram = document.querySelector('.diagram-container');
+ var svg = diagram && diagram.querySelector(':scope > svg');
+ var viewBox = svg && svg.viewBox && svg.viewBox.baseVal;
+ var diagramWidth = svg ? svg.getBoundingClientRect().width : 0;
+ var viewBoxWidth = viewBox ? viewBox.width : 0;
+ var scale = viewBoxWidth > 0 ? Math.min(1, diagramWidth / viewBoxWidth) : 0;
+ var minimum = null;
+ if (svg && scale > 0) {
+ Array.from(svg.querySelectorAll('text[data-node-label], text[data-boundary-label], text[data-detail="context"]')).forEach(function (text) {
+ var detail = text.hasAttribute('data-node-label')
+ ? 'primary'
+ : text.hasAttribute('data-boundary-label') ? 'boundary' : 'context';
+ if (detail === 'context' && !text.closest('[data-node-id]')) return;
+ var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
+ if (!Number.isFinite(sourceFontPx)) return;
+ var projectedFontPx = sourceFontPx * scale;
+ if (!minimum || projectedFontPx < minimum.projectedFontPx) {
+ minimum = {
+ text: (text.textContent || '').trim(),
+ detail: detail,
+ sourceFontPx: sourceFontPx,
+ projectedFontPx: projectedFontPx
+ };
+ }
+ });
+ }
+ return {
+ innerWidth: window.innerWidth,
+ innerHeight: window.innerHeight,
+ scrollWidth: Math.ceil(document.documentElement.scrollWidth),
+ scrollHeight: Math.ceil(document.documentElement.scrollHeight),
+ resolvedTheme: document.documentElement.getAttribute('data-theme') || '',
+ readerWidth: reader ? reader.getBoundingClientRect().width : 0,
+ diagramWidth: diagramWidth,
+ viewBoxWidth: viewBoxWidth,
+ minimumProjectedNodeTextPx: minimum ? minimum.projectedFontPx : null,
+ minimumProjectedNodeText: minimum ? minimum.text : null,
+ minimumProjectedNodeTextDetail: minimum ? minimum.detail : null
+ };
+ })()`);
if (!metrics || !Number.isFinite(metrics.scrollWidth) || !Number.isFinite(metrics.scrollHeight)) {
throw new Error('Chrome returned incomplete containment metrics.');
}
@@ -356,6 +454,11 @@ function observation({ width, height, theme, metrics }) {
const scrollHeight = Number(metrics.scrollHeight);
const overflowX = scrollWidth > innerWidth;
const overflowY = scrollHeight > innerHeight;
+ const minimumProjectedNodeTextPx = metrics.minimumProjectedNodeTextPx == null
+ ? null
+ : Number(metrics.minimumProjectedNodeTextPx);
+ const readabilityOk = minimumProjectedNodeTextPx == null
+ || minimumProjectedNodeTextPx >= MIN_PROJECTED_NODE_TEXT_PX;
return {
width,
height,
@@ -367,6 +470,14 @@ function observation({ width, height, theme, metrics }) {
overflowX,
overflowY,
ok: !overflowX && !overflowY,
+ readerWidth: Number(metrics.readerWidth) || null,
+ diagramWidth: Number(metrics.diagramWidth) || null,
+ viewBoxWidth: Number(metrics.viewBoxWidth) || null,
+ minimumProjectedNodeTextPx,
+ minimumProjectedNodeText: metrics.minimumProjectedNodeText || null,
+ minimumProjectedNodeTextDetail: metrics.minimumProjectedNodeTextDetail || null,
+ minimumRequiredNodeTextPx: MIN_PROJECTED_NODE_TEXT_PX,
+ readabilityOk,
resolvedTheme: metrics.resolvedTheme || theme,
};
}
@@ -411,6 +522,7 @@ function baseReceipt({ artifactPath, artifact, outputs, chrome }) {
state: { detail: 'read', motion: 'still' },
chrome,
containment: { status: 'fail', viewports: [] },
+ readability: { status: 'fail', minimumProjectedNodeTextPx: MIN_PROJECTED_NODE_TEXT_PX, viewports: [] },
captures: { status: 'fail', screenshots: [], contactSheet: null },
sidecars: {
receipt: path.basename(outputs.receipt),
@@ -450,6 +562,7 @@ export async function runVisualCheck({
if (!resolvedChrome) {
receipt.status = 'skipped';
receipt.containment.status = 'skipped';
+ receipt.readability.status = 'skipped';
receipt.captures.status = 'skipped';
receipt.error = 'Chrome or Chromium is unavailable. Set ARCHIFY_CHROME to its executable path.';
persistReceipt(outputs, receipt);
@@ -496,30 +609,34 @@ export async function runVisualCheck({
receipt.containment.viewports = VISUAL_CHECK_VIEWPORTS.map(({ width, height }) => (
observations.get(screenshotKey(width, height, 'light'))
));
+ receipt.readability.viewports = receipt.containment.viewports.map((entry) => ({ ...entry }));
receipt.captures.screenshots = outputs.screenshots.map((entry) => ({
...observations.get(screenshotKey(entry.width, entry.height, entry.theme)),
file: path.basename(entry.path),
}));
const allObservations = [...observations.values()];
const containmentPass = allObservations.every((entry) => entry.ok);
+ const readabilityPass = receipt.readability.viewports.every((entry) => entry.readabilityOk);
receipt.containment.status = containmentPass ? 'pass' : 'fail';
+ receipt.readability.status = readabilityPass ? 'pass' : 'fail';
receipt.captures.status = 'pass';
receipt.captures.contactSheet = path.basename(outputs.contactSheet);
- receipt.status = containmentPass ? 'pass' : 'fail';
- receipt.ok = containmentPass;
+ receipt.status = containmentPass && readabilityPass ? 'pass' : 'fail';
+ receipt.ok = containmentPass && readabilityPass;
writeAtomic(outputs.contactSheet, contactSheetHtml({
artifactPath: artifact,
receipt,
screenshots: receipt.captures.screenshots,
}));
persistReceipt(outputs, receipt);
- return { exitCode: containmentPass ? EXIT.pass : EXIT.fail, receipt };
+ return { exitCode: receipt.ok ? EXIT.pass : EXIT.fail, receipt };
} catch (error) {
cleanupCaptureSidecars(outputs);
receipt.status = 'fail';
receipt.ok = false;
receipt.error = error.message;
receipt.containment.status = 'fail';
+ receipt.readability.status = 'fail';
receipt.captures.status = 'fail';
receipt.captures.screenshots = [];
receipt.captures.contactSheet = null;
diff --git a/archify/delta/architecture-delta.mjs b/archify/delta/architecture-delta.mjs
index 094bcd53..6b63b4dd 100644
--- a/archify/delta/architecture-delta.mjs
+++ b/archify/delta/architecture-delta.mjs
@@ -417,22 +417,50 @@ function transformNodeGroups(svg, transform) {
return parts.join('');
}
-const BOUNDARY_PAIR_RE = /<rect data-graph-role="structural-frame"[^>]*data-composition-frame-kind="([^"]+)"[^>]*\/>\s*<text[^>]*>([^<]+)<\/text>/g;
+const BOUNDARY_FRAME_RE = /<rect data-graph-role="structural-frame"[^>]*data-composition-frame-kind="([^"]+)"[^>]*data-composition-frame-label="([^"]+)"[^>]*\/>/g;
+const BOUNDARY_LABEL_RE = /<g data-graph-role="structural-frame-label"[^>]*data-composition-frame-kind="([^"]+)"[^>]*data-composition-frame-label="([^"]+)"[^>]*>[\s\S]*?<\/g>/g;
+
+function boundaryElements(svg) {
+ const collect = (pattern, part) => [...svg.matchAll(pattern)].map((match) => ({
+ start: match.index,
+ end: match.index + match[0].length,
+ markup: match[0],
+ key: `${match[1]}:${match[2]}`,
+ part,
+ }));
+ return [
+ ...collect(BOUNDARY_FRAME_RE, 'frame'),
+ ...collect(BOUNDARY_LABEL_RE, 'label'),
+ ].sort((left, right) => left.start - right.start);
+}
-function transformBoundaryPairs(svg, transform) {
- return svg.replace(BOUNDARY_PAIR_RE, (pair, kind, label) => transform(pair, `${kind}:${label}`));
+function transformBoundaryElements(svg, transform) {
+ let cursor = 0;
+ const parts = [];
+ for (const element of boundaryElements(svg)) {
+ parts.push(svg.slice(cursor, element.start));
+ parts.push(transform(element.markup, element.key, element.part));
+ cursor = element.end;
+ }
+ parts.push(svg.slice(cursor));
+ return parts.join('');
}
export function annotateArchitectureSideSvg(svg, receipt, side) {
const nodes = changeMap(receipt.changes.components);
const edges = changeMap(receipt.changes.connections);
const boundaries = boundaryChangeMap(receipt.changes.boundaries);
- let result = transformBoundaryPairs(svg, (pair, key) => {
+ let result = transformBoundaryElements(svg, (markup, key, part) => {
const change = boundaries.get(key);
- if (!change) return pair;
- return pair
- .replace(/^<rect[^>]+\/>/, (tag) => addState(tag, change, side).replace(/\/>$/, ` data-delta-boundary-key="${esc(change.key)}"/>`))
- .replace(/<text[^>]*>/, (tag) => tag.replace(/>$/, ` data-delta-state="${change.status}" data-delta-boundary-state="${change.status}" data-delta-boundary-key="${esc(change.key)}">`));
+ if (!change) return markup;
+ if (part === 'frame') {
+ return addState(markup, change, side)
+ .replace(/\/>$/, ` data-delta-boundary-key="${esc(change.key)}"/>`);
+ }
+ return markup.replace(
+ /<text[^>]*>/,
+ (tag) => tag.replace(/>$/, ` data-delta-state="${change.status}" data-delta-boundary-state="${change.status}" data-delta-boundary-key="${esc(change.key)}">`),
+ );
});
result = transformNodeGroups(result, (group, id) => {
const change = nodes.get(id);
@@ -469,16 +497,27 @@ function forceElementState(markup, state, classifications = []) {
return result;
}
-function boundaryPairByKey(svg, key) {
- for (const match of svg.matchAll(BOUNDARY_PAIR_RE)) {
- if (`${match[1]}:${match[2]}` === key) return match[0];
- }
- return '';
+function boundaryMarkupByKey(svg, key) {
+ return boundaryElements(svg)
+ .filter((element) => element.key === key)
+ .map((element) => element.markup)
+ .join('\n');
+}
+
+function boundaryMarkupParts(markup) {
+ const parts = { frame: '', label: '' };
+ for (const element of boundaryElements(markup)) parts[element.part] = element.markup;
+ return parts;
}
function forceBoundaryState(markup, state, key, classifications = []) {
return markup
.replace(/^<rect[^>]+\/>/, (tag) => addState(tag, { classifications }, 'delta', state).replace(/\/>$/, ` data-delta-boundary-key="${esc(key)}"/>`))
+ .replace(
+ /<rect data-graph-role="structural-frame-label-mask"[^>]*\/>/,
+ (tag) => addState(tag, { classifications }, 'delta', state)
+ .replace(/\/>$/, ` data-delta-boundary-state="${state}" data-delta-boundary-mask-key="${esc(key)}"/>`),
+ )
.replace(/<text[^>]*>/, (tag) => tag.replace(/>$/, ` data-delta-state="${state}" data-delta-boundary-state="${state}" data-delta-boundary-key="${esc(key)}">`));
}
@@ -512,7 +551,8 @@ export function buildDeltaSvg(baseSvg, headSvg, receipt) {
const boundaries = boundaryChangeMap(receipt.changes.boundaries);
const baseNodePhantoms = [];
const baseEdgePhantoms = [];
- const baseBoundaryPhantoms = [];
+ const baseBoundaryFramePhantoms = [];
+ const baseBoundaryLabelPhantoms = [];
const edgeMarkers = [];
const boundaryMarkers = [];
@@ -534,20 +574,25 @@ export function buildDeltaSvg(baseSvg, headSvg, receipt) {
for (const change of boundaries.values()) {
const renderedKey = `${change.kind}:${esc(change.label)}`;
if (change.status === 'removed') {
- const phantom = forceBoundaryState(boundaryPairByKey(baseSvg, renderedKey), 'removed', change.key, change.classifications);
- baseBoundaryPhantoms.push(phantom);
+ const phantom = forceBoundaryState(boundaryMarkupByKey(baseSvg, renderedKey), 'removed', change.key, change.classifications);
+ const parts = boundaryMarkupParts(phantom);
+ baseBoundaryFramePhantoms.push(parts.frame);
+ baseBoundaryLabelPhantoms.push(parts.label);
boundaryMarkers.push(boundarySymbolMarkup(phantom, 'removed'));
}
else if (change.status === 'changed' || change.status === 'geometry-changed') {
- baseBoundaryPhantoms.push(forceBoundaryState(boundaryPairByKey(baseSvg, renderedKey), 'moved-from', change.key, change.classifications));
+ const phantom = forceBoundaryState(boundaryMarkupByKey(baseSvg, renderedKey), 'moved-from', change.key, change.classifications);
+ const parts = boundaryMarkupParts(phantom);
+ baseBoundaryFramePhantoms.push(parts.frame);
+ baseBoundaryLabelPhantoms.push(parts.label);
}
}
let delta = annotateArchitectureSideSvg(headSvg, receipt, 'head');
delta = delta.replace(/^<svg[^>]+>/, (tag) => tag.replace(/viewBox="[^"]+"/, `viewBox="0 0 ${Math.max(baseW, headW) + 24} ${Math.max(baseH, headH) + 24}"`));
- delta = delta.replace(' <!-- Boundaries (behind everything) -->', ` <!-- Baseline boundary phantoms -->\n${baseBoundaryPhantoms.join('\n')}\n\n <!-- Boundaries (behind everything) -->`);
+ delta = delta.replace(' <!-- Boundaries (behind everything) -->', ` <!-- Baseline boundary frame phantoms -->\n${baseBoundaryFramePhantoms.filter(Boolean).join('\n')}\n\n <!-- Boundaries (behind everything) -->`);
delta = delta.replace(' <!-- Connection paths (before components for correct z-order) -->', ` <!-- Baseline relationship phantoms -->\n${baseEdgePhantoms.join('\n')}\n\n <!-- Connection paths (before components for correct z-order) -->`);
- delta = delta.replace(' <!-- Components -->', ` <!-- Baseline removed and move-from component phantoms -->\n${baseNodePhantoms.join('\n')}\n\n <!-- Components -->`);
+ delta = delta.replace(' <!-- Components -->', ` <!-- Baseline boundary label phantoms (below current components) -->\n${baseBoundaryLabelPhantoms.filter(Boolean).join('\n')}\n\n <!-- Baseline removed and move-from component phantoms -->\n${baseNodePhantoms.join('\n')}\n\n <!-- Components -->`);
for (const change of edges.values()) {
if (change.status === 'added' || change.status === 'changed' || change.status === 'rerouted') {
@@ -558,7 +603,7 @@ export function buildDeltaSvg(baseSvg, headSvg, receipt) {
for (const change of boundaries.values()) {
if (!['added', 'changed', 'geometry-changed'].includes(change.status)) continue;
const renderedKey = `${change.kind}:${esc(change.label)}`;
- boundaryMarkers.push(boundarySymbolMarkup(boundaryPairByKey(delta, renderedKey), change.status));
+ boundaryMarkers.push(boundarySymbolMarkup(boundaryMarkupByKey(delta, renderedKey), change.status));
}
delta = delta.replace(' <!-- Legend -->', ` <!-- Delta relationship symbols -->\n${edgeMarkers.filter(Boolean).join('\n')}\n\n <!-- Delta boundary symbols -->\n${boundaryMarkers.filter(Boolean).join('\n')}\n\n <!-- Legend -->`);
return prefixSvgIds(staticize(delta), 'delta');
diff --git a/archify/examples/dataflow-product-analytics.html b/archify/examples/dataflow-product-analytics.html
index f34dbc3e..57e151b0 100644
--- a/archify/examples/dataflow-product-analytics.html
+++ b/archify/examples/dataflow-product-analytics.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4976,7 +4977,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="100" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Web App</text>
+ <text data-node-label data-detail-anchor x="100" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Web App</text>
<text data-detail="context" x="100" y="165" class="t-muted" font-size="7" text-anchor="middle">browser SDK</text>
<text data-detail="fine" x="100" y="175" class="t-frontend" font-size="7" text-anchor="middle">events</text>
</g>
@@ -4991,7 +4992,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="100" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Mobile</text>
+ <text data-node-label data-detail-anchor x="100" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Mobile</text>
<text data-detail="context" x="100" y="393" class="t-muted" font-size="7" text-anchor="middle">iOS / Android</text>
<text data-detail="fine" x="100" y="403" class="t-frontend" font-size="7" text-anchor="middle">events</text>
</g>
@@ -5003,7 +5004,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(265 248) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Edge API</text>
+ <text data-node-label data-detail-anchor x="315" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Edge API</text>
<text data-detail="context" x="315" y="279" class="t-muted" font-size="7" text-anchor="middle">collector</text>
<text data-detail="fine" x="315" y="289" class="t-cloud" font-size="7" text-anchor="middle">TLS</text>
</g>
@@ -5016,7 +5017,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="530" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Consent Gate</text>
+ <text data-node-label data-detail-anchor x="530" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Consent Gate</text>
<text data-detail="context" x="530" y="165" class="t-muted" font-size="7" text-anchor="middle">policy filter</text>
<text data-detail="fine" x="530" y="175" class="t-security" font-size="7" text-anchor="middle">PII guard</text>
</g>
@@ -5031,7 +5032,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="530" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Event Stream</text>
+ <text data-node-label data-detail-anchor x="530" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Event Stream</text>
<text data-detail="context" x="530" y="393" class="t-muted" font-size="7" text-anchor="middle">Kafka topic</text>
<text data-detail="fine" x="530" y="403" class="t-messagebus" font-size="7" text-anchor="middle">ordered</text>
</g>
@@ -5044,7 +5045,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="745" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">PII Vault</text>
+ <text data-node-label data-detail-anchor x="745" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">PII Vault</text>
<text data-detail="context" x="745" y="165" class="t-muted" font-size="7" text-anchor="middle">encrypted</text>
<text data-detail="fine" x="745" y="175" class="t-security" font-size="7" text-anchor="middle">restricted</text>
</g>
@@ -5057,7 +5058,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="745" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Warehouse</text>
+ <text data-node-label data-detail-anchor x="745" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Warehouse</text>
<text data-detail="context" x="745" y="393" class="t-muted" font-size="7" text-anchor="middle">analytics tables</text>
<text data-detail="fine" x="745" y="403" class="t-database" font-size="7" text-anchor="middle">curated</text>
</g>
@@ -5070,7 +5071,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="745" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Feature Store</text>
+ <text data-node-label data-detail-anchor x="745" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Feature Store</text>
<text data-detail="context" x="745" y="621" class="t-muted" font-size="7" text-anchor="middle">daily batch</text>
<text data-detail="fine" x="745" y="631" class="t-database" font-size="7" text-anchor="middle">derived</text>
</g>
@@ -5082,7 +5083,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(910 248) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="960" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Dashboards</text>
+ <text data-node-label data-detail-anchor x="960" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Dashboards</text>
<text data-detail="context" x="960" y="279" class="t-muted" font-size="7" text-anchor="middle">product metrics</text>
<text data-detail="fine" x="960" y="289" class="t-backend" font-size="7" text-anchor="middle">SQL</text>
</g>
@@ -5094,7 +5095,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(910 590) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="960" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">ML Model</text>
+ <text data-node-label data-detail-anchor x="960" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">ML Model</text>
<text data-detail="context" x="960" y="621" class="t-muted" font-size="7" text-anchor="middle">ranking job</text>
<text data-detail="fine" x="960" y="631" class="t-backend" font-size="7" text-anchor="middle">features</text>
</g>
@@ -10700,6 +10701,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10719,6 +10774,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/archify/examples/lifecycle-agent-run.html b/archify/examples/lifecycle-agent-run.html
index 24b0d269..3200c804 100644
--- a/archify/examples/lifecycle-agent-run.html
+++ b/archify/examples/lifecycle-agent-run.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4966,7 +4967,7 @@
<path d="m7 5.4 3.6 2.6L7 10.6Z" class="sigil-fill"/>
</g>
<text data-detail="fine" x="45" y="140" class="t-frontend" font-size="7" font-weight="700">01</text>
- <text data-detail-anchor x="94" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Queued</text>
+ <text data-node-label data-detail-anchor x="94" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Queued</text>
<text data-detail="context" x="94" y="163" class="t-muted" font-size="7" text-anchor="middle">request accepted</text>
<text data-detail="fine" x="94" y="177" class="t-frontend" font-size="7" text-anchor="middle">entry</text>
</g>
@@ -4979,7 +4980,7 @@
<path d="M2 8h3l1.5-3.5L9 12l1.6-4H14"/>
</g>
<text data-detail="fine" x="199" y="140" class="t-backend" font-size="7" font-weight="700">02</text>
- <text data-detail-anchor x="248" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Planning</text>
+ <text data-node-label data-detail-anchor x="248" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Planning</text>
<text data-detail="context" x="248" y="163" class="t-muted" font-size="7" text-anchor="middle">build task graph</text>
<text data-detail="fine" x="248" y="177" class="t-backend" font-size="7" text-anchor="middle">model</text>
</g>
@@ -4992,7 +4993,7 @@
<path d="M2 8h3l1.5-3.5L9 12l1.6-4H14"/>
</g>
<text data-detail="fine" x="353" y="140" class="t-backend" font-size="7" font-weight="700">03</text>
- <text data-detail-anchor x="402" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Executing</text>
+ <text data-node-label data-detail-anchor x="402" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Executing</text>
<text data-detail="context" x="402" y="163" class="t-muted" font-size="7" text-anchor="middle">tool calls</text>
<text data-detail="fine" x="402" y="177" class="t-backend" font-size="7" text-anchor="middle">work</text>
</g>
@@ -5006,7 +5007,7 @@
<circle cx="8" cy="8" r="1.2" class="sigil-fill"/>
</g>
<text data-detail="fine" x="507" y="140" class="t-security" font-size="7" font-weight="700">04</text>
- <text data-detail-anchor x="556" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Reviewing</text>
+ <text data-node-label data-detail-anchor x="556" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Reviewing</text>
<text data-detail="context" x="556" y="163" class="t-muted" font-size="7" text-anchor="middle">quality gate</text>
<text data-detail="fine" x="556" y="177" class="t-security" font-size="7" text-anchor="middle">check</text>
</g>
@@ -5020,7 +5021,7 @@
<path d="m5.2 8 1.8 1.8 3.8-4"/>
</g>
<text data-detail="fine" x="661" y="140" class="t-database" font-size="7" font-weight="700">05</text>
- <text data-detail-anchor x="710" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Completed</text>
+ <text data-node-label data-detail-anchor x="710" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Completed</text>
<text data-detail="context" x="710" y="163" class="t-muted" font-size="7" text-anchor="middle">final response</text>
<text data-detail="fine" x="710" y="177" class="t-database" font-size="7" text-anchor="middle">done</text>
</g>
@@ -5032,7 +5033,7 @@
<g aria-hidden="true" data-semantic-sigil="waiting" class="semantic-sigil s-cloud" transform="translate(448 284) scale(0.6875)">
<path d="M4 2.5h8M4 13.5h8M5 3c0 2.8 2 3.2 3 5-1 1.8-3 2.2-3 5M11 3c0 2.8-2 3.2-3 5 1 1.8 3 2.2 3 5"/>
</g>
- <text data-detail-anchor x="402" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Needs Approval</text>
+ <text data-node-label data-detail-anchor x="402" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Needs Approval</text>
<text data-detail="context" x="402" y="315" class="t-muted" font-size="7" text-anchor="middle">human gate</text>
<text data-detail="fine" x="402" y="325" class="t-cloud" font-size="7" text-anchor="middle">pause</text>
</g>
@@ -5044,7 +5045,7 @@
<g aria-hidden="true" data-semantic-sigil="waiting" class="semantic-sigil s-cloud" transform="translate(602 284) scale(0.6875)">
<path d="M4 2.5h8M4 13.5h8M5 3c0 2.8 2 3.2 3 5-1 1.8-3 2.2-3 5M11 3c0 2.8-2 3.2-3 5 1 1.8 3 2.2 3 5"/>
</g>
- <text data-detail-anchor x="556" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Blocked</text>
+ <text data-node-label data-detail-anchor x="556" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Blocked</text>
<text data-detail="context" x="556" y="315" class="t-muted" font-size="7" text-anchor="middle">missing input</text>
<text data-detail="fine" x="556" y="325" class="t-cloud" font-size="7" text-anchor="middle">wait</text>
</g>
@@ -5057,7 +5058,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="402" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Failed</text>
+ <text data-node-label data-detail-anchor x="402" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Failed</text>
<text data-detail="context" x="402" y="393" class="t-muted" font-size="7" text-anchor="middle">recoverable error</text>
<text data-detail="fine" x="402" y="403" class="t-security" font-size="7" text-anchor="middle">retryable</text>
</g>
@@ -5070,7 +5071,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="402" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Cancelled</text>
+ <text data-node-label data-detail-anchor x="402" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Cancelled</text>
<text data-detail="context" x="402" y="487" class="t-muted" font-size="7" text-anchor="middle">user stopped</text>
<text data-detail="fine" x="402" y="497" class="t-security" font-size="7" text-anchor="middle">terminal</text>
</g>
@@ -5083,7 +5084,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="556" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Expired</text>
+ <text data-node-label data-detail-anchor x="556" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Expired</text>
<text data-detail="context" x="556" y="487" class="t-muted" font-size="7" text-anchor="middle">timeout</text>
<text data-detail="fine" x="556" y="497" class="t-security" font-size="7" text-anchor="middle">terminal</text>
</g>
@@ -10649,6 +10650,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10668,6 +10723,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/archify/examples/production-deployment.architecture.json b/archify/examples/production-deployment.architecture.json
index 91507689..472cb83e 100644
--- a/archify/examples/production-deployment.architecture.json
+++ b/archify/examples/production-deployment.architecture.json
@@ -38,14 +38,14 @@
{ "id": "redis", "type": "database", "label": "Redis", "sublabel": "multi-AZ cache", "pos": [840, 195], "size": [126, 62], "tag": "platform" },
{ "id": "postgres", "type": "database", "label": "PostgreSQL", "sublabel": "primary / encrypted", "pos": [840, 405], "size": [126, 62], "tag": "data team" },
{ "id": "events", "type": "messagebus", "label": "Event Bus", "sublabel": "orders.v1", "pos": [1040, 300], "size": [126, 60], "tag": "platform" },
- { "id": "worker", "type": "backend", "label": "Workers", "sublabel": "private workload", "pos": [1240, 300], "size": [126, 60], "tag": "app team" },
- { "id": "replica", "type": "database", "label": "DR Replica", "sublabel": "eu-west-1", "pos": [1040, 610], "size": [126, 62], "tag": "data team" },
- { "id": "audit", "type": "cloud", "label": "Audit Archive", "sublabel": "immutable objects", "pos": [1240, 465], "size": [126, 62], "tag": "security" },
- { "id": "observability", "type": "external", "label": "Observability", "sublabel": "metrics + traces", "pos": [1240, 85], "size": [126, 62], "tag": "SRE" }
+ { "id": "worker", "type": "backend", "label": "Workers", "sublabel": "private workload", "pos": [1190, 300], "size": [126, 60], "tag": "app team" },
+ { "id": "replica", "type": "database", "label": "DR Replica", "sublabel": "eu-west-1", "pos": [1040, 578], "size": [126, 62], "tag": "data team" },
+ { "id": "audit", "type": "cloud", "label": "Audit Archive", "sublabel": "immutable objects", "pos": [1190, 450], "size": [126, 62], "tag": "security" },
+ { "id": "observability", "type": "external", "label": "Observability", "sublabel": "metrics + traces", "pos": [1190, 85], "size": [126, 62], "tag": "SRE" }
],
"boundaries": [
- { "kind": "region", "label": "AWS us-east-1 / production", "wraps": ["edge", "gateway", "api_a", "api_b", "redis", "postgres", "events", "worker", "audit"] },
- { "kind": "security-group", "label": "private application network", "wraps": ["api_a", "api_b", "redis", "postgres", "events", "worker"] },
+ { "kind": "region", "label": "AWS us-east-1 / production", "wraps": ["edge", "gateway", "api_a", "api_b", "redis", "postgres", "events", "worker", "audit"], "pad": 20 },
+ { "kind": "security-group", "label": "private application network", "wraps": ["api_a", "api_b", "redis", "postgres", "events", "worker"], "pad": 14 },
{ "kind": "region", "label": "AWS eu-west-1 / disaster recovery", "wraps": ["replica"] },
{ "kind": "security-group", "label": "DR private subnet", "wraps": ["replica"], "pad": 14 }
],
diff --git a/archify/examples/sequence-cache-miss-request.html b/archify/examples/sequence-cache-miss-request.html
index 1427c2b0..ae9d189f 100644
--- a/archify/examples/sequence-cache-miss-request.html
+++ b/archify/examples/sequence-cache-miss-request.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -5087,7 +5088,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="62" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
+ <text data-node-label data-detail-anchor x="62" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
<text data-detail="context" x="62" y="111" class="t-muted" font-size="7" text-anchor="middle">browser session</text>
</g>
@@ -5101,7 +5102,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="170" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Web App</text>
+ <text data-node-label data-detail-anchor x="170" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Web App</text>
<text data-detail="context" x="170" y="111" class="t-muted" font-size="7" text-anchor="middle">React UI</text>
</g>
@@ -5112,7 +5113,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(241 78) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="278" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API</text>
+ <text data-node-label data-detail-anchor x="278" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API</text>
<text data-detail="context" x="278" y="111" class="t-muted" font-size="7" text-anchor="middle">request handler</text>
</g>
@@ -5124,7 +5125,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="386" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth</text>
+ <text data-node-label data-detail-anchor x="386" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth</text>
<text data-detail="context" x="386" y="111" class="t-muted" font-size="7" text-anchor="middle">JWT verify</text>
</g>
@@ -5136,7 +5137,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="494" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
+ <text data-node-label data-detail-anchor x="494" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
<text data-detail="context" x="494" y="111" class="t-muted" font-size="7" text-anchor="middle">cache</text>
</g>
@@ -5148,7 +5149,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="602" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Postgres</text>
+ <text data-node-label data-detail-anchor x="602" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Postgres</text>
<text data-detail="context" x="602" y="111" class="t-muted" font-size="7" text-anchor="middle">source of truth</text>
</g>
@@ -5162,7 +5163,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="710" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace</text>
+ <text data-node-label data-detail-anchor x="710" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace</text>
<text data-detail="context" x="710" y="111" class="t-muted" font-size="7" text-anchor="middle">async event</text>
</g>
@@ -10715,6 +10716,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10734,6 +10789,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/archify/examples/web-app-rendered.html b/archify/examples/web-app-rendered.html
index 62b289f1..7bc5a4f8 100644
--- a/archify/examples/web-app-rendered.html
+++ b/archify/examples/web-app-rendered.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4938,11 +4939,9 @@
<rect width="100%" height="100%" fill="url(#grid)" />
<!-- Boundaries (behind everything) -->
- <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="220" y="120" width="820" height="400" rx="12" class="c-region" stroke-width="1"/>
- <text x="228" y="138" class="t-cloud" font-size="9" font-weight="600">AWS Region: us-west-2</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="AWS Region: us-west-2" x="220" y="120" width="820" height="400" rx="12" class="c-region" stroke-width="1"/>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="430" y="270" width="400" height="110" rx="8" class="c-security-group" stroke-width="1"/>
- <text x="438" y="288" class="t-security" font-size="9" font-weight="600">sg-api :443/:8000</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" data-composition-frame-label="sg-api :443/:8000" x="430" y="270" width="400" height="110" rx="8" class="c-security-group" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
<path data-edge-from="users" data-edge-to="cdn" data-edge-label="HTTPS" data-edge-key="0" data-edge-id="users-to-cdn" data-composition-points="160,330;250,330" d="M 160 330 L 250 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
@@ -4964,7 +4963,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="100" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Users</text>
+ <text data-node-label data-detail-anchor x="100" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Users</text>
<text data-detail="context" x="100" y="344" class="t-muted" font-size="9" text-anchor="middle">Browser / Mobile</text>
</g>
@@ -4976,7 +4975,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="100" y="140" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>
+ <text data-node-label data-detail-anchor x="100" y="140" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>
<text data-detail="context" x="100" y="156" class="t-muted" font-size="9" text-anchor="middle">OAuth 2.0</text>
<text data-detail="fine" x="100" y="166" class="t-security" font-size="7" text-anchor="middle">JWT + PKCE</text>
</g>
@@ -4988,7 +4987,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(256 306) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>
+ <text data-node-label data-detail-anchor x="315" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>
<text data-detail="context" x="315" y="344" class="t-muted" font-size="9" text-anchor="middle">CDN</text>
</g>
@@ -4999,7 +4998,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(466 306) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="525" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>
+ <text data-node-label data-detail-anchor x="525" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>
<text data-detail="context" x="525" y="344" class="t-muted" font-size="9" text-anchor="middle">HTTPS :443</text>
</g>
@@ -5010,7 +5009,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(676 306) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="735" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>
+ <text data-node-label data-detail-anchor x="735" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>
<text data-detail="context" x="735" y="344" class="t-muted" font-size="9" text-anchor="middle">FastAPI :8000</text>
</g>
@@ -5022,7 +5021,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="735" y="178" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
+ <text data-node-label data-detail-anchor x="735" y="178" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
<text data-detail="context" x="735" y="194" class="t-muted" font-size="9" text-anchor="middle">cache :6379</text>
</g>
@@ -5034,7 +5033,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="945" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">PostgreSQL</text>
+ <text data-node-label data-detail-anchor x="945" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">PostgreSQL</text>
<text data-detail="context" x="945" y="344" class="t-muted" font-size="9" text-anchor="middle">primary :5432</text>
</g>
@@ -5045,7 +5044,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(256 446) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">S3</text>
+ <text data-node-label data-detail-anchor x="315" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">S3</text>
<text data-detail="context" x="315" y="484" class="t-muted" font-size="9" text-anchor="middle">static assets</text>
<text data-detail="fine" x="315" y="492" class="t-cloud" font-size="7" text-anchor="middle">OAI protected</text>
</g>
@@ -5060,7 +5059,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="735" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SQS</text>
+ <text data-node-label data-detail-anchor x="735" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SQS</text>
<text data-detail="context" x="735" y="484" class="t-muted" font-size="9" text-anchor="middle">job queue</text>
</g>
@@ -5071,7 +5070,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(886 446) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="945" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Worker</text>
+ <text data-node-label data-detail-anchor x="945" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Worker</text>
<text data-detail="context" x="945" y="484" class="t-muted" font-size="9" text-anchor="middle">async jobs</text>
</g>
@@ -5104,6 +5103,17 @@
</g>
+ <!-- Boundary labels (foreground masks keep routes out of titles) -->
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="0" data-composition-frame-kind="region" data-composition-frame-label="AWS Region: us-west-2">
+ <rect data-graph-role="structural-frame-label-mask" x="224" y="130" width="123.39999999999999" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="228" y="143" class="t-cloud" font-size="9" font-weight="600">AWS Region: us-west-2</text>
+ </g>
+
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="1" data-composition-frame-kind="security-group" data-composition-frame-label="sg-api :443/:8000">
+ <rect data-graph-role="structural-frame-label-mask" x="434" y="280" width="101.8" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="438" y="293" class="t-security" font-size="9" font-weight="600">sg-api :443/:8000</text>
+ </g>
+
<!-- Legend -->
<g data-legend data-legend-bridge>
<text x="40" y="552" class="t-primary" font-size="12" font-weight="650">Legend</text>
@@ -10655,6 +10665,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10674,6 +10738,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/archify/examples/workflow-agent-tool-call-rendered.html b/archify/examples/workflow-agent-tool-call-rendered.html
index ee020383..bc6acb85 100644
--- a/archify/examples/workflow-agent-tool-call-rendered.html
+++ b/archify/examples/workflow-agent-tool-call-rendered.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4998,7 +4999,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
+ <text data-node-label data-detail-anchor x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
<text data-detail="context" x="88" y="131" class="t-muted" font-size="8" text-anchor="middle">asks for work</text>
</g>
@@ -5012,7 +5013,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="220" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Chat Surface</text>
+ <text data-node-label data-detail-anchor x="220" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Chat Surface</text>
<text data-detail="context" x="220" y="131" class="t-muted" font-size="8" text-anchor="middle">thread + files</text>
</g>
@@ -5023,7 +5024,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(585 99) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="625" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Final Reply</text>
+ <text data-node-label data-detail-anchor x="625" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Final Reply</text>
<text data-detail="context" x="625" y="131" class="t-muted" font-size="8" text-anchor="middle">answer + changes</text>
</g>
@@ -5034,7 +5035,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(260 215) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="300" y="230" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Agent Planner</text>
+ <text data-node-label data-detail-anchor x="300" y="230" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Agent Planner</text>
<text data-detail="context" x="300" y="247" class="t-muted" font-size="8" text-anchor="middle">plan next step</text>
<text data-detail="fine" x="300" y="265" class="t-backend" font-size="7" text-anchor="middle">context aware</text>
</g>
@@ -5046,7 +5047,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(390 223) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="430" y="238" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Router</text>
+ <text data-node-label data-detail-anchor x="430" y="238" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Router</text>
<text data-detail="context" x="430" y="255" class="t-muted" font-size="8" text-anchor="middle">choose capability</text>
</g>
@@ -5058,7 +5059,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="430" y="354" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Approval Gate</text>
+ <text data-node-label data-detail-anchor x="430" y="354" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Approval Gate</text>
<text data-detail="context" x="430" y="371" class="t-muted" font-size="8" text-anchor="middle">scope + consent</text>
<text data-detail="fine" x="430" y="389" class="t-security" font-size="7" text-anchor="middle">block risky ops</text>
</g>
@@ -5071,7 +5072,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="500" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Blocked</text>
+ <text data-node-label data-detail-anchor x="500" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Blocked</text>
<text data-detail="context" x="500" y="503" class="t-muted" font-size="8" text-anchor="middle">wait or reject</text>
</g>
@@ -5085,7 +5086,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="625" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Retry Path</text>
+ <text data-node-label data-detail-anchor x="625" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Retry Path</text>
<text data-detail="context" x="625" y="503" class="t-muted" font-size="8" text-anchor="middle">revise request</text>
</g>
@@ -5099,7 +5100,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="500" y="602" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Call</text>
+ <text data-node-label data-detail-anchor x="500" y="602" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Call</text>
<text data-detail="context" x="500" y="619" class="t-muted" font-size="6.6" text-anchor="middle">shell / browser / MCP</text>
<text data-detail="fine" x="500" y="637" class="t-messagebus" font-size="7" text-anchor="middle">structured result</text>
</g>
@@ -5111,7 +5112,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(585 595) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">External API</text>
+ <text data-node-label data-detail-anchor x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">External API</text>
<text data-detail="context" x="625" y="627" class="t-muted" font-size="8" text-anchor="middle">network service</text>
</g>
@@ -5123,7 +5124,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="220" y="734" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Context Store</text>
+ <text data-node-label data-detail-anchor x="220" y="734" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Context Store</text>
<text data-detail="context" x="220" y="751" class="t-muted" font-size="8" text-anchor="middle">repo + memory</text>
</g>
@@ -5135,7 +5136,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="500" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace Log</text>
+ <text data-node-label data-detail-anchor x="500" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace Log</text>
<text data-detail="context" x="500" y="751" class="t-muted" font-size="8" text-anchor="middle">events + output</text>
</g>
@@ -10697,6 +10698,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10716,6 +10771,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/archify/renderers/architecture/render-architecture.mjs b/archify/renderers/architecture/render-architecture.mjs
index 87f09468..182a9317 100644
--- a/archify/renderers/architecture/render-architecture.mjs
+++ b/archify/renderers/architecture/render-architecture.mjs
@@ -7,6 +7,7 @@ import { throwDiagnosticProblems } from '../shared/diagnostics.mjs';
import { legendFootprint, relationshipLegendObstacles, resolveLegend, renderLegend as renderResolvedLegend } from '../shared/legend.mjs';
import { availableNodeTextWidth, fittedNodeFontSize, minimumNodeTextWidth } from '../shared/text-fit.mjs';
import { brandLabelFitWidth, brandMetadataFor, brandTopRailProblem, renderBrandMark } from '../shared/brand-marks.mjs';
+import { minimumReadableSourceTextPx } from '../shared/desktop-readability.mjs';
import { gridLayout, resolveComponentPos, validateGridPlacement } from './grid.mjs';
import {
asArray,
@@ -67,6 +68,13 @@ const layout = {
// (CHANGELOG v2.2.1): 30px on top/left/right, plus 20px extra at the bottom.
boundaryPad: 30,
boundaryExtraBottom: 20,
+ boundaryLabelBaseline: 18,
+ boundaryLabelClearance: 4,
+ boundaryLabelFontPreferred: 9,
+ boundaryLabelFontMinimum: 6,
+ boundaryLabelMaskHeight: 16,
+ boundaryLabelRailGap: 2,
+ boundaryLabelFrameInset: 4,
legendH: 28,
};
@@ -88,6 +96,7 @@ function measureComponent(c) {
}
const components = new Map(asArray(arch.components).map((c) => [c.id, measureComponent(c)]));
+const enforcesBoundaryTitleComposition = Boolean(arch.meta?.quality_profile);
const componentSteps = new Map();
for (const [index, conn] of asArray(arch.connections).entries()) {
if (!componentSteps.has(conn.from)) componentSteps.set(conn.from, index);
@@ -106,29 +115,30 @@ function boundaryRect(boundary) {
const maxX = Math.max(...members.map((m) => m.x + m.width));
const maxY = Math.max(...members.map((m) => m.y + m.height));
const pad = boundary.pad ?? layout.boundaryPad;
+ const topPad = Math.max(
+ pad,
+ layout.boundaryLabelBaseline + layout.boundaryLabelClearance,
+ );
return {
...boundary,
x: minX - pad,
- y: minY - pad,
+ y: minY - topPad,
width: maxX - minX + pad * 2,
- height: maxY - minY + pad + layout.boundaryExtraBottom,
+ height: maxY - minY + topPad + layout.boundaryExtraBottom,
+ memberTop: minY,
};
}
-const boundaries = asArray(arch.boundaries).map(boundaryRect).filter(Boolean);
-const compositionFrames = boundaries.map((boundary, index) => ({
- ...boundary,
- id: boundary.id || index,
- kind: boundary.kind || 'boundary',
- radius: boundary.kind === 'security-group' ? 8 : 12,
-}));
+function rectContains(outer, inner) {
+ const epsilon = 1e-9;
+ return outer.x <= inner.x + epsilon
+ && outer.y <= inner.y + epsilon
+ && outer.x + outer.width + epsilon >= inner.x + inner.width
+ && outer.y + outer.height + epsilon >= inner.y + inner.height;
+}
-function componentContext(component) {
- const scopes = boundaries
- .filter((boundary) => asArray(boundary.wraps).includes(component.id))
- .sort((a, b) => (b.width * b.height) - (a.width * a.height))
- .map((boundary) => boundary.label);
- return scopes.length ? scopes.join(' › ') : 'Architecture component';
+function boundaryLabelWidth(label, fontSize) {
+ return Math.max(30, textUnits(label) * fontSize * 0.6 + 10);
}
const architectureLegendEntries = resolveLegend(
@@ -137,19 +147,17 @@ const architectureLegendEntries = resolveLegend(
new Set([...components.values()].map((component) => component.type)),
);
-// ---- Auto viewBox: fit all geometry + the measured resolved legend ----------
-function autoViewBox() {
- let maxX = 0;
- let maxY = 0;
- for (const c of components.values()) {
- maxX = Math.max(maxX, c.x + c.width);
- maxY = Math.max(maxY, c.y + c.height);
- }
- for (const b of boundaries) {
- maxX = Math.max(maxX, b.x + b.width);
- maxY = Math.max(maxY, b.y + b.height);
- }
-
+function autoViewBoxFor(candidateBoundaries) {
+ const maxX = Math.max(
+ 0,
+ ...[...components.values()].map((component) => component.x + component.width),
+ ...candidateBoundaries.map((boundary) => boundary.x + boundary.width),
+ );
+ const maxY = Math.max(
+ 0,
+ ...[...components.values()].map((component) => component.y + component.height),
+ ...candidateBoundaries.map((boundary) => boundary.y + boundary.height),
+ );
let width = Math.ceil(maxX + layout.margin);
let footprint = legendFootprint(architectureLegendEntries, {
width: Math.max(1, width - layout.margin * 2),
@@ -166,12 +174,171 @@ function autoViewBox() {
];
}
-const viewBox = arch.meta?.viewBox || autoViewBox();
+function resolvedViewBoxWidth(candidateBoundaries) {
+ if (Array.isArray(arch.meta?.viewBox) && Number.isFinite(arch.meta.viewBox[0])) {
+ return arch.meta.viewBox[0];
+ }
+ return autoViewBoxFor(candidateBoundaries)[0];
+}
+
+function expandBoundaryForReadableTitle(boundary, minimumFontSize) {
+ if (!enforcesBoundaryTitleComposition) return boundary;
+ const requiredWidth = boundaryLabelWidth(boundary.label, minimumFontSize)
+ + layout.boundaryLabelFrameInset * 2;
+ const extra = Math.max(0, requiredWidth - boundary.width);
+ if (!extra) return boundary;
+ return {
+ ...boundary,
+ x: boundary.x - extra / 2,
+ width: boundary.width + extra,
+ };
+}
+
+function measureBoundaryTitle(boundary, minimumFontSize) {
+ const availableWidth = Math.max(0, boundary.width - layout.boundaryLabelFrameInset * 2);
+ const units = textUnits(boundary.label);
+ const fitted = units > 0
+ ? (availableWidth - 10) / (units * 0.6)
+ : layout.boundaryLabelFontPreferred;
+ const preferredFontSize = Math.max(layout.boundaryLabelFontPreferred, minimumFontSize);
+ const fontSize = Math.max(
+ minimumFontSize,
+ Math.min(preferredFontSize, fitted),
+ );
+ const desiredWidth = boundaryLabelWidth(boundary.label, fontSize);
+ const height = Math.max(layout.boundaryLabelMaskHeight, Math.ceil(fontSize + 7));
+ return {
+ x: boundary.x + layout.boundaryLabelFrameInset,
+ y: boundary.memberTop
+ - layout.boundaryLabelClearance
+ - height,
+ width: Math.min(availableWidth, desiredWidth),
+ height,
+ fontSize,
+ minimumFontSize,
+ baselineOffset: fontSize + 4,
+ availableWidth,
+ minimumWidth: boundaryLabelWidth(boundary.label, minimumFontSize),
+ };
+}
+
+function horizontalOverlap(left, right) {
+ return left.x < right.x + right.width && left.x + left.width > right.x;
+}
+
+function layoutBoundaryTitles(rawBoundaries, minimumFontSize) {
+ const placedTitles = [];
+ const measured = new Map();
+ const ordered = rawBoundaries
+ .map((boundary, index) => ({ boundary, index }))
+ .sort((left, right) => {
+ const areaDelta = left.boundary.width * left.boundary.height
+ - right.boundary.width * right.boundary.height;
+ return areaDelta || left.index - right.index;
+ });
+
+ for (const entry of ordered) {
+ const { index } = entry;
+ const boundary = expandBoundaryForReadableTitle(entry.boundary, minimumFontSize);
+ const title = measureBoundaryTitle(boundary, minimumFontSize);
+ let guard = 0;
+ while (guard < rawBoundaries.length + components.size + 1) {
+ guard += 1;
+ const blockers = [
+ ...placedTitles,
+ ...components.values(),
+ ].filter((candidate) => horizontalOverlap(title, candidate) && rectsOverlap(title, candidate));
+ if (!blockers.length) break;
+ title.y = Math.min(
+ ...blockers.map((blocker) => blocker.y - layout.boundaryLabelRailGap - title.height),
+ );
+ }
+ placedTitles.push(title);
+ measured.set(index, { boundary, title });
+ }
+
+ return rawBoundaries.map((_boundary, index) => {
+ const { boundary, title } = measured.get(index);
+ const bottom = boundary.y + boundary.height;
+ // Profile-less schema-v1 inputs keep their legacy boundary geometry. A
+ // quality profile opts into the stricter title-composition contract and
+ // may expand the frame to contain an adapted title rail.
+ const y = enforcesBoundaryTitleComposition
+ ? Math.min(boundary.y, title.y - layout.boundaryLabelFrameInset)
+ : boundary.y;
+ return {
+ ...boundary,
+ y,
+ height: bottom - y,
+ title,
+ };
+ });
+}
+
+const rawBoundaries = asArray(arch.boundaries).map(boundaryRect).filter(Boolean);
+function resolveBoundaryTitles() {
+ if (!enforcesBoundaryTitleComposition || rawBoundaries.length === 0) {
+ return {
+ boundaries: layoutBoundaryTitles(rawBoundaries, layout.boundaryLabelFontMinimum),
+ readabilityProblem: null,
+ };
+ }
+
+ const maximumIterations = 32;
+ let candidateBoundaries = rawBoundaries;
+ for (let iteration = 0; iteration < maximumIterations; iteration += 1) {
+ const budgetViewBoxWidth = resolvedViewBoxWidth(candidateBoundaries);
+ const minimumFontSize = Math.max(
+ layout.boundaryLabelFontMinimum,
+ minimumReadableSourceTextPx(budgetViewBoxWidth) + 1e-6,
+ );
+ const nextBoundaries = layoutBoundaryTitles(rawBoundaries, minimumFontSize);
+ const finalViewBoxWidth = resolvedViewBoxWidth(nextBoundaries);
+ const finalMinimumFontSize = Math.max(
+ layout.boundaryLabelFontMinimum,
+ minimumReadableSourceTextPx(finalViewBoxWidth),
+ );
+ if (minimumFontSize >= finalMinimumFontSize) {
+ return { boundaries: nextBoundaries, readabilityProblem: null };
+ }
+ candidateBoundaries = nextBoundaries;
+ }
+
+ const finalViewBoxWidth = resolvedViewBoxWidth(candidateBoundaries);
+ return {
+ boundaries: candidateBoundaries,
+ readabilityProblem: `[composition/desktop-readability] Boundary title layout did not converge after ${maximumIterations} iterations for the final ${finalViewBoxWidth}px viewBox — shorten boundary labels, provide a wider authored viewBox, or move wrapped components closer to the left edge.`,
+ };
+}
+
+const resolvedBoundaryTitles = resolveBoundaryTitles();
+const boundaries = resolvedBoundaryTitles.boundaries;
+const compositionFrames = boundaries.map((boundary, index) => ({
+ ...boundary,
+ id: boundary.id || index,
+ kind: boundary.kind || 'boundary',
+ radius: boundary.kind === 'security-group' ? 8 : 12,
+}));
+
+function componentContext(component) {
+ const scopes = boundaries
+ .filter((boundary) => asArray(boundary.wraps).includes(component.id))
+ .sort((a, b) => (b.width * b.height) - (a.width * a.height))
+ .map((boundary) => boundary.label);
+ return scopes.length ? scopes.join(' › ') : 'Architecture component';
+}
+
+// ---- Auto viewBox: fit all geometry + the measured resolved legend ----------
+const viewBox = arch.meta?.viewBox || autoViewBoxFor(boundaries);
const legendY = () => viewBox[1] - 16;
// ---- Validation: mechanical correctness, never layout taste -----------------
function validateArchitecture() {
const problems = [];
+ if (resolvedBoundaryTitles.readabilityProblem) {
+ problems.push(resolvedBoundaryTitles.readabilityProblem);
+ }
+ const requiresNestedBoundaryMembership = arch.meta?.engineering_profile === 'deployment-ownership';
if (arch.schema_version !== 1) problems.push('Architecture files must set "schema_version": 1.');
if (arch.diagram_type !== 'architecture') problems.push('Architecture files must set "diagram_type": "architecture".');
if (!arch.meta?.title) problems.push('Architecture files must include meta.title.');
@@ -241,6 +408,95 @@ function validateArchitecture() {
if (!components.has(id)) problems.push(`Boundary "${boundary.label}" wraps unknown component "${id}".`);
}
}
+ const viewBoxRect = { x: 0, y: 0, width: viewBox[0], height: viewBox[1] };
+ for (const boundary of boundaries) {
+ if (!enforcesBoundaryTitleComposition) continue;
+ if (boundary.title.minimumWidth > boundary.title.availableWidth) {
+ problems.push(
+ `Boundary label "${boundary.label}" needs ~${Math.ceil(boundary.title.minimumWidth)}px to fit at the `
+ + `${Number(boundary.title.minimumFontSize.toFixed(2))}px desktop-readable source minimum, but its frame provides ${Math.floor(boundary.title.availableWidth)}px — `
+ + 'shorten the boundary label, increase pad, or widen the wrapped component layout.',
+ );
+ }
+ if (!rectContains(boundary, boundary.title)) {
+ problems.push(
+ `Boundary label "${boundary.label}" extends outside its final frame — shorten the label or increase boundary pad.`,
+ );
+ }
+ if (!rectContains(viewBoxRect, boundary.title)) {
+ problems.push(
+ `Boundary label "${boundary.label}" extends outside the viewBox — move wrapped components away from the canvas edge, shorten the label, or increase the viewBox.`,
+ );
+ }
+ for (const component of components.values()) {
+ if (!rectsOverlap(boundary.title, component)) continue;
+ problems.push(
+ `Boundary label "${boundary.label}" overlaps component "${component.id}" — move the component, increase boundary title space, or shorten the label.`,
+ );
+ }
+ }
+ for (let leftIndex = 0; leftIndex < boundaries.length; leftIndex += 1) {
+ const left = boundaries[leftIndex];
+ const leftMembers = new Set(asArray(left.wraps));
+ for (let rightIndex = leftIndex + 1; rightIndex < boundaries.length; rightIndex += 1) {
+ const right = boundaries[rightIndex];
+ if (enforcesBoundaryTitleComposition && rectsOverlap(left.title, right.title)) {
+ problems.push(
+ `Boundary labels "${left.label}" and "${right.label}" overlap — shorten a label or increase boundary title space.`,
+ );
+ }
+ // Ordinary architecture boundaries are sets, not an implied ownership
+ // tree: orthogonal scopes such as runtime and compliance may share some
+ // components while each contains others. The opt-in deployment profile
+ // does promise hierarchical region/private-scope membership, so only it
+ // receives the stricter membership-to-frame containment contract.
+ if (!requiresNestedBoundaryMembership) continue;
+ const rightMembers = new Set(asArray(right.wraps));
+ const shared = [...leftMembers].filter((id) => rightMembers.has(id));
+ const leftNested = [...leftMembers].every((id) => rightMembers.has(id));
+ const rightNested = [...rightMembers].every((id) => leftMembers.has(id));
+ if (shared.length && !leftNested && !rightNested) {
+ const leftOnly = [...leftMembers].filter((id) => !rightMembers.has(id));
+ const rightOnly = [...rightMembers].filter((id) => !leftMembers.has(id));
+ problems.push(
+ `Boundary "${left.label}" crosses boundary "${right.label}" because their memberships partially overlap `
+ + `(shared: ${shared.map((id) => `"${id}"`).join(', ')}; `
+ + `only in "${left.label}": ${leftOnly.map((id) => `"${id}"`).join(', ')}; `
+ + `only in "${right.label}": ${rightOnly.map((id) => `"${id}"`).join(', ')}) — `
+ + 'keep one boundary fully nested by removing outside members, or split the boundary.',
+ );
+ continue;
+ }
+
+ if (!rectsOverlap(left, right)) continue;
+ const leftContainsRight = rectContains(left, right);
+ const rightContainsLeft = rectContains(right, left);
+ if (!leftContainsRight && !rightContainsLeft) {
+ problems.push(
+ `Boundary "${left.label}" and boundary "${right.label}" final frames partially overlap — `
+ + 'adjust wraps, pad, or component positions so the frames are disjoint or one fully contains the other.',
+ );
+ continue;
+ }
+
+ if (!shared.length) {
+ problems.push(
+ `Boundary "${left.label}" and boundary "${right.label}" final frames overlap even though their memberships are disjoint — `
+ + 'adjust pad or component positions so the frames are disjoint, or make wraps express the intended nesting.',
+ );
+ continue;
+ }
+
+ const containmentMatchesMembership = (leftNested && rightContainsLeft)
+ || (rightNested && leftContainsRight);
+ if (!containmentMatchesMembership) {
+ problems.push(
+ `Boundary "${left.label}" and boundary "${right.label}" final frame containment contradicts their wraps membership — `
+ + 'reduce the inner boundary pad, move its components, or correct wraps so geometry and nesting agree.',
+ );
+ }
+ }
+ }
for (const b of boundaries) {
if (b.x < 0 || b.y < 0 || b.x + b.width > viewBox[0] || b.y + b.height > viewBox[1]) {
problems.push(`Boundary "${b.label}" extends outside the viewBox — its members sit too close to the canvas edge; add margin or enlarge meta.viewBox.`);
@@ -264,8 +520,8 @@ function validateArchitecture() {
pathFor,
diagramType: 'architecture',
relationCollection: 'connections',
- fromSideFor: (conn) => inferredAutoSide(conn, 'source'),
- toSideFor: (conn) => inferredAutoSide(conn, 'target'),
+ fromSideFor: (conn) => connectionEndpointSide(conn, 'source'),
+ toSideFor: (conn) => connectionEndpointSide(conn, 'target'),
routeHint: 'keep automatic routing so the renderer can use a side-aware bridge, or set truthful fromSide/toSide with perpendicular via segments',
}));
problems.push(...cleanFlowProblems({
@@ -331,6 +587,14 @@ function validateArchitecture() {
problems.push(`Label "${rect.label}" overlaps component "${c.id}" — adjust labelDx/labelDy/labelSegment or set labelAt.\n${suggestLabelObstacleFix(rect, rect.lx, rect.ly, c)}`);
}
}
+ if (enforcesBoundaryTitleComposition) {
+ for (const boundary of boundaries) {
+ if (!rectsOverlap(boundary.title, rect)) continue;
+ problems.push(
+ `Boundary label "${boundary.label}" overlaps connection label "${rect.label}" — move the boundary title rail by adjusting wrapped component positions, or move the connection label with labelAt/labelDx/labelDy/labelSegment.`,
+ );
+ }
+ }
}
problems.push(...cleanLabelRouteClearanceProblems({
relations: arch.connections,
@@ -662,10 +926,9 @@ function connectionSides(conn) {
};
}
-function inferredAutoSide(conn, endpoint) {
+function connectionEndpointSide(conn, endpoint) {
const field = endpoint === 'source' ? 'fromSide' : 'toSide';
if (conn[field] && conn[field] !== 'auto') return conn[field];
- if (conn.via || (conn.route && conn.route !== 'auto')) return null;
return connectionSides(conn)[field];
}
@@ -694,12 +957,18 @@ function pathFor(conn) {
}
// ---- Rendering ---------------------------------------------------------------
-function renderBoundary(b, index) {
+function renderBoundaryFrame(b, index) {
const cls = b.kind === 'security-group' ? 'c-security-group' : 'c-region';
- const labelCls = b.kind === 'security-group' ? 't-security' : 't-cloud';
const rx = b.kind === 'security-group' ? 8 : 12;
- return ` <rect data-graph-role="structural-frame" data-composition-frame-kind="${esc(b.kind || 'boundary')}" data-composition-frame-id="${index}" x="${b.x}" y="${b.y}" width="${b.width}" height="${b.height}" rx="${rx}" class="${cls}" stroke-width="1"/>
- <text x="${b.x + 8}" y="${b.y + 18}" class="${labelCls}" font-size="9" font-weight="600">${esc(b.label)}</text>`;
+ return ` <rect data-graph-role="structural-frame" data-composition-frame-kind="${esc(b.kind || 'boundary')}" data-composition-frame-id="${index}" data-composition-frame-label="${esc(b.label)}" x="${b.x}" y="${b.y}" width="${b.width}" height="${b.height}" rx="${rx}" class="${cls}" stroke-width="1"/>`;
+}
+
+function renderBoundaryLabel(b, index) {
+ const labelCls = b.kind === 'security-group' ? 't-security' : 't-cloud';
+ return ` <g data-graph-role="structural-frame-label" data-composition-frame-id="${index}" data-composition-frame-kind="${esc(b.kind || 'boundary')}" data-composition-frame-label="${esc(b.label)}">
+ <rect data-graph-role="structural-frame-label-mask" x="${b.title.x}" y="${b.title.y}" width="${b.title.width}" height="${b.title.height}" rx="3" class="c-mask"/>
+ <text data-boundary-label x="${b.title.x + 4}" y="${b.title.y + b.title.baselineOffset}" class="${labelCls}" font-size="${b.title.fontSize}" font-weight="600">${esc(b.label)}</text>
+ </g>`;
}
function renderConnectionPath(conn, index) {
@@ -739,7 +1008,7 @@ function renderComponent(c) {
<rect x="${c.x}" y="${c.y}" width="${c.width}" height="${c.height}" rx="6" class="c-mask"/>
<rect x="${c.x}" y="${c.y}" width="${c.width}" height="${c.height}" rx="6" class="${fill}"${animateAttr(arch.meta, 'node', componentSteps.get(c.id))} stroke-width="1.5"/>
${renderSemanticSigil(c.type, { x: c.x + 6, y: c.y + 6 })}${brand ? `\n ${brand}` : ''}
- <text${hasSub ? ' data-detail-anchor' : ''} x="${cx}" y="${labelY}" class="t-primary" font-size="${labelFontSize}" font-weight="600" text-anchor="middle">${esc(c.label)}</text>${sub}${tag}
+ <text data-node-label${hasSub ? ' data-detail-anchor' : ''} x="${cx}" y="${labelY}" class="t-primary" font-size="${labelFontSize}" font-weight="600" text-anchor="middle">${esc(c.label)}</text>${sub}${tag}
</g>`;
}
@@ -783,7 +1052,7 @@ ${renderDefinitions()}
<rect width="100%" height="100%" fill="url(#grid)" />
<!-- Boundaries (behind everything) -->
-${boundaries.map(renderBoundary).join('\n\n')}
+${boundaries.map(renderBoundaryFrame).join('\n\n')}
<!-- Connection paths (before components for correct z-order) -->
${asArray(arch.connections).map(renderConnectionPath).join('\n')}
@@ -794,6 +1063,9 @@ ${[...components.values()].map(renderComponent).join('\n\n')}
<!-- Connection labels -->
${asArray(arch.connections).map(renderConnectionLabel).join('\n')}
+ <!-- Boundary labels (foreground masks keep routes out of titles) -->
+${boundaries.map(renderBoundaryLabel).join('\n\n')}
+
<!-- Legend -->
${renderLegend()}
</svg>`;
diff --git a/archify/renderers/dataflow/render-dataflow.mjs b/archify/renderers/dataflow/render-dataflow.mjs
index 2250dfb8..04ff9be7 100644
--- a/archify/renderers/dataflow/render-dataflow.mjs
+++ b/archify/renderers/dataflow/render-dataflow.mjs
@@ -10,6 +10,7 @@ import {
asArray,
isFinitePoint,
rectsOverlap,
+ cleanEndpointSideProblems,
cleanFlowProblems,
cleanCrossingProblems,
cleanAmbiguousCorridorProblems,
@@ -201,6 +202,16 @@ function validateDataflow() {
}
}
+ problems.push(...cleanEndpointSideProblems({
+ relations: dataflow.flows,
+ endpointIds: new Set(nodes.keys()),
+ pathFor,
+ diagramType: 'dataflow',
+ relationCollection: 'flows',
+ fromSideFor: (flow) => flowSides(flow).fromSide,
+ toSideFor: (flow) => flowSides(flow).toSide,
+ routeHint: 'keep automatic routing, or choose fromSide/toSide and via points whose first and final segments cross node borders perpendicularly',
+ }));
problems.push(...cleanFlowProblems({
relations: dataflow.flows,
endpointIds: new Set(nodes.keys()),
@@ -321,15 +332,28 @@ function routeVia(flow, from, to, start, end) {
}
const pathCache = new Map();
-const automaticPorts = automaticPortSpread(dataflow.flows, nodes);
+
+function flowSides(flow) {
+ const from = nodes.get(flow.from);
+ const to = nodes.get(flow.to);
+ return {
+ fromSide: chosenSide(flow.fromSide, defaultFromSide(from, to)),
+ toSide: chosenSide(flow.toSide, defaultToSide(from, to)),
+ };
+}
+
+const automaticPorts = automaticPortSpread(dataflow.flows, nodes, {
+ sideFor: (flow, endpoint) => flowSides(flow)[endpoint === 'source' ? 'fromSide' : 'toSide'],
+});
function pathFor(flow) {
if (pathCache.has(flow)) return pathCache.get(flow);
const from = nodes.get(flow.from);
const to = nodes.get(flow.to);
const ports = automaticPorts.get(flow);
- const start = ports?.from || anchor(from, chosenSide(flow.fromSide, defaultFromSide(from, to)));
- const end = ports?.to || anchor(to, chosenSide(flow.toSide, defaultToSide(from, to)));
+ const { fromSide, toSide } = flowSides(flow);
+ const start = ports?.from || anchor(from, fromSide);
+ const end = ports?.to || anchor(to, toSide);
const points = [start, ...routeVia(flow, from, to, start, end), end];
const routed = { d: polylinePath(points), points };
pathCache.set(flow, routed);
@@ -363,7 +387,7 @@ function renderNode(node) {
<rect x="${node.x}" y="${node.y}" width="${node.width}" height="${node.height}" rx="6" class="c-mask"/>
<rect x="${node.x}" y="${node.y}" width="${node.width}" height="${node.height}" rx="6" class="${fill}"${animateAttr(dataflow.meta, 'node', nodeSteps.get(node.id))} stroke-width="1.5"/>
${renderSemanticSigil(node.type, { x: node.x + 6, y: node.y + 6 })}${brand ? `\n ${brand}` : ''}
- <text${hasSub ? ' data-detail-anchor' : ''} x="${node.cx}" y="${node.y + 21}" class="t-primary" font-size="${labelFontSize}" font-weight="600" text-anchor="middle">${esc(node.label)}</text>${sub}${tag}
+ <text data-node-label${hasSub ? ' data-detail-anchor' : ''} x="${node.cx}" y="${node.y + 21}" class="t-primary" font-size="${labelFontSize}" font-weight="600" text-anchor="middle">${esc(node.label)}</text>${sub}${tag}
</g>`;
}
diff --git a/archify/renderers/lifecycle/render-lifecycle.mjs b/archify/renderers/lifecycle/render-lifecycle.mjs
index 118ca216..f80ce397 100644
--- a/archify/renderers/lifecycle/render-lifecycle.mjs
+++ b/archify/renderers/lifecycle/render-lifecycle.mjs
@@ -10,6 +10,7 @@ import {
asArray,
isFinitePoint,
rectsOverlap,
+ cleanEndpointSideProblems,
cleanFlowProblems,
cleanCrossingProblems,
cleanAmbiguousCorridorProblems,
@@ -227,6 +228,21 @@ function validateLifecycle() {
}
}
+ // Authored via points are authoritative in schema v1, including under a
+ // quality profile. Preserve and render them exactly: applying the endpoint
+ // gate would either reject an existing typed input or require silently
+ // falsifying its geometry. Automatic routes still receive the side gate.
+ problems.push(...cleanEndpointSideProblems({
+ relations: lifecycle.transitions,
+ endpointIds: new Set(states.keys()),
+ pathFor,
+ diagramType: 'lifecycle',
+ relationCollection: 'transitions',
+ fromSideFor: (transition) => transitionSides(transition).fromSide,
+ toSideFor: (transition) => transitionSides(transition).toSide,
+ shouldCheckRelation: (transition) => !Array.isArray(transition.via),
+ routeHint: 'keep automatic routing, or choose fromSide/toSide and via points whose first and final segments cross state borders perpendicularly',
+ }));
problems.push(...cleanFlowProblems({
relations: lifecycle.transitions,
endpointIds: new Set(states.keys()),
@@ -318,7 +334,7 @@ function validateLifecycle() {
}
}
-function routeVia(transition, from, to, start, end) {
+function routeVia(transition, from, to, start, end, fromSide, toSide) {
if (transition.via) return transition.via;
switch (transition.route || 'auto') {
case 'straight':
@@ -345,24 +361,46 @@ function routeVia(transition, from, to, start, end) {
}
case 'auto':
default: {
- if (from.lane === to.lane) return [];
- const y = transition.channelY ?? (start[1] + end[1]) / 2;
- return [[start[0], y], [end[0], y]];
+ if (start[0] === end[0] || start[1] === end[1]) return [];
+ const fromVertical = fromSide === 'top' || fromSide === 'bottom';
+ const toVertical = toSide === 'top' || toSide === 'bottom';
+ if (fromVertical !== toVertical) {
+ return [fromVertical ? [start[0], end[1]] : [end[0], start[1]]];
+ }
+ if (fromVertical) {
+ const y = transition.channelY ?? (start[1] + end[1]) / 2;
+ return [[start[0], y], [end[0], y]];
+ }
+ const x = transition.channelX ?? (start[0] + end[0]) / 2;
+ return [[x, start[1]], [x, end[1]]];
}
}
}
const pathCache = new Map();
-const automaticPorts = automaticPortSpread(lifecycle.transitions, states);
+
+function transitionSides(transition) {
+ const from = states.get(transition.from);
+ const to = states.get(transition.to);
+ return {
+ fromSide: chosenSide(transition.fromSide, defaultFromSide(from, to)),
+ toSide: chosenSide(transition.toSide, defaultToSide(from, to)),
+ };
+}
+
+const automaticPorts = automaticPortSpread(lifecycle.transitions, states, {
+ sideFor: (transition, endpoint) => transitionSides(transition)[endpoint === 'source' ? 'fromSide' : 'toSide'],
+});
function pathFor(transition) {
if (pathCache.has(transition)) return pathCache.get(transition);
const from = states.get(transition.from);
const to = states.get(transition.to);
const ports = automaticPorts.get(transition);
- const start = ports?.from || anchor(from, chosenSide(transition.fromSide, defaultFromSide(from, to)));
- const end = ports?.to || anchor(to, chosenSide(transition.toSide, defaultToSide(from, to)));
- let via = routeVia(transition, from, to, start, end);
+ const { fromSide, toSide } = transitionSides(transition);
+ const start = ports?.from || anchor(from, fromSide);
+ const end = ports?.to || anchor(to, toSide);
+ let via = routeVia(transition, from, to, start, end, fromSide, toSide);
if (ports && !via.length && Math.abs(start[0] - end[0]) >= 4 && Math.abs(start[1] - end[1]) >= 4) {
const midX = (start[0] + end[0]) / 2;
via = [[midX, start[1]], [midX, end[1]]];
@@ -421,7 +459,7 @@ function renderState(state) {
<rect x="${state.x}" y="${state.y}" width="${state.width}" height="${state.height}" rx="7" class="c-mask"/>
<rect x="${state.x}" y="${state.y}" width="${state.width}" height="${state.height}" rx="7" class="${fill}"${animateAttr(lifecycle.meta, 'node', stateSteps.get(state.id))} stroke-width="1.5"/>
${renderSemanticSigil(state.type, { x: hasBrand ? state.x + 6 : state.x + state.width - 17, y: state.y + 6 })}${brand ? `\n ${brand}` : ''}${step}
- <text${hasSub ? ' data-detail-anchor' : ''} x="${state.cx}" y="${state.y + 21}" class="t-primary" font-size="${labelFontSize}" font-weight="600" text-anchor="middle">${esc(state.label)}</text>${sub}${tag}
+ <text data-node-label${hasSub ? ' data-detail-anchor' : ''} x="${state.cx}" y="${state.y + 21}" class="t-primary" font-size="${labelFontSize}" font-weight="600" text-anchor="middle">${esc(state.label)}</text>${sub}${tag}
</g>`;
}
diff --git a/archify/renderers/sequence/render-sequence.mjs b/archify/renderers/sequence/render-sequence.mjs
index 9e547e5e..3f4d1c32 100644
--- a/archify/renderers/sequence/render-sequence.mjs
+++ b/archify/renderers/sequence/render-sequence.mjs
@@ -318,7 +318,7 @@ function renderParticipant(participant) {
<rect x="${participant.x}" y="${layout.topY}" width="${layout.participantW}" height="${layout.participantH}" rx="6" class="c-mask"/>
<rect x="${participant.x}" y="${layout.topY}" width="${layout.participantW}" height="${layout.participantH}" rx="6" class="${fill}"${animateAttr(sequence.meta, 'node', participant.index)} stroke-width="1.5"/>
${renderSemanticSigil(participant.type, { x: participant.x + 6, y: layout.topY + 6 })}${brand ? `\n ${brand}` : ''}
- <text${hasSub ? ' data-detail-anchor' : ''} x="${participant.cx}" y="${layout.topY + 22}" class="t-primary" font-size="${labelFontSize}" font-weight="600" text-anchor="middle">${esc(participant.label)}</text>${sub}
+ <text data-node-label${hasSub ? ' data-detail-anchor' : ''} x="${participant.cx}" y="${layout.topY + 22}" class="t-primary" font-size="${labelFontSize}" font-weight="600" text-anchor="middle">${esc(participant.label)}</text>${sub}
</g>`;
}
diff --git a/archify/renderers/shared/desktop-readability.mjs b/archify/renderers/shared/desktop-readability.mjs
new file mode 100644
index 00000000..1a4c249d
--- /dev/null
+++ b/archify/renderers/shared/desktop-readability.mjs
@@ -0,0 +1,26 @@
+export const DESKTOP_READABILITY_VIEWPORT = Object.freeze({ width: 1440, height: 900 });
+export const DESKTOP_READER_MIN_WIDTH = 960;
+export const DESKTOP_READER_HORIZONTAL_CHROME = 30;
+export const DESKTOP_READER_DIAGRAM_WIDTH = DESKTOP_READER_MIN_WIDTH - DESKTOP_READER_HORIZONTAL_CHROME;
+export const MIN_PROJECTED_NODE_TEXT_PX = 6;
+
+export function projectedNodeTextPx(sourceFontPx, viewBoxWidth, diagramWidth = DESKTOP_READER_DIAGRAM_WIDTH) {
+ if (![sourceFontPx, viewBoxWidth, diagramWidth].every(Number.isFinite) || viewBoxWidth <= 0 || diagramWidth <= 0) {
+ return Number.NaN;
+ }
+ return sourceFontPx * Math.min(1, diagramWidth / viewBoxWidth);
+}
+
+export function minimumReadableSourceTextPx(
+ viewBoxWidth,
+ diagramWidth = DESKTOP_READER_DIAGRAM_WIDTH,
+ minimumProjectedPx = MIN_PROJECTED_NODE_TEXT_PX,
+) {
+ if (![viewBoxWidth, diagramWidth, minimumProjectedPx].every(Number.isFinite)
+ || viewBoxWidth <= 0
+ || diagramWidth <= 0
+ || minimumProjectedPx <= 0) {
+ return Number.NaN;
+ }
+ return minimumProjectedPx / Math.min(1, diagramWidth / viewBoxWidth);
+}
diff --git a/archify/renderers/shared/geometry.mjs b/archify/renderers/shared/geometry.mjs
index fee610c1..7b091f1c 100644
--- a/archify/renderers/shared/geometry.mjs
+++ b/archify/renderers/shared/geometry.mjs
@@ -257,7 +257,11 @@ export function routeHonorsEndpointSides(points, fromSide, toSide) {
// Explicit fromSide/toSide are authored geometry, so a tangent or backwards
// endpoint segment changes their meaning. Fail this universally instead of
-// leaving a malformed arrow for visual review to discover.
+// leaving a malformed arrow for visual review to discover. Named routes and
+// authored via points already carry their own geometry semantics: when they
+// omit endpoint sides, do not invent a relative-position side and then reject
+// the route for disagreeing with that invention. Pure automatic routes may
+// still be checked against renderer-inferred sides.
export function cleanEndpointSideProblems({
relations,
endpointIds,
@@ -266,17 +270,28 @@ export function cleanEndpointSideProblems({
relationCollection,
fromSideFor,
toSideFor,
+ shouldCheckRelation = () => true,
routeHint = 'align the first/final via segment with fromSide/toSide, change the side, or remove explicit routing so auto can choose a perpendicular approach',
}) {
const problems = [];
for (const [relationIndex, relation] of asArray(relations).entries()) {
if (!relation || !endpointIds?.has(relation.from) || !endpointIds?.has(relation.to)) continue;
+ if (!shouldCheckRelation(relation, relationIndex)) continue;
const points = pathFor(relation)?.points;
if (!Array.isArray(points) || points.length < 2) continue;
const authoredFromSide = relation.fromSide && relation.fromSide !== 'auto' ? relation.fromSide : null;
const authoredToSide = relation.toSide && relation.toSide !== 'auto' ? relation.toSide : null;
- const fromSide = (typeof fromSideFor === 'function' ? fromSideFor(relation) : null) ?? authoredFromSide;
- const toSide = (typeof toSideFor === 'function' ? toSideFor(relation) : null) ?? authoredToSide;
+ const hasAuthoredRouteGeometry = Boolean(
+ (relation.route && relation.route !== 'auto') || Array.isArray(relation.via),
+ );
+ const inferredFromSide = !hasAuthoredRouteGeometry && typeof fromSideFor === 'function'
+ ? fromSideFor(relation)
+ : null;
+ const inferredToSide = !hasAuthoredRouteGeometry && typeof toSideFor === 'function'
+ ? toSideFor(relation)
+ : null;
+ const fromSide = authoredFromSide ?? inferredFromSide;
+ const toSide = authoredToSide ?? inferredToSide;
const checks = [
fromSide
? { ...endpointSideIssue(points, 'source', fromSide), sideOrigin: authoredFromSide ? 'authored' : 'inferred' }
@@ -1107,7 +1122,7 @@ export function automaticPortRhythmBridge(
// Keep conservative auto-routed fan-out/fan-in relationships visually
// distinct without changing authored route controls. The returned map only
// contains endpoints that belong to a shared automatic midpoint anchor.
-export function automaticPortSpread(relations, boxes, { gutter = 16, maxSpacing = 14 } = {}) {
+export function automaticPortSpread(relations, boxes, { gutter = 16, maxSpacing = 14, sideFor } = {}) {
const groups = new Map();
const spread = new Map();
@@ -1124,8 +1139,14 @@ export function automaticPortSpread(relations, boxes, { gutter = 16, maxSpacing
const from = boxes.get(relation.from);
const to = boxes.get(relation.to);
if (!from || !to) continue;
- const fromSide = chosenSide(relation.fromSide, defaultFromSide(from, to));
- const toSide = chosenSide(relation.toSide, defaultToSide(from, to));
+ const fromSide = chosenSide(
+ relation.fromSide,
+ sideFor?.(relation, 'source') || defaultFromSide(from, to),
+ );
+ const toSide = chosenSide(
+ relation.toSide,
+ sideFor?.(relation, 'target') || defaultToSide(from, to),
+ );
add(relation, 'from', from, fromSide, to);
add(relation, 'to', to, toSide, from);
}
diff --git a/archify/renderers/workflow/render-workflow.mjs b/archify/renderers/workflow/render-workflow.mjs
index b55dd393..db480d56 100644
--- a/archify/renderers/workflow/render-workflow.mjs
+++ b/archify/renderers/workflow/render-workflow.mjs
@@ -10,6 +10,8 @@ import {
asArray,
isFinitePoint,
rectsOverlap,
+ segmentIntersectsRect,
+ cleanEndpointSideProblems,
cleanFlowProblems,
cleanCrossingProblems,
cleanAmbiguousCorridorProblems,
@@ -23,6 +25,8 @@ import {
defaultFromSide,
defaultToSide,
chosenSide,
+ normalizeRoutePoints,
+ routeHonorsEndpointSides,
polylinePath,
routePointsValue,
labelPoint,
@@ -319,6 +323,16 @@ function validateWorkflow() {
}
}
+ problems.push(...cleanEndpointSideProblems({
+ relations: workflow.edges,
+ endpointIds: new Set(nodes.keys()),
+ pathFor,
+ diagramType: 'workflow',
+ relationCollection: 'edges',
+ fromSideFor: (edge) => edgeSides(edge).fromSide,
+ toSideFor: (edge) => edgeSides(edge).toSide,
+ routeHint: 'keep automatic routing, or choose fromSide/toSide and via points whose first and final segments cross node borders perpendicularly',
+ }));
problems.push(...cleanFlowProblems({
relations: workflow.edges,
endpointIds: new Set(nodes.keys()),
@@ -393,7 +407,7 @@ function validateWorkflow() {
const labelRects = [];
for (const [edgeIndex, edge] of workflow.edges.entries()) {
if (!edge.label || !nodes.has(edge.from) || !nodes.has(edge.to)) continue;
- const [lx, ly] = labelPoint(edge, pathFor(edge).points);
+ const [lx, ly] = workflowEdgeLabelPoint(edge, pathFor(edge).points);
const width = Math.max(30, textUnits(edge.label) * 4.8 + 10);
labelRects.push({ relation: edge, relationIndex: edgeIndex, label: edge.label, x: lx - width / 2, y: ly - 10, width, height: 14, lx, ly });
}
@@ -453,7 +467,61 @@ function sameLaneAutoVia(start, end) {
return [[midX, start[1]], [midX, end[1]]];
}
-function routeVia(edge, from, to, start, end) {
+function routeClearsUnrelatedNodes(edge, points, clearance = 2) {
+ const endpointIds = new Set([edge.from, edge.to]);
+ for (const node of nodes.values()) {
+ if (endpointIds.has(node.id)) continue;
+ for (let index = 0; index < points.length - 1; index += 1) {
+ if (segmentIntersectsRect({ start: points[index], end: points[index + 1] }, node, clearance)) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+function oneBendCrossLaneVia(edge, start, end, fromSide, toSide) {
+ const fromVertical = fromSide === 'top' || fromSide === 'bottom';
+ const toVertical = toSide === 'top' || toSide === 'bottom';
+ if (fromVertical === toVertical) return null;
+
+ const corner = fromVertical ? [start[0], end[1]] : [end[0], start[1]];
+ const points = normalizeRoutePoints([start, corner, end]);
+ if (points.length !== 3 || !routeHonorsEndpointSides(points, fromSide, toSide)) return null;
+
+ const segmentsAreReadable = points.slice(0, -1).every((point, index) => (
+ Math.hypot(
+ points[index + 1][0] - point[0],
+ points[index + 1][1] - point[1],
+ ) >= 8
+ ));
+ if (!segmentsAreReadable || !routeClearsUnrelatedNodes(edge, points)) return null;
+ return points.slice(1, -1);
+}
+
+function automaticOneBendSides(edge, from, to) {
+ const automaticRoute = !edge.via && (!edge.route || edge.route === 'auto');
+ const automaticFrom = !edge.fromSide || edge.fromSide === 'auto';
+ const automaticTo = !edge.toSide || edge.toSide === 'auto';
+ if (!automaticRoute || !automaticFrom || !automaticTo || from.lane === to.lane) return null;
+ if (from.cx === to.cx || from.cy === to.cy) return null;
+ const verticalFrom = to.cy < from.cy ? 'top' : 'bottom';
+ const horizontalTo = to.cx < from.cx ? 'right' : 'left';
+ const horizontalFrom = to.cx < from.cx ? 'left' : 'right';
+ const verticalTo = to.cy < from.cy ? 'bottom' : 'top';
+ const candidates = [
+ { fromSide: verticalFrom, toSide: horizontalTo },
+ { fromSide: horizontalFrom, toSide: verticalTo },
+ ];
+
+ return candidates.find(({ fromSide, toSide }) => {
+ const start = anchor(from, fromSide);
+ const end = anchor(to, toSide);
+ return oneBendCrossLaneVia(edge, start, end, fromSide, toSide);
+ }) || null;
+}
+
+function routeVia(edge, from, to, start, end, fromSide, toSide) {
if (edge.via) return edge.via;
switch (edge.route || 'auto') {
case 'straight':
@@ -481,6 +549,8 @@ function routeVia(edge, from, to, start, end) {
case 'auto':
default: {
if (from.lane === to.lane) return sameLaneAutoVia(start, end);
+ const oneBendVia = oneBendCrossLaneVia(edge, start, end, fromSide, toSide);
+ if (oneBendVia) return oneBendVia;
const y = gapYBetween(from.lane, to.lane, edge.bias ?? 0.5);
return [[start[0], y], [end[0], y]];
}
@@ -488,16 +558,45 @@ function routeVia(edge, from, to, start, end) {
}
const pathCache = new Map();
-const automaticPorts = automaticPortSpread(workflow.edges, nodes);
+
+function workflowEdgeLabelPoint(edge, points) {
+ if (edge.labelAt || Number.isInteger(edge.labelSegment) || points.length !== 3) {
+ return labelPoint(edge, points);
+ }
+ const segmentLengths = [0, 1].map((index) => Math.hypot(
+ points[index + 1][0] - points[index][0],
+ points[index + 1][1] - points[index][1],
+ ));
+ const labelSegment = segmentLengths[0] >= segmentLengths[1] ? 0 : 1;
+ const point = labelPoint({ ...edge, labelSegment }, points);
+ if (points[labelSegment][0] === points[labelSegment + 1][0]) point[1] += 10;
+ return point;
+}
+
+function edgeSides(edge) {
+ const from = nodes.get(edge.from);
+ const to = nodes.get(edge.to);
+ const oneBendSides = automaticOneBendSides(edge, from, to);
+ if (oneBendSides) return oneBendSides;
+ return {
+ fromSide: chosenSide(edge.fromSide, defaultFromSide(from, to)),
+ toSide: chosenSide(edge.toSide, defaultToSide(from, to)),
+ };
+}
+
+const automaticPorts = automaticPortSpread(workflow.edges, nodes, {
+ sideFor: (edge, endpoint) => edgeSides(edge)[endpoint === 'source' ? 'fromSide' : 'toSide'],
+});
function pathFor(edge) {
if (pathCache.has(edge)) return pathCache.get(edge);
const from = nodes.get(edge.from);
const to = nodes.get(edge.to);
const ports = automaticPorts.get(edge);
- const start = ports?.from || anchor(from, chosenSide(edge.fromSide, defaultFromSide(from, to)));
- const end = ports?.to || anchor(to, chosenSide(edge.toSide, defaultToSide(from, to)));
- const points = [start, ...routeVia(edge, from, to, start, end), end];
+ const { fromSide, toSide } = edgeSides(edge);
+ const start = ports?.from || anchor(from, fromSide);
+ const end = ports?.to || anchor(to, toSide);
+ const points = [start, ...routeVia(edge, from, to, start, end, fromSide, toSide), end];
const routed = { d: polylinePath(points), points };
pathCache.set(edge, routed);
return routed;
@@ -554,7 +653,7 @@ function renderNode(node) {
<rect x="${node.x}" y="${node.y}" width="${node.width}" height="${node.height}" rx="6" class="c-mask"/>
<rect x="${node.x}" y="${node.y}" width="${node.width}" height="${node.height}" rx="6" class="${fill}"${animateAttr(workflow.meta, 'node', nodeStep(node))} stroke-width="1.5"/>
${renderSemanticSigil(node.type, { x: node.x + 6, y: node.y + 6 })}${brand ? `\n ${brand}` : ''}
- <text${hasSub ? ' data-detail-anchor' : ''} x="${node.cx}" y="${node.y + 21}" class="t-primary" font-size="${labelFontSize}" font-weight="600" text-anchor="middle">${esc(node.label)}</text>${sub}${tag}
+ <text data-node-label${hasSub ? ' data-detail-anchor' : ''} x="${node.cx}" y="${node.y + 21}" class="t-primary" font-size="${labelFontSize}" font-weight="600" text-anchor="middle">${esc(node.label)}</text>${sub}${tag}
</g>`;
}
@@ -568,7 +667,7 @@ function renderEdgePath(edge, index) {
function renderEdgeLabel(edge, index) {
if (!edge.label) return '';
const routed = pathFor(edge);
- const [lx, ly] = labelPoint(edge, routed.points);
+ const [lx, ly] = workflowEdgeLabelPoint(edge, routed.points);
const labelW = Math.max(30, textUnits(edge.label) * 4.8 + 10);
return ` <g data-detail="context" ${focusEdgeAttrs(edge.from, edge.to, edge.label, index, edge.id)}>
<rect x="${lx - labelW / 2}" y="${ly - 10}" width="${labelW}" height="14" rx="3" class="c-mask"/>
diff --git a/archify/scripts/check-render-output.mjs b/archify/scripts/check-render-output.mjs
index 6730dbf5..704b9650 100644
--- a/archify/scripts/check-render-output.mjs
+++ b/archify/scripts/check-render-output.mjs
@@ -3,6 +3,12 @@
import fs from 'node:fs';
import path from 'node:path';
import { collectAmbiguousCorridors, collectBorderRuns, collectLabelRouteClearance, collectRouteRhythmIssues, routeBudgetMetrics } from '../renderers/shared/geometry.mjs';
+import {
+ DESKTOP_READABILITY_VIEWPORT,
+ DESKTOP_READER_DIAGRAM_WIDTH,
+ MIN_PROJECTED_NODE_TEXT_PX,
+ projectedNodeTextPx,
+} from '../renderers/shared/desktop-readability.mjs';
const input = process.argv[2];
@@ -46,6 +52,8 @@ let composition = {
shortEndpointSegmentCount: 0,
shortInteriorSegmentCount: 0,
microSegmentCount: 0,
+ desktopReadabilityIssues: 0,
+ minProjectedNodeTextPx: null,
},
suggestedLimits: { bendsPerRelationship: 2, stretch: 1.35, segmentPx: 16, microSegmentPx: 8 },
issues: [],
@@ -67,6 +75,7 @@ if (svgMatches.length === 1) {
addCheck('finite_svg', !/\b(?:NaN|undefined|Infinity|-Infinity)\b/.test(svg));
const legendStart = svg.indexOf('<!-- Legend -->');
const beforeLegend = legendStart >= 0 ? svg.slice(0, legendStart) : svg;
+ const desktopReadabilityIssue = collectDesktopReadability(svgAttrs, beforeLegend);
const arrows = collectArrows(beforeLegend);
const diagonal = arrows.flatMap((arrow) => diagonalStraightSegments(arrow).map((segment) => ({ arrow, ...segment })));
addCheck(
@@ -108,16 +117,19 @@ if (svgMatches.length === 1) {
const corridorIsError = qualityProfile === 'showcase';
const rhythmIsError = qualityProfile === 'showcase';
const labelClearanceIsError = qualityProfile === 'showcase';
+ const desktopReadabilityIsError = qualityProfile === 'showcase';
const compositionErrors = (qualityGatesEnforced ? containerBorderRuns.length : 0)
+ (crossingIsError ? relationshipCrossings.length : 0)
+ (corridorIsError ? ambiguousCorridors.length : 0)
+ (labelClearanceIsError ? labelRouteClearance.length : 0)
- + (rhythmIsError ? routeRhythmIssues.length : 0);
+ + (rhythmIsError ? routeRhythmIssues.length : 0)
+ + (desktopReadabilityIsError && desktopReadabilityIssue ? 1 : 0);
const compositionWarnings = (qualityGatesEnforced ? 0 : containerBorderRuns.length)
+ (crossingIsError ? 0 : relationshipCrossings.length)
+ (corridorIsError ? 0 : ambiguousCorridors.length)
+ (labelClearanceIsError ? 0 : labelRouteClearance.length)
- + (rhythmIsError ? 0 : routeRhythmIssues.length);
+ + (rhythmIsError ? 0 : routeRhythmIssues.length)
+ + (desktopReadabilityIsError || !desktopReadabilityIssue ? 0 : 1);
composition = {
schemaVersion: 1,
profile: qualityProfile,
@@ -134,6 +146,8 @@ if (svgMatches.length === 1) {
minLabelRouteClearance: labelRouteMeasurements.length
? Math.round(Math.min(...labelRouteMeasurements.map((hit) => hit.clearance)) * 10) / 10
: null,
+ desktopReadabilityIssues: desktopReadabilityIssue ? 1 : 0,
+ minProjectedNodeTextPx: desktopReadabilityIssue?.projectedFontPx ?? null,
...roundedRouteMetrics(routeMetrics),
},
suggestedLimits: { bendsPerRelationship: 2, stretch: 1.35, segmentPx: 16, microSegmentPx: 8 },
@@ -191,6 +205,20 @@ if (svgMatches.length === 1) {
from: hit.start.map((value) => Math.round(value * 10) / 10),
to: hit.end.map((value) => Math.round(value * 10) / 10),
})),
+ ...(desktopReadabilityIssue ? [{
+ severity: desktopReadabilityIsError ? 'error' : 'warning',
+ code: 'composition/desktop-readability',
+ viewportWidth: DESKTOP_READABILITY_VIEWPORT.width,
+ viewportHeight: DESKTOP_READABILITY_VIEWPORT.height,
+ availableDiagramWidth: DESKTOP_READER_DIAGRAM_WIDTH,
+ viewBoxWidth: desktopReadabilityIssue.viewBoxWidth,
+ scale: desktopReadabilityIssue.scale,
+ text: desktopReadabilityIssue.text,
+ detail: desktopReadabilityIssue.detail,
+ sourceFontPx: desktopReadabilityIssue.sourceFontPx,
+ projectedFontPx: desktopReadabilityIssue.projectedFontPx,
+ minimumProjectedFontPx: MIN_PROJECTED_NODE_TEXT_PX,
+ }] : []),
],
};
addCheck(
@@ -590,6 +618,37 @@ function textBox(attrs, text) {
};
}
+function collectDesktopReadability(svgAttrs, fragment) {
+ const viewBox = String(svgAttrs.viewBox || '').trim().split(/[\s,]+/).map(Number);
+ const viewBoxWidth = viewBox.length === 4 ? viewBox[2] : Number.NaN;
+ if (!Number.isFinite(viewBoxWidth) || viewBoxWidth <= 0) return null;
+ const scale = Math.min(1, DESKTOP_READER_DIAGRAM_WIDTH / viewBoxWidth);
+ let worst = null;
+ for (const match of fragment.matchAll(/<text\b([^>]*)>([\s\S]*?)<\/text>/gi)) {
+ const primary = /\bdata-node-label(?:\s*=|\s|$)/i.test(match[1]);
+ const boundary = /\bdata-boundary-label(?:\s*=|\s|$)/i.test(match[1]);
+ const context = /\bdata-detail\s*=\s*"context"/i.test(match[1]);
+ if (!primary && !boundary && !context) continue;
+ const attrs = parseAttrs(match[1]);
+ const fontSize = Number.parseFloat(attrs['font-size'] || '');
+ if (!Number.isFinite(fontSize)) continue;
+ const projected = projectedNodeTextPx(fontSize, viewBoxWidth);
+ if (projected >= MIN_PROJECTED_NODE_TEXT_PX) continue;
+ const candidate = {
+ viewBoxWidth,
+ scale,
+ text: stripTags(match[2]).trim(),
+ detail: primary
+ ? 'primary'
+ : boundary ? 'boundary' : 'context',
+ sourceFontPx: fontSize,
+ projectedFontPx: projected,
+ };
+ if (!worst || candidate.projectedFontPx < worst.projectedFontPx) worst = candidate;
+ }
+ return worst;
+}
+
function estimatedTextWidth(text, fontSize) {
let units = 0;
for (const char of text) units += char.charCodeAt(0) > 255 ? 1.8 : 0.62;
diff --git a/archify/test/adaptive-reader-layout.test.mjs b/archify/test/adaptive-reader-layout.test.mjs
index c672cd56..f8e12a01 100644
--- a/archify/test/adaptive-reader-layout.test.mjs
+++ b/archify/test/adaptive-reader-layout.test.mjs
@@ -3,6 +3,15 @@ import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
+import {
+ DESKTOP_READABILITY_VIEWPORT,
+ DESKTOP_READER_DIAGRAM_WIDTH,
+ DESKTOP_READER_HORIZONTAL_CHROME,
+ DESKTOP_READER_MIN_WIDTH,
+ MIN_PROJECTED_NODE_TEXT_PX,
+ minimumReadableSourceTextPx,
+ projectedNodeTextPx,
+} from '../renderers/shared/desktop-readability.mjs';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const skillRoot = path.resolve(__dirname, '..');
@@ -24,6 +33,26 @@ test('wide desktop diagrams use one height-budgeted reader shell instead of brea
assert.match(reader, /html\.style\.setProperty\('--archify-reader-width', rounded \+ 'px'\)/);
});
+test('desktop readability budget matches the minimum adaptive reader at 1440 by 900', () => {
+ assert.deepEqual(DESKTOP_READABILITY_VIEWPORT, { width: 1440, height: 900 });
+ assert.equal(DESKTOP_READER_MIN_WIDTH, 960);
+ assert.equal(DESKTOP_READER_HORIZONTAL_CHROME, 30);
+ assert.equal(DESKTOP_READER_DIAGRAM_WIDTH, 930);
+ assert.match(reader, new RegExp(`var MIN_READER_WIDTH = ${DESKTOP_READER_MIN_WIDTH}`));
+ assert.match(template, /@media \(min-width: 768px\) and \(max-height: 1100px\)[\s\S]*?\.diagram-container \{ padding: 0\.875rem; \}/);
+ assert.match(template, /@media \(min-width: 768px\) and \(max-height: 920px\)[\s\S]*?body \{ padding-block: 1\.25rem; \}/);
+ assert.match(template, /\.diagram-container \{[\s\S]*?border: 1px solid var\(--panel-border\)/);
+});
+
+test('desktop readability source floor is the inverse of the projected-size gate', () => {
+ const sourceFloor = minimumReadableSourceTextPx(1376);
+ assert.ok(Math.abs(sourceFloor - 8.87741935483871) < 1e-12);
+ assert.ok(Math.abs(projectedNodeTextPx(sourceFloor, 1376) - MIN_PROJECTED_NODE_TEXT_PX) < 1e-12);
+ assert.equal(minimumReadableSourceTextPx(DESKTOP_READER_DIAGRAM_WIDTH), MIN_PROJECTED_NODE_TEXT_PX);
+ assert.equal(minimumReadableSourceTextPx(700), MIN_PROJECTED_NODE_TEXT_PX);
+ assert.ok(Number.isNaN(minimumReadableSourceTextPx(0)));
+});
+
test('adaptive width preserves canonical SVG geometry and yields to specialized viewer modes', () => {
assert.match(reader, /window\.innerWidth >= MIN_DESKTOP_WIDTH/);
assert.match(reader, /html\.getAttribute\('data-embed'\) !== 'true'/);
@@ -45,3 +74,12 @@ test('reader remeasures real content and reduces width before allowing desktop p
assert.match(skill, /Generate one responsive artifact for laptops and external displays/);
assert.match(skill, /preserve the authored SVG\/viewBox, proportions, semantic geometry/);
});
+
+test('reader exposes an explicit stable-dimensions contract for browser evidence', () => {
+ assert.match(reader, /function stableSnapshot\(\)/);
+ assert.match(reader, /function whenStable\(\)/);
+ assert.match(reader, /document\.fonts && document\.fonts\.ready/);
+ assert.match(reader, /Math\.ceil\(document\.body\.scrollHeight\)/);
+ assert.match(reader, /stableFrames >= 3/);
+ assert.match(reader, /whenStable: whenStable/);
+});
diff --git a/archify/test/architecture-delta.test.mjs b/archify/test/architecture-delta.test.mjs
index 51f1426a..147b7c1e 100644
--- a/archify/test/architecture-delta.test.mjs
+++ b/archify/test/architecture-delta.test.mjs
@@ -194,6 +194,45 @@ test('mixed semantic and geometry relationship changes retain both exact routes'
assert.deepEqual(validateArchitectureDeltaHtml(html, receipt), { ok: true, checksPassed: 10, checkCount: 10 });
});
+test('baseline boundary title masks stay below current components and carry delta identity', () => {
+ const documentAt = (pos, pad) => ({
+ schema_version: 1,
+ diagram_type: 'architecture',
+ meta: { title: 'Boundary mask z-order', quality_profile: 'standard', viewBox: [600, 400] },
+ components: [{ id: 'node', type: 'backend', label: 'Current node', pos, size: [120, 60] }],
+ connections: [],
+ boundaries: [{ kind: 'region', label: 'Boundary label', wraps: ['node'], pad }],
+ });
+ const basePath = path.join(tmp, 'boundary-mask.base.json');
+ const headPath = path.join(tmp, 'boundary-mask.head.json');
+ const output = path.join(tmp, 'boundary-mask.delta.html');
+ fs.writeFileSync(basePath, JSON.stringify(documentAt([250, 200], 30)));
+ fs.writeFileSync(headPath, JSON.stringify(documentAt([224, 180], 40)));
+
+ const result = run(['compare', 'architecture', basePath, headPath, output, '--json']);
+ assert.equal(result.status, 0, result.stderr);
+ const html = fs.readFileSync(output, 'utf8');
+ const delta = html.match(/<section class="canvas" data-view="delta">([\s\S]*?)<\/section>/)?.[1] || '';
+ const currentComponents = delta.indexOf('<!-- Components -->');
+ const currentNode = delta.indexOf('data-node-id="node"', currentComponents);
+ const phantomMask = delta.match(
+ /<rect data-graph-role="structural-frame-label-mask"[^>]*data-delta-state="moved-from"[^>]*data-delta-boundary-state="moved-from"[^>]*data-delta-boundary-mask-key="region:Boundary label"[^>]*\/>/,
+ )?.[0];
+ const currentNodeRect = delta.slice(currentNode).match(/<rect\b[^>]*\/>/)?.[0];
+ assert.ok(phantomMask && currentNodeRect, 'expected the phantom mask and current component rect');
+ const rect = (tag) => Object.fromEntries(
+ [...tag.matchAll(/\b(x|y|width|height)="([^"]+)"/g)].map((match) => [match[1], Number(match[2])]),
+ );
+ const maskBox = rect(phantomMask);
+ const nodeBox = rect(currentNodeRect);
+ const overlaps = maskBox.x < nodeBox.x + nodeBox.width
+ && maskBox.x + maskBox.width > nodeBox.x
+ && maskBox.y < nodeBox.y + nodeBox.height
+ && maskBox.y + maskBox.height > nodeBox.y;
+ assert.equal(overlaps, true, `expected overlap: ${JSON.stringify({ maskBox, nodeBox })}`);
+ assert.ok(delta.indexOf(phantomMask) < currentNode, 'phantom mask must paint below the current component');
+});
+
test('same-label node id changes remain one removal plus one addition', () => {
const base = read(baseFixture);
const head = read(baseFixture);
diff --git a/archify/test/automatic-port-spread.test.mjs b/archify/test/automatic-port-spread.test.mjs
index f7013e53..dc6e1868 100644
--- a/archify/test/automatic-port-spread.test.mjs
+++ b/archify/test/automatic-port-spread.test.mjs
@@ -253,7 +253,7 @@ test('architecture: an unspread near-aligned connection shares one horizontal ax
assert.deepEqual(connectionPoints(html, 'console-controlplane'), [[430, 332], [500, 332]]);
});
-test('workflow: automatic cross-lane fan-out spreads the shared source port', () => {
+test('workflow: automatic cross-lane fan-out selects distinct perpendicular source sides', () => {
const html = render('workflow', {
schema_version: 1,
diagram_type: 'workflow',
@@ -276,9 +276,9 @@ test('workflow: automatic cross-lane fan-out spreads the shared source port', ()
],
});
- assert.deepEqual(connectionPoints(html, 'to-upper')[0], [134, 233]);
+ assert.deepEqual(connectionPoints(html, 'to-upper')[0], [88, 217]);
assert.deepEqual(connectionPoints(html, 'to-middle')[0], [134, 243]);
- assert.deepEqual(connectionPoints(html, 'to-lower')[0], [134, 253]);
+ assert.deepEqual(connectionPoints(html, 'to-lower')[0], [88, 269]);
});
test('dataflow: automatic fan-out spreads flows without changing their authored topology', () => {
diff --git a/archify/test/base-input-compatibility.test.mjs b/archify/test/base-input-compatibility.test.mjs
new file mode 100644
index 00000000..c500d36a
--- /dev/null
+++ b/archify/test/base-input-compatibility.test.mjs
@@ -0,0 +1,42 @@
+import assert from 'node:assert/strict';
+import { spawnSync } from 'node:child_process';
+import fs from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';
+import test from 'node:test';
+import { fileURLToPath } from 'node:url';
+
+const here = path.dirname(fileURLToPath(import.meta.url));
+const skillRoot = path.resolve(here, '..');
+const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-base-input-compatibility-'));
+
+function renderBaseFixture(type, name) {
+ const input = path.join(skillRoot, 'test', 'fixtures', 'v1-baseline', name);
+ const output = path.join(tmp, `${name}.html`);
+ return spawnSync(process.execPath, [
+ path.join(skillRoot, 'bin', 'archify.mjs'),
+ 'render',
+ type,
+ input,
+ output,
+ ], {
+ cwd: skillRoot,
+ encoding: 'utf8',
+ });
+}
+
+test('base named-route fixtures remain valid without redundant authored endpoint sides', () => {
+ for (const [type, name] of [
+ ['dataflow', 'event-stream.dataflow.json'],
+ ['architecture', 'production-deployment.architecture.json'],
+ ]) {
+ const result = renderBaseFixture(type, name);
+ assert.equal(
+ result.status,
+ 0,
+ `${type} base input must remain valid:\n${result.stdout || result.stderr}`,
+ );
+ }
+});
+
+process.on('exit', () => fs.rmSync(tmp, { recursive: true, force: true }));
diff --git a/archify/test/desktop-reader-browser.test.mjs b/archify/test/desktop-reader-browser.test.mjs
new file mode 100644
index 00000000..867a7cb4
--- /dev/null
+++ b/archify/test/desktop-reader-browser.test.mjs
@@ -0,0 +1,58 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { execFileSync } from 'node:child_process';
+import fs from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+import { findChrome, runVisualCheck } from '../bin/visual-check.mjs';
+import { DESKTOP_READABILITY_VIEWPORT, MIN_PROJECTED_NODE_TEXT_PX } from '../renderers/shared/desktop-readability.mjs';
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+const skillRoot = path.resolve(__dirname, '..');
+const chromePath = process.env.ARCHIFY_CHROME ? findChrome() : null;
+
+test('production showcase is readable in the real 1440 by 900 adaptive reader', {
+ skip: chromePath ? false : 'Set ARCHIFY_CHROME to run the real browser regression.',
+}, async () => {
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-desktop-reader-'));
+ const artifact = path.join(tmp, 'production-deployment.html');
+ try {
+ execFileSync(process.execPath, [
+ path.join(skillRoot, 'bin', 'archify.mjs'),
+ 'render',
+ 'architecture',
+ path.join(skillRoot, 'examples', 'production-deployment.architecture.json'),
+ artifact,
+ '--quality',
+ 'showcase',
+ ], { cwd: skillRoot, encoding: 'utf8' });
+
+ for (let attempt = 1; attempt <= 3; attempt += 1) {
+ const result = await runVisualCheck({ artifactPath: artifact, chromePath });
+ assert.equal(result.exitCode, 0, `attempt ${attempt}: ${JSON.stringify(result.receipt, null, 2)}`);
+ assert.equal(result.receipt.readability.status, 'pass', `attempt ${attempt}: ${JSON.stringify(result.receipt, null, 2)}`);
+ const desktop = result.receipt.readability.viewports.find(({ width, height }) => (
+ width === DESKTOP_READABILITY_VIEWPORT.width && height === DESKTOP_READABILITY_VIEWPORT.height
+ ));
+ const darkDesktop = result.receipt.captures.screenshots.find(({ width, height, theme }) => (
+ width === DESKTOP_READABILITY_VIEWPORT.width
+ && height === DESKTOP_READABILITY_VIEWPORT.height
+ && theme === 'dark'
+ ));
+ for (const observation of [desktop, darkDesktop]) {
+ assert.ok(observation);
+ assert.equal(observation.readerWidth, 960);
+ assert.equal(observation.diagramWidth, 930);
+ assert.ok(observation.minimumProjectedNodeTextPx >= MIN_PROJECTED_NODE_TEXT_PX);
+ assert.equal(observation.minimumProjectedNodeTextDetail, 'boundary');
+ assert.equal(observation.minimumProjectedNodeText, 'AWS eu-west-1 / disaster recovery');
+ assert.equal(observation.readabilityOk, true);
+ assert.equal(observation.scrollHeight, DESKTOP_READABILITY_VIEWPORT.height);
+ }
+ }
+ } finally {
+ fs.rmSync(tmp, { recursive: true, force: true });
+ }
+});
diff --git a/archify/test/fixtures/automatic-routing-node-border-clearance.workflow.json b/archify/test/fixtures/automatic-routing-node-border-clearance.workflow.json
new file mode 100644
index 00000000..f5e48e87
--- /dev/null
+++ b/archify/test/fixtures/automatic-routing-node-border-clearance.workflow.json
@@ -0,0 +1,40 @@
+{
+ "schema_version": 1,
+ "diagram_type": "workflow",
+ "meta": {
+ "title": "自动连线节点边框避让回归",
+ "quality_profile": "showcase",
+ "viewBox": [720, 360]
+ },
+ "lanes": [
+ { "id": "orchestrator", "label": "Orchestrator PTY" },
+ { "id": "runtime", "label": "Hive Runtime" }
+ ],
+ "nodes": [
+ {
+ "id": "team_send",
+ "lane": "orchestrator",
+ "col": 2,
+ "type": "backend",
+ "label": "team send 派单",
+ "sublabel": "选择目标 Worker"
+ },
+ {
+ "id": "inject",
+ "lane": "runtime",
+ "col": 1,
+ "type": "security",
+ "label": "校验并注入输入",
+ "sublabel": "UI token → PTY stdin"
+ }
+ ],
+ "edges": [
+ {
+ "id": "stdin",
+ "from": "inject",
+ "to": "team_send",
+ "label": "PTY stdin",
+ "variant": "emphasis"
+ }
+ ]
+}
diff --git a/archify/test/fixtures/v1-baseline/event-stream.dataflow.json b/archify/test/fixtures/v1-baseline/event-stream.dataflow.json
new file mode 100644
index 00000000..e7cc5002
--- /dev/null
+++ b/archify/test/fixtures/v1-baseline/event-stream.dataflow.json
@@ -0,0 +1,57 @@
+{
+ "schema_version": 1,
+ "diagram_type": "dataflow",
+ "meta": {
+ "title": "Order Event-stream Topology",
+ "output": "examples/event-stream.html",
+ "viewBox": [1080, 780],
+ "animation": "trace",
+ "visual_preset": "signal-flow",
+ "quality_profile": "showcase",
+ "views": [
+ { "id": "order-transit", "label": "Order event transit", "focus": ["checkout", "orders", "validate", "state", "fulfillment"], "note": "Follow an order from producer through ordered processing to fulfillment." },
+ { "id": "payment-transit", "label": "Payment event transit", "focus": ["billing", "payments", "enrich", "state", "analytics"], "note": "Track payment facts into the shared materialized state and analytics." },
+ { "id": "failure-and-replay", "label": "Failure and replay", "focus": ["validate", "enrich", "dlq", "replay", "ops"], "note": "Isolate dead letters, operator review, and controlled replay ownership." }
+ ]
+ },
+ "stages": [
+ { "label": "Producers" },
+ { "label": "Transit" },
+ { "label": "Processors" },
+ { "label": "State + recovery" },
+ { "label": "Consumers" }
+ ],
+ "nodes": [
+ { "id": "checkout", "type": "frontend", "label": "Checkout API", "sublabel": "order producer", "stage": 0, "row": 0, "tag": "team commerce" },
+ { "id": "billing", "type": "backend", "label": "Billing API", "sublabel": "payment producer", "stage": 0, "row": 2, "tag": "team money" },
+ { "id": "orders", "type": "messagebus", "label": "orders.v1", "sublabel": "12 partitions", "stage": 1, "row": 0, "tag": "key: order_id" },
+ { "id": "payments", "type": "messagebus", "label": "payments.v2", "sublabel": "8 partitions", "stage": 1, "row": 2, "tag": "key: order_id" },
+ { "id": "validate", "type": "backend", "label": "Order Validate", "sublabel": "group fulfillment", "stage": 2, "row": 0, "tag": "ordered" },
+ { "id": "enrich", "type": "backend", "label": "Payment Enrich", "sublabel": "group analytics", "stage": 2, "row": 2, "tag": "at-least-once" },
+ { "id": "state", "type": "database", "label": "Order State", "sublabel": "materialized view", "stage": 3, "row": 1, "tag": "idempotent" },
+ { "id": "dlq", "type": "messagebus", "label": "events.dlq", "sublabel": "poison events", "stage": 3, "row": 4, "tag": "7-day retention" },
+ { "id": "fulfillment", "type": "backend", "label": "Fulfillment", "sublabel": "shipping workflow", "stage": 4, "row": 0, "tag": "consumer" },
+ { "id": "analytics", "type": "database", "label": "Analytics", "sublabel": "streaming facts", "stage": 4, "row": 2, "tag": "consumer" },
+ { "id": "replay", "type": "security", "label": "Replay Tool", "sublabel": "approved batch", "stage": 4, "row": 4, "tag": "operator gate" },
+ { "id": "ops", "type": "external", "label": "On-call", "sublabel": "DLQ owner", "stage": 4, "row": 3, "yOffset": -18, "tag": "SRE" }
+ ],
+ "flows": [
+ { "from": "checkout", "to": "orders", "label": "OrderPlaced", "classification": "schema v1", "variant": "emphasis", "route": "straight" },
+ { "from": "billing", "to": "payments", "label": "PaymentCaptured", "classification": "schema v2", "variant": "emphasis", "route": "straight" },
+ { "from": "orders", "to": "validate", "label": "ordered orders", "classification": "consumer group", "variant": "emphasis", "route": "straight" },
+ { "from": "payments", "to": "enrich", "label": "payment facts", "classification": "at-least-once", "variant": "emphasis", "route": "straight" },
+ { "from": "validate", "to": "state", "label": "valid order", "classification": "idempotent", "variant": "emphasis", "route": "vertical-channel" },
+ { "from": "enrich", "to": "state", "label": "enriched payment", "classification": "idempotent", "variant": "default", "route": "vertical-channel" },
+ { "from": "state", "to": "fulfillment", "label": "ready orders", "classification": "read model", "variant": "emphasis", "route": "vertical-channel" },
+ { "from": "state", "to": "analytics", "label": "order facts", "classification": "non-PII", "variant": "default", "route": "vertical-channel" },
+ { "from": "validate", "to": "dlq", "label": "invalid event", "classification": "dead letter", "variant": "security", "fromSide": "top", "toSide": "top", "via": [[530, 80], [20, 80], [20, 550], [745, 550]], "labelAt": [300, 550] },
+ { "from": "enrich", "to": "dlq", "label": "poison event", "classification": "dead letter", "variant": "security", "route": "bottom-channel", "labelDy": 30 },
+ { "from": "dlq", "to": "ops", "label": "failure sample", "classification": "restricted", "variant": "security", "route": "vertical-channel" },
+ { "from": "dlq", "to": "replay", "label": "approved replay", "classification": "audited batch", "variant": "dashed", "route": "straight", "labelDy": 30 }
+ ],
+ "cards": [
+ { "dot": "amber", "title": "Transit Contract", "items": ["Every event and topic is named", "Partition keys preserve per-order ordering", "Consumer groups expose processing ownership"] },
+ { "dot": "emerald", "title": "State + Delivery", "items": ["Processors write an idempotent materialized view", "Fulfillment and analytics consume distinct assets", "At-least-once delivery never implies duplicate business effects"] },
+ { "dot": "rose", "title": "Failure Ownership", "items": ["Poison events land in a retained dead-letter topic", "On-call inspects samples before replay", "Replay is gated, batched, and auditable"] }
+ ]
+}
diff --git a/archify/test/fixtures/v1-baseline/production-deployment.architecture.json b/archify/test/fixtures/v1-baseline/production-deployment.architecture.json
new file mode 100644
index 00000000..91507689
--- /dev/null
+++ b/archify/test/fixtures/v1-baseline/production-deployment.architecture.json
@@ -0,0 +1,71 @@
+{
+ "schema_version": 1,
+ "diagram_type": "architecture",
+ "meta": {
+ "title": "Production Deployment Ownership",
+ "output": "examples/production-deployment.html",
+ "visual_preset": "blueprint",
+ "animation": "trace",
+ "quality_profile": "showcase",
+ "engineering_profile": "deployment-ownership",
+ "views": [
+ {
+ "id": "request-boundary",
+ "label": "Request crosses the edge",
+ "focus": ["clients", "edge", "gateway", "api_a", "api_b"],
+ "note": "Follow public traffic into the private application network."
+ },
+ {
+ "id": "state-ownership",
+ "label": "State and ownership",
+ "focus": ["api_a", "api_b", "redis", "postgres", "replica"],
+ "note": "Separate stateless platform workloads from data-team-owned state."
+ },
+ {
+ "id": "async-operations",
+ "label": "Async and operations",
+ "focus": ["api_b", "events", "worker", "audit", "observability"],
+ "note": "See the asynchronous work and the evidence it emits."
+ }
+ ]
+ },
+ "components": [
+ { "id": "clients", "type": "external", "label": "Customers", "sublabel": "web + mobile", "pos": [38, 300], "size": [122, 60] },
+ { "id": "edge", "type": "cloud", "label": "Global Edge", "sublabel": "CDN + WAF", "pos": [230, 300], "size": [126, 60], "tag": "edge team" },
+ { "id": "gateway", "type": "security", "label": "API Gateway", "sublabel": "public :443", "pos": [430, 300], "size": [128, 60], "tag": "platform" },
+ { "id": "api_a", "type": "backend", "label": "API Pods / AZ-a", "sublabel": "private subnet", "pos": [630, 195], "size": [136, 62], "tag": "app team" },
+ { "id": "api_b", "type": "backend", "label": "API Pods / AZ-b", "sublabel": "private subnet", "pos": [630, 405], "size": [136, 62], "tag": "app team" },
+ { "id": "redis", "type": "database", "label": "Redis", "sublabel": "multi-AZ cache", "pos": [840, 195], "size": [126, 62], "tag": "platform" },
+ { "id": "postgres", "type": "database", "label": "PostgreSQL", "sublabel": "primary / encrypted", "pos": [840, 405], "size": [126, 62], "tag": "data team" },
+ { "id": "events", "type": "messagebus", "label": "Event Bus", "sublabel": "orders.v1", "pos": [1040, 300], "size": [126, 60], "tag": "platform" },
+ { "id": "worker", "type": "backend", "label": "Workers", "sublabel": "private workload", "pos": [1240, 300], "size": [126, 60], "tag": "app team" },
+ { "id": "replica", "type": "database", "label": "DR Replica", "sublabel": "eu-west-1", "pos": [1040, 610], "size": [126, 62], "tag": "data team" },
+ { "id": "audit", "type": "cloud", "label": "Audit Archive", "sublabel": "immutable objects", "pos": [1240, 465], "size": [126, 62], "tag": "security" },
+ { "id": "observability", "type": "external", "label": "Observability", "sublabel": "metrics + traces", "pos": [1240, 85], "size": [126, 62], "tag": "SRE" }
+ ],
+ "boundaries": [
+ { "kind": "region", "label": "AWS us-east-1 / production", "wraps": ["edge", "gateway", "api_a", "api_b", "redis", "postgres", "events", "worker", "audit"] },
+ { "kind": "security-group", "label": "private application network", "wraps": ["api_a", "api_b", "redis", "postgres", "events", "worker"] },
+ { "kind": "region", "label": "AWS eu-west-1 / disaster recovery", "wraps": ["replica"] },
+ { "kind": "security-group", "label": "DR private subnet", "wraps": ["replica"], "pad": 14 }
+ ],
+ "connections": [
+ { "from": "clients", "to": "edge", "label": "HTTPS", "variant": "emphasis" },
+ { "from": "edge", "to": "gateway", "label": "mTLS", "variant": "security" },
+ { "from": "gateway", "to": "api_a", "label": "VPC route", "variant": "emphasis", "route": "orthogonal-h", "labelAt": [594, 275] },
+ { "from": "gateway", "to": "api_b", "label": "VPC route", "variant": "emphasis", "route": "orthogonal-h", "labelAt": [594, 385] },
+ { "from": "api_a", "to": "redis", "label": "cache", "route": "straight" },
+ { "from": "api_b", "to": "postgres", "label": "SQL", "route": "straight" },
+ { "from": "api_a", "to": "events", "label": "publish", "variant": "dashed", "fromSide": "top", "toSide": "top", "via": [[698, 170], [1103, 170]] },
+ { "from": "api_b", "to": "events", "variant": "dashed", "fromSide": "top", "toSide": "bottom", "via": [[698, 380], [1103, 380]] },
+ { "from": "events", "to": "worker", "variant": "emphasis" },
+ { "from": "postgres", "to": "replica", "label": "cross-region WAL", "variant": "security", "route": "orthogonal-v", "labelAt": [1003, 529] },
+ { "from": "worker", "to": "audit", "label": "evidence", "variant": "dashed", "fromSide": "bottom", "toSide": "top", "labelDy": 58 },
+ { "from": "worker", "to": "observability", "label": "OTLP", "variant": "dashed", "route": "orthogonal-v" }
+ ],
+ "cards": [
+ { "dot": "cyan", "title": "Runtime Ownership", "items": ["Platform owns the edge, gateway, cache, and event bus", "Application teams own API pods and workers", "Data owns primary and disaster-recovery state"] },
+ { "dot": "rose", "title": "Named Crossings", "items": ["Public HTTPS terminates at the managed edge", "mTLS crosses into the application network", "Cross-region WAL is explicit and encrypted"] },
+ { "dot": "emerald", "title": "Operational Evidence", "items": ["Workers emit traces to SRE-owned observability", "Audit evidence lands in immutable storage", "Unknown placement should remain marked, never invented"] }
+ ]
+}
diff --git a/archify/test/layout-rules.test.mjs b/archify/test/layout-rules.test.mjs
index dc3aef88..f5f0c051 100644
--- a/archify/test/layout-rules.test.mjs
+++ b/archify/test/layout-rules.test.mjs
@@ -51,12 +51,137 @@ function render(mode, doc) {
}
}
+function validateCli(mode, doc, quality = 'showcase') {
+ const input = path.join(tmp, `${mode}-cli-${Math.abs(hash(JSON.stringify(doc)))}.json`);
+ fs.writeFileSync(input, JSON.stringify(doc));
+ try {
+ const stdout = execFileSync('node', [
+ path.join(skillRoot, 'bin', 'archify.mjs'),
+ 'validate',
+ mode,
+ input,
+ '--quality',
+ quality,
+ '--json',
+ ], { encoding: 'utf8' });
+ return { code: 0, result: JSON.parse(stdout) };
+ } catch (err) {
+ return {
+ code: err.status ?? 1,
+ result: JSON.parse(String(err.stdout || '{}')),
+ };
+ }
+}
+
function hash(s) {
let h = 0;
for (let i = 0; i < s.length; i += 1) h = (h * 31 + s.charCodeAt(i)) | 0;
return h;
}
+function workflowEdgePoints(html, id) {
+ const escapedId = id.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ const pointsAttribute = html.match(
+ new RegExp(`data-edge-id="${escapedId}" data-composition-points="([^"]+)"`),
+ )?.[1];
+ assert.ok(pointsAttribute, `expected rendered workflow edge points for ${id}`);
+ return pointsAttribute.split(';').map((point) => point.split(',').map(Number));
+}
+
+function workflowNodeRect(html, id) {
+ const escapedId = id.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ const match = html.match(new RegExp(
+ `<g id="node-${escapedId}"[^>]*>[\\s\\S]*?<rect x="([^"]+)" y="([^"]+)" width="([^"]+)" height="([^"]+)"`,
+ ));
+ assert.ok(match, `expected rendered workflow node rect for ${id}`);
+ const [, x, y, width, height] = match.map(Number);
+ return { x, y, width, height };
+}
+
+function boundaryFrameRect(html, index) {
+ const match = html.match(new RegExp(
+ `<rect data-graph-role="structural-frame"[^>]*data-composition-frame-id="${index}"[^>]*x="([^"]+)" y="([^"]+)" width="([^"]+)" height="([^"]+)"`,
+ ));
+ assert.ok(match, `expected boundary frame ${index}`);
+ const [, x, y, width, height] = match.map(Number);
+ return { x, y, width, height };
+}
+
+function boundaryTitleMasks(html) {
+ return [...html.matchAll(
+ /<g data-graph-role="structural-frame-label"[^>]*data-composition-frame-id="(\d+)"[^>]*>[\s\S]*?<rect data-graph-role="structural-frame-label-mask" x="([^"]+)" y="([^"]+)" width="([^"]+)" height="([^"]+)"/g,
+ )].map((match) => ({
+ index: Number(match[1]),
+ x: Number(match[2]),
+ y: Number(match[3]),
+ width: Number(match[4]),
+ height: Number(match[5]),
+ }));
+}
+
+function rectContainsRect(outer, inner) {
+ return outer.x <= inner.x
+ && outer.y <= inner.y
+ && outer.x + outer.width >= inner.x + inner.width
+ && outer.y + outer.height >= inner.y + inner.height;
+}
+
+function rectanglesOverlap(left, right) {
+ return left.x < right.x + right.width
+ && left.x + left.width > right.x
+ && left.y < right.y + right.height
+ && left.y + left.height > right.y;
+}
+
+function workflowEdgeLabelPoint(html, id) {
+ const escapedId = id.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ const match = html.match(new RegExp(
+ `<g data-detail="context"[^>]*data-edge-id="${escapedId}"[^>]*>[\\s\\S]*?<text x="([^"]+)" y="([^"]+)"`,
+ ));
+ assert.ok(match, `expected rendered workflow edge label for ${id}`);
+ return match.slice(1).map(Number);
+}
+
+function axisOverlapLength(a1, a2, b1, b2) {
+ return Math.max(0, Math.min(Math.max(a1, a2), Math.max(b1, b2))
+ - Math.max(Math.min(a1, a2), Math.min(b1, b2)));
+}
+
+function workflowNodeBorderOverlap(points, rect) {
+ const hits = [];
+ for (let index = 0; index < points.length - 1; index += 1) {
+ const [start, end] = [points[index], points[index + 1]];
+ if (start[0] === end[0] && (start[0] === rect.x || start[0] === rect.x + rect.width)) {
+ const length = axisOverlapLength(start[1], end[1], rect.y, rect.y + rect.height);
+ if (length > 0) hits.push({ segment: index, length, start, end });
+ }
+ if (start[1] === end[1] && (start[1] === rect.y || start[1] === rect.y + rect.height)) {
+ const length = axisOverlapLength(start[0], end[0], rect.x, rect.x + rect.width);
+ if (length > 0) hits.push({ segment: index, length, start, end });
+ }
+ }
+ return hits;
+}
+
+function assertRelationshipsAvoidAllNodeBorders(html, relationships, diagramNodes) {
+ for (const [edgeIndex, edge] of relationships.entries()) {
+ const edgeId = edge.id || `edge-${edgeIndex}`;
+ const points = workflowEdgePoints(html, edgeId);
+ for (const node of diagramNodes) {
+ const hits = workflowNodeBorderOverlap(points, workflowNodeRect(html, node.id));
+ assert.deepEqual(
+ hits,
+ [],
+ `workflow edge ${edgeId} runs along node ${node.id} border: ${JSON.stringify(hits)}`,
+ );
+ }
+ }
+}
+
+function assertWorkflowEdgesAvoidAllNodeBorders(html, doc) {
+ assertRelationshipsAvoidAllNodeBorders(html, doc.edges, doc.nodes);
+}
+
// [name, mode, mutate(doc), expectedSubstrings[]] — every mutation introduces
// exactly one layout violation. Each expected substring must appear in stderr.
const CASES = [
@@ -138,6 +263,48 @@ const CASES = [
(d) => { d.connections[0].to = 'ghost'; }, ['unknown target "ghost"']],
['architecture: boundary wraps unknown component', 'architecture',
(d) => { d.boundaries[0].wraps.push('ghost'); }, ['wraps unknown component "ghost"']],
+ ['architecture: boundary title must fit inside its own frame', 'architecture',
+ (d) => {
+ d.meta.quality_profile = 'standard';
+ d.meta.viewBox = [500, 400];
+ d.components = [{
+ id: 'narrow',
+ type: 'backend',
+ label: 'Narrow',
+ pos: [330, 100],
+ size: [128, 60],
+ }];
+ delete d.meta.views;
+ d.connections = [];
+ d.cards = [];
+ d.boundaries = [{
+ kind: 'region',
+ label: 'A boundary title that cannot fit its narrow authored frame',
+ wraps: ['narrow'],
+ pad: 0,
+ }];
+ }, ['Boundary label', 'fit', 'shorten']],
+ ['architecture: boundary title must stay inside the authored viewBox', 'architecture',
+ (d) => {
+ d.meta.quality_profile = 'standard';
+ d.meta.viewBox = [500, 400];
+ d.components = [{
+ id: 'near-top',
+ type: 'backend',
+ label: 'Near top',
+ pos: [120, 8],
+ size: [128, 60],
+ }];
+ delete d.meta.views;
+ d.connections = [];
+ d.cards = [];
+ d.boundaries = [{
+ kind: 'region',
+ label: 'Viewport title',
+ wraps: ['near-top'],
+ pad: 0,
+ }];
+ }, ['Boundary label', 'outside the viewBox', 'move wrapped components']],
['architecture: label wider than component', 'architecture',
(d) => { d.components[0].label = 'An Extremely Long Component Label Overflow'; }, ['wider than component', 'shorten the label']],
['architecture: component sublabel wider than its legible minimum', 'architecture',
@@ -164,6 +331,222 @@ for (const [name, mode, mutate, expected] of CASES) {
});
}
+test('architecture: ordinary boundaries may express orthogonal overlapping memberships', () => {
+ const d = load('architecture');
+ d.boundaries[1].wraps.push('auth');
+ const { code, stderr, outPath } = render('architecture', d);
+ assert.equal(code, 0, stderr);
+ const html = fs.readFileSync(outPath, 'utf8');
+ assert.equal(rectanglesOverlap(boundaryFrameRect(html, 0), boundaryFrameRect(html, 1)), true);
+ const masks = boundaryTitleMasks(html);
+ assert.equal(masks.length, 2);
+ assert.equal(rectanglesOverlap(masks[0], masks[1]), false);
+});
+
+test('architecture: profile-less v1 keeps rendering when a boundary title cannot meet strict composition', () => {
+ const d = load('architecture');
+ delete d.meta.quality_profile;
+ d.meta.viewBox = [500, 400];
+ d.components = [{
+ id: 'narrow',
+ type: 'backend',
+ label: 'Narrow',
+ pos: [330, 100],
+ size: [128, 60],
+ }];
+ delete d.meta.views;
+ d.connections = [];
+ d.cards = [];
+ d.boundaries = [{
+ kind: 'region',
+ label: 'A boundary title that cannot fit its narrow authored frame',
+ wraps: ['narrow'],
+ pad: 0,
+ }];
+
+ const { code, stderr } = render('architecture', d);
+ assert.equal(code, 0, stderr);
+});
+
+test('architecture: profile-less v1 keeps legacy boundary geometry at the top edge', () => {
+ const d = load('architecture');
+ delete d.meta.quality_profile;
+ d.meta.viewBox = [500, 400];
+ d.components = [{
+ id: 'near-top',
+ type: 'backend',
+ label: 'Near top',
+ pos: [120, 22],
+ size: [128, 60],
+ }];
+ delete d.meta.views;
+ d.connections = [];
+ d.cards = [];
+ d.boundaries = [{
+ kind: 'region',
+ label: 'Legacy top edge',
+ wraps: ['near-top'],
+ pad: 0,
+ }];
+
+ const { code, stderr } = render('architecture', d);
+ assert.equal(code, 0, stderr);
+});
+
+test('architecture: deployment ownership requires nested membership geometry to agree', () => {
+ const d = JSON.parse(fs.readFileSync(
+ path.join(skillRoot, 'examples/production-deployment.architecture.json'),
+ 'utf8',
+ ));
+ d.boundaries.find((boundary) => boundary.label === 'private application network').pad = 260;
+ const { code, stderr } = render('architecture', d);
+ assert.notEqual(code, 0);
+ assert.match(stderr, /final frames partially overlap/);
+ assert.match(stderr, /adjust wraps, pad, or component positions/);
+});
+
+test('architecture: boundary labels reserve readable space above wrapped components', () => {
+ const d = load('architecture');
+ d.boundaries = [{
+ kind: 'security-group',
+ label: 'Tool effects and permissions',
+ wraps: ['lb', 'api'],
+ pad: 14,
+ }];
+
+ const { code, stderr, outPath } = render('architecture', d);
+ assert.equal(code, 0, stderr);
+ const html = fs.readFileSync(outPath, 'utf8');
+ const label = html.match(
+ /<text data-boundary-label x="[^"]+" y="([^"]+)" class="t-security" font-size="[^"]+" font-weight="600">Tool effects and permissions<\/text>/,
+ );
+ assert.ok(label, 'expected the security boundary label');
+ const labelBaseline = Number(label[1]);
+ const firstWrappedNodeY = Math.min(
+ workflowNodeRect(html, 'lb').y,
+ workflowNodeRect(html, 'api').y,
+ );
+ assert.ok(
+ labelBaseline <= firstWrappedNodeY - 4,
+ `expected the boundary label baseline (${labelBaseline}) to clear the first wrapped node (${firstWrappedNodeY})`,
+ );
+});
+
+test('architecture: auto viewBox keeps expanded boundary titles readable at desktop scale', () => {
+ const d = load('architecture');
+ delete d.meta.viewBox;
+ d.meta.quality_profile = 'showcase';
+ delete d.meta.views;
+ d.components = [{
+ id: 'node',
+ type: 'backend',
+ label: 'Current node',
+ pos: [800, 100],
+ size: [120, 60],
+ }];
+ d.connections = [];
+ d.cards = [];
+ d.boundaries = [{
+ kind: 'region',
+ label: 'Disaster recovery boundary Disaster recovery boundary Disaster recovery boundary',
+ wraps: ['node'],
+ pad: 30,
+ }];
+
+ const { code, stderr, outPath } = render('architecture', d);
+ assert.equal(code, 0, stderr);
+ const html = fs.readFileSync(outPath, 'utf8');
+ const viewBoxWidth = Number(html.match(/\bviewBox="0 0 ([\d.]+) [\d.]+"/)?.[1]);
+ const sourceFontPx = Number(html.match(/<text data-boundary-label[^>]*font-size="([\d.]+)"/)?.[1]);
+ const projectedFontPx = sourceFontPx * Math.min(1, 930 / viewBoxWidth);
+ assert.ok(
+ projectedFontPx >= 6,
+ `expected the final ${viewBoxWidth}px viewBox to project its ${sourceFontPx}px boundary title at 6px or larger, got ${projectedFontPx}px`,
+ );
+});
+
+test('architecture: boundary labels and their masks paint above relationship routes', () => {
+ const d = load('architecture');
+ const { code, stderr, outPath } = render('architecture', d);
+ assert.equal(code, 0, stderr);
+ const html = fs.readFileSync(outPath, 'utf8');
+ const lastRoute = html.lastIndexOf('data-composition-points=');
+ const firstBoundaryLabel = html.indexOf('data-graph-role="structural-frame-label"');
+ assert.ok(lastRoute >= 0, 'expected at least one rendered relationship route');
+ assert.ok(firstBoundaryLabel >= 0, 'expected a foreground boundary label group');
+ assert.ok(
+ firstBoundaryLabel > lastRoute,
+ 'boundary labels must paint after relationship routes so routes cannot cross the title text',
+ );
+ assert.match(
+ html.slice(firstBoundaryLabel, firstBoundaryLabel + 500),
+ /data-graph-role="structural-frame-label-mask"/,
+ 'expected an opaque mask behind the foreground boundary title',
+ );
+});
+
+test('architecture: nested boundary title rails stay inside frames and avoid labels and nodes', () => {
+ const d = JSON.parse(fs.readFileSync(
+ path.join(skillRoot, 'examples/production-deployment.architecture.json'),
+ 'utf8',
+ ));
+ const { code, stderr, outPath } = render('architecture', d);
+ assert.equal(code, 0, stderr);
+ const html = fs.readFileSync(outPath, 'utf8');
+ const masks = boundaryTitleMasks(html);
+ assert.equal(masks.length, d.boundaries.length);
+
+ for (const mask of masks) {
+ assert.ok(
+ rectContainsRect(boundaryFrameRect(html, mask.index), mask),
+ `boundary title mask ${mask.index} must stay inside its frame: ${JSON.stringify(mask)}`,
+ );
+ for (const component of d.components) {
+ assert.equal(
+ rectanglesOverlap(mask, workflowNodeRect(html, component.id)),
+ false,
+ `boundary title mask ${mask.index} overlaps component ${component.id}`,
+ );
+ }
+ }
+
+ for (let left = 0; left < masks.length; left += 1) {
+ for (let right = left + 1; right < masks.length; right += 1) {
+ assert.equal(
+ rectanglesOverlap(masks[left], masks[right]),
+ false,
+ `boundary title masks ${left} and ${right} overlap`,
+ );
+ }
+ }
+});
+
+test('architecture: boundary title masks cannot obscure connection labels', () => {
+ const d = {
+ schema_version: 1,
+ diagram_type: 'architecture',
+ meta: { title: 'Boundary and connection labels', quality_profile: 'standard', viewBox: [700, 500] },
+ components: [
+ { id: 'scoped', type: 'backend', label: 'Scoped', pos: [250, 100], size: [120, 60] },
+ { id: 'source', type: 'external', label: 'Source', pos: [50, 300], size: [100, 50] },
+ { id: 'target', type: 'external', label: 'Target', pos: [500, 300], size: [100, 50] },
+ ],
+ boundaries: [{ kind: 'region', label: 'Runtime scope', wraps: ['scoped'] }],
+ connections: [{
+ from: 'source',
+ to: 'target',
+ label: 'Route label',
+ route: 'straight',
+ labelAt: [270, 88],
+ }],
+ };
+
+ const { code, stderr } = render('architecture', d);
+ assert.notEqual(code, 0);
+ assert.match(stderr, /Boundary label "Runtime scope" overlaps connection label "Route label"/);
+ assert.match(stderr, /labelAt\/labelDx\/labelDy\/labelSegment/);
+});
+
// ---- sublabel/tag shrink-to-fit: the render half of the same rule ----
// Validation only rejects text that cannot fit even at its legible minimum.
// Everything between "fits at the preferred size" and that floor must shrink,
@@ -291,6 +674,258 @@ test('workflow: same-lane offset auto edge stays orthogonal', () => {
assert.match(html, /M 236 105 L 260 105 L 260 133 L 284 133/);
});
+test('workflow: automatic routing uses one bend and avoids every node border', () => {
+ const d = JSON.parse(fs.readFileSync(
+ path.join(skillRoot, 'test/fixtures/automatic-routing-node-border-clearance.workflow.json'),
+ 'utf8',
+ ));
+ const { code, stderr, outPath } = render('workflow', d);
+ assert.equal(code, 0, stderr);
+ const html = fs.readFileSync(outPath, 'utf8');
+ const points = workflowEdgePoints(html, 'stdin');
+ const target = workflowNodeRect(html, 'team_send');
+ assert.equal(points.length, 3, `expected one bend, received ${JSON.stringify(points)}`);
+ assert.equal(points[0][0], points[1][0], 'edge must leave the source vertically');
+ assert.ok(points[1][1] < points[0][1], 'edge must leave the source through its top side');
+ assert.equal(points[1][1], points[2][1], 'edge must enter the target horizontally');
+ assert.ok(points[2][0] > points[1][0], 'edge must enter the target through its left side');
+ assert.equal(points[2][0], target.x, 'edge must stop at the target border');
+ assert.ok(
+ points[2][1] > target.y && points[2][1] < target.y + target.height,
+ 'edge must meet the target inside its left-side anchor range',
+ );
+ assertWorkflowEdgesAvoidAllNodeBorders(html, d);
+
+ const [labelX, labelY] = workflowEdgeLabelPoint(html, 'stdin');
+ assert.equal(labelX, points[0][0], 'the label should use the longer vertical segment');
+ assert.ok(labelY > points[1][1] && labelY < points[0][1], 'the label should stay inside that segment');
+});
+
+test('workflow: shared automatic endpoints avoid every node border', () => {
+ const d = {
+ schema_version: 1,
+ diagram_type: 'workflow',
+ meta: { title: 'Shared endpoint border invariant' },
+ lanes: [
+ { id: 'target-lane', label: 'Target' },
+ { id: 'source-lane', label: 'Sources' },
+ ],
+ nodes: [
+ { id: 'target', lane: 'target-lane', col: 2, type: 'backend', label: 'Target' },
+ { id: 'source-left', lane: 'source-lane', col: 1, type: 'backend', label: 'Left' },
+ { id: 'source-right', lane: 'source-lane', col: 3, type: 'backend', label: 'Right' },
+ ],
+ edges: [
+ { id: 'left-to-target', from: 'source-left', to: 'target' },
+ { id: 'right-to-target', from: 'source-right', to: 'target' },
+ ],
+ };
+ const { code, stderr, outPath } = render('workflow', d);
+ assert.equal(code, 0, stderr);
+ assertWorkflowEdgesAvoidAllNodeBorders(fs.readFileSync(outPath, 'utf8'), d);
+});
+
+test('workflow: blocked first one-bend candidate selects the clear one-bend orientation', () => {
+ const d = {
+ schema_version: 1,
+ diagram_type: 'workflow',
+ meta: { title: 'Blocked one-bend candidate', quality_profile: 'showcase' },
+ lanes: [
+ { id: 'target-lane', label: 'Target' },
+ { id: 'obstacle-lane', label: 'Obstacle' },
+ { id: 'source-lane', label: 'Source' },
+ ],
+ nodes: [
+ { id: 'target', lane: 'target-lane', col: 3, type: 'backend', label: 'Target' },
+ { id: 'obstacle', lane: 'obstacle-lane', col: 1, type: 'security', label: 'Obstacle' },
+ { id: 'source', lane: 'source-lane', col: 1, type: 'backend', label: 'Source' },
+ ],
+ edges: [{ id: 'clear-corner', from: 'source', to: 'target' }],
+ };
+ const { code, stderr, outPath } = render('workflow', d);
+ assert.equal(code, 0, stderr);
+ const points = workflowEdgePoints(fs.readFileSync(outPath, 'utf8'), 'clear-corner');
+ assert.equal(points.length, 3, `expected the alternate one-bend route, received ${JSON.stringify(points)}`);
+ assert.equal(points[0][1], points[1][1], 'blocked vertical-first candidate must switch to horizontal-first');
+ assert.ok(points[1][0] > points[0][0], 'edge must leave the source through its right side');
+ assert.equal(points[1][0], points[2][0], 'edge must enter the target vertically');
+ assert.ok(points[2][1] < points[1][1], 'edge must enter the target through its bottom side');
+});
+
+test('workflow: explicit drop routing remains authoritative over the one-bend preference', () => {
+ const d = {
+ schema_version: 1,
+ diagram_type: 'workflow',
+ meta: { title: 'Explicit route compatibility', quality_profile: 'showcase' },
+ lanes: [
+ { id: 'target-lane', label: 'Target' },
+ { id: 'source-lane', label: 'Source' },
+ ],
+ nodes: [
+ { id: 'target', lane: 'target-lane', col: 3, type: 'backend', label: 'Target' },
+ { id: 'source', lane: 'source-lane', col: 1, type: 'backend', label: 'Source' },
+ ],
+ edges: [{
+ id: 'authored-drop',
+ from: 'source',
+ to: 'target',
+ route: 'drop',
+ fromSide: 'top',
+ toSide: 'bottom',
+ }],
+ };
+ const { code, stderr, outPath } = render('workflow', d);
+ assert.equal(code, 0, stderr);
+ const points = workflowEdgePoints(fs.readFileSync(outPath, 'utf8'), 'authored-drop');
+ assert.equal(points.length, 4, `explicit drop route was replaced: ${JSON.stringify(points)}`);
+ assert.equal(points[0][0], points[1][0]);
+ assert.equal(points[1][1], points[2][1]);
+ assert.equal(points[2][0], points[3][0]);
+});
+
+test('workflow: authored endpoint sides that follow a border are rejected generically', () => {
+ const d = {
+ schema_version: 1,
+ diagram_type: 'workflow',
+ meta: { title: 'Authored endpoint border run' },
+ lanes: [
+ { id: 'target-lane', label: 'Target' },
+ { id: 'source-lane', label: 'Source' },
+ ],
+ nodes: [
+ { id: 'target', lane: 'target-lane', col: 3, type: 'backend', label: 'Target' },
+ { id: 'source', lane: 'source-lane', col: 1, type: 'backend', label: 'Source' },
+ ],
+ edges: [{
+ id: 'invalid-drop',
+ from: 'source',
+ to: 'target',
+ route: 'drop',
+ fromSide: 'right',
+ toSide: 'left',
+ }],
+ };
+ const { code, stderr } = render('workflow', d);
+ assert.notEqual(code, 0);
+ assert.match(stderr, /\[clean-flow\/endpoint-side-direction\] workflow edges\[0\] id "invalid-drop"/);
+ assert.match(stderr, /cross node borders perpendicularly/);
+});
+
+test('dataflow: authored endpoint sides that follow a border are rejected generically', () => {
+ const d = {
+ schema_version: 1,
+ diagram_type: 'dataflow',
+ meta: { title: 'Data-flow endpoint border run' },
+ stages: [{ label: 'Source' }, { label: 'Target' }],
+ nodes: [
+ { id: 'source', stage: 0, row: 0, type: 'backend', label: 'Source' },
+ { id: 'target', stage: 1, row: 2, type: 'database', label: 'Target' },
+ ],
+ flows: [{
+ id: 'invalid-bottom',
+ from: 'source',
+ to: 'target',
+ label: 'payload',
+ route: 'bottom-channel',
+ fromSide: 'right',
+ toSide: 'left',
+ }],
+ };
+ const { code, stderr } = render('dataflow', d);
+ assert.notEqual(code, 0);
+ assert.match(stderr, /\[clean-flow\/endpoint-side-direction\] dataflow flows\[0\] id "invalid-bottom"/);
+ assert.match(stderr, /cross node borders perpendicularly/);
+});
+
+test('lifecycle: automatic cross-lane routes avoid every state border', () => {
+ const d = {
+ schema_version: 1,
+ diagram_type: 'lifecycle',
+ meta: { title: 'Lifecycle endpoint border invariant' },
+ lanes: [
+ { id: 'main', label: 'Main' },
+ { id: 'terminal', label: 'Terminal' },
+ ],
+ states: [
+ { id: 'target', lane: 'main', col: 3, type: 'success', label: 'Target' },
+ { id: 'source', lane: 'terminal', col: 1, type: 'active', label: 'Source' },
+ ],
+ transitions: [{ id: 'automatic-transition', from: 'source', to: 'target' }],
+ };
+ const { code, stderr, outPath } = render('lifecycle', d);
+ assert.equal(code, 0, stderr);
+ assertRelationshipsAvoidAllNodeBorders(
+ fs.readFileSync(outPath, 'utf8'),
+ d.transitions,
+ d.states,
+ );
+});
+
+function tangentViaLifecycle() {
+ return {
+ schema_version: 1,
+ diagram_type: 'lifecycle',
+ meta: { title: 'Legacy tangent via compatibility' },
+ lanes: [
+ { id: 'main', label: 'Main' },
+ { id: 'terminal', label: 'Terminal' },
+ ],
+ states: [
+ { id: 'source', lane: 'main', col: 1, type: 'active', label: 'Source' },
+ { id: 'target', lane: 'terminal', col: 0, type: 'success', label: 'Target' },
+ ],
+ transitions: [{
+ id: 'legacy-via',
+ from: 'source',
+ to: 'target',
+ fromSide: 'bottom',
+ toSide: 'top',
+ via: [[320, 188], [320, 430], [402, 430]],
+ }],
+ };
+}
+
+test('lifecycle: legacy tangent via is rendered exactly instead of silently rewritten', () => {
+ const d = tangentViaLifecycle();
+ const { code, stderr, outPath } = render('lifecycle', d);
+ assert.equal(code, 0, stderr);
+ assert.deepEqual(workflowEdgePoints(fs.readFileSync(outPath, 'utf8'), 'legacy-via'), [
+ [248, 188], [320, 188], [320, 430], [402, 430], [402, 450],
+ ]);
+});
+
+for (const qualityProfile of ['standard', 'showcase']) {
+ test(`lifecycle: ${qualityProfile} keeps an authored tangent via authoritative`, () => {
+ const d = tangentViaLifecycle();
+ d.meta.quality_profile = qualityProfile;
+ const { code, stderr, outPath } = render('lifecycle', d);
+ assert.equal(code, 0, stderr);
+ assert.deepEqual(workflowEdgePoints(fs.readFileSync(outPath, 'utf8'), 'legacy-via'), [
+ [248, 188], [320, 188], [320, 430], [402, 430], [402, 450],
+ ]);
+ });
+
+ test(`lifecycle: public validate accepts an authoritative authored tangent via in ${qualityProfile}`, () => {
+ const d = tangentViaLifecycle();
+ d.meta.quality_profile = qualityProfile;
+ const { code, result } = validateCli('lifecycle', d);
+ assert.equal(code, 0, JSON.stringify(result, null, 2));
+ assert.equal(result.ok, true);
+ });
+}
+
+test('workflow: explicit labelAt remains authoritative on an automatic one-bend edge', () => {
+ const d = JSON.parse(fs.readFileSync(
+ path.join(skillRoot, 'test/fixtures/automatic-routing-node-border-clearance.workflow.json'),
+ 'utf8',
+ ));
+ d.edges[0].labelAt = [350, 166];
+ const { code, stderr, outPath } = render('workflow', d);
+ assert.equal(code, 0, stderr);
+ const html = fs.readFileSync(outPath, 'utf8');
+ assert.deepEqual(workflowEdgeLabelPoint(html, 'stdin'), [350, 166]);
+});
+
test('workflow: bounded font fitting keeps an ordinary long sublabel inside its node', () => {
const d = load('workflow');
d.nodes[0].sublabel = 'shell / browser / MCP';
@@ -546,7 +1181,7 @@ test('architecture: showcase rejects an unrelated proper edge crossing', () => {
],
connections: [
{ id: 'down-right', from: 'a', to: 'b', route: 'orthogonal-h' },
- { id: 'up-right', from: 'c', to: 'd', route: 'orthogonal-v' },
+ { id: 'up-right', from: 'c', to: 'd', route: 'orthogonal-v', fromSide: 'top', toSide: 'bottom' },
],
};
const { code, stderr } = render('architecture', d);
@@ -572,7 +1207,7 @@ test('architecture: standard keeps the same proper crossing renderable', () => {
],
connections: [
{ from: 'a', to: 'b', route: 'orthogonal-h' },
- { from: 'c', to: 'd', route: 'orthogonal-v' },
+ { from: 'c', to: 'd', route: 'orthogonal-v', fromSide: 'top', toSide: 'bottom' },
],
};
const { code, stderr } = render('architecture', d);
diff --git a/archify/test/real-repository-proof.test.mjs b/archify/test/real-repository-proof.test.mjs
index 1f2a517e..13c0c86a 100644
--- a/archify/test/real-repository-proof.test.mjs
+++ b/archify/test/real-repository-proof.test.mjs
@@ -46,6 +46,8 @@ test('MCO proof is source-backed, reproducible, and linked from every README', (
]);
assert.equal(source.components.length, 13);
assert.equal(source.connections.length, 12);
+ assert.match(source.components.find((component) => component.id === 'router')?.sublabel || '', /\bdoctor\b/);
+ assert.match(source.components.find((component) => component.id === 'adapters')?.sublabel || '', /\bdetect\b/);
assert.deepEqual(source.meta.repository, {
url: 'https://github.com/mco-org/mco',
revision: '9f1a1cf1afdc04d7b5406782b40dfec76d9bc798',
diff --git a/archify/test/render-output-checks.test.mjs b/archify/test/render-output-checks.test.mjs
index 8a91c73b..0a7bbd47 100644
--- a/archify/test/render-output-checks.test.mjs
+++ b/archify/test/render-output-checks.test.mjs
@@ -11,9 +11,9 @@ const skillRoot = path.resolve(__dirname, '..');
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-output-checks-'));
const checker = path.join(skillRoot, 'scripts/check-render-output.mjs');
-function checkHtml(name, svgBody, profile = 'standard') {
+function checkHtml(name, svgBody, profile = 'standard', viewBox = '0 0 240 160') {
const htmlPath = path.join(tmp, `${name}.html`);
- fs.writeFileSync(htmlPath, `<!doctype html><html><body><svg viewBox="0 0 240 160" data-quality-profile="${profile}">${svgBody}</svg></body></html>`);
+ fs.writeFileSync(htmlPath, `<!doctype html><html><body><svg viewBox="${viewBox}" data-quality-profile="${profile}">${svgBody}</svg></body></html>`);
try {
const stdout = execFileSync('node', [checker, htmlPath], { encoding: 'utf8' });
return { code: 0, result: JSON.parse(stdout) };
@@ -22,6 +22,79 @@ function checkHtml(name, svgBody, profile = 'standard') {
}
}
+test('render output check: showcase rejects node copy that becomes illegible at 1440px', () => {
+ const { code, result } = checkHtml('showcase-desktop-readability', `
+ <g data-node-id="tool-runtime">
+ <rect x="1398" y="266" width="194" height="70" rx="6" class="c-mask"/>
+ <text data-detail-anchor x="1495" y="299" class="t-primary" font-size="11">ToolRuntime</text>
+ <text data-detail="context" x="1495" y="315" class="t-muted" font-size="8.1">permissions and recovery</text>
+ </g>
+ `, 'showcase', '0 0 1994 804');
+
+ assert.notEqual(code, 0);
+ const issue = result.composition.issues.find(
+ (item) => item.code === 'composition/desktop-readability',
+ );
+ assert.equal(issue?.severity, 'error');
+ assert.equal(issue?.viewportWidth, 1440);
+ assert.ok(issue?.projectedFontPx < issue?.minimumProjectedFontPx);
+});
+
+test('render output check: compares exact projected size before rounding diagnostics', () => {
+ const sourceFontPx = 8.1;
+ const viewBoxWidth = 1260;
+ assert.ok(sourceFontPx * 930 / viewBoxWidth < 6);
+
+ const { code, result } = checkHtml('showcase-desktop-readability-borderline', `
+ <g data-node-id="tool-runtime">
+ <rect x="100" y="100" width="194" height="70" rx="6" class="c-mask"/>
+ <text data-detail="context" x="197" y="140" class="t-muted" font-size="${sourceFontPx}">permissions and recovery</text>
+ </g>
+ `, 'showcase', `0 0 ${viewBoxWidth} 804`);
+
+ assert.notEqual(code, 0);
+ const issue = result.composition.issues.find(
+ (item) => item.code === 'composition/desktop-readability',
+ );
+ assert.equal(issue?.severity, 'error');
+ assert.ok(issue?.projectedFontPx < issue?.minimumProjectedFontPx);
+});
+
+test('render output check: includes primary node labels in desktop readability', () => {
+ const { code, result } = checkHtml('showcase-primary-desktop-readability', `
+ <g data-node-id="compact-node">
+ <rect x="100" y="100" width="120" height="48" rx="6" class="c-mask"/>
+ <text data-node-label x="160" y="126" class="t-primary" font-size="8">Compact node</text>
+ </g>
+ `, 'showcase', '0 0 1300 700');
+
+ assert.notEqual(code, 0);
+ const issue = result.composition.issues.find(
+ (item) => item.code === 'composition/desktop-readability',
+ );
+ assert.equal(issue?.text, 'Compact node');
+ assert.equal(issue?.detail, 'primary');
+ assert.equal(issue?.availableDiagramWidth, 930);
+ assert.ok(issue?.projectedFontPx < issue?.minimumProjectedFontPx);
+});
+
+test('render output check: includes semantic boundary labels in desktop readability', () => {
+ const { code, result } = checkHtml('showcase-boundary-desktop-readability', `
+ <g data-graph-role="structural-frame-label">
+ <rect data-graph-role="structural-frame-label-mask" x="100" y="100" width="180" height="16" class="c-mask"/>
+ <text x="104" y="113" class="t-cloud" font-size="8.4" data-boundary-label>Disaster recovery boundary</text>
+ </g>
+ `, 'showcase', '0 0 1376 728');
+
+ assert.notEqual(code, 0);
+ const issue = result.composition.issues.find(
+ (item) => item.code === 'composition/desktop-readability',
+ );
+ assert.equal(issue?.text, 'Disaster recovery boundary');
+ assert.equal(issue?.detail, 'boundary');
+ assert.ok(issue?.projectedFontPx < issue?.minimumProjectedFontPx);
+});
+
test('render output check: accepts orthogonal arrows away from legend', () => {
const { code, result } = checkHtml('clean', `
<path d="M 20 20 L 120 20 L 120 60" class="a-default" stroke-width="1.4" marker-end="url(#arrowhead)"/>
diff --git a/archify/test/repair-receipt.test.mjs b/archify/test/repair-receipt.test.mjs
index e969d5be..faf43293 100644
--- a/archify/test/repair-receipt.test.mjs
+++ b/archify/test/repair-receipt.test.mjs
@@ -146,4 +146,36 @@ test('repair receipt: repository evidence failures retain a stable rule and exac
assert.deepEqual(repair.supportedFixes, ['pass --repo-root with the matching local Git checkout']);
});
+test('repair receipt: public validate reports borderline desktop readability with a supported fix', () => {
+ const input = writeFixture('borderline-readability.architecture.json', {
+ schema_version: 1,
+ diagram_type: 'architecture',
+ meta: {
+ title: 'Borderline desktop readability',
+ quality_profile: 'showcase',
+ viewBox: [1826, 804],
+ },
+ components: [{
+ id: 'tool-runtime',
+ type: 'security',
+ label: 'ToolRuntime',
+ sublabel: 'OpenAI · Anthropic · provider gateways',
+ pos: [100, 100],
+ size: [194, 70],
+ }],
+ connections: [],
+ });
+ const result = run(['validate', 'architecture', input, '--quality', 'showcase', '--json']);
+
+ assert.equal(result.status, 1, result.stderr || result.stdout);
+ assert.equal(result.stderr, '');
+ const repair = receipt(result).diagnostics.find(
+ (entry) => entry.code === 'composition/desktop-readability',
+ );
+ assert.ok(repair);
+ assert.deepEqual(repair.subject, { check: 'composition' });
+ assert.ok(repair.evidence.projectedFontPx < repair.evidence.minimumProjectedFontPx);
+ assert.ok(repair.supportedFixes.some((fix) => fix.includes('reduce the viewBox width')));
+});
+
process.on('exit', () => fs.rmSync(tmp, { recursive: true, force: true }));
diff --git a/archify/test/v1-compatibility.test.mjs b/archify/test/v1-compatibility.test.mjs
index 59eb20c3..21c6f9cb 100644
--- a/archify/test/v1-compatibility.test.mjs
+++ b/archify/test/v1-compatibility.test.mjs
@@ -96,6 +96,22 @@ for (const [mode, filename] of Object.entries(OFFICIAL_V1_EXAMPLES)) {
});
}
+test('quality-profile lifecycle keeps the checked-in authored via authoritative', () => {
+ const doc = JSON.parse(fs.readFileSync(path.join(skillRoot, 'examples/agent-run.lifecycle.json'), 'utf8'));
+ const transition = doc.transitions.find(({ id }) => id === 'approval-cancelled');
+ assert.deepEqual(transition.via, [[480, 336], [480, 432], [402, 432]]);
+
+ const rendered = render('lifecycle', doc);
+ assert.equal(rendered.code, 0, rendered.stderr);
+ const html = fs.readFileSync(rendered.output, 'utf8');
+ assert.match(
+ html,
+ /data-edge-id="approval-cancelled"[^>]*data-composition-points="[^"]*480,336;480,432;402,432[^"]*"/,
+ );
+ const validated = validate('lifecycle', doc);
+ assert.equal(validated.code, 0, validated.stderr);
+});
+
test('legacy v1 architecture auto viewBox accommodates all seven implicit auto legend kinds', () => {
const types = ['frontend', 'backend', 'database', 'cloud', 'security', 'messagebus', 'external'];
const doc = {
diff --git a/archify/test/visual-check.test.mjs b/archify/test/visual-check.test.mjs
index 209ee461..9971a19a 100644
--- a/archify/test/visual-check.test.mjs
+++ b/archify/test/visual-check.test.mjs
@@ -1,13 +1,17 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
+import { EventEmitter } from 'node:events';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
+import { PassThrough } from 'node:stream';
import { fileURLToPath } from 'node:url';
import {
+ ChromeVisualBrowser,
VISUAL_CHECK_VIEWPORTS,
+ chromeVisualBrowserArgs,
runVisualCheck,
sidecarPaths,
} from '../bin/visual-check.mjs';
@@ -27,7 +31,7 @@ function sha256(file) {
return createHash('sha256').update(fs.readFileSync(file)).digest('hex');
}
-function fakeBrowser({ overflowAt, screenshotFailure } = {}) {
+function fakeBrowser({ overflowAt, unreadableAt, screenshotFailure } = {}) {
const calls = [];
return {
calls,
@@ -38,18 +42,116 @@ function fakeBrowser({ overflowAt, screenshotFailure } = {}) {
}
if (screenshotPath) fs.writeFileSync(screenshotPath, png);
const overflow = overflowAt?.({ width, height, theme }) || false;
+ const unreadable = unreadableAt?.({ width, height, theme }) || false;
return {
innerWidth: width,
innerHeight: height,
scrollWidth: width + (overflow ? 1 : 0),
scrollHeight: height,
resolvedTheme: theme,
+ readerWidth: 960,
+ diagramWidth: 930,
+ viewBoxWidth: 1300,
+ minimumProjectedNodeTextPx: unreadable ? 5.72 : 6.44,
+ minimumProjectedNodeText: unreadable ? 'Compact node' : 'Readable node',
+ minimumProjectedNodeTextDetail: unreadable ? 'primary' : 'context',
};
},
async close() {},
};
}
+function fakeChromeChild() {
+ const child = new EventEmitter();
+ child.exitCode = null;
+ child.signalCode = null;
+ child.stderr = new PassThrough();
+ child.stdio = [null, null, child.stderr, new PassThrough(), new PassThrough()];
+ child.kill = (signal) => {
+ child.signalCode = signal;
+ queueMicrotask(() => {
+ child.emit('exit', null, signal);
+ child.emit('close', null, signal);
+ });
+ return true;
+ };
+ return child;
+}
+
+test('visual-check disables the Chrome sandbox only for root or an explicit environment opt-in', () => {
+ const profileRoot = path.join(tmp, 'chrome-profile');
+ const ordinary = chromeVisualBrowserArgs(profileRoot, { env: {}, getuid: () => 1001 });
+ const optedIn = chromeVisualBrowserArgs(profileRoot, {
+ env: { ARCHIFY_CHROME_NO_SANDBOX: '1' },
+ getuid: () => 1001,
+ });
+ const root = chromeVisualBrowserArgs(profileRoot, { env: {}, getuid: () => 0 });
+
+ assert.equal(ordinary.includes('--no-sandbox'), false);
+ assert.equal(optedIn.includes('--no-sandbox'), true);
+ assert.equal(root.includes('--no-sandbox'), true);
+});
+
+test('visual-check converts a Chrome DevTools pipe reset and captured stderr into a structured failure', async () => {
+ const input = artifact('chrome-pipe-reset.html');
+ const child = fakeChromeChild();
+
+ const result = await runVisualCheck({
+ artifactPath: input,
+ chromePath: '/fake/chrome',
+ browserFactory: async () => {
+ const browser = new ChromeVisualBrowser('/fake/chrome', {
+ env: { ARCHIFY_CHROME_NO_SANDBOX: '1' },
+ getuid: () => 1001,
+ spawnImpl: () => child,
+ });
+ setImmediate(() => {
+ child.stderr.write('Chrome sandbox initialization failed\n');
+ const error = new Error('read ECONNRESET');
+ error.code = 'ECONNRESET';
+ child.stdio[4].emit('error', error);
+ });
+ return browser;
+ },
+ });
+
+ assert.equal(result.exitCode, 1);
+ assert.equal(result.receipt.status, 'fail');
+ assert.match(result.receipt.error, /Chrome DevTools read pipe failed/);
+ assert.match(result.receipt.error, /ECONNRESET/);
+ assert.match(result.receipt.error, /Chrome sandbox initialization failed/);
+ assert.equal(fs.existsSync(sidecarPaths(input).receipt), true);
+});
+
+test('visual-check reports Chrome early exit status and stderr without an uncaught exception', async () => {
+ const input = artifact('chrome-early-exit.html');
+ const child = fakeChromeChild();
+
+ const result = await runVisualCheck({
+ artifactPath: input,
+ chromePath: '/fake/chrome',
+ browserFactory: async () => {
+ const browser = new ChromeVisualBrowser('/fake/chrome', {
+ env: { ARCHIFY_CHROME_NO_SANDBOX: '1' },
+ getuid: () => 1001,
+ spawnImpl: () => child,
+ });
+ setImmediate(() => {
+ child.stderr.write('Chrome rejected its launch flags\n');
+ child.exitCode = 23;
+ child.emit('close', 23, null);
+ });
+ return browser;
+ },
+ });
+
+ assert.equal(result.exitCode, 1);
+ assert.equal(result.receipt.status, 'fail');
+ assert.match(result.receipt.error, /Chrome DevTools process exit failed/);
+ assert.match(result.receipt.error, /exit code 23/);
+ assert.match(result.receipt.error, /Chrome rejected its launch flags/);
+});
+
test('visual-check records four containment viewports and four endpoint theme captures', async () => {
const input = artifact('passing.html');
const before = sha256(input);
@@ -108,6 +210,28 @@ test('visual-check returns 1 and preserves evidence when any viewport overflows'
assert.equal(fs.existsSync(sidecarPaths(input).contactSheet), true);
});
+test('visual-check returns 1 when the real reader projects node text below 6px', async () => {
+ const input = artifact('unreadable.html');
+ const result = await runVisualCheck({
+ artifactPath: input,
+ chromePath: '/fake/chrome',
+ browserFactory: async () => fakeBrowser({
+ unreadableAt: ({ width, height, theme }) => width === 1440 && height === 900 && theme === 'light',
+ }),
+ });
+
+ assert.equal(result.exitCode, 1);
+ assert.equal(result.receipt.status, 'fail');
+ assert.equal(result.receipt.readability.status, 'fail');
+ const desktop = result.receipt.readability.viewports.find(
+ (entry) => entry.width === 1440 && entry.height === 900,
+ );
+ assert.equal(desktop?.diagramWidth, 930);
+ assert.equal(desktop?.minimumProjectedNodeText, 'Compact node');
+ assert.equal(desktop?.minimumProjectedNodeTextDetail, 'primary');
+ assert.equal(desktop?.readabilityOk, false);
+});
+
test('visual-check returns 1 and removes misleading capture sidecars on screenshot failure', async () => {
const input = artifact('capture-failure.html');
const outputs = sidecarPaths(input);
diff --git a/docs/assets/archify-live-proof.gif b/docs/assets/archify-live-proof.gif
index 18313fb4..608f691c 100644
Binary files a/docs/assets/archify-live-proof.gif and b/docs/assets/archify-live-proof.gif differ
diff --git a/docs/assets/archify-live-proof.json b/docs/assets/archify-live-proof.json
index c57f86fd..2c0193b2 100644
--- a/docs/assets/archify-live-proof.json
+++ b/docs/assets/archify-live-proof.json
@@ -7,13 +7,13 @@
"fps": 10,
"frameCount": 54,
"durationSeconds": 5.4,
- "bytes": 1543390,
- "sha256": "495d97deddd7613066ca7a8833b259b075a567c9153203fa820c8383c22363eb",
+ "bytes": 1587643,
+ "sha256": "39b0435a28b48d262d7cade9fc07f2a95fe5b88927a436667d047ed5c9b80b85",
"scenes": [
{
"id": "signal-flow",
"artifact": "docs/gallery/artifacts/agent-tool-call.workflow.html",
- "artifactSha256": "00d5301446f6f1ffd2cdb5b2e698b12cf893423b1a8ceee39e76b464bf194142",
+ "artifactSha256": "efde3cb66601c0cbfaf1243015370db9dd9a47f062d7abb5442b68c46fc6174b",
"view": "happy-path",
"eyebrow": "WORKFLOW · SIGNAL FLOW",
"title": "Agent Tool Call",
@@ -22,7 +22,7 @@
{
"id": "blueprint",
"artifact": "docs/gallery/artifacts/production-deployment.architecture.html",
- "artifactSha256": "6b3f991f936436e8918c97f3f788354189558446d5b724b152c8e76392dbbebe",
+ "artifactSha256": "b37cb56052b3e5c8f58040227c40b02dba80079ac5dedcfef2d34202e586b9f6",
"view": "request-boundary",
"eyebrow": "ARCHITECTURE · BLUEPRINT",
"title": "Production Deployment",
@@ -31,7 +31,7 @@
{
"id": "classic",
"artifact": "docs/gallery/artifacts/cache-miss.sequence.html",
- "artifactSha256": "16c594a726b7089e20ae72b82c8f6656a81c9f1d91970de0ae538ea49cdc895d",
+ "artifactSha256": "ddb51bfbbeb7f64f8b427a590c417f8cae34766240ad3e985920095ea691e50f",
"view": "cache-fallback",
"eyebrow": "SEQUENCE · CLASSIC",
"title": "Cache Miss Request",
diff --git a/docs/cases/mco-runtime.architecture.html b/docs/cases/mco-runtime.architecture.html
index b0da0e28..e9e5f5f1 100644
--- a/docs/cases/mco-runtime.architecture.html
+++ b/docs/cases/mco-runtime.architecture.html
@@ -4913,7 +4913,7 @@
<!-- Main Diagram -->
<div class="diagram-container" data-detail-level="read">
- <svg viewBox="0 0 1750 648" role="img" aria-labelledby="archify-diagram-title archify-diagram-description" data-animation="trace" data-preset="signal-flow" data-quality-profile="showcase">
+ <svg viewBox="0 0 1310 648" role="img" aria-labelledby="archify-diagram-title archify-diagram-description" data-animation="trace" data-preset="signal-flow" data-quality-profile="showcase">
<title id="archify-diagram-title">MCO Runtime Architecture</title>
<desc id="archify-diagram-description">mco-org/mco · explicit provider policy · parallel invocation · durable raw answers</desc>
<!-- Definitions -->
@@ -4939,187 +4939,185 @@
<rect width="100%" height="100%" fill="url(#grid)" />
<!-- Boundaries (behind everything) -->
- <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="160" y="100" width="1300" height="480" rx="12" class="c-region" stroke-width="1"/>
- <text x="168" y="118" class="t-cloud" font-size="9" font-weight="600">mco local package / Python runtime</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="mco local package / Python runtime" x="145" y="80" width="1125" height="420" rx="12" class="c-region" stroke-width="1"/>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="570" y="270" width="680" height="110" rx="8" class="c-security-group" stroke-width="1"/>
- <text x="578" y="288" class="t-security" font-size="9" font-weight="600">explicit execution-policy boundary</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" data-composition-frame-label="explicit execution-policy boundary" x="535" y="220" width="735" height="110" rx="8" class="c-security-group" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
- <path data-edge-from="callers" data-edge-to="entry" data-edge-key="0" data-edge-id="caller-entry" data-composition-points="150,330;190,330" d="M 150 330 L 190 330" class="a-emphasis" data-animate="edge" style="--step:0" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="entry" data-edge-to="router" data-edge-key="1" data-edge-id="entry-route" data-composition-points="340,330;390,330" d="M 340 330 L 390 330" class="a-emphasis" data-animate="edge" style="--step:1" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="router" data-edge-to="policy" data-edge-key="2" data-edge-id="route-policy" data-composition-points="540,330;600,330" d="M 540 330 L 600 330" class="a-security" data-animate="edge" style="--step:2" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
- <path data-edge-from="config" data-edge-to="policy" data-edge-key="3" data-edge-id="config-policy" data-composition-points="680,190;680,300" d="M 680 190 L 680 300" class="a-security" data-animate="edge" style="--step:3" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
- <path data-edge-from="policy" data-edge-to="workflow" data-edge-key="4" data-edge-id="policy-workflow" data-composition-points="760,330;820,330" d="M 760 330 L 820 330" class="a-emphasis" data-animate="edge" style="--step:4" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="workflow" data-edge-to="adapters" data-edge-key="5" data-edge-id="workflow-adapters" data-composition-points="990,330;1050,330" d="M 990 330 L 1050 330" class="a-emphasis" data-animate="edge" style="--step:5" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="adapters" data-edge-to="provider_clis" data-edge-label="native CLI / ACP" data-edge-key="6" data-edge-id="adapters-providers" data-composition-points="1220,330;1530,330" d="M 1220 330 L 1530 330" class="a-emphasis" data-animate="edge" style="--step:6" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="adapters" data-edge-to="answer_transport" data-edge-label="decode events" data-edge-key="7" data-edge-id="adapters-answer" data-composition-points="1135,360;1135,500" d="M 1135 360 L 1135 500" class="a-default" data-animate="edge" style="--step:7" stroke-width="1.5" marker-end="url(#arrowhead)"/>
- <path data-edge-from="answer_transport" data-edge-to="artifacts" data-edge-key="8" data-edge-id="answer-artifacts" data-composition-points="1220,530;1260,530" d="M 1220 530 L 1260 530" class="a-emphasis" data-animate="edge" style="--step:8" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="artifacts" data-edge-to="consumers" data-edge-label="raw answers" data-edge-key="9" data-edge-id="artifacts-consumers" data-composition-points="1430,530;1530,530" d="M 1430 530 L 1530 530" class="a-emphasis" data-animate="edge" style="--step:9" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="router" data-edge-to="session_daemon" data-edge-label="start · send · resume" data-edge-key="10" data-edge-id="router-session" data-composition-points="465,360;465,500" d="M 465 360 L 465 500" class="a-dashed" data-animate="edge" style="--step:10" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
- <path data-edge-from="session_daemon" data-edge-to="session_state" data-edge-label="persist" data-edge-key="11" data-edge-id="session-state" data-composition-points="545,530;600,530" d="M 545 530 L 600 530" class="a-dashed" data-animate="edge" style="--step:11" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
+ <path data-edge-from="callers" data-edge-to="entry" data-edge-key="0" data-edge-id="caller-entry" data-composition-points="135,280;175,280" d="M 135 280 L 175 280" class="a-emphasis" data-animate="edge" style="--step:0" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ <path data-edge-from="entry" data-edge-to="router" data-edge-key="1" data-edge-id="entry-route" data-composition-points="335,280;360,280" d="M 335 280 L 360 280" class="a-emphasis" data-animate="edge" style="--step:1" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ <path data-edge-from="router" data-edge-to="policy" data-edge-key="2" data-edge-id="route-policy" data-composition-points="540,280;565,280" d="M 540 280 L 565 280" class="a-security" data-animate="edge" style="--step:2" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
+ <path data-edge-from="config" data-edge-to="policy" data-edge-key="3" data-edge-id="config-policy" data-composition-points="652.5,170;652.5,250" d="M 652.5 170 L 652.5 250" class="a-security" data-animate="edge" style="--step:3" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
+ <path data-edge-from="policy" data-edge-to="workflow" data-edge-key="4" data-edge-id="policy-workflow" data-composition-points="740,280;765,280" d="M 740 280 L 765 280" class="a-emphasis" data-animate="edge" style="--step:4" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ <path data-edge-from="workflow" data-edge-to="adapters" data-edge-key="5" data-edge-id="workflow-adapters" data-composition-points="985,280;1010,280" d="M 985 280 L 1010 280" class="a-emphasis" data-animate="edge" style="--step:5" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ <path data-edge-from="adapters" data-edge-to="provider_clis" data-edge-label="native CLI / ACP" data-edge-key="6" data-edge-id="adapters-providers" data-composition-points="1125,250;1125,60" d="M 1125 250 L 1125 60" class="a-emphasis" data-animate="edge" style="--step:6" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ <path data-edge-from="adapters" data-edge-to="answer_transport" data-edge-label="decode events" data-edge-key="7" data-edge-id="adapters-answer" data-composition-points="1125,310;1125,365;860,365;860,420" d="M 1125 310 L 1125 357 Q 1125 365 1117 365 L 868 365 Q 860 365 860 373 L 860 420" class="a-default" data-animate="edge" style="--step:7" stroke-width="1.5" marker-end="url(#arrowhead)"/>
+ <path data-edge-from="answer_transport" data-edge-to="artifacts" data-edge-key="8" data-edge-id="answer-artifacts" data-composition-points="955,450;1010,450" d="M 955 450 L 1010 450" class="a-emphasis" data-animate="edge" style="--step:8" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ <path data-edge-from="artifacts" data-edge-to="consumers" data-edge-label="raw answers" data-edge-key="9" data-edge-id="artifacts-consumers" data-composition-points="1095,480;1095,520" d="M 1095 480 L 1095 520" class="a-emphasis" data-animate="edge" style="--step:9" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ <path data-edge-from="router" data-edge-to="session_daemon" data-edge-label="start · send · resume" data-edge-key="10" data-edge-id="router-session" data-composition-points="450,310;450,420" d="M 450 310 L 450 420" class="a-dashed" data-animate="edge" style="--step:10" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
+ <path data-edge-from="session_daemon" data-edge-to="session_state" data-edge-label="persist" data-edge-key="11" data-edge-id="session-state" data-composition-points="535,450;565,450" d="M 535 450 L 565 450" class="a-dashed" data-animate="edge" style="--step:11" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
<!-- Components -->
<g id="node-callers" data-node-id="callers" data-node-label="Callers" tabindex="0" role="button" aria-label="Focus Callers, human · coding agent, Architecture component" aria-pressed="false" data-node-kind="external" data-node-sublabel="human · coding agent" data-node-context="Architecture component">
<title>Callers · human · coding agent · Architecture component</title>
- <rect x="20" y="300" width="130" height="60" rx="6" class="c-mask"/>
- <rect x="20" y="300" width="130" height="60" rx="6" class="c-external" data-animate="node" style="--step:0" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(26 306) scale(0.6875)">
+ <rect x="5" y="250" width="130" height="60" rx="6" class="c-mask"/>
+ <rect x="5" y="250" width="130" height="60" rx="6" class="c-external" data-animate="node" style="--step:0" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(11 256) scale(0.6875)">
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="85" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Callers</text>
- <text data-detail="context" x="85" y="344" class="t-muted" font-size="9" text-anchor="middle">human · coding agent</text>
+ <text data-node-label data-detail-anchor x="70" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Callers</text>
+ <text data-detail="context" x="70" y="294" class="t-muted" font-size="9" text-anchor="middle">human · coding agent</text>
</g>
<g id="node-entry" data-node-id="entry" data-node-label="Entry Surfaces" tabindex="0" role="button" aria-label="Focus Entry Surfaces, npm shim · Python CLI · MCP, mco local package / Python runtime" aria-pressed="false" data-node-kind="frontend" data-node-sublabel="npm shim · Python CLI · MCP" data-node-context="mco local package / Python runtime">
<title>Entry Surfaces · npm shim · Python CLI · MCP · mco local package / Python runtime</title>
- <rect x="190" y="300" width="150" height="60" rx="6" class="c-mask"/>
- <rect x="190" y="300" width="150" height="60" rx="6" class="c-frontend" data-animate="node" style="--step:1" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="frontend" class="semantic-sigil s-frontend" transform="translate(196 306) scale(0.6875)">
+ <rect x="175" y="250" width="160" height="60" rx="6" class="c-mask"/>
+ <rect x="175" y="250" width="160" height="60" rx="6" class="c-frontend" data-animate="node" style="--step:1" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="frontend" class="semantic-sigil s-frontend" transform="translate(181 256) scale(0.6875)">
<rect x="2" y="3" width="12" height="10" rx="2"/>
<path d="M2 6.5h12"/>
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="265" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Entry Surfaces</text>
- <text data-detail="context" x="265" y="344" class="t-muted" font-size="8.7" text-anchor="middle">npm shim · Python CLI · MCP</text>
+ <text data-node-label data-detail-anchor x="255" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Entry Surfaces</text>
+ <text data-detail="context" x="255" y="294" class="t-muted" font-size="9" text-anchor="middle">npm shim · Python CLI · MCP</text>
</g>
<g id="node-router" data-node-id="router" data-node-label="Command Router" tabindex="0" role="button" aria-label="Focus Command Router, run · review · doctor · session, mco local package / Python runtime" aria-pressed="false" data-node-kind="backend" data-node-sublabel="run · review · doctor · session" data-node-context="mco local package / Python runtime">
<title>Command Router · run · review · doctor · session · mco local package / Python runtime</title>
- <rect x="390" y="300" width="150" height="60" rx="6" class="c-mask"/>
- <rect x="390" y="300" width="150" height="60" rx="6" class="c-backend" data-animate="node" style="--step:2" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(396 306) scale(0.6875)">
+ <rect x="360" y="250" width="180" height="60" rx="6" class="c-mask"/>
+ <rect x="360" y="250" width="180" height="60" rx="6" class="c-backend" data-animate="node" style="--step:2" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(366 256) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="465" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Command Router</text>
- <text data-detail="context" x="465" y="344" class="t-muted" font-size="7.6" text-anchor="middle">run · review · doctor · session</text>
+ <text data-node-label data-detail-anchor x="450" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Command Router</text>
+ <text data-detail="context" x="450" y="294" class="t-muted" font-size="9" text-anchor="middle">run · review · doctor · session</text>
</g>
<g id="node-config" data-node-id="config" data-node-label="Config + Selection" tabindex="0" role="button" aria-label="Focus Config + Selection, files · explicit provider team, mco local package / Python runtime" aria-pressed="false" data-node-kind="database" data-node-sublabel="files · explicit provider team" data-node-tag="no silent team" data-node-context="mco local package / Python runtime">
<title>Config + Selection · files · explicit provider team · mco local package / Python runtime · no silent team</title>
- <rect x="600" y="130" width="160" height="60" rx="6" class="c-mask"/>
- <rect x="600" y="130" width="160" height="60" rx="6" class="c-database" data-animate="node" style="--step:3" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(606 136) scale(0.6875)">
+ <rect x="565" y="110" width="175" height="60" rx="6" class="c-mask"/>
+ <rect x="565" y="110" width="175" height="60" rx="6" class="c-database" data-animate="node" style="--step:3" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(571 116) scale(0.6875)">
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="680" y="158" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Config + Selection</text>
- <text data-detail="context" x="680" y="174" class="t-muted" font-size="8.4" text-anchor="middle">files · explicit provider team</text>
- <text data-detail="fine" x="680" y="182" class="t-database" font-size="7" text-anchor="middle">no silent team</text>
+ <text data-node-label data-detail-anchor x="652.5" y="138" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Config + Selection</text>
+ <text data-detail="context" x="652.5" y="154" class="t-muted" font-size="9" text-anchor="middle">files · explicit provider team</text>
+ <text data-detail="fine" x="652.5" y="162" class="t-database" font-size="7" text-anchor="middle">no silent team</text>
</g>
<g id="node-policy" data-node-id="policy" data-node-label="Execution Policy" tabindex="0" role="button" aria-label="Focus Execution Policy, read_only · write · yolo, mco local package / Python runtime › explicit execution-policy boundary" aria-pressed="false" data-node-kind="security" data-node-sublabel="read_only · write · yolo" data-node-tag="explicit boundary" data-node-context="mco local package / Python runtime › explicit execution-policy boundary">
<title>Execution Policy · read_only · write · yolo · mco local package / Python runtime › explicit execution-policy boundary · explicit boundary</title>
- <rect x="600" y="300" width="160" height="60" rx="6" class="c-mask"/>
- <rect x="600" y="300" width="160" height="60" rx="6" class="c-security" data-animate="node" style="--step:3" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="security" class="semantic-sigil s-security" transform="translate(606 306) scale(0.6875)">
+ <rect x="565" y="250" width="175" height="60" rx="6" class="c-mask"/>
+ <rect x="565" y="250" width="175" height="60" rx="6" class="c-security" data-animate="node" style="--step:3" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="security" class="semantic-sigil s-security" transform="translate(571 256) scale(0.6875)">
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="680" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Execution Policy</text>
- <text data-detail="context" x="680" y="344" class="t-muted" font-size="9" text-anchor="middle">read_only · write · yolo</text>
- <text data-detail="fine" x="680" y="352" class="t-security" font-size="7" text-anchor="middle">explicit boundary</text>
+ <text data-node-label data-detail-anchor x="652.5" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Execution Policy</text>
+ <text data-detail="context" x="652.5" y="294" class="t-muted" font-size="9" text-anchor="middle">read_only · write · yolo</text>
+ <text data-detail="fine" x="652.5" y="302" class="t-security" font-size="7" text-anchor="middle">explicit boundary</text>
</g>
<g id="node-workflow" data-node-id="workflow" data-node-label="Invocation Workflow" tabindex="0" role="button" aria-label="Focus Invocation Workflow, parallel · chain · debate · synthesize, mco local package / Python runtime › explicit execution-policy boundary" aria-pressed="false" data-node-kind="backend" data-node-sublabel="parallel · chain · debate · synthesize" data-node-context="mco local package / Python runtime › explicit execution-policy boundary">
<title>Invocation Workflow · parallel · chain · debate · synthesize · mco local package / Python runtime › explicit execution-policy boundary</title>
- <rect x="820" y="300" width="170" height="60" rx="6" class="c-mask"/>
- <rect x="820" y="300" width="170" height="60" rx="6" class="c-backend" data-animate="node" style="--step:5" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(826 306) scale(0.6875)">
+ <rect x="765" y="250" width="220" height="60" rx="6" class="c-mask"/>
+ <rect x="765" y="250" width="220" height="60" rx="6" class="c-backend" data-animate="node" style="--step:5" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(771 256) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="905" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Invocation Workflow</text>
- <text data-detail="context" x="905" y="344" class="t-muted" font-size="7.1" text-anchor="middle">parallel · chain · debate · synthesize</text>
+ <text data-node-label data-detail-anchor x="875" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Invocation Workflow</text>
+ <text data-detail="context" x="875" y="294" class="t-muted" font-size="9" text-anchor="middle">parallel · chain · debate · synthesize</text>
</g>
<g id="node-adapters" data-node-id="adapters" data-node-label="Provider Adapters" tabindex="0" role="button" aria-label="Focus Provider Adapters, shim / ACP · detect · run · poll · cancel, mco local package / Python runtime › explicit execution-policy boundary" aria-pressed="false" data-node-kind="messagebus" data-node-sublabel="shim / ACP · detect · run · poll · cancel" data-node-context="mco local package / Python runtime › explicit execution-policy boundary">
<title>Provider Adapters · shim / ACP · detect · run · poll · cancel · mco local package / Python runtime › explicit execution-policy boundary</title>
- <rect x="1050" y="300" width="170" height="60" rx="6" class="c-mask"/>
- <rect x="1050" y="300" width="170" height="60" rx="6" class="c-messagebus" data-animate="node" style="--step:6" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="messagebus" class="semantic-sigil s-messagebus" transform="translate(1056 306) scale(0.6875)">
+ <rect x="1010" y="250" width="230" height="60" rx="6" class="c-mask"/>
+ <rect x="1010" y="250" width="230" height="60" rx="6" class="c-messagebus" data-animate="node" style="--step:6" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="messagebus" class="semantic-sigil s-messagebus" transform="translate(1016 256) scale(0.6875)">
<path d="M2.5 4.5h11M2.5 8h11M2.5 11.5h11"/>
<circle cx="5" cy="4.5" r="1" class="sigil-fill"/>
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="1135" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Provider Adapters</text>
- <text data-detail="context" x="1135" y="344" class="t-muted" font-size="6.5" text-anchor="middle">shim / ACP · detect · run · poll · cancel</text>
+ <text data-node-label data-detail-anchor x="1125" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Provider Adapters</text>
+ <text data-detail="context" x="1125" y="294" class="t-muted" font-size="9" text-anchor="middle">shim / ACP · detect · run · poll · cancel</text>
</g>
<g id="node-provider_clis" data-node-id="provider_clis" data-node-label="Provider CLIs" tabindex="0" role="button" aria-label="Focus Provider CLIs, Claude · Codex · Pi · 7 more, Architecture component" aria-pressed="false" data-node-kind="external" data-node-sublabel="Claude · Codex · Pi · 7 more" data-node-context="Architecture component">
<title>Provider CLIs · Claude · Codex · Pi · 7 more · Architecture component</title>
- <rect x="1530" y="300" width="180" height="60" rx="6" class="c-mask"/>
- <rect x="1530" y="300" width="180" height="60" rx="6" class="c-external" data-animate="node" style="--step:7" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(1536 306) scale(0.6875)">
+ <rect x="1035" y="0" width="180" height="60" rx="6" class="c-mask"/>
+ <rect x="1035" y="0" width="180" height="60" rx="6" class="c-external" data-animate="node" style="--step:7" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(1041 6) scale(0.6875)">
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="1620" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Provider CLIs</text>
- <text data-detail="context" x="1620" y="344" class="t-muted" font-size="9" text-anchor="middle">Claude · Codex · Pi · 7 more</text>
+ <text data-node-label data-detail-anchor x="1125" y="28" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Provider CLIs</text>
+ <text data-detail="context" x="1125" y="44" class="t-muted" font-size="9" text-anchor="middle">Claude · Codex · Pi · 7 more</text>
</g>
<g id="node-answer_transport" data-node-id="answer_transport" data-node-label="Answer Transport" tabindex="0" role="button" aria-label="Focus Answer Transport, plain · JSON · JSONL · ACP events, mco local package / Python runtime" aria-pressed="false" data-node-kind="messagebus" data-node-sublabel="plain · JSON · JSONL · ACP events" data-node-context="mco local package / Python runtime">
<title>Answer Transport · plain · JSON · JSONL · ACP events · mco local package / Python runtime</title>
- <rect x="1050" y="500" width="170" height="60" rx="6" class="c-mask"/>
- <rect x="1050" y="500" width="170" height="60" rx="6" class="c-messagebus" data-animate="node" style="--step:8" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="messagebus" class="semantic-sigil s-messagebus" transform="translate(1056 506) scale(0.6875)">
+ <rect x="765" y="420" width="190" height="60" rx="6" class="c-mask"/>
+ <rect x="765" y="420" width="190" height="60" rx="6" class="c-messagebus" data-animate="node" style="--step:8" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="messagebus" class="semantic-sigil s-messagebus" transform="translate(771 426) scale(0.6875)">
<path d="M2.5 4.5h11M2.5 8h11M2.5 11.5h11"/>
<circle cx="5" cy="4.5" r="1" class="sigil-fill"/>
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="1135" y="528" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Answer Transport</text>
- <text data-detail="context" x="1135" y="544" class="t-muted" font-size="8.1" text-anchor="middle">plain · JSON · JSONL · ACP events</text>
+ <text data-node-label data-detail-anchor x="860" y="448" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Answer Transport</text>
+ <text data-detail="context" x="860" y="464" class="t-muted" font-size="9" text-anchor="middle">plain · JSON · JSONL · ACP events</text>
</g>
<g id="node-artifacts" data-node-id="artifacts" data-node-label="Invocation Artifacts" tabindex="0" role="button" aria-label="Focus Invocation Artifacts, answers · result.md · run.json, mco local package / Python runtime" aria-pressed="false" data-node-kind="cloud" data-node-sublabel="answers · result.md · run.json" data-node-tag="raw evidence" data-node-context="mco local package / Python runtime">
<title>Invocation Artifacts · answers · result.md · run.json · mco local package / Python runtime · raw evidence</title>
- <rect x="1260" y="500" width="170" height="60" rx="6" class="c-mask"/>
- <rect x="1260" y="500" width="170" height="60" rx="6" class="c-cloud" data-animate="node" style="--step:9" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(1266 506) scale(0.6875)">
+ <rect x="1010" y="420" width="170" height="60" rx="6" class="c-mask"/>
+ <rect x="1010" y="420" width="170" height="60" rx="6" class="c-cloud" data-animate="node" style="--step:9" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(1016 426) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="1345" y="528" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Invocation Artifacts</text>
- <text data-detail="context" x="1345" y="544" class="t-muted" font-size="9" text-anchor="middle">answers · result.md · run.json</text>
- <text data-detail="fine" x="1345" y="552" class="t-cloud" font-size="7" text-anchor="middle">raw evidence</text>
+ <text data-node-label data-detail-anchor x="1095" y="448" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Invocation Artifacts</text>
+ <text data-detail="context" x="1095" y="464" class="t-muted" font-size="9" text-anchor="middle">answers · result.md · run.json</text>
+ <text data-detail="fine" x="1095" y="472" class="t-cloud" font-size="7" text-anchor="middle">raw evidence</text>
</g>
<g id="node-consumers" data-node-id="consumers" data-node-label="Output Consumers" tabindex="0" role="button" aria-label="Focus Output Consumers, terminal · calling agent · CI, Architecture component" aria-pressed="false" data-node-kind="external" data-node-sublabel="terminal · calling agent · CI" data-node-context="Architecture component">
<title>Output Consumers · terminal · calling agent · CI · Architecture component</title>
- <rect x="1530" y="500" width="180" height="60" rx="6" class="c-mask"/>
- <rect x="1530" y="500" width="180" height="60" rx="6" class="c-external" data-animate="node" style="--step:10" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(1536 506) scale(0.6875)">
+ <rect x="1005" y="520" width="180" height="60" rx="6" class="c-mask"/>
+ <rect x="1005" y="520" width="180" height="60" rx="6" class="c-external" data-animate="node" style="--step:10" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(1011 526) scale(0.6875)">
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="1620" y="528" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Output Consumers</text>
- <text data-detail="context" x="1620" y="544" class="t-muted" font-size="9" text-anchor="middle">terminal · calling agent · CI</text>
+ <text data-node-label data-detail-anchor x="1095" y="548" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Output Consumers</text>
+ <text data-detail="context" x="1095" y="564" class="t-muted" font-size="9" text-anchor="middle">terminal · calling agent · CI</text>
</g>
<g id="node-session_daemon" data-node-id="session_daemon" data-node-label="Session Daemon" tabindex="0" role="button" aria-label="Focus Session Daemon, detached worker · Unix socket, mco local package / Python runtime" aria-pressed="false" data-node-kind="backend" data-node-sublabel="detached worker · Unix socket" data-node-context="mco local package / Python runtime">
<title>Session Daemon · detached worker · Unix socket · mco local package / Python runtime</title>
- <rect x="385" y="500" width="160" height="60" rx="6" class="c-mask"/>
- <rect x="385" y="500" width="160" height="60" rx="6" class="c-backend" data-animate="node" style="--step:11" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(391 506) scale(0.6875)">
+ <rect x="365" y="420" width="170" height="60" rx="6" class="c-mask"/>
+ <rect x="365" y="420" width="170" height="60" rx="6" class="c-backend" data-animate="node" style="--step:11" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(371 426) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="465" y="528" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Session Daemon</text>
- <text data-detail="context" x="465" y="544" class="t-muted" font-size="8.7" text-anchor="middle">detached worker · Unix socket</text>
+ <text data-node-label data-detail-anchor x="450" y="448" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Session Daemon</text>
+ <text data-detail="context" x="450" y="464" class="t-muted" font-size="9" text-anchor="middle">detached worker · Unix socket</text>
</g>
<g id="node-session_state" data-node-id="session_state" data-node-label="Session State" tabindex="0" role="button" aria-label="Focus Session State, state.json · history.jsonl, mco local package / Python runtime" aria-pressed="false" data-node-kind="database" data-node-sublabel="state.json · history.jsonl" data-node-tag=".mco/sessions" data-node-context="mco local package / Python runtime">
<title>Session State · state.json · history.jsonl · mco local package / Python runtime · .mco/sessions</title>
- <rect x="600" y="500" width="160" height="60" rx="6" class="c-mask"/>
- <rect x="600" y="500" width="160" height="60" rx="6" class="c-database" data-animate="node" style="--step:12" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(606 506) scale(0.6875)">
+ <rect x="565" y="420" width="170" height="60" rx="6" class="c-mask"/>
+ <rect x="565" y="420" width="170" height="60" rx="6" class="c-database" data-animate="node" style="--step:12" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(571 426) scale(0.6875)">
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="680" y="528" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Session State</text>
- <text data-detail="context" x="680" y="544" class="t-muted" font-size="9" text-anchor="middle">state.json · history.jsonl</text>
- <text data-detail="fine" x="680" y="552" class="t-database" font-size="7" text-anchor="middle">.mco/sessions</text>
+ <text data-node-label data-detail-anchor x="650" y="448" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Session State</text>
+ <text data-detail="context" x="650" y="464" class="t-muted" font-size="9" text-anchor="middle">state.json · history.jsonl</text>
+ <text data-detail="fine" x="650" y="472" class="t-database" font-size="7" text-anchor="middle">.mco/sessions</text>
</g>
<!-- Connection labels -->
@@ -5130,25 +5128,36 @@
<g data-detail="context" data-edge-from="adapters" data-edge-to="provider_clis" data-edge-label="native CLI / ACP" data-edge-key="6" data-edge-id="adapters-providers">
- <rect x="1331.6" y="310" width="86.8" height="14" rx="3" class="c-mask"/>
- <text x="1375" y="320" class="t-backend" font-size="8" text-anchor="middle">native CLI / ACP</text>
+ <rect x="1081.6" y="230" width="86.8" height="14" rx="3" class="c-mask"/>
+ <text x="1125" y="240" class="t-backend" font-size="8" text-anchor="middle">native CLI / ACP</text>
</g>
<g data-detail="context" data-edge-from="adapters" data-edge-to="answer_transport" data-edge-label="decode events" data-edge-key="7" data-edge-id="adapters-answer">
- <rect x="1098.8" y="420" width="72.4" height="14" rx="3" class="c-mask"/>
- <text x="1135" y="430" class="t-muted" font-size="8" text-anchor="middle">decode events</text>
+ <rect x="958.8" y="355" width="72.4" height="14" rx="3" class="c-mask"/>
+ <text x="995" y="365" class="t-muted" font-size="8" text-anchor="middle">decode events</text>
</g>
<g data-detail="context" data-edge-from="artifacts" data-edge-to="consumers" data-edge-label="raw answers" data-edge-key="9" data-edge-id="artifacts-consumers">
- <rect x="1448.6" y="510" width="62.8" height="14" rx="3" class="c-mask"/>
- <text x="1480" y="520" class="t-backend" font-size="8" text-anchor="middle">raw answers</text>
+ <rect x="1063.6" y="500" width="62.8" height="14" rx="3" class="c-mask"/>
+ <text x="1095" y="510" class="t-backend" font-size="8" text-anchor="middle">raw answers</text>
</g>
<g data-detail="context" data-edge-from="router" data-edge-to="session_daemon" data-edge-label="start · send · resume" data-edge-key="10" data-edge-id="router-session">
- <rect x="409.6" y="420" width="110.8" height="14" rx="3" class="c-mask"/>
- <text x="465" y="430" class="t-messagebus" font-size="8" text-anchor="middle">start · send · resume</text>
+ <rect x="394.6" y="355" width="110.8" height="14" rx="3" class="c-mask"/>
+ <text x="450" y="365" class="t-messagebus" font-size="8" text-anchor="middle">start · send · resume</text>
</g>
<g data-detail="context" data-edge-from="session_daemon" data-edge-to="session_state" data-edge-label="persist" data-edge-key="11" data-edge-id="session-state">
- <rect x="550.7" y="510" width="43.6" height="14" rx="3" class="c-mask"/>
- <text x="572.5" y="520" class="t-messagebus" font-size="8" text-anchor="middle">persist</text>
+ <rect x="528.2" y="396" width="43.6" height="14" rx="3" class="c-mask"/>
+ <text x="550" y="406" class="t-messagebus" font-size="8" text-anchor="middle">persist</text>
+ </g>
+
+ <!-- Boundary labels (foreground masks keep routes out of titles) -->
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="0" data-composition-frame-kind="region" data-composition-frame-label="mco local package / Python runtime">
+ <rect data-graph-role="structural-frame-label-mask" x="149" y="90" width="193.6" height="16" rx="3" class="c-mask"/>
+ <text x="153" y="103" class="t-cloud" font-size="9" font-weight="600">mco local package / Python runtime</text>
+ </g>
+
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="1" data-composition-frame-kind="security-group" data-composition-frame-label="explicit execution-policy boundary">
+ <rect data-graph-role="structural-frame-label-mask" x="539" y="230" width="193.6" height="16" rx="3" class="c-mask"/>
+ <text x="543" y="243" class="t-security" font-size="9" font-weight="600">explicit execution-policy boundary</text>
</g>
<!-- Legend -->
diff --git a/docs/cases/mco-runtime.architecture.json b/docs/cases/mco-runtime.architecture.json
index fef93d23..ea0b3eab 100644
--- a/docs/cases/mco-runtime.architecture.json
+++ b/docs/cases/mco-runtime.architecture.json
@@ -39,7 +39,7 @@
"type": "external",
"label": "Callers",
"sublabel": "human · coding agent",
- "pos": [20, 300],
+ "pos": [5, 250],
"size": [130, 60]
},
{
@@ -47,8 +47,8 @@
"type": "frontend",
"label": "Entry Surfaces",
"sublabel": "npm shim · Python CLI · MCP",
- "pos": [190, 300],
- "size": [150, 60],
+ "pos": [175, 250],
+ "size": [160, 60],
"sources": [
{ "path": "bin/mco.js", "line": 1, "label": "npm entry" },
{ "path": "runtime/mcp_server.py", "line": 108, "end_line": 153, "label": "MCP entry" }
@@ -59,8 +59,8 @@
"type": "backend",
"label": "Command Router",
"sublabel": "run · review · doctor · session",
- "pos": [390, 300],
- "size": [150, 60],
+ "pos": [360, 250],
+ "size": [180, 60],
"sources": [
{ "path": "runtime/cli.py", "line": 1945, "label": "CLI main" }
]
@@ -70,8 +70,8 @@
"type": "database",
"label": "Config + Selection",
"sublabel": "files · explicit provider team",
- "pos": [600, 130],
- "size": [160, 60],
+ "pos": [565, 110],
+ "size": [175, 60],
"tag": "no silent team",
"sources": [
{ "path": "runtime/config.py", "line": 24, "label": "Review config" }
@@ -82,8 +82,8 @@
"type": "security",
"label": "Execution Policy",
"sublabel": "read_only · write · yolo",
- "pos": [600, 300],
- "size": [160, 60],
+ "pos": [565, 250],
+ "size": [175, 60],
"tag": "explicit boundary",
"sources": [
{ "path": "runtime/policy.py", "line": 34, "label": "Provider policy" }
@@ -94,8 +94,8 @@
"type": "backend",
"label": "Invocation Workflow",
"sublabel": "parallel · chain · debate · synthesize",
- "pos": [820, 300],
- "size": [170, 60],
+ "pos": [765, 250],
+ "size": [220, 60],
"sources": [
{ "path": "runtime/invocation_runtime.py", "line": 696, "label": "Workflow entry" },
{ "path": "runtime/invocation_runtime.py", "line": 156, "label": "Single invocation" }
@@ -106,8 +106,8 @@
"type": "messagebus",
"label": "Provider Adapters",
"sublabel": "shim / ACP · detect · run · poll · cancel",
- "pos": [1050, 300],
- "size": [170, 60],
+ "pos": [1010, 250],
+ "size": [230, 60],
"sources": [
{ "path": "runtime/adapters/__init__.py", "line": 57, "label": "Adapter registry" },
{ "path": "runtime/contracts.py", "line": 77, "label": "Provider contract" }
@@ -118,7 +118,7 @@
"type": "external",
"label": "Provider CLIs",
"sublabel": "Claude · Codex · Pi · 7 more",
- "pos": [1530, 300],
+ "pos": [1035, 0],
"size": [180, 60]
},
{
@@ -126,8 +126,8 @@
"type": "messagebus",
"label": "Answer Transport",
"sublabel": "plain · JSON · JSONL · ACP events",
- "pos": [1050, 500],
- "size": [170, 60],
+ "pos": [765, 420],
+ "size": [190, 60],
"sources": [
{ "path": "runtime/answer_transport.py", "line": 79, "label": "Transport decoders" }
]
@@ -137,7 +137,7 @@
"type": "cloud",
"label": "Invocation Artifacts",
"sublabel": "answers · result.md · run.json",
- "pos": [1260, 500],
+ "pos": [1010, 420],
"size": [170, 60],
"tag": "raw evidence",
"sources": [
@@ -149,7 +149,7 @@
"type": "external",
"label": "Output Consumers",
"sublabel": "terminal · calling agent · CI",
- "pos": [1530, 500],
+ "pos": [1005, 520],
"size": [180, 60]
},
{
@@ -157,8 +157,8 @@
"type": "backend",
"label": "Session Daemon",
"sublabel": "detached worker · Unix socket",
- "pos": [385, 500],
- "size": [160, 60],
+ "pos": [365, 420],
+ "size": [170, 60],
"sources": [
{ "path": "runtime/session/daemon.py", "line": 50, "label": "Daemon context" }
]
@@ -168,8 +168,8 @@
"type": "database",
"label": "Session State",
"sublabel": "state.json · history.jsonl",
- "pos": [600, 500],
- "size": [160, 60],
+ "pos": [565, 420],
+ "size": [170, 60],
"tag": ".mco/sessions",
"sources": [
{ "path": "runtime/session/state.py", "line": 25, "label": "Session state" }
@@ -232,14 +232,16 @@
"from": "adapters",
"to": "provider_clis",
"label": "native CLI / ACP",
- "variant": "emphasis"
+ "variant": "emphasis",
+ "fromSide": "top",
+ "toSide": "bottom"
},
{
"id": "adapters-answer",
"from": "adapters",
"to": "answer_transport",
"label": "decode events",
- "labelAt": [1135, 430],
+ "labelAt": [995, 365],
"fromSide": "bottom",
"toSide": "top"
},
@@ -254,14 +256,17 @@
"from": "artifacts",
"to": "consumers",
"label": "raw answers",
- "variant": "emphasis"
+ "labelAt": [1095, 510],
+ "variant": "emphasis",
+ "fromSide": "bottom",
+ "toSide": "top"
},
{
"id": "router-session",
"from": "router",
"to": "session_daemon",
"label": "start · send · resume",
- "labelAt": [465, 430],
+ "labelAt": [450, 365],
"variant": "dashed",
"fromSide": "bottom",
"toSide": "top",
@@ -272,6 +277,7 @@
"from": "session_daemon",
"to": "session_state",
"label": "persist",
+ "labelAt": [550, 406],
"variant": "dashed"
}
],
diff --git a/docs/gallery.html b/docs/gallery.html
index 1a67fb76..9490c94f 100644
--- a/docs/gallery.html
+++ b/docs/gallery.html
@@ -339,7 +339,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 11E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="00d5301446f6f1ffd2cdb5b2e698b12cf893423b1a8ceee39e76b464bf194142">00d5301446f6</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="efde3cb66601c0cbfaf1243015370db9dd9a47f062d7abb5442b68c46fc6174b">efde3cb66601</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-tool-call.workflow.html?present=1&amp;play=1#view=happy-path" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -369,7 +369,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="6b3f991f936436e8918c97f3f788354189558446d5b724b152c8e76392dbbebe">6b3f991f9364</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="b37cb56052b3e5c8f58040227c40b02dba80079ac5dedcfef2d34202e586b9f6">b37cb56052b3</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/production-deployment.architecture.html?present=1&amp;play=1#view=request-boundary" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -398,7 +398,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="16c594a726b7089e20ae72b82c8f6656a81c9f1d91970de0ae538ea49cdc895d">16c594a726b7</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="ddb51bfbbeb7f64f8b427a590c417f8cae34766240ad3e985920095ea691e50f">ddb51bfbbeb7</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/cache-miss.sequence.html?present=1&amp;play=1#view=cache-fallback" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -427,7 +427,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="82c66c18299233c03cd9ce1deefd21f6ca4acbcfd540d5eef5a541017bfa272a">82c66c182992</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="d6eca6db2807d709dac5e1019f0a59b0719dee53d890192dda9b0672afff287c">d6eca6db2807</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/release-delivery.workflow.html?present=1&amp;play=1#view=approval-to-production" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -456,7 +456,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="bd23ffe63c0aeb185b6a8133c62269189fe9c526b79bef8c94869cf4194f911f">bd23ffe63c0a</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="2bf86a5f3355b6a44210a39aee8690b39536b03b56920f6fa52f5809b8a93ac1">2bf86a5f3355</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/incident-response.workflow.html?present=1&amp;play=1#view=mitigate-and-verify" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -485,7 +485,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="4b6f5e0d936cb929afbc6f4a249104383c01176f6f618add30ff0c440e3607b4">4b6f5e0d936c</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="17fbc96ad3aa79214da2333fe20ed508084e48a26e6193d20acbf83795587665">17fbc96ad3aa</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/product-analytics.dataflow.html?present=1&amp;play=1#view=consent-boundary" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -514,7 +514,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 14E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="c91a1a7d64730d2b0b253104cf98d635875f5be49add38f057f7a4f49da268a1">c91a1a7d6473</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="2bc264bf59c59828b5174db31f06a77bf8b053f8f8c5eb0737c38be63b4949c2">2bc264bf59c5</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/async-job-roundtrip.sequence.html?present=1&amp;play=1#view=work-and-retry" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -543,7 +543,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="04e7f12e6a55e513b61920e680f3dd59b42b4064e5ee61045d0b8abd3b6eea55">04e7f12e6a55</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="9294f98104336d31cf70988cb3748d28b53bdb0b30567a25853c93e57d21dd0a">9294f9810433</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/event-stream.dataflow.html?present=1&amp;play=1#view=order-transit" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -572,7 +572,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 6E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="2c88a1868e5271f43c1505a62c542b9c87e39cd438d5079eb0259d06a830ed7a">2c88a1868e52</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="dd8222b55435a49403057a96d6bd4894f082ea09f783f73546022fc3b71330e7">dd8222b55435</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-run.lifecycle.html?present=1&amp;play=1#view=main-lifecycle" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -601,7 +601,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 6E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="2b31f3d079ec732afd7d3a6fa93ace5a82ee89d02f1f131370c1ab7ab2e2bba9">2b31f3d079ec</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="bf47d297d4d0c69b435deb9a2dc1a9e40d1de7338bdd0453baa97657bf28c976">bf47d297d4d0</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/deployment-release.lifecycle.html?present=1&amp;play=1#view=rollback-outcomes" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -630,7 +630,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 9E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="44c57c682f0fc60d439e1e670b4b8ddb2285740790b38dcaa3fd41161530450f">44c57c682f0f</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="a73b9d6c003cadc6fa93d520a817fffcb0fba8a1c5aa57922c071186c48e00f7">a73b9d6c003c</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/web-app.architecture.html?present=1&amp;play=1#view=request-path" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -716,8 +716,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 645566,
- "artifactSha256": "00d5301446f6f1ffd2cdb5b2e698b12cf893423b1a8ceee39e76b464bf194142",
+ "artifactBytes": 647987,
+ "artifactSha256": "efde3cb66601c0cbfaf1243015370db9dd9a47f062d7abb5442b68c46fc6174b",
"sourceBytes": 6367,
"sourceSha256": "9c94c8c0b2104478b77befb4cc5e343d381acba6e66645ab17616fde20b60e05",
"checks": [
@@ -772,6 +772,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 52.1,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 2,
"routesOverSuggestedBends": 0,
"maxStretch": 1.257,
@@ -814,10 +816,10 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 648159,
- "artifactSha256": "6b3f991f936436e8918c97f3f788354189558446d5b724b152c8e76392dbbebe",
- "sourceBytes": 5454,
- "sourceSha256": "738e9c7f22e4e6e88f5aafc087dc58409105927daa9a79aaf240c8393654494f",
+ "artifactBytes": 652388,
+ "artifactSha256": "b37cb56052b3e5c8f58040227c40b02dba80079ac5dedcfef2d34202e586b9f6",
+ "sourceBytes": 5476,
+ "sourceSha256": "ec484aa8576664fdb207b543fa49486b23273faccb7a5071e1a0becfb48c22eb",
"checks": [
{
"name": "single_svg",
@@ -870,6 +872,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 36,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 2,
"routesOverSuggestedBends": 0,
"maxStretch": 1.098,
@@ -912,8 +916,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 642063,
- "artifactSha256": "16c594a726b7089e20ae72b82c8f6656a81c9f1d91970de0ae538ea49cdc895d",
+ "artifactBytes": 644404,
+ "artifactSha256": "ddb51bfbbeb7f64f8b427a590c417f8cae34766240ad3e985920095ea691e50f",
"sourceBytes": 4345,
"sourceSha256": "4bbaa6ca3cd4036002fd5d0f3a332eb922cec69d09bac3d7925f95beb4308389",
"checks": [
@@ -968,6 +972,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 15,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 0,
"routesOverSuggestedBends": 0,
"maxStretch": 1,
@@ -1010,8 +1016,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 644390,
- "artifactSha256": "82c66c18299233c03cd9ce1deefd21f6ca4acbcfd540d5eef5a541017bfa272a",
+ "artifactBytes": 646779,
+ "artifactSha256": "d6eca6db2807d709dac5e1019f0a59b0719dee53d890192dda9b0672afff287c",
"sourceBytes": 5164,
"sourceSha256": "e5c880417eac1623923c3dd5461e0c78acd762e1621a28bd53fc14a84cad6a91",
"checks": [
@@ -1066,6 +1072,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 36.3,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 2,
"routesOverSuggestedBends": 0,
"maxStretch": 1.214,
@@ -1108,8 +1116,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 641703,
- "artifactSha256": "bd23ffe63c0aeb185b6a8133c62269189fe9c526b79bef8c94869cf4194f911f",
+ "artifactBytes": 644108,
+ "artifactSha256": "2bf86a5f3355b6a44210a39aee8690b39536b03b56920f6fa52f5809b8a93ac1",
"sourceBytes": 5375,
"sourceSha256": "5c760c82eee545dfb7da38a4e628059d7891af4cfbfc13c8a7009ea64f69aa1b",
"checks": [
@@ -1164,6 +1172,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 119,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 3,
"routesOverSuggestedBends": 1,
"maxStretch": 3.465,
@@ -1206,8 +1216,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 645648,
- "artifactSha256": "4b6f5e0d936cb929afbc6f4a249104383c01176f6f618add30ff0c440e3607b4",
+ "artifactBytes": 648037,
+ "artifactSha256": "17fbc96ad3aa79214da2333fe20ed508084e48a26e6193d20acbf83795587665",
"sourceBytes": 5627,
"sourceSha256": "6fa38a7ccedf96da592d60b392783b846188eaa3ec9136c6dc06ca020e43a110",
"checks": [
@@ -1262,6 +1272,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 57,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 3,
"routesOverSuggestedBends": 2,
"maxStretch": 1.369,
@@ -1304,8 +1316,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 642473,
- "artifactSha256": "c91a1a7d64730d2b0b253104cf98d635875f5be49add38f057f7a4f49da268a1",
+ "artifactBytes": 644814,
+ "artifactSha256": "2bc264bf59c59828b5174db31f06a77bf8b053f8f8c5eb0737c38be63b4949c2",
"sourceBytes": 4370,
"sourceSha256": "545f20920c89b69c2bb1f15508d5543fddbeb15cffba61e102206e04bd5a5cd9",
"checks": [
@@ -1360,6 +1372,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 22,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 0,
"routesOverSuggestedBends": 0,
"maxStretch": 1,
@@ -1402,8 +1416,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 649567,
- "artifactSha256": "04e7f12e6a55e513b61920e680f3dd59b42b4064e5ee61045d0b8abd3b6eea55",
+ "artifactBytes": 651988,
+ "artifactSha256": "9294f98104336d31cf70988cb3748d28b53bdb0b30567a25853c93e57d21dd0a",
"sourceBytes": 5433,
"sourceSha256": "a92d6597ddbe164f395da32a7d4b33cfae08edd7d9600a6fb45a2058e5bbb43e",
"checks": [
@@ -1458,6 +1472,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 9,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 4,
"routesOverSuggestedBends": 1,
"maxStretch": 2.663,
@@ -1500,8 +1516,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 6,
- "artifactBytes": 639283,
- "artifactSha256": "2c88a1868e5271f43c1505a62c542b9c87e39cd438d5079eb0259d06a830ed7a",
+ "artifactBytes": 641672,
+ "artifactSha256": "dd8222b55435a49403057a96d6bd4894f082ea09f783f73546022fc3b71330e7",
"sourceBytes": 4417,
"sourceSha256": "af939579dcafc8b4c49f09594591577994398aee57a57369d4c791dfc0d85a42",
"checks": [
@@ -1556,6 +1572,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": null,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 3,
"routesOverSuggestedBends": 2,
"maxStretch": 3.267,
@@ -1598,8 +1616,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 6,
- "artifactBytes": 640253,
- "artifactSha256": "2b31f3d079ec732afd7d3a6fa93ace5a82ee89d02f1f131370c1ab7ab2e2bba9",
+ "artifactBytes": 642658,
+ "artifactSha256": "bf47d297d4d0c69b435deb9a2dc1a9e40d1de7338bdd0453baa97657bf28c976",
"sourceBytes": 4274,
"sourceSha256": "735c2c5819266e6ea2a71775b6eefce98b53030ce90cb721dc8e1d022ce5be71",
"checks": [
@@ -1654,6 +1672,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": null,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 0,
"routesOverSuggestedBends": 0,
"maxStretch": 1,
@@ -1696,8 +1716,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 639490,
- "artifactSha256": "44c57c682f0fc60d439e1e670b4b8ddb2285740790b38dcaa3fd41161530450f",
+ "artifactBytes": 642750,
+ "artifactSha256": "a73b9d6c003cadc6fa93d520a817fffcb0fba8a1c5aa57922c071186c48e00f7",
"sourceBytes": 3793,
"sourceSha256": "483350f5297df682aba4e4a0fa491307ce3d3abd725ae4df07fab177490752cf",
"checks": [
@@ -1752,6 +1772,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 20,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 3,
"routesOverSuggestedBends": 1,
"maxStretch": 1,
diff --git a/docs/gallery/artifacts/agent-run.lifecycle.html b/docs/gallery/artifacts/agent-run.lifecycle.html
index 24b0d269..3200c804 100644
--- a/docs/gallery/artifacts/agent-run.lifecycle.html
+++ b/docs/gallery/artifacts/agent-run.lifecycle.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4966,7 +4967,7 @@
<path d="m7 5.4 3.6 2.6L7 10.6Z" class="sigil-fill"/>
</g>
<text data-detail="fine" x="45" y="140" class="t-frontend" font-size="7" font-weight="700">01</text>
- <text data-detail-anchor x="94" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Queued</text>
+ <text data-node-label data-detail-anchor x="94" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Queued</text>
<text data-detail="context" x="94" y="163" class="t-muted" font-size="7" text-anchor="middle">request accepted</text>
<text data-detail="fine" x="94" y="177" class="t-frontend" font-size="7" text-anchor="middle">entry</text>
</g>
@@ -4979,7 +4980,7 @@
<path d="M2 8h3l1.5-3.5L9 12l1.6-4H14"/>
</g>
<text data-detail="fine" x="199" y="140" class="t-backend" font-size="7" font-weight="700">02</text>
- <text data-detail-anchor x="248" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Planning</text>
+ <text data-node-label data-detail-anchor x="248" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Planning</text>
<text data-detail="context" x="248" y="163" class="t-muted" font-size="7" text-anchor="middle">build task graph</text>
<text data-detail="fine" x="248" y="177" class="t-backend" font-size="7" text-anchor="middle">model</text>
</g>
@@ -4992,7 +4993,7 @@
<path d="M2 8h3l1.5-3.5L9 12l1.6-4H14"/>
</g>
<text data-detail="fine" x="353" y="140" class="t-backend" font-size="7" font-weight="700">03</text>
- <text data-detail-anchor x="402" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Executing</text>
+ <text data-node-label data-detail-anchor x="402" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Executing</text>
<text data-detail="context" x="402" y="163" class="t-muted" font-size="7" text-anchor="middle">tool calls</text>
<text data-detail="fine" x="402" y="177" class="t-backend" font-size="7" text-anchor="middle">work</text>
</g>
@@ -5006,7 +5007,7 @@
<circle cx="8" cy="8" r="1.2" class="sigil-fill"/>
</g>
<text data-detail="fine" x="507" y="140" class="t-security" font-size="7" font-weight="700">04</text>
- <text data-detail-anchor x="556" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Reviewing</text>
+ <text data-node-label data-detail-anchor x="556" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Reviewing</text>
<text data-detail="context" x="556" y="163" class="t-muted" font-size="7" text-anchor="middle">quality gate</text>
<text data-detail="fine" x="556" y="177" class="t-security" font-size="7" text-anchor="middle">check</text>
</g>
@@ -5020,7 +5021,7 @@
<path d="m5.2 8 1.8 1.8 3.8-4"/>
</g>
<text data-detail="fine" x="661" y="140" class="t-database" font-size="7" font-weight="700">05</text>
- <text data-detail-anchor x="710" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Completed</text>
+ <text data-node-label data-detail-anchor x="710" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Completed</text>
<text data-detail="context" x="710" y="163" class="t-muted" font-size="7" text-anchor="middle">final response</text>
<text data-detail="fine" x="710" y="177" class="t-database" font-size="7" text-anchor="middle">done</text>
</g>
@@ -5032,7 +5033,7 @@
<g aria-hidden="true" data-semantic-sigil="waiting" class="semantic-sigil s-cloud" transform="translate(448 284) scale(0.6875)">
<path d="M4 2.5h8M4 13.5h8M5 3c0 2.8 2 3.2 3 5-1 1.8-3 2.2-3 5M11 3c0 2.8-2 3.2-3 5 1 1.8 3 2.2 3 5"/>
</g>
- <text data-detail-anchor x="402" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Needs Approval</text>
+ <text data-node-label data-detail-anchor x="402" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Needs Approval</text>
<text data-detail="context" x="402" y="315" class="t-muted" font-size="7" text-anchor="middle">human gate</text>
<text data-detail="fine" x="402" y="325" class="t-cloud" font-size="7" text-anchor="middle">pause</text>
</g>
@@ -5044,7 +5045,7 @@
<g aria-hidden="true" data-semantic-sigil="waiting" class="semantic-sigil s-cloud" transform="translate(602 284) scale(0.6875)">
<path d="M4 2.5h8M4 13.5h8M5 3c0 2.8 2 3.2 3 5-1 1.8-3 2.2-3 5M11 3c0 2.8-2 3.2-3 5 1 1.8 3 2.2 3 5"/>
</g>
- <text data-detail-anchor x="556" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Blocked</text>
+ <text data-node-label data-detail-anchor x="556" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Blocked</text>
<text data-detail="context" x="556" y="315" class="t-muted" font-size="7" text-anchor="middle">missing input</text>
<text data-detail="fine" x="556" y="325" class="t-cloud" font-size="7" text-anchor="middle">wait</text>
</g>
@@ -5057,7 +5058,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="402" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Failed</text>
+ <text data-node-label data-detail-anchor x="402" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Failed</text>
<text data-detail="context" x="402" y="393" class="t-muted" font-size="7" text-anchor="middle">recoverable error</text>
<text data-detail="fine" x="402" y="403" class="t-security" font-size="7" text-anchor="middle">retryable</text>
</g>
@@ -5070,7 +5071,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="402" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Cancelled</text>
+ <text data-node-label data-detail-anchor x="402" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Cancelled</text>
<text data-detail="context" x="402" y="487" class="t-muted" font-size="7" text-anchor="middle">user stopped</text>
<text data-detail="fine" x="402" y="497" class="t-security" font-size="7" text-anchor="middle">terminal</text>
</g>
@@ -5083,7 +5084,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="556" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Expired</text>
+ <text data-node-label data-detail-anchor x="556" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Expired</text>
<text data-detail="context" x="556" y="487" class="t-muted" font-size="7" text-anchor="middle">timeout</text>
<text data-detail="fine" x="556" y="497" class="t-security" font-size="7" text-anchor="middle">terminal</text>
</g>
@@ -10649,6 +10650,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10668,6 +10723,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/artifacts/agent-tool-call.workflow.html b/docs/gallery/artifacts/agent-tool-call.workflow.html
index ee020383..bc6acb85 100644
--- a/docs/gallery/artifacts/agent-tool-call.workflow.html
+++ b/docs/gallery/artifacts/agent-tool-call.workflow.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4998,7 +4999,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
+ <text data-node-label data-detail-anchor x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
<text data-detail="context" x="88" y="131" class="t-muted" font-size="8" text-anchor="middle">asks for work</text>
</g>
@@ -5012,7 +5013,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="220" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Chat Surface</text>
+ <text data-node-label data-detail-anchor x="220" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Chat Surface</text>
<text data-detail="context" x="220" y="131" class="t-muted" font-size="8" text-anchor="middle">thread + files</text>
</g>
@@ -5023,7 +5024,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(585 99) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="625" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Final Reply</text>
+ <text data-node-label data-detail-anchor x="625" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Final Reply</text>
<text data-detail="context" x="625" y="131" class="t-muted" font-size="8" text-anchor="middle">answer + changes</text>
</g>
@@ -5034,7 +5035,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(260 215) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="300" y="230" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Agent Planner</text>
+ <text data-node-label data-detail-anchor x="300" y="230" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Agent Planner</text>
<text data-detail="context" x="300" y="247" class="t-muted" font-size="8" text-anchor="middle">plan next step</text>
<text data-detail="fine" x="300" y="265" class="t-backend" font-size="7" text-anchor="middle">context aware</text>
</g>
@@ -5046,7 +5047,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(390 223) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="430" y="238" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Router</text>
+ <text data-node-label data-detail-anchor x="430" y="238" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Router</text>
<text data-detail="context" x="430" y="255" class="t-muted" font-size="8" text-anchor="middle">choose capability</text>
</g>
@@ -5058,7 +5059,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="430" y="354" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Approval Gate</text>
+ <text data-node-label data-detail-anchor x="430" y="354" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Approval Gate</text>
<text data-detail="context" x="430" y="371" class="t-muted" font-size="8" text-anchor="middle">scope + consent</text>
<text data-detail="fine" x="430" y="389" class="t-security" font-size="7" text-anchor="middle">block risky ops</text>
</g>
@@ -5071,7 +5072,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="500" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Blocked</text>
+ <text data-node-label data-detail-anchor x="500" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Blocked</text>
<text data-detail="context" x="500" y="503" class="t-muted" font-size="8" text-anchor="middle">wait or reject</text>
</g>
@@ -5085,7 +5086,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="625" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Retry Path</text>
+ <text data-node-label data-detail-anchor x="625" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Retry Path</text>
<text data-detail="context" x="625" y="503" class="t-muted" font-size="8" text-anchor="middle">revise request</text>
</g>
@@ -5099,7 +5100,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="500" y="602" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Call</text>
+ <text data-node-label data-detail-anchor x="500" y="602" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Call</text>
<text data-detail="context" x="500" y="619" class="t-muted" font-size="6.6" text-anchor="middle">shell / browser / MCP</text>
<text data-detail="fine" x="500" y="637" class="t-messagebus" font-size="7" text-anchor="middle">structured result</text>
</g>
@@ -5111,7 +5112,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(585 595) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">External API</text>
+ <text data-node-label data-detail-anchor x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">External API</text>
<text data-detail="context" x="625" y="627" class="t-muted" font-size="8" text-anchor="middle">network service</text>
</g>
@@ -5123,7 +5124,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="220" y="734" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Context Store</text>
+ <text data-node-label data-detail-anchor x="220" y="734" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Context Store</text>
<text data-detail="context" x="220" y="751" class="t-muted" font-size="8" text-anchor="middle">repo + memory</text>
</g>
@@ -5135,7 +5136,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="500" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace Log</text>
+ <text data-node-label data-detail-anchor x="500" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace Log</text>
<text data-detail="context" x="500" y="751" class="t-muted" font-size="8" text-anchor="middle">events + output</text>
</g>
@@ -10697,6 +10698,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10716,6 +10771,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/artifacts/async-job-roundtrip.sequence.html b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
index 6edb236d..c54a756d 100644
--- a/docs/gallery/artifacts/async-job-roundtrip.sequence.html
+++ b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -5105,7 +5106,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="62" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Client</text>
+ <text data-node-label data-detail-anchor x="62" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Client</text>
<text data-detail="context" x="62" y="111" class="t-muted" font-size="7" text-anchor="middle">mobile app</text>
</g>
@@ -5116,7 +5117,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(133 78) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="170" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Jobs API</text>
+ <text data-node-label data-detail-anchor x="170" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Jobs API</text>
<text data-detail="context" x="170" y="111" class="t-muted" font-size="7" text-anchor="middle">request edge</text>
</g>
@@ -5130,7 +5131,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="278" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Queue</text>
+ <text data-node-label data-detail-anchor x="278" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Queue</text>
<text data-detail="context" x="278" y="111" class="t-muted" font-size="7" text-anchor="middle">durable work</text>
</g>
@@ -5141,7 +5142,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(349 78) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="386" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Worker</text>
+ <text data-node-label data-detail-anchor x="386" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Worker</text>
<text data-detail="context" x="386" y="111" class="t-muted" font-size="7" text-anchor="middle">background</text>
</g>
@@ -5152,7 +5153,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(457 78) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="494" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Provider</text>
+ <text data-node-label data-detail-anchor x="494" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Provider</text>
<text data-detail="context" x="494" y="111" class="t-muted" font-size="7" text-anchor="middle">external API</text>
</g>
@@ -5164,7 +5165,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="602" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Job Store</text>
+ <text data-node-label data-detail-anchor x="602" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Job Store</text>
<text data-detail="context" x="602" y="111" class="t-muted" font-size="7" text-anchor="middle">source of truth</text>
</g>
@@ -5178,7 +5179,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="710" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Notifier</text>
+ <text data-node-label data-detail-anchor x="710" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Notifier</text>
<text data-detail="context" x="710" y="111" class="t-muted" font-size="7" text-anchor="middle">webhook</text>
</g>
@@ -10727,6 +10728,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10746,6 +10801,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/artifacts/cache-miss.sequence.html b/docs/gallery/artifacts/cache-miss.sequence.html
index 1427c2b0..ae9d189f 100644
--- a/docs/gallery/artifacts/cache-miss.sequence.html
+++ b/docs/gallery/artifacts/cache-miss.sequence.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -5087,7 +5088,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="62" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
+ <text data-node-label data-detail-anchor x="62" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
<text data-detail="context" x="62" y="111" class="t-muted" font-size="7" text-anchor="middle">browser session</text>
</g>
@@ -5101,7 +5102,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="170" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Web App</text>
+ <text data-node-label data-detail-anchor x="170" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Web App</text>
<text data-detail="context" x="170" y="111" class="t-muted" font-size="7" text-anchor="middle">React UI</text>
</g>
@@ -5112,7 +5113,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(241 78) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="278" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API</text>
+ <text data-node-label data-detail-anchor x="278" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API</text>
<text data-detail="context" x="278" y="111" class="t-muted" font-size="7" text-anchor="middle">request handler</text>
</g>
@@ -5124,7 +5125,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="386" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth</text>
+ <text data-node-label data-detail-anchor x="386" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth</text>
<text data-detail="context" x="386" y="111" class="t-muted" font-size="7" text-anchor="middle">JWT verify</text>
</g>
@@ -5136,7 +5137,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="494" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
+ <text data-node-label data-detail-anchor x="494" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
<text data-detail="context" x="494" y="111" class="t-muted" font-size="7" text-anchor="middle">cache</text>
</g>
@@ -5148,7 +5149,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="602" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Postgres</text>
+ <text data-node-label data-detail-anchor x="602" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Postgres</text>
<text data-detail="context" x="602" y="111" class="t-muted" font-size="7" text-anchor="middle">source of truth</text>
</g>
@@ -5162,7 +5163,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="710" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace</text>
+ <text data-node-label data-detail-anchor x="710" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace</text>
<text data-detail="context" x="710" y="111" class="t-muted" font-size="7" text-anchor="middle">async event</text>
</g>
@@ -10715,6 +10716,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10734,6 +10789,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/artifacts/deployment-release.lifecycle.html b/docs/gallery/artifacts/deployment-release.lifecycle.html
index 9d9388c1..ef494f25 100644
--- a/docs/gallery/artifacts/deployment-release.lifecycle.html
+++ b/docs/gallery/artifacts/deployment-release.lifecycle.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4966,7 +4967,7 @@
<path d="m7 5.4 3.6 2.6L7 10.6Z" class="sigil-fill"/>
</g>
<text data-detail="fine" x="45" y="140" class="t-frontend" font-size="7" font-weight="700">01</text>
- <text data-detail-anchor x="94" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Queued</text>
+ <text data-node-label data-detail-anchor x="94" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Queued</text>
<text data-detail="context" x="94" y="163" class="t-muted" font-size="7" text-anchor="middle">change accepted</text>
<text data-detail="fine" x="94" y="177" class="t-frontend" font-size="7" text-anchor="middle">pending</text>
</g>
@@ -4979,7 +4980,7 @@
<path d="M2 8h3l1.5-3.5L9 12l1.6-4H14"/>
</g>
<text data-detail="fine" x="199" y="140" class="t-backend" font-size="7" font-weight="700">02</text>
- <text data-detail-anchor x="248" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Building</text>
+ <text data-node-label data-detail-anchor x="248" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Building</text>
<text data-detail="context" x="248" y="163" class="t-muted" font-size="7" text-anchor="middle">immutable image</text>
<text data-detail="fine" x="248" y="177" class="t-backend" font-size="7" text-anchor="middle">running</text>
</g>
@@ -4993,7 +4994,7 @@
<circle cx="8" cy="8" r="1.2" class="sigil-fill"/>
</g>
<text data-detail="fine" x="353" y="140" class="t-security" font-size="7" font-weight="700">03</text>
- <text data-detail-anchor x="402" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Verifying</text>
+ <text data-node-label data-detail-anchor x="402" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Verifying</text>
<text data-detail="context" x="402" y="163" class="t-muted" font-size="7" text-anchor="middle">tests + policy</text>
<text data-detail="fine" x="402" y="177" class="t-security" font-size="7" text-anchor="middle">gate</text>
</g>
@@ -5006,7 +5007,7 @@
<path d="M4 2.5h8M4 13.5h8M5 3c0 2.8 2 3.2 3 5-1 1.8-3 2.2-3 5M11 3c0 2.8-2 3.2-3 5 1 1.8 3 2.2 3 5"/>
</g>
<text data-detail="fine" x="507" y="140" class="t-cloud" font-size="7" font-weight="700">04</text>
- <text data-detail-anchor x="556" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Ready</text>
+ <text data-node-label data-detail-anchor x="556" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Ready</text>
<text data-detail="context" x="556" y="163" class="t-muted" font-size="7" text-anchor="middle">promotion pending</text>
<text data-detail="fine" x="556" y="177" class="t-cloud" font-size="7" text-anchor="middle">approved</text>
</g>
@@ -5020,7 +5021,7 @@
<path d="m5.2 8 1.8 1.8 3.8-4"/>
</g>
<text data-detail="fine" x="661" y="140" class="t-database" font-size="7" font-weight="700">05</text>
- <text data-detail-anchor x="710" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Live</text>
+ <text data-node-label data-detail-anchor x="710" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Live</text>
<text data-detail="context" x="710" y="163" class="t-muted" font-size="7" text-anchor="middle">production healthy</text>
<text data-detail="fine" x="710" y="177" class="t-database" font-size="7" text-anchor="middle">success</text>
</g>
@@ -5032,7 +5033,7 @@
<g aria-hidden="true" data-semantic-sigil="waiting" class="semantic-sigil s-cloud" transform="translate(448 284) scale(0.6875)">
<path d="M4 2.5h8M4 13.5h8M5 3c0 2.8 2 3.2 3 5-1 1.8-3 2.2-3 5M11 3c0 2.8-2 3.2-3 5 1 1.8 3 2.2 3 5"/>
</g>
- <text data-detail-anchor x="402" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Needs Approval</text>
+ <text data-node-label data-detail-anchor x="402" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Needs Approval</text>
<text data-detail="context" x="402" y="315" class="t-muted" font-size="7" text-anchor="middle">release owner</text>
<text data-detail="fine" x="402" y="325" class="t-cloud" font-size="7" text-anchor="middle">pause</text>
</g>
@@ -5044,7 +5045,7 @@
<g aria-hidden="true" data-semantic-sigil="active" class="semantic-sigil s-backend" transform="translate(602 284) scale(0.6875)">
<path d="M2 8h3l1.5-3.5L9 12l1.6-4H14"/>
</g>
- <text data-detail-anchor x="556" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Rolling Back</text>
+ <text data-node-label data-detail-anchor x="556" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Rolling Back</text>
<text data-detail="context" x="556" y="315" class="t-muted" font-size="7" text-anchor="middle">last good image</text>
<text data-detail="fine" x="556" y="325" class="t-backend" font-size="7" text-anchor="middle">automatic</text>
</g>
@@ -5056,7 +5057,7 @@
<g aria-hidden="true" data-semantic-sigil="waiting" class="semantic-sigil s-cloud" transform="translate(756 284) scale(0.6875)">
<path d="M4 2.5h8M4 13.5h8M5 3c0 2.8 2 3.2 3 5-1 1.8-3 2.2-3 5M11 3c0 2.8-2 3.2-3 5 1 1.8 3 2.2 3 5"/>
</g>
- <text data-detail-anchor x="710" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Health Paused</text>
+ <text data-node-label data-detail-anchor x="710" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Health Paused</text>
<text data-detail="context" x="710" y="315" class="t-muted" font-size="7" text-anchor="middle">SLO regression</text>
<text data-detail="fine" x="710" y="325" class="t-cloud" font-size="7" text-anchor="middle">observe</text>
</g>
@@ -5069,7 +5070,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="402" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Cancelled</text>
+ <text data-node-label data-detail-anchor x="402" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Cancelled</text>
<text data-detail="context" x="402" y="487" class="t-muted" font-size="7" text-anchor="middle">approval denied</text>
<text data-detail="fine" x="402" y="497" class="t-security" font-size="7" text-anchor="middle">terminal</text>
</g>
@@ -5082,7 +5083,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="556" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Failed</text>
+ <text data-node-label data-detail-anchor x="556" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Failed</text>
<text data-detail="context" x="556" y="487" class="t-muted" font-size="7" text-anchor="middle">rollback failed</text>
<text data-detail="fine" x="556" y="497" class="t-security" font-size="7" text-anchor="middle">terminal</text>
</g>
@@ -5095,7 +5096,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.2 8 1.8 1.8 3.8-4"/>
</g>
- <text data-detail-anchor x="710" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Rolled Back</text>
+ <text data-node-label data-detail-anchor x="710" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Rolled Back</text>
<text data-detail="context" x="710" y="487" class="t-muted" font-size="7" text-anchor="middle">service restored</text>
<text data-detail="fine" x="710" y="497" class="t-database" font-size="7" text-anchor="middle">terminal</text>
</g>
@@ -10661,6 +10662,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10680,6 +10735,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/artifacts/event-stream.dataflow.html b/docs/gallery/artifacts/event-stream.dataflow.html
index 200b888d..a6f33569 100644
--- a/docs/gallery/artifacts/event-stream.dataflow.html
+++ b/docs/gallery/artifacts/event-stream.dataflow.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4978,7 +4979,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="100" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Checkout API</text>
+ <text data-node-label data-detail-anchor x="100" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Checkout API</text>
<text data-detail="context" x="100" y="165" class="t-muted" font-size="7" text-anchor="middle">order producer</text>
<text data-detail="fine" x="100" y="175" class="t-frontend" font-size="7" text-anchor="middle">team commerce</text>
</g>
@@ -4990,7 +4991,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(50 362) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="100" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Billing API</text>
+ <text data-node-label data-detail-anchor x="100" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Billing API</text>
<text data-detail="context" x="100" y="393" class="t-muted" font-size="7" text-anchor="middle">payment producer</text>
<text data-detail="fine" x="100" y="403" class="t-backend" font-size="7" text-anchor="middle">team money</text>
</g>
@@ -5005,7 +5006,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="315" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">orders.v1</text>
+ <text data-node-label data-detail-anchor x="315" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">orders.v1</text>
<text data-detail="context" x="315" y="165" class="t-muted" font-size="7" text-anchor="middle">12 partitions</text>
<text data-detail="fine" x="315" y="175" class="t-messagebus" font-size="7" text-anchor="middle">key: order_id</text>
</g>
@@ -5020,7 +5021,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="315" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">payments.v2</text>
+ <text data-node-label data-detail-anchor x="315" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">payments.v2</text>
<text data-detail="context" x="315" y="393" class="t-muted" font-size="7" text-anchor="middle">8 partitions</text>
<text data-detail="fine" x="315" y="403" class="t-messagebus" font-size="7" text-anchor="middle">key: order_id</text>
</g>
@@ -5032,7 +5033,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(480 134) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="530" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Order Validate</text>
+ <text data-node-label data-detail-anchor x="530" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Order Validate</text>
<text data-detail="context" x="530" y="165" class="t-muted" font-size="7" text-anchor="middle">group fulfillment</text>
<text data-detail="fine" x="530" y="175" class="t-backend" font-size="7" text-anchor="middle">ordered</text>
</g>
@@ -5044,7 +5045,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(480 362) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="530" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Payment Enrich</text>
+ <text data-node-label data-detail-anchor x="530" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Payment Enrich</text>
<text data-detail="context" x="530" y="393" class="t-muted" font-size="7" text-anchor="middle">group analytics</text>
<text data-detail="fine" x="530" y="403" class="t-backend" font-size="7" text-anchor="middle">at-least-once</text>
</g>
@@ -5057,7 +5058,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="745" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Order State</text>
+ <text data-node-label data-detail-anchor x="745" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Order State</text>
<text data-detail="context" x="745" y="279" class="t-muted" font-size="7" text-anchor="middle">materialized view</text>
<text data-detail="fine" x="745" y="289" class="t-database" font-size="7" text-anchor="middle">idempotent</text>
</g>
@@ -5072,7 +5073,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="745" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">events.dlq</text>
+ <text data-node-label data-detail-anchor x="745" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">events.dlq</text>
<text data-detail="context" x="745" y="621" class="t-muted" font-size="7" text-anchor="middle">poison events</text>
<text data-detail="fine" x="745" y="631" class="t-messagebus" font-size="7" text-anchor="middle">7-day retention</text>
</g>
@@ -5084,7 +5085,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(910 134) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="960" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Fulfillment</text>
+ <text data-node-label data-detail-anchor x="960" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Fulfillment</text>
<text data-detail="context" x="960" y="165" class="t-muted" font-size="7" text-anchor="middle">shipping workflow</text>
<text data-detail="fine" x="960" y="175" class="t-backend" font-size="7" text-anchor="middle">consumer</text>
</g>
@@ -5097,7 +5098,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="960" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Analytics</text>
+ <text data-node-label data-detail-anchor x="960" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Analytics</text>
<text data-detail="context" x="960" y="393" class="t-muted" font-size="7" text-anchor="middle">streaming facts</text>
<text data-detail="fine" x="960" y="403" class="t-database" font-size="7" text-anchor="middle">consumer</text>
</g>
@@ -5110,7 +5111,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="960" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Replay Tool</text>
+ <text data-node-label data-detail-anchor x="960" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Replay Tool</text>
<text data-detail="context" x="960" y="621" class="t-muted" font-size="7" text-anchor="middle">approved batch</text>
<text data-detail="fine" x="960" y="631" class="t-security" font-size="7" text-anchor="middle">operator gate</text>
</g>
@@ -5123,7 +5124,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="960" y="473" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">On-call</text>
+ <text data-node-label data-detail-anchor x="960" y="473" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">On-call</text>
<text data-detail="context" x="960" y="489" class="t-muted" font-size="7" text-anchor="middle">DLQ owner</text>
<text data-detail="fine" x="960" y="499" class="t-external" font-size="7" text-anchor="middle">SRE</text>
</g>
@@ -10739,6 +10740,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10758,6 +10813,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/artifacts/incident-response.workflow.html b/docs/gallery/artifacts/incident-response.workflow.html
index ff44f078..f1233b99 100644
--- a/docs/gallery/artifacts/incident-response.workflow.html
+++ b/docs/gallery/artifacts/incident-response.workflow.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4997,7 +4998,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SLO Alert</text>
+ <text data-node-label data-detail-anchor x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SLO Alert</text>
<text data-detail="context" x="88" y="131" class="t-muted" font-size="8" text-anchor="middle">burn rate</text>
</g>
@@ -5009,7 +5010,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="220" y="238" class="t-primary" font-size="9.4" font-weight="600" text-anchor="middle">Page On-call</text>
+ <text data-node-label data-detail-anchor x="220" y="238" class="t-primary" font-size="9.4" font-weight="600" text-anchor="middle">Page On-call</text>
<text data-detail="context" x="220" y="255" class="t-muted" font-size="8" text-anchor="middle">acknowledge</text>
</g>
@@ -5020,7 +5021,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(274 223) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="300" y="238" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Triage</text>
+ <text data-node-label data-detail-anchor x="300" y="238" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Triage</text>
<text data-detail="context" x="300" y="255" class="t-muted" font-size="7.7" text-anchor="middle">scope impact</text>
</g>
@@ -5032,7 +5033,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="430" y="230" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Declare</text>
+ <text data-node-label data-detail-anchor x="430" y="230" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Declare</text>
<text data-detail="context" x="430" y="247" class="t-muted" font-size="8" text-anchor="middle">assign commander</text>
<text data-detail="fine" x="430" y="265" class="t-security" font-size="7" text-anchor="middle">SEV-1/2</text>
</g>
@@ -5044,7 +5045,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(400 347) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="430" y="362" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Contain</text>
+ <text data-node-label data-detail-anchor x="430" y="362" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Contain</text>
<text data-detail="context" x="430" y="379" class="t-muted" font-size="8" text-anchor="middle">stop growth</text>
</g>
@@ -5055,7 +5056,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(480 347) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="500" y="362" class="t-primary" font-size="10.4" font-weight="600" text-anchor="middle">Recover</text>
+ <text data-node-label data-detail-anchor x="500" y="362" class="t-primary" font-size="10.4" font-weight="600" text-anchor="middle">Recover</text>
<text data-detail="context" x="500" y="379" class="t-muted" font-size="8" text-anchor="middle">restore</text>
</g>
@@ -5067,7 +5068,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="625" y="478" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Verify</text>
+ <text data-node-label data-detail-anchor x="625" y="478" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Verify</text>
<text data-detail="context" x="625" y="495" class="t-muted" font-size="8" text-anchor="middle">SLO + traces</text>
<text data-detail="fine" x="625" y="513" class="t-database" font-size="7" text-anchor="middle">15 min stable</text>
</g>
@@ -5080,7 +5081,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Resolve</text>
+ <text data-node-label data-detail-anchor x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Resolve</text>
<text data-detail="context" x="625" y="627" class="t-muted" font-size="8" text-anchor="middle">final update</text>
</g>
@@ -5094,7 +5095,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="430" y="610" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Status Update</text>
+ <text data-node-label data-detail-anchor x="430" y="610" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Status Update</text>
<text data-detail="context" x="430" y="627" class="t-muted" font-size="8" text-anchor="middle">impact + ETA</text>
</g>
@@ -5106,7 +5107,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="430" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Escalate</text>
+ <text data-node-label data-detail-anchor x="430" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Escalate</text>
<text data-detail="context" x="430" y="751" class="t-muted" font-size="8" text-anchor="middle">specialist</text>
</g>
@@ -5120,7 +5121,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="625" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Rollback</text>
+ <text data-node-label data-detail-anchor x="625" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Rollback</text>
<text data-detail="context" x="625" y="751" class="t-muted" font-size="8" text-anchor="middle">last good</text>
</g>
@@ -10666,6 +10667,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10685,6 +10740,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/artifacts/product-analytics.dataflow.html b/docs/gallery/artifacts/product-analytics.dataflow.html
index f34dbc3e..57e151b0 100644
--- a/docs/gallery/artifacts/product-analytics.dataflow.html
+++ b/docs/gallery/artifacts/product-analytics.dataflow.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4976,7 +4977,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="100" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Web App</text>
+ <text data-node-label data-detail-anchor x="100" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Web App</text>
<text data-detail="context" x="100" y="165" class="t-muted" font-size="7" text-anchor="middle">browser SDK</text>
<text data-detail="fine" x="100" y="175" class="t-frontend" font-size="7" text-anchor="middle">events</text>
</g>
@@ -4991,7 +4992,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="100" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Mobile</text>
+ <text data-node-label data-detail-anchor x="100" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Mobile</text>
<text data-detail="context" x="100" y="393" class="t-muted" font-size="7" text-anchor="middle">iOS / Android</text>
<text data-detail="fine" x="100" y="403" class="t-frontend" font-size="7" text-anchor="middle">events</text>
</g>
@@ -5003,7 +5004,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(265 248) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Edge API</text>
+ <text data-node-label data-detail-anchor x="315" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Edge API</text>
<text data-detail="context" x="315" y="279" class="t-muted" font-size="7" text-anchor="middle">collector</text>
<text data-detail="fine" x="315" y="289" class="t-cloud" font-size="7" text-anchor="middle">TLS</text>
</g>
@@ -5016,7 +5017,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="530" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Consent Gate</text>
+ <text data-node-label data-detail-anchor x="530" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Consent Gate</text>
<text data-detail="context" x="530" y="165" class="t-muted" font-size="7" text-anchor="middle">policy filter</text>
<text data-detail="fine" x="530" y="175" class="t-security" font-size="7" text-anchor="middle">PII guard</text>
</g>
@@ -5031,7 +5032,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="530" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Event Stream</text>
+ <text data-node-label data-detail-anchor x="530" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Event Stream</text>
<text data-detail="context" x="530" y="393" class="t-muted" font-size="7" text-anchor="middle">Kafka topic</text>
<text data-detail="fine" x="530" y="403" class="t-messagebus" font-size="7" text-anchor="middle">ordered</text>
</g>
@@ -5044,7 +5045,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="745" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">PII Vault</text>
+ <text data-node-label data-detail-anchor x="745" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">PII Vault</text>
<text data-detail="context" x="745" y="165" class="t-muted" font-size="7" text-anchor="middle">encrypted</text>
<text data-detail="fine" x="745" y="175" class="t-security" font-size="7" text-anchor="middle">restricted</text>
</g>
@@ -5057,7 +5058,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="745" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Warehouse</text>
+ <text data-node-label data-detail-anchor x="745" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Warehouse</text>
<text data-detail="context" x="745" y="393" class="t-muted" font-size="7" text-anchor="middle">analytics tables</text>
<text data-detail="fine" x="745" y="403" class="t-database" font-size="7" text-anchor="middle">curated</text>
</g>
@@ -5070,7 +5071,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="745" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Feature Store</text>
+ <text data-node-label data-detail-anchor x="745" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Feature Store</text>
<text data-detail="context" x="745" y="621" class="t-muted" font-size="7" text-anchor="middle">daily batch</text>
<text data-detail="fine" x="745" y="631" class="t-database" font-size="7" text-anchor="middle">derived</text>
</g>
@@ -5082,7 +5083,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(910 248) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="960" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Dashboards</text>
+ <text data-node-label data-detail-anchor x="960" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Dashboards</text>
<text data-detail="context" x="960" y="279" class="t-muted" font-size="7" text-anchor="middle">product metrics</text>
<text data-detail="fine" x="960" y="289" class="t-backend" font-size="7" text-anchor="middle">SQL</text>
</g>
@@ -5094,7 +5095,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(910 590) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="960" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">ML Model</text>
+ <text data-node-label data-detail-anchor x="960" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">ML Model</text>
<text data-detail="context" x="960" y="621" class="t-muted" font-size="7" text-anchor="middle">ranking job</text>
<text data-detail="fine" x="960" y="631" class="t-backend" font-size="7" text-anchor="middle">features</text>
</g>
@@ -10700,6 +10701,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10719,6 +10774,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/artifacts/production-deployment.architecture.html b/docs/gallery/artifacts/production-deployment.architecture.html
index 33a43d4d..d2d1c723 100644
--- a/docs/gallery/artifacts/production-deployment.architecture.html
+++ b/docs/gallery/artifacts/production-deployment.architecture.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4912,7 +4913,7 @@
<!-- Main Diagram -->
<div class="diagram-container" data-detail-level="read">
- <svg viewBox="0 0 1436 760" role="img" aria-labelledby="archify-diagram-title archify-diagram-description" data-animation="trace" data-preset="blueprint" data-engineering-profile="deployment-ownership" data-quality-profile="showcase">
+ <svg viewBox="0 0 1376 728" role="img" aria-labelledby="archify-diagram-title archify-diagram-description" data-animation="trace" data-preset="blueprint" data-engineering-profile="deployment-ownership" data-quality-profile="showcase">
<title id="archify-diagram-title">Production Deployment Ownership</title>
<desc id="archify-diagram-description">A architecture diagram generated by Archify.</desc>
<!-- Definitions -->
@@ -4938,17 +4939,13 @@
<rect width="100%" height="100%" fill="url(#grid)" />
<!-- Boundaries (behind everything) -->
- <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="200" y="165" width="1196" height="382" rx="12" class="c-region" stroke-width="1"/>
- <text x="208" y="183" class="t-cloud" font-size="9" font-weight="600">AWS us-east-1 / production</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="AWS us-east-1 / production" x="210" y="171" width="1126" height="361" rx="12" class="c-region" stroke-width="1"/>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="600" y="165" width="796" height="322" rx="8" class="c-security-group" stroke-width="1"/>
- <text x="608" y="183" class="t-security" font-size="9" font-weight="600">private application network</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" data-composition-frame-label="private application network" x="616" y="171" width="714" height="316" rx="8" class="c-security-group" stroke-width="1"/>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="2" x="1010" y="580" width="186" height="112" rx="12" class="c-region" stroke-width="1"/>
- <text x="1018" y="598" class="t-cloud" font-size="9" font-weight="600">AWS eu-west-1 / disaster recovery</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="2" data-composition-frame-label="AWS eu-west-1 / disaster recovery" x="1006.1135384870968" y="536" width="193.77292302580642" height="124" rx="12" class="c-region" stroke-width="1"/>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="3" x="1026" y="596" width="154" height="96" rx="8" class="c-security-group" stroke-width="1"/>
- <text x="1034" y="614" class="t-security" font-size="9" font-weight="600">DR private subnet</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="3" data-composition-frame-label="DR private subnet" x="1026" y="554" width="154" height="106" rx="8" class="c-security-group" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
<path data-edge-from="clients" data-edge-to="edge" data-edge-label="HTTPS" data-edge-key="0" data-composition-points="160,330;230,330" d="M 160 330 L 230 330" class="a-emphasis" data-animate="edge" style="--step:0" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
@@ -4959,10 +4956,10 @@
<path data-edge-from="api_b" data-edge-to="postgres" data-edge-label="SQL" data-edge-key="5" data-composition-points="766,436;840,436" d="M 766 436 L 840 436" class="a-default" data-animate="edge" style="--step:5" stroke-width="1.5" marker-end="url(#arrowhead)"/>
<path data-edge-from="api_a" data-edge-to="events" data-edge-label="publish" data-edge-key="6" data-composition-points="698,195;698,170;1103,170;1103,300" d="M 698 195 L 698 178 Q 698 170 706 170 L 1095 170 Q 1103 170 1103 178 L 1103 300" class="a-dashed" data-animate="edge" style="--step:6" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
<path data-edge-from="api_b" data-edge-to="events" data-edge-key="7" data-composition-points="698,405;698,380;1103,380;1103,360" d="M 698 405 L 698 388 Q 698 380 706 380 L 1095 380 Q 1103 380 1103 372 L 1103 360" class="a-dashed" data-animate="edge" style="--step:7" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
- <path data-edge-from="events" data-edge-to="worker" data-edge-key="8" data-composition-points="1166,330;1240,330" d="M 1166 330 L 1240 330" class="a-emphasis" data-animate="edge" style="--step:8" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="postgres" data-edge-to="replica" data-edge-label="cross-region WAL" data-edge-key="9" data-composition-points="966,436;966,538.5;1040,538.5;1040,641" d="M 966 436 L 966 530.5 Q 966 538.5 974 538.5 L 1032 538.5 Q 1040 538.5 1040 546.5 L 1040 641" class="a-security" data-animate="edge" style="--step:9" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
- <path data-edge-from="worker" data-edge-to="audit" data-edge-label="evidence" data-edge-key="10" data-composition-points="1303,360;1303,465" d="M 1303 360 L 1303 465" class="a-dashed" data-animate="edge" style="--step:10" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
- <path data-edge-from="worker" data-edge-to="observability" data-edge-label="OTLP" data-edge-key="11" data-composition-points="1303,300;1303,223.5;1303,223.5;1303,147" d="M 1303 300 L 1303 223.5 L 1303 223.5 L 1303 147" class="a-dashed" data-animate="edge" style="--step:11" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
+ <path data-edge-from="events" data-edge-to="worker" data-edge-key="8" data-composition-points="1166,330;1190,330" d="M 1166 330 L 1190 330" class="a-emphasis" data-animate="edge" style="--step:8" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ <path data-edge-from="postgres" data-edge-to="replica" data-edge-label="cross-region WAL" data-edge-key="9" data-composition-points="966,436;966,522.5;1040,522.5;1040,609" d="M 966 436 L 966 514.5 Q 966 522.5 974 522.5 L 1032 522.5 Q 1040 522.5 1040 530.5 L 1040 609" class="a-security" data-animate="edge" style="--step:9" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
+ <path data-edge-from="worker" data-edge-to="audit" data-edge-label="evidence" data-edge-key="10" data-composition-points="1253,360;1253,450" d="M 1253 360 L 1253 450" class="a-dashed" data-animate="edge" style="--step:10" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
+ <path data-edge-from="worker" data-edge-to="observability" data-edge-label="OTLP" data-edge-key="11" data-composition-points="1253,300;1253,223.5;1253,223.5;1253,147" d="M 1253 300 L 1253 223.5 L 1253 223.5 L 1253 147" class="a-dashed" data-animate="edge" style="--step:11" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
<!-- Components -->
<g id="node-clients" data-node-id="clients" data-node-label="Customers" tabindex="0" role="button" aria-label="Focus Customers, web + mobile, Architecture component" aria-pressed="false" data-node-kind="external" data-node-sublabel="web + mobile" data-node-context="Architecture component">
@@ -4973,7 +4970,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="99" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Customers</text>
+ <text data-node-label data-detail-anchor x="99" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Customers</text>
<text data-detail="context" x="99" y="344" class="t-muted" font-size="9" text-anchor="middle">web + mobile</text>
</g>
@@ -4984,7 +4981,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(236 306) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="293" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Global Edge</text>
+ <text data-node-label data-detail-anchor x="293" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Global Edge</text>
<text data-detail="context" x="293" y="344" class="t-muted" font-size="9" text-anchor="middle">CDN + WAF</text>
<text data-detail="fine" x="293" y="352" class="t-cloud" font-size="7" text-anchor="middle">edge team</text>
</g>
@@ -4997,7 +4994,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="494" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Gateway</text>
+ <text data-node-label data-detail-anchor x="494" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Gateway</text>
<text data-detail="context" x="494" y="344" class="t-muted" font-size="9" text-anchor="middle">public :443</text>
<text data-detail="fine" x="494" y="352" class="t-security" font-size="7" text-anchor="middle">platform</text>
</g>
@@ -5009,7 +5006,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(636 201) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="698" y="224" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Pods / AZ-a</text>
+ <text data-node-label data-detail-anchor x="698" y="224" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Pods / AZ-a</text>
<text data-detail="context" x="698" y="240" class="t-muted" font-size="9" text-anchor="middle">private subnet</text>
<text data-detail="fine" x="698" y="249" class="t-backend" font-size="7" text-anchor="middle">app team</text>
</g>
@@ -5021,7 +5018,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(636 411) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="698" y="434" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Pods / AZ-b</text>
+ <text data-node-label data-detail-anchor x="698" y="434" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Pods / AZ-b</text>
<text data-detail="context" x="698" y="450" class="t-muted" font-size="9" text-anchor="middle">private subnet</text>
<text data-detail="fine" x="698" y="459" class="t-backend" font-size="7" text-anchor="middle">app team</text>
</g>
@@ -5034,7 +5031,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="903" y="224" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
+ <text data-node-label data-detail-anchor x="903" y="224" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
<text data-detail="context" x="903" y="240" class="t-muted" font-size="9" text-anchor="middle">multi-AZ cache</text>
<text data-detail="fine" x="903" y="249" class="t-database" font-size="7" text-anchor="middle">platform</text>
</g>
@@ -5047,7 +5044,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="903" y="434" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">PostgreSQL</text>
+ <text data-node-label data-detail-anchor x="903" y="434" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">PostgreSQL</text>
<text data-detail="context" x="903" y="450" class="t-muted" font-size="9" text-anchor="middle">primary / encrypted</text>
<text data-detail="fine" x="903" y="459" class="t-database" font-size="7" text-anchor="middle">data team</text>
</g>
@@ -5062,59 +5059,59 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="1103" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Event Bus</text>
+ <text data-node-label data-detail-anchor x="1103" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Event Bus</text>
<text data-detail="context" x="1103" y="344" class="t-muted" font-size="9" text-anchor="middle">orders.v1</text>
<text data-detail="fine" x="1103" y="352" class="t-messagebus" font-size="7" text-anchor="middle">platform</text>
</g>
<g id="node-worker" data-node-id="worker" data-node-label="Workers" tabindex="0" role="button" aria-label="Focus Workers, private workload, AWS us-east-1 / production › private application network" aria-pressed="false" data-node-kind="backend" data-node-sublabel="private workload" data-node-tag="app team" data-node-context="AWS us-east-1 / production › private application network">
<title>Workers · private workload · AWS us-east-1 / production › private application network · app team</title>
- <rect x="1240" y="300" width="126" height="60" rx="6" class="c-mask"/>
- <rect x="1240" y="300" width="126" height="60" rx="6" class="c-backend" data-animate="node" style="--step:9" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(1246 306) scale(0.6875)">
+ <rect x="1190" y="300" width="126" height="60" rx="6" class="c-mask"/>
+ <rect x="1190" y="300" width="126" height="60" rx="6" class="c-backend" data-animate="node" style="--step:9" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(1196 306) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="1303" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Workers</text>
- <text data-detail="context" x="1303" y="344" class="t-muted" font-size="9" text-anchor="middle">private workload</text>
- <text data-detail="fine" x="1303" y="352" class="t-backend" font-size="7" text-anchor="middle">app team</text>
+ <text data-node-label data-detail-anchor x="1253" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Workers</text>
+ <text data-detail="context" x="1253" y="344" class="t-muted" font-size="9" text-anchor="middle">private workload</text>
+ <text data-detail="fine" x="1253" y="352" class="t-backend" font-size="7" text-anchor="middle">app team</text>
</g>
<g id="node-replica" data-node-id="replica" data-node-label="DR Replica" tabindex="0" role="button" aria-label="Focus DR Replica, eu-west-1, AWS eu-west-1 / disaster recovery › DR private subnet" aria-pressed="false" data-node-kind="database" data-node-sublabel="eu-west-1" data-node-tag="data team" data-node-context="AWS eu-west-1 / disaster recovery › DR private subnet">
<title>DR Replica · eu-west-1 · AWS eu-west-1 / disaster recovery › DR private subnet · data team</title>
- <rect x="1040" y="610" width="126" height="62" rx="6" class="c-mask"/>
- <rect x="1040" y="610" width="126" height="62" rx="6" class="c-database" data-animate="node" style="--step:10" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(1046 616) scale(0.6875)">
+ <rect x="1040" y="578" width="126" height="62" rx="6" class="c-mask"/>
+ <rect x="1040" y="578" width="126" height="62" rx="6" class="c-database" data-animate="node" style="--step:10" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(1046 584) scale(0.6875)">
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="1103" y="639" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">DR Replica</text>
- <text data-detail="context" x="1103" y="655" class="t-muted" font-size="9" text-anchor="middle">eu-west-1</text>
- <text data-detail="fine" x="1103" y="664" class="t-database" font-size="7" text-anchor="middle">data team</text>
+ <text data-node-label data-detail-anchor x="1103" y="607" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">DR Replica</text>
+ <text data-detail="context" x="1103" y="623" class="t-muted" font-size="9" text-anchor="middle">eu-west-1</text>
+ <text data-detail="fine" x="1103" y="632" class="t-database" font-size="7" text-anchor="middle">data team</text>
</g>
<g id="node-audit" data-node-id="audit" data-node-label="Audit Archive" tabindex="0" role="button" aria-label="Focus Audit Archive, immutable objects, AWS us-east-1 / production" aria-pressed="false" data-node-kind="cloud" data-node-sublabel="immutable objects" data-node-tag="security" data-node-context="AWS us-east-1 / production">
<title>Audit Archive · immutable objects · AWS us-east-1 / production · security</title>
- <rect x="1240" y="465" width="126" height="62" rx="6" class="c-mask"/>
- <rect x="1240" y="465" width="126" height="62" rx="6" class="c-cloud" data-animate="node" style="--step:11" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(1246 471) scale(0.6875)">
+ <rect x="1190" y="450" width="126" height="62" rx="6" class="c-mask"/>
+ <rect x="1190" y="450" width="126" height="62" rx="6" class="c-cloud" data-animate="node" style="--step:11" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(1196 456) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="1303" y="494" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Audit Archive</text>
- <text data-detail="context" x="1303" y="510" class="t-muted" font-size="9" text-anchor="middle">immutable objects</text>
- <text data-detail="fine" x="1303" y="519" class="t-cloud" font-size="7" text-anchor="middle">security</text>
+ <text data-node-label data-detail-anchor x="1253" y="479" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Audit Archive</text>
+ <text data-detail="context" x="1253" y="495" class="t-muted" font-size="9" text-anchor="middle">immutable objects</text>
+ <text data-detail="fine" x="1253" y="504" class="t-cloud" font-size="7" text-anchor="middle">security</text>
</g>
<g id="node-observability" data-node-id="observability" data-node-label="Observability" tabindex="0" role="button" aria-label="Focus Observability, metrics + traces, Architecture component" aria-pressed="false" data-node-kind="external" data-node-sublabel="metrics + traces" data-node-tag="SRE" data-node-context="Architecture component">
<title>Observability · metrics + traces · Architecture component · SRE</title>
- <rect x="1240" y="85" width="126" height="62" rx="6" class="c-mask"/>
- <rect x="1240" y="85" width="126" height="62" rx="6" class="c-external" data-animate="node" style="--step:12" stroke-width="1.5"/>
- <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(1246 91) scale(0.6875)">
+ <rect x="1190" y="85" width="126" height="62" rx="6" class="c-mask"/>
+ <rect x="1190" y="85" width="126" height="62" rx="6" class="c-external" data-animate="node" style="--step:12" stroke-width="1.5"/>
+ <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(1196 91) scale(0.6875)">
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="1303" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Observability</text>
- <text data-detail="context" x="1303" y="130" class="t-muted" font-size="9" text-anchor="middle">metrics + traces</text>
- <text data-detail="fine" x="1303" y="139" class="t-external" font-size="7" text-anchor="middle">SRE</text>
+ <text data-node-label data-detail-anchor x="1253" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Observability</text>
+ <text data-detail="context" x="1253" y="130" class="t-muted" font-size="9" text-anchor="middle">metrics + traces</text>
+ <text data-detail="fine" x="1253" y="139" class="t-external" font-size="7" text-anchor="middle">SRE</text>
</g>
<!-- Connection labels -->
@@ -5153,40 +5150,61 @@
<text x="1003" y="529" class="t-security" font-size="8" text-anchor="middle">cross-region WAL</text>
</g>
<g data-detail="context" data-edge-from="worker" data-edge-to="audit" data-edge-label="evidence" data-edge-key="10">
- <rect x="1278.8" y="398" width="48.4" height="14" rx="3" class="c-mask"/>
- <text x="1303" y="408" class="t-messagebus" font-size="8" text-anchor="middle">evidence</text>
+ <rect x="1228.8" y="398" width="48.4" height="14" rx="3" class="c-mask"/>
+ <text x="1253" y="408" class="t-messagebus" font-size="8" text-anchor="middle">evidence</text>
</g>
<g data-detail="context" data-edge-from="worker" data-edge-to="observability" data-edge-label="OTLP" data-edge-key="11">
- <rect x="1288" y="203.5" width="30" height="14" rx="3" class="c-mask"/>
- <text x="1303" y="213.5" class="t-messagebus" font-size="8" text-anchor="middle">OTLP</text>
+ <rect x="1238" y="203.5" width="30" height="14" rx="3" class="c-mask"/>
+ <text x="1253" y="213.5" class="t-messagebus" font-size="8" text-anchor="middle">OTLP</text>
+ </g>
+
+ <!-- Boundary labels (foreground masks keep routes out of titles) -->
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="0" data-composition-frame-kind="region" data-composition-frame-label="AWS us-east-1 / production">
+ <rect data-graph-role="structural-frame-label-mask" x="214" y="175" width="150.4" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="218" y="188" class="t-cloud" font-size="9" font-weight="600">AWS us-east-1 / production</text>
+ </g>
+
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="1" data-composition-frame-kind="security-group" data-composition-frame-label="private application network">
+ <rect data-graph-role="structural-frame-label-mask" x="620" y="175" width="155.79999999999998" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="624" y="188" class="t-security" font-size="9" font-weight="600">private application network</text>
+ </g>
+
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="2" data-composition-frame-kind="region" data-composition-frame-label="AWS eu-west-1 / disaster recovery">
+ <rect data-graph-role="structural-frame-label-mask" x="1010.1135384870968" y="540" width="185.77292302580642" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="1014.1135384870968" y="552.8774203548387" class="t-cloud" font-size="8.877420354838709" font-weight="600">AWS eu-west-1 / disaster recovery</text>
+ </g>
+
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="3" data-composition-frame-kind="security-group" data-composition-frame-label="DR private subnet">
+ <rect data-graph-role="structural-frame-label-mask" x="1030" y="558" width="101.8" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="1034" y="571" class="t-security" font-size="9" font-weight="600">DR private subnet</text>
</g>
<!-- Legend -->
<g data-legend data-legend-bridge>
- <text x="40" y="724" class="t-primary" font-size="12" font-weight="650">Legend</text>
- <g data-legend-semantic-kind="backend" data-legend-kind="backend" data-legend-label="Backend" data-legend-x="40" data-legend-baseline="744" data-legend-width="78">
- <rect x="40" y="735" width="16" height="10" rx="2.5" class="c-backend" stroke-width="1"/>
- <text x="62" y="744" class="t-muted" font-size="10" font-weight="500">Backend</text>
+ <text x="40" y="692" class="t-primary" font-size="12" font-weight="650">Legend</text>
+ <g data-legend-semantic-kind="backend" data-legend-kind="backend" data-legend-label="Backend" data-legend-x="40" data-legend-baseline="712" data-legend-width="78">
+ <rect x="40" y="703" width="16" height="10" rx="2.5" class="c-backend" stroke-width="1"/>
+ <text x="62" y="712" class="t-muted" font-size="10" font-weight="500">Backend</text>
</g>
- <g data-legend-semantic-kind="database" data-legend-kind="database" data-legend-label="Database" data-legend-x="140" data-legend-baseline="744" data-legend-width="83">
- <rect x="140" y="735" width="16" height="10" rx="2.5" class="c-database" stroke-width="1"/>
- <text x="162" y="744" class="t-muted" font-size="10" font-weight="500">Database</text>
+ <g data-legend-semantic-kind="database" data-legend-kind="database" data-legend-label="Database" data-legend-x="140" data-legend-baseline="712" data-legend-width="83">
+ <rect x="140" y="703" width="16" height="10" rx="2.5" class="c-database" stroke-width="1"/>
+ <text x="162" y="712" class="t-muted" font-size="10" font-weight="500">Database</text>
</g>
- <g data-legend-semantic-kind="cloud" data-legend-kind="cloud" data-legend-label="Cloud" data-legend-x="245" data-legend-baseline="744" data-legend-width="68">
- <rect x="245" y="735" width="16" height="10" rx="2.5" class="c-cloud" stroke-width="1"/>
- <text x="267" y="744" class="t-muted" font-size="10" font-weight="500">Cloud</text>
+ <g data-legend-semantic-kind="cloud" data-legend-kind="cloud" data-legend-label="Cloud" data-legend-x="245" data-legend-baseline="712" data-legend-width="68">
+ <rect x="245" y="703" width="16" height="10" rx="2.5" class="c-cloud" stroke-width="1"/>
+ <text x="267" y="712" class="t-muted" font-size="10" font-weight="500">Cloud</text>
</g>
- <g data-legend-semantic-kind="security" data-legend-kind="security" data-legend-label="Security" data-legend-x="335" data-legend-baseline="744" data-legend-width="83">
- <rect x="335" y="735" width="16" height="10" rx="2.5" class="c-security" stroke-width="1"/>
- <text x="357" y="744" class="t-muted" font-size="10" font-weight="500">Security</text>
+ <g data-legend-semantic-kind="security" data-legend-kind="security" data-legend-label="Security" data-legend-x="335" data-legend-baseline="712" data-legend-width="83">
+ <rect x="335" y="703" width="16" height="10" rx="2.5" class="c-security" stroke-width="1"/>
+ <text x="357" y="712" class="t-muted" font-size="10" font-weight="500">Security</text>
</g>
- <g data-legend-semantic-kind="messagebus" data-legend-kind="messagebus" data-legend-label="Message bus" data-legend-x="440" data-legend-baseline="744" data-legend-width="98">
- <rect x="440" y="735" width="16" height="10" rx="2.5" class="c-messagebus" stroke-width="1"/>
- <text x="462" y="744" class="t-muted" font-size="10" font-weight="500">Message bus</text>
+ <g data-legend-semantic-kind="messagebus" data-legend-kind="messagebus" data-legend-label="Message bus" data-legend-x="440" data-legend-baseline="712" data-legend-width="98">
+ <rect x="440" y="703" width="16" height="10" rx="2.5" class="c-messagebus" stroke-width="1"/>
+ <text x="462" y="712" class="t-muted" font-size="10" font-weight="500">Message bus</text>
</g>
- <g data-legend-semantic-kind="external" data-legend-kind="external" data-legend-label="External" data-legend-x="560" data-legend-baseline="744" data-legend-width="83">
- <rect x="560" y="735" width="16" height="10" rx="2.5" class="c-external" stroke-width="1"/>
- <text x="582" y="744" class="t-muted" font-size="10" font-weight="500">External</text>
+ <g data-legend-semantic-kind="external" data-legend-kind="external" data-legend-label="External" data-legend-x="560" data-legend-baseline="712" data-legend-width="83">
+ <rect x="560" y="703" width="16" height="10" rx="2.5" class="c-external" stroke-width="1"/>
+ <text x="582" y="712" class="t-muted" font-size="10" font-weight="500">External</text>
</g>
</g>
</svg>
@@ -10714,6 +10732,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10733,6 +10805,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/artifacts/release-delivery.workflow.html b/docs/gallery/artifacts/release-delivery.workflow.html
index d566b6f6..a148890b 100644
--- a/docs/gallery/artifacts/release-delivery.workflow.html
+++ b/docs/gallery/artifacts/release-delivery.workflow.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4997,7 +4998,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Commit</text>
+ <text data-node-label data-detail-anchor x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Commit</text>
<text data-detail="context" x="88" y="131" class="t-muted" font-size="8" text-anchor="middle">signed change</text>
</g>
@@ -5011,7 +5012,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="220" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Pull Request</text>
+ <text data-node-label data-detail-anchor x="220" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Pull Request</text>
<text data-detail="context" x="220" y="131" class="t-muted" font-size="8" text-anchor="middle">reviewed diff</text>
</g>
@@ -5022,7 +5023,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(260 215) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="300" y="230" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Build</text>
+ <text data-node-label data-detail-anchor x="300" y="230" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Build</text>
<text data-detail="context" x="300" y="247" class="t-muted" font-size="8" text-anchor="middle">locked inputs</text>
<text data-detail="fine" x="300" y="265" class="t-backend" font-size="7" text-anchor="middle">reproducible</text>
</g>
@@ -5035,7 +5036,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="430" y="230" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Quality Gates</text>
+ <text data-node-label data-detail-anchor x="430" y="230" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Quality Gates</text>
<text data-detail="context" x="430" y="247" class="t-muted" font-size="8" text-anchor="middle">test + scan</text>
<text data-detail="fine" x="430" y="265" class="t-security" font-size="7" text-anchor="middle">blocking</text>
</g>
@@ -5048,7 +5049,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="500" y="354" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Approve</text>
+ <text data-node-label data-detail-anchor x="500" y="354" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Approve</text>
<text data-detail="context" x="500" y="371" class="t-muted" font-size="8" text-anchor="middle">release owner</text>
<text data-detail="fine" x="500" y="389" class="t-security" font-size="7" text-anchor="middle">human gate</text>
</g>
@@ -5060,7 +5061,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(460 463) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="500" y="478" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Deploy</text>
+ <text data-node-label data-detail-anchor x="500" y="478" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Deploy</text>
<text data-detail="context" x="500" y="495" class="t-muted" font-size="8" text-anchor="middle">canary 10%</text>
<text data-detail="fine" x="500" y="513" class="t-cloud" font-size="7" text-anchor="middle">production</text>
</g>
@@ -5072,7 +5073,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(585 471) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="625" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Verify</text>
+ <text data-node-label data-detail-anchor x="625" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Verify</text>
<text data-detail="context" x="625" y="503" class="t-muted" font-size="8" text-anchor="middle">smoke + SLO</text>
</g>
@@ -5084,7 +5085,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Announce</text>
+ <text data-node-label data-detail-anchor x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Announce</text>
<text data-detail="context" x="625" y="627" class="t-muted" font-size="8" text-anchor="middle">status + notes</text>
</g>
@@ -5096,7 +5097,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="300" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Stop Release</text>
+ <text data-node-label data-detail-anchor x="300" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Stop Release</text>
<text data-detail="context" x="300" y="751" class="t-muted" font-size="8" text-anchor="middle">gate failed</text>
</g>
@@ -5110,7 +5111,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="500" y="726" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Rollback</text>
+ <text data-node-label data-detail-anchor x="500" y="726" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Rollback</text>
<text data-detail="context" x="500" y="743" class="t-muted" font-size="6.2" text-anchor="middle">last good image</text>
<text data-detail="fine" x="500" y="761" class="t-messagebus" font-size="6.6" text-anchor="middle">owner: on-call</text>
</g>
@@ -10692,6 +10693,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10711,6 +10766,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/artifacts/web-app.architecture.html b/docs/gallery/artifacts/web-app.architecture.html
index 62b289f1..7bc5a4f8 100644
--- a/docs/gallery/artifacts/web-app.architecture.html
+++ b/docs/gallery/artifacts/web-app.architecture.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4938,11 +4939,9 @@
<rect width="100%" height="100%" fill="url(#grid)" />
<!-- Boundaries (behind everything) -->
- <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="220" y="120" width="820" height="400" rx="12" class="c-region" stroke-width="1"/>
- <text x="228" y="138" class="t-cloud" font-size="9" font-weight="600">AWS Region: us-west-2</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="AWS Region: us-west-2" x="220" y="120" width="820" height="400" rx="12" class="c-region" stroke-width="1"/>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="430" y="270" width="400" height="110" rx="8" class="c-security-group" stroke-width="1"/>
- <text x="438" y="288" class="t-security" font-size="9" font-weight="600">sg-api :443/:8000</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" data-composition-frame-label="sg-api :443/:8000" x="430" y="270" width="400" height="110" rx="8" class="c-security-group" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
<path data-edge-from="users" data-edge-to="cdn" data-edge-label="HTTPS" data-edge-key="0" data-edge-id="users-to-cdn" data-composition-points="160,330;250,330" d="M 160 330 L 250 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
@@ -4964,7 +4963,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="100" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Users</text>
+ <text data-node-label data-detail-anchor x="100" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Users</text>
<text data-detail="context" x="100" y="344" class="t-muted" font-size="9" text-anchor="middle">Browser / Mobile</text>
</g>
@@ -4976,7 +4975,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="100" y="140" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>
+ <text data-node-label data-detail-anchor x="100" y="140" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>
<text data-detail="context" x="100" y="156" class="t-muted" font-size="9" text-anchor="middle">OAuth 2.0</text>
<text data-detail="fine" x="100" y="166" class="t-security" font-size="7" text-anchor="middle">JWT + PKCE</text>
</g>
@@ -4988,7 +4987,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(256 306) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>
+ <text data-node-label data-detail-anchor x="315" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>
<text data-detail="context" x="315" y="344" class="t-muted" font-size="9" text-anchor="middle">CDN</text>
</g>
@@ -4999,7 +4998,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(466 306) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="525" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>
+ <text data-node-label data-detail-anchor x="525" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>
<text data-detail="context" x="525" y="344" class="t-muted" font-size="9" text-anchor="middle">HTTPS :443</text>
</g>
@@ -5010,7 +5009,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(676 306) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="735" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>
+ <text data-node-label data-detail-anchor x="735" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>
<text data-detail="context" x="735" y="344" class="t-muted" font-size="9" text-anchor="middle">FastAPI :8000</text>
</g>
@@ -5022,7 +5021,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="735" y="178" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
+ <text data-node-label data-detail-anchor x="735" y="178" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
<text data-detail="context" x="735" y="194" class="t-muted" font-size="9" text-anchor="middle">cache :6379</text>
</g>
@@ -5034,7 +5033,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="945" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">PostgreSQL</text>
+ <text data-node-label data-detail-anchor x="945" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">PostgreSQL</text>
<text data-detail="context" x="945" y="344" class="t-muted" font-size="9" text-anchor="middle">primary :5432</text>
</g>
@@ -5045,7 +5044,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(256 446) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">S3</text>
+ <text data-node-label data-detail-anchor x="315" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">S3</text>
<text data-detail="context" x="315" y="484" class="t-muted" font-size="9" text-anchor="middle">static assets</text>
<text data-detail="fine" x="315" y="492" class="t-cloud" font-size="7" text-anchor="middle">OAI protected</text>
</g>
@@ -5060,7 +5059,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="735" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SQS</text>
+ <text data-node-label data-detail-anchor x="735" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SQS</text>
<text data-detail="context" x="735" y="484" class="t-muted" font-size="9" text-anchor="middle">job queue</text>
</g>
@@ -5071,7 +5070,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(886 446) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="945" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Worker</text>
+ <text data-node-label data-detail-anchor x="945" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Worker</text>
<text data-detail="context" x="945" y="484" class="t-muted" font-size="9" text-anchor="middle">async jobs</text>
</g>
@@ -5104,6 +5103,17 @@
</g>
+ <!-- Boundary labels (foreground masks keep routes out of titles) -->
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="0" data-composition-frame-kind="region" data-composition-frame-label="AWS Region: us-west-2">
+ <rect data-graph-role="structural-frame-label-mask" x="224" y="130" width="123.39999999999999" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="228" y="143" class="t-cloud" font-size="9" font-weight="600">AWS Region: us-west-2</text>
+ </g>
+
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="1" data-composition-frame-kind="security-group" data-composition-frame-label="sg-api :443/:8000">
+ <rect data-graph-role="structural-frame-label-mask" x="434" y="280" width="101.8" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="438" y="293" class="t-security" font-size="9" font-weight="600">sg-api :443/:8000</text>
+ </g>
+
<!-- Legend -->
<g data-legend data-legend-bridge>
<text x="40" y="552" class="t-primary" font-size="12" font-weight="650">Legend</text>
@@ -10655,6 +10665,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10674,6 +10738,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/docs/gallery/manifest.json b/docs/gallery/manifest.json
index 544ccdc8..0d8de502 100644
--- a/docs/gallery/manifest.json
+++ b/docs/gallery/manifest.json
@@ -27,8 +27,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 645566,
- "artifactSha256": "00d5301446f6f1ffd2cdb5b2e698b12cf893423b1a8ceee39e76b464bf194142",
+ "artifactBytes": 647987,
+ "artifactSha256": "efde3cb66601c0cbfaf1243015370db9dd9a47f062d7abb5442b68c46fc6174b",
"sourceBytes": 6367,
"sourceSha256": "9c94c8c0b2104478b77befb4cc5e343d381acba6e66645ab17616fde20b60e05",
"checks": [
@@ -83,6 +83,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 52.1,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 2,
"routesOverSuggestedBends": 0,
"maxStretch": 1.257,
@@ -125,10 +127,10 @@
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 648159,
- "artifactSha256": "6b3f991f936436e8918c97f3f788354189558446d5b724b152c8e76392dbbebe",
- "sourceBytes": 5454,
- "sourceSha256": "738e9c7f22e4e6e88f5aafc087dc58409105927daa9a79aaf240c8393654494f",
+ "artifactBytes": 652388,
+ "artifactSha256": "b37cb56052b3e5c8f58040227c40b02dba80079ac5dedcfef2d34202e586b9f6",
+ "sourceBytes": 5476,
+ "sourceSha256": "ec484aa8576664fdb207b543fa49486b23273faccb7a5071e1a0becfb48c22eb",
"checks": [
{
"name": "single_svg",
@@ -181,6 +183,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 36,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 2,
"routesOverSuggestedBends": 0,
"maxStretch": 1.098,
@@ -223,8 +227,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 642063,
- "artifactSha256": "16c594a726b7089e20ae72b82c8f6656a81c9f1d91970de0ae538ea49cdc895d",
+ "artifactBytes": 644404,
+ "artifactSha256": "ddb51bfbbeb7f64f8b427a590c417f8cae34766240ad3e985920095ea691e50f",
"sourceBytes": 4345,
"sourceSha256": "4bbaa6ca3cd4036002fd5d0f3a332eb922cec69d09bac3d7925f95beb4308389",
"checks": [
@@ -279,6 +283,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 15,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 0,
"routesOverSuggestedBends": 0,
"maxStretch": 1,
@@ -321,8 +327,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 644390,
- "artifactSha256": "82c66c18299233c03cd9ce1deefd21f6ca4acbcfd540d5eef5a541017bfa272a",
+ "artifactBytes": 646779,
+ "artifactSha256": "d6eca6db2807d709dac5e1019f0a59b0719dee53d890192dda9b0672afff287c",
"sourceBytes": 5164,
"sourceSha256": "e5c880417eac1623923c3dd5461e0c78acd762e1621a28bd53fc14a84cad6a91",
"checks": [
@@ -377,6 +383,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 36.3,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 2,
"routesOverSuggestedBends": 0,
"maxStretch": 1.214,
@@ -419,8 +427,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 641703,
- "artifactSha256": "bd23ffe63c0aeb185b6a8133c62269189fe9c526b79bef8c94869cf4194f911f",
+ "artifactBytes": 644108,
+ "artifactSha256": "2bf86a5f3355b6a44210a39aee8690b39536b03b56920f6fa52f5809b8a93ac1",
"sourceBytes": 5375,
"sourceSha256": "5c760c82eee545dfb7da38a4e628059d7891af4cfbfc13c8a7009ea64f69aa1b",
"checks": [
@@ -475,6 +483,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 119,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 3,
"routesOverSuggestedBends": 1,
"maxStretch": 3.465,
@@ -517,8 +527,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 645648,
- "artifactSha256": "4b6f5e0d936cb929afbc6f4a249104383c01176f6f618add30ff0c440e3607b4",
+ "artifactBytes": 648037,
+ "artifactSha256": "17fbc96ad3aa79214da2333fe20ed508084e48a26e6193d20acbf83795587665",
"sourceBytes": 5627,
"sourceSha256": "6fa38a7ccedf96da592d60b392783b846188eaa3ec9136c6dc06ca020e43a110",
"checks": [
@@ -573,6 +583,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 57,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 3,
"routesOverSuggestedBends": 2,
"maxStretch": 1.369,
@@ -615,8 +627,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 642473,
- "artifactSha256": "c91a1a7d64730d2b0b253104cf98d635875f5be49add38f057f7a4f49da268a1",
+ "artifactBytes": 644814,
+ "artifactSha256": "2bc264bf59c59828b5174db31f06a77bf8b053f8f8c5eb0737c38be63b4949c2",
"sourceBytes": 4370,
"sourceSha256": "545f20920c89b69c2bb1f15508d5543fddbeb15cffba61e102206e04bd5a5cd9",
"checks": [
@@ -671,6 +683,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 22,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 0,
"routesOverSuggestedBends": 0,
"maxStretch": 1,
@@ -713,8 +727,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 649567,
- "artifactSha256": "04e7f12e6a55e513b61920e680f3dd59b42b4064e5ee61045d0b8abd3b6eea55",
+ "artifactBytes": 651988,
+ "artifactSha256": "9294f98104336d31cf70988cb3748d28b53bdb0b30567a25853c93e57d21dd0a",
"sourceBytes": 5433,
"sourceSha256": "a92d6597ddbe164f395da32a7d4b33cfae08edd7d9600a6fb45a2058e5bbb43e",
"checks": [
@@ -769,6 +783,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 9,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 4,
"routesOverSuggestedBends": 1,
"maxStretch": 2.663,
@@ -811,8 +827,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 6,
- "artifactBytes": 639283,
- "artifactSha256": "2c88a1868e5271f43c1505a62c542b9c87e39cd438d5079eb0259d06a830ed7a",
+ "artifactBytes": 641672,
+ "artifactSha256": "dd8222b55435a49403057a96d6bd4894f082ea09f783f73546022fc3b71330e7",
"sourceBytes": 4417,
"sourceSha256": "af939579dcafc8b4c49f09594591577994398aee57a57369d4c791dfc0d85a42",
"checks": [
@@ -867,6 +883,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": null,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 3,
"routesOverSuggestedBends": 2,
"maxStretch": 3.267,
@@ -909,8 +927,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 6,
- "artifactBytes": 640253,
- "artifactSha256": "2b31f3d079ec732afd7d3a6fa93ace5a82ee89d02f1f131370c1ab7ab2e2bba9",
+ "artifactBytes": 642658,
+ "artifactSha256": "bf47d297d4d0c69b435deb9a2dc1a9e40d1de7338bdd0453baa97657bf28c976",
"sourceBytes": 4274,
"sourceSha256": "735c2c5819266e6ea2a71775b6eefce98b53030ce90cb721dc8e1d022ce5be71",
"checks": [
@@ -965,6 +983,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": null,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 0,
"routesOverSuggestedBends": 0,
"maxStretch": 1,
@@ -1007,8 +1027,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 639490,
- "artifactSha256": "44c57c682f0fc60d439e1e670b4b8ddb2285740790b38dcaa3fd41161530450f",
+ "artifactBytes": 642750,
+ "artifactSha256": "a73b9d6c003cadc6fa93d520a817fffcb0fba8a1c5aa57922c071186c48e00f7",
"sourceBytes": 3793,
"sourceSha256": "483350f5297df682aba4e4a0fa491307ce3d3abd725ae4df07fab177490752cf",
"checks": [
@@ -1063,6 +1083,8 @@
"containerBorderRuns": 0,
"labelRouteClearanceIssues": 0,
"minLabelRouteClearance": 20,
+ "desktopReadabilityIssues": 0,
+ "minProjectedNodeTextPx": null,
"maxBends": 3,
"routesOverSuggestedBends": 1,
"maxStretch": 1,
diff --git a/docs/gallery/sources/production-deployment.architecture.json b/docs/gallery/sources/production-deployment.architecture.json
index 91507689..472cb83e 100644
--- a/docs/gallery/sources/production-deployment.architecture.json
+++ b/docs/gallery/sources/production-deployment.architecture.json
@@ -38,14 +38,14 @@
{ "id": "redis", "type": "database", "label": "Redis", "sublabel": "multi-AZ cache", "pos": [840, 195], "size": [126, 62], "tag": "platform" },
{ "id": "postgres", "type": "database", "label": "PostgreSQL", "sublabel": "primary / encrypted", "pos": [840, 405], "size": [126, 62], "tag": "data team" },
{ "id": "events", "type": "messagebus", "label": "Event Bus", "sublabel": "orders.v1", "pos": [1040, 300], "size": [126, 60], "tag": "platform" },
- { "id": "worker", "type": "backend", "label": "Workers", "sublabel": "private workload", "pos": [1240, 300], "size": [126, 60], "tag": "app team" },
- { "id": "replica", "type": "database", "label": "DR Replica", "sublabel": "eu-west-1", "pos": [1040, 610], "size": [126, 62], "tag": "data team" },
- { "id": "audit", "type": "cloud", "label": "Audit Archive", "sublabel": "immutable objects", "pos": [1240, 465], "size": [126, 62], "tag": "security" },
- { "id": "observability", "type": "external", "label": "Observability", "sublabel": "metrics + traces", "pos": [1240, 85], "size": [126, 62], "tag": "SRE" }
+ { "id": "worker", "type": "backend", "label": "Workers", "sublabel": "private workload", "pos": [1190, 300], "size": [126, 60], "tag": "app team" },
+ { "id": "replica", "type": "database", "label": "DR Replica", "sublabel": "eu-west-1", "pos": [1040, 578], "size": [126, 62], "tag": "data team" },
+ { "id": "audit", "type": "cloud", "label": "Audit Archive", "sublabel": "immutable objects", "pos": [1190, 450], "size": [126, 62], "tag": "security" },
+ { "id": "observability", "type": "external", "label": "Observability", "sublabel": "metrics + traces", "pos": [1190, 85], "size": [126, 62], "tag": "SRE" }
],
"boundaries": [
- { "kind": "region", "label": "AWS us-east-1 / production", "wraps": ["edge", "gateway", "api_a", "api_b", "redis", "postgres", "events", "worker", "audit"] },
- { "kind": "security-group", "label": "private application network", "wraps": ["api_a", "api_b", "redis", "postgres", "events", "worker"] },
+ { "kind": "region", "label": "AWS us-east-1 / production", "wraps": ["edge", "gateway", "api_a", "api_b", "redis", "postgres", "events", "worker", "audit"], "pad": 20 },
+ { "kind": "security-group", "label": "private application network", "wraps": ["api_a", "api_b", "redis", "postgres", "events", "worker"], "pad": 14 },
{ "kind": "region", "label": "AWS eu-west-1 / disaster recovery", "wraps": ["replica"] },
{ "kind": "security-group", "label": "DR private subnet", "wraps": ["replica"], "pad": 14 }
],
diff --git a/examples/archify-repo-grid.html b/examples/archify-repo-grid.html
index a9e5e1d9..d9cb8b55 100644
--- a/examples/archify-repo-grid.html
+++ b/examples/archify-repo-grid.html
@@ -4939,8 +4939,7 @@
<rect width="100%" height="100%" fill="url(#grid)" />
<!-- Boundaries (behind everything) -->
- <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="298" y="70" width="612" height="218" rx="12" class="c-region" stroke-width="1"/>
- <text x="306" y="88" class="t-cloud" font-size="9" font-weight="600">archify/ skill package</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="archify/ skill package" x="298" y="70" width="612" height="218" rx="12" class="c-region" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
<path data-edge-from="user" data-edge-to="agents" data-edge-key="0" data-composition-points="160,238;184,238" d="M 160 238 L 184 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
@@ -4961,7 +4960,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="100" y="236" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">You</text>
+ <text data-node-label data-detail-anchor x="100" y="236" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">You</text>
<text data-detail="context" x="100" y="252" class="t-muted" font-size="9" text-anchor="middle">NL / Mermaid</text>
</g>
@@ -4975,7 +4974,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="244" y="236" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Agent Hosts</text>
+ <text data-node-label data-detail-anchor x="244" y="236" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Agent Hosts</text>
<text data-detail="context" x="244" y="252" class="t-muted" font-size="9" text-anchor="middle">Claude · Codex</text>
</g>
@@ -4989,7 +4988,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="244" y="128" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SKILL.md</text>
+ <text data-node-label data-detail-anchor x="244" y="128" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SKILL.md</text>
<text data-detail="context" x="244" y="144" class="t-muted" font-size="9" text-anchor="middle">layout rules</text>
</g>
@@ -5003,7 +5002,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="388" y="236" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">JSON IR</text>
+ <text data-node-label data-detail-anchor x="388" y="236" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">JSON IR</text>
<text data-detail="context" x="388" y="252" class="t-muted" font-size="9" text-anchor="middle">schema v1</text>
</g>
@@ -5015,7 +5014,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="388" y="128" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Schema</text>
+ <text data-node-label data-detail-anchor x="388" y="128" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Schema</text>
<text data-detail="context" x="388" y="144" class="t-muted" font-size="9" text-anchor="middle">ajv</text>
</g>
@@ -5026,7 +5025,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(478 214) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text x="532" y="242" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Renderers ×5</text>
+ <text data-node-label x="532" y="242" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Renderers ×5</text>
</g>
<g id="node-template" data-node-id="template" data-node-label="template.html" tabindex="0" role="button" aria-label="Focus template.html, archify/ skill package" aria-pressed="false" data-node-kind="frontend" data-node-context="archify/ skill package">
@@ -5039,7 +5038,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text x="676" y="242" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">template.html</text>
+ <text data-node-label x="676" y="242" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">template.html</text>
</g>
<g id="node-checker" data-node-id="checker" data-node-label="Output Check" tabindex="0" role="button" aria-label="Focus Output Check, archify/ skill package" aria-pressed="false" data-node-kind="security" data-node-context="archify/ skill package">
@@ -5050,7 +5049,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text x="820" y="242" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Output Check</text>
+ <text data-node-label x="820" y="242" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Output Check</text>
</g>
<g id="node-html" data-node-id="html" data-node-label="HTML" tabindex="0" role="button" aria-label="Focus HTML, artifact, Architecture component" aria-pressed="false" data-node-kind="cloud" data-node-sublabel="artifact" data-node-context="Architecture component">
@@ -5060,7 +5059,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(910 214) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="964" y="236" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">HTML</text>
+ <text data-node-label data-detail-anchor x="964" y="236" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">HTML</text>
<text data-detail="context" x="964" y="252" class="t-muted" font-size="9" text-anchor="middle">artifact</text>
</g>
@@ -5074,6 +5073,12 @@
+ <!-- Boundary labels (foreground masks keep routes out of titles) -->
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="0" data-composition-frame-kind="region" data-composition-frame-label="archify/ skill package">
+ <rect data-graph-role="structural-frame-label-mask" x="302" y="80" width="128.8" height="16" rx="3" class="c-mask"/>
+ <text x="306" y="93" class="t-cloud" font-size="9" font-weight="600">archify/ skill package</text>
+ </g>
+
<!-- Legend -->
<g data-legend data-legend-bridge>
<text x="40" y="320" class="t-primary" font-size="12" font-weight="650">Legend</text>
diff --git a/examples/archify-repo.html b/examples/archify-repo.html
index 7c5e7315..5f23b580 100644
--- a/examples/archify-repo.html
+++ b/examples/archify-repo.html
@@ -4939,8 +4939,7 @@
<rect width="100%" height="100%" fill="url(#grid)" />
<!-- Boundaries (behind everything) -->
- <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="370" y="110" width="770" height="270" rx="12" class="c-region" stroke-width="1"/>
- <text x="378" y="128" class="t-cloud" font-size="9" font-weight="600">archify/ skill package</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="archify/ skill package" x="370" y="110" width="770" height="270" rx="12" class="c-region" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
<path data-edge-from="user" data-edge-to="agents" data-edge-key="0" data-composition-points="160,330;200,330" d="M 160 330 L 200 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
@@ -4963,7 +4962,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="100" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">You</text>
+ <text data-node-label data-detail-anchor x="100" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">You</text>
<text data-detail="context" x="100" y="344" class="t-muted" font-size="9" text-anchor="middle">NL or Mermaid</text>
</g>
@@ -4977,7 +4976,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="275" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Agent Hosts</text>
+ <text data-node-label data-detail-anchor x="275" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Agent Hosts</text>
<text data-detail="context" x="275" y="344" class="t-muted" font-size="9" text-anchor="middle">Claude · Codex · opencode</text>
</g>
@@ -4991,7 +4990,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="275" y="168" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SKILL.md</text>
+ <text data-node-label data-detail-anchor x="275" y="168" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SKILL.md</text>
<text data-detail="context" x="275" y="184" class="t-muted" font-size="9" text-anchor="middle">layout judgment</text>
<text data-detail="fine" x="275" y="192" class="t-frontend" font-size="7" text-anchor="middle">prompt dialect</text>
</g>
@@ -5006,7 +5005,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="470" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">JSON IR</text>
+ <text data-node-label data-detail-anchor x="470" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">JSON IR</text>
<text data-detail="context" x="470" y="344" class="t-muted" font-size="9" text-anchor="middle">schema_version: 1</text>
</g>
@@ -5018,7 +5017,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="470" y="168" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">JSON Schema</text>
+ <text data-node-label data-detail-anchor x="470" y="168" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">JSON Schema</text>
<text data-detail="context" x="470" y="184" class="t-muted" font-size="9" text-anchor="middle">ajv strict</text>
<text data-detail="fine" x="470" y="192" class="t-security" font-size="7" text-anchor="middle">fail-closed</text>
</g>
@@ -5030,7 +5029,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(596 306) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="660" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Renderers ×5</text>
+ <text data-node-label data-detail-anchor x="660" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Renderers ×5</text>
<text data-detail="context" x="660" y="344" class="t-muted" font-size="9" text-anchor="middle">layout checks</text>
<text data-detail="fine" x="660" y="352" class="t-backend" font-size="7" text-anchor="middle">no auto-layout</text>
</g>
@@ -5045,7 +5044,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="850" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">template.html</text>
+ <text data-node-label data-detail-anchor x="850" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">template.html</text>
<text data-detail="context" x="850" y="344" class="t-muted" font-size="9" text-anchor="middle">theme + export</text>
</g>
@@ -5057,7 +5056,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="1040" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Output Check</text>
+ <text data-node-label data-detail-anchor x="1040" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Output Check</text>
<text data-detail="context" x="1040" y="344" class="t-muted" font-size="9" text-anchor="middle">SVG gates</text>
</g>
@@ -5068,7 +5067,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(1166 306) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="1230" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">HTML Artifact</text>
+ <text data-node-label data-detail-anchor x="1230" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">HTML Artifact</text>
<text data-detail="context" x="1230" y="344" class="t-muted" font-size="9" text-anchor="middle">single file</text>
</g>
@@ -5079,7 +5078,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(1166 146) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="1230" y="168" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">archify.zip</text>
+ <text data-node-label data-detail-anchor x="1230" y="168" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">archify.zip</text>
<text data-detail="context" x="1230" y="184" class="t-muted" font-size="9" text-anchor="middle">skill package</text>
</g>
@@ -5090,7 +5089,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(596 446) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="660" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CI Gates</text>
+ <text data-node-label data-detail-anchor x="660" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CI Gates</text>
<text data-detail="context" x="660" y="484" class="t-muted" font-size="9" text-anchor="middle">golden + zip</text>
</g>
@@ -5112,6 +5111,12 @@
+ <!-- Boundary labels (foreground masks keep routes out of titles) -->
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="0" data-composition-frame-kind="region" data-composition-frame-label="archify/ skill package">
+ <rect data-graph-role="structural-frame-label-mask" x="374" y="120" width="128.8" height="16" rx="3" class="c-mask"/>
+ <text x="378" y="133" class="t-cloud" font-size="9" font-weight="600">archify/ skill package</text>
+ </g>
+
<!-- Legend -->
<g data-legend data-legend-bridge>
<text x="40" y="532" class="t-primary" font-size="12" font-weight="650">Legend</text>
diff --git a/examples/checkout-platform-delta.html b/examples/checkout-platform-delta.html
index 8eba620e..b117a0fd 100644
--- a/examples/checkout-platform-delta.html
+++ b/examples/checkout-platform-delta.html
@@ -9677,11 +9677,9 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
&lt;rect width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;url(#grid)&quot; /&gt;
&lt;!-- Boundaries (behind everything) --&gt;
- &lt;rect data-graph-role=&quot;structural-frame&quot; data-composition-frame-kind=&quot;region&quot; data-composition-frame-id=&quot;0&quot; x=&quot;190&quot; y=&quot;70&quot; width=&quot;610&quot; height=&quot;410&quot; rx=&quot;12&quot; class=&quot;c-region&quot; stroke-width=&quot;1&quot;/&gt;
- &lt;text x=&quot;198&quot; y=&quot;88&quot; class=&quot;t-cloud&quot; font-size=&quot;9&quot; font-weight=&quot;600&quot;&gt;Production region&lt;/text&gt;
+ &lt;rect data-graph-role=&quot;structural-frame&quot; data-composition-frame-kind=&quot;region&quot; data-composition-frame-id=&quot;0&quot; data-composition-frame-label=&quot;Production region&quot; x=&quot;190&quot; y=&quot;70&quot; width=&quot;610&quot; height=&quot;410&quot; rx=&quot;12&quot; class=&quot;c-region&quot; stroke-width=&quot;1&quot;/&gt;
- &lt;rect data-graph-role=&quot;structural-frame&quot; data-composition-frame-kind=&quot;security-group&quot; data-composition-frame-id=&quot;1&quot; x=&quot;400&quot; y=&quot;220&quot; width=&quot;400&quot; height=&quot;110&quot; rx=&quot;8&quot; class=&quot;c-security-group&quot; stroke-width=&quot;1&quot;/&gt;
- &lt;text x=&quot;408&quot; y=&quot;238&quot; class=&quot;t-security&quot; font-size=&quot;9&quot; font-weight=&quot;600&quot;&gt;Checkout trust zone&lt;/text&gt;
+ &lt;rect data-graph-role=&quot;structural-frame&quot; data-composition-frame-kind=&quot;security-group&quot; data-composition-frame-id=&quot;1&quot; data-composition-frame-label=&quot;Checkout trust zone&quot; x=&quot;400&quot; y=&quot;220&quot; width=&quot;400&quot; height=&quot;110&quot; rx=&quot;8&quot; class=&quot;c-security-group&quot; stroke-width=&quot;1&quot;/&gt;
&lt;!-- Connection paths (before components for correct z-order) --&gt;
&lt;path data-edge-from=&quot;orders&quot; data-edge-to=&quot;payments&quot; data-edge-label=&quot;authorize&quot; data-edge-key=&quot;0&quot; data-edge-id=&quot;authorize-payment&quot; data-composition-points=&quot;770,280;850,280&quot; d=&quot;M 770 280 L 850 280&quot; class=&quot;a-security&quot; stroke-width=&quot;1.5&quot; marker-end=&quot;url(#arrowhead-security)&quot;/&gt;
@@ -9812,6 +9810,17 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
&lt;text x=&quot;495&quot; y=&quot;174&quot; class=&quot;t-muted&quot; font-size=&quot;8&quot; text-anchor=&quot;middle&quot;&gt;session&lt;/text&gt;
&lt;/g&gt;
+ &lt;!-- Boundary labels (foreground masks keep routes out of titles) --&gt;
+ &lt;g data-graph-role=&quot;structural-frame-label&quot; data-composition-frame-id=&quot;0&quot; data-composition-frame-kind=&quot;region&quot; data-composition-frame-label=&quot;Production region&quot;&gt;
+ &lt;rect data-graph-role=&quot;structural-frame-label-mask&quot; x=&quot;194&quot; y=&quot;75&quot; width=&quot;101.80000000000001&quot; height=&quot;16&quot; rx=&quot;3&quot; class=&quot;c-mask&quot;/&gt;
+ &lt;text x=&quot;198&quot; y=&quot;88&quot; class=&quot;t-cloud&quot; font-size=&quot;9&quot; font-weight=&quot;600&quot;&gt;Production region&lt;/text&gt;
+ &lt;/g&gt;
+
+ &lt;g data-graph-role=&quot;structural-frame-label&quot; data-composition-frame-id=&quot;1&quot; data-composition-frame-kind=&quot;security-group&quot; data-composition-frame-label=&quot;Checkout trust zone&quot;&gt;
+ &lt;rect data-graph-role=&quot;structural-frame-label-mask&quot; x=&quot;404&quot; y=&quot;225&quot; width=&quot;112.60000000000001&quot; height=&quot;16&quot; rx=&quot;3&quot; class=&quot;c-mask&quot;/&gt;
+ &lt;text x=&quot;408&quot; y=&quot;238&quot; class=&quot;t-security&quot; font-size=&quot;9&quot; font-weight=&quot;600&quot;&gt;Checkout trust zone&lt;/text&gt;
+ &lt;/g&gt;
+
&lt;!-- Legend --&gt;
&lt;g data-legend data-legend-bridge&gt;
&lt;text x=&quot;40&quot; y=&quot;512&quot; class=&quot;t-primary&quot; font-size=&quot;12&quot; font-weight=&quot;650&quot;&gt;Legend&lt;/text&gt;
@@ -18433,18 +18442,14 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
<!-- Background Grid -->
<rect width="100%" height="100%" fill="url(#delta-head-grid)" />
- <!-- Baseline boundary phantoms -->
-<rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="190" y="70" width="610" height="410" rx="12" class="c-region" stroke-width="1" data-delta-state="moved-from" data-delta-classifications="scope" data-delta-boundary-key="region:Production region"/>
- <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-state="moved-from" data-delta-boundary-state="moved-from" data-delta-boundary-key="region:Production region">Production region</text>
-<rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="400" y="220" width="400" height="110" rx="8" class="c-security-group" stroke-width="1" data-delta-state="moved-from" data-delta-classifications="scope" data-delta-boundary-key="security-group:Checkout trust zone"/>
- <text x="408" y="238" class="t-security" font-size="9" font-weight="600" data-delta-state="moved-from" data-delta-boundary-state="moved-from" data-delta-boundary-key="security-group:Checkout trust zone">Checkout trust zone</text>
+ <!-- Baseline boundary frame phantoms -->
+<rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="Production region" x="190" y="70" width="610" height="410" rx="12" class="c-region" stroke-width="1" data-delta-state="moved-from" data-delta-classifications="scope" data-delta-boundary-key="region:Production region"/>
+<rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" data-composition-frame-label="Checkout trust zone" x="400" y="220" width="400" height="110" rx="8" class="c-security-group" stroke-width="1" data-delta-state="moved-from" data-delta-classifications="scope" data-delta-boundary-key="security-group:Checkout trust zone"/>
<!-- Boundaries (behind everything) -->
- <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="190" y="70" width="610" height="430" rx="12" class="c-region" stroke-width="1" data-delta-state="changed" data-delta-classifications="scope" data-delta-boundary-key="region:Production region"/>
- <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-state="changed" data-delta-boundary-state="changed" data-delta-boundary-key="region:Production region">Production region</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="Production region" x="190" y="70" width="610" height="430" rx="12" class="c-region" stroke-width="1" data-delta-state="changed" data-delta-classifications="scope" data-delta-boundary-key="region:Production region"/>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="400" y="70" width="400" height="260" rx="8" class="c-security-group" stroke-width="1" data-delta-state="changed" data-delta-classifications="scope" data-delta-boundary-key="security-group:Checkout trust zone"/>
- <text x="408" y="88" class="t-security" font-size="9" font-weight="600" data-delta-state="changed" data-delta-boundary-state="changed" data-delta-boundary-key="security-group:Checkout trust zone">Checkout trust zone</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" data-composition-frame-label="Checkout trust zone" x="400" y="70" width="400" height="260" rx="8" class="c-security-group" stroke-width="1" data-delta-state="changed" data-delta-classifications="scope" data-delta-boundary-key="security-group:Checkout trust zone"/>
<!-- Baseline relationship phantoms -->
<path data-edge-from="orders" data-edge-to="payments" data-edge-label="authorize" data-edge-key="0" data-edge-id="authorize-payment" data-composition-points="770,280;850,280" d="M 770 280 L 850 280" class="a-security" stroke-width="1.5" marker-end="url(#arrowhead-security)" data-delta-state="removed" data-delta-classifications="geometry,topology"/>
@@ -18630,6 +18635,27 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
<text x="495" y="376" class="t-messagebus" font-size="8" text-anchor="middle">accepted</text>
</g>
+ <!-- Baseline boundary label phantoms -->
+<g data-graph-role="structural-frame-label" data-composition-frame-id="0" data-composition-frame-kind="region" data-composition-frame-label="Production region">
+ <rect data-graph-role="structural-frame-label-mask" x="194" y="75" width="101.80000000000001" height="16" rx="3" class="c-mask"/>
+ <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-state="moved-from" data-delta-boundary-state="moved-from" data-delta-boundary-key="region:Production region">Production region</text>
+ </g>
+<g data-graph-role="structural-frame-label" data-composition-frame-id="1" data-composition-frame-kind="security-group" data-composition-frame-label="Checkout trust zone">
+ <rect data-graph-role="structural-frame-label-mask" x="404" y="225" width="112.60000000000001" height="16" rx="3" class="c-mask"/>
+ <text x="408" y="238" class="t-security" font-size="9" font-weight="600" data-delta-state="moved-from" data-delta-boundary-state="moved-from" data-delta-boundary-key="security-group:Checkout trust zone">Checkout trust zone</text>
+ </g>
+
+ <!-- Boundary labels (foreground masks keep routes out of titles) -->
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="0" data-composition-frame-kind="region" data-composition-frame-label="Production region">
+ <rect data-graph-role="structural-frame-label-mask" x="194" y="75" width="101.80000000000001" height="16" rx="3" class="c-mask"/>
+ <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-state="changed" data-delta-boundary-state="changed" data-delta-boundary-key="region:Production region">Production region</text>
+ </g>
+
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="1" data-composition-frame-kind="security-group" data-composition-frame-label="Checkout trust zone">
+ <rect data-graph-role="structural-frame-label-mask" x="404" y="75" width="112.60000000000001" height="16" rx="3" class="c-mask"/>
+ <text x="408" y="88" class="t-security" font-size="9" font-weight="600" data-delta-state="changed" data-delta-boundary-state="changed" data-delta-boundary-key="security-group:Checkout trust zone">Checkout trust zone</text>
+ </g>
+
<!-- Delta relationship symbols -->
<text class="delta-edge-marker" data-delta-state="removed" data-edge-id="authorize-payment" x="779" y="273" aria-hidden="true">−</text>
<text class="delta-edge-marker" data-delta-state="moved-from" data-edge-id="publish-order" x="504" y="303" aria-hidden="true">↔</text>
@@ -23611,11 +23637,9 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
&lt;rect width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;url(#grid)&quot; /&gt;
&lt;!-- Boundaries (behind everything) --&gt;
- &lt;rect data-graph-role=&quot;structural-frame&quot; data-composition-frame-kind=&quot;region&quot; data-composition-frame-id=&quot;0&quot; x=&quot;190&quot; y=&quot;70&quot; width=&quot;610&quot; height=&quot;430&quot; rx=&quot;12&quot; class=&quot;c-region&quot; stroke-width=&quot;1&quot;/&gt;
- &lt;text x=&quot;198&quot; y=&quot;88&quot; class=&quot;t-cloud&quot; font-size=&quot;9&quot; font-weight=&quot;600&quot;&gt;Production region&lt;/text&gt;
+ &lt;rect data-graph-role=&quot;structural-frame&quot; data-composition-frame-kind=&quot;region&quot; data-composition-frame-id=&quot;0&quot; data-composition-frame-label=&quot;Production region&quot; x=&quot;190&quot; y=&quot;70&quot; width=&quot;610&quot; height=&quot;430&quot; rx=&quot;12&quot; class=&quot;c-region&quot; stroke-width=&quot;1&quot;/&gt;
- &lt;rect data-graph-role=&quot;structural-frame&quot; data-composition-frame-kind=&quot;security-group&quot; data-composition-frame-id=&quot;1&quot; x=&quot;400&quot; y=&quot;70&quot; width=&quot;400&quot; height=&quot;260&quot; rx=&quot;8&quot; class=&quot;c-security-group&quot; stroke-width=&quot;1&quot;/&gt;
- &lt;text x=&quot;408&quot; y=&quot;88&quot; class=&quot;t-security&quot; font-size=&quot;9&quot; font-weight=&quot;600&quot;&gt;Checkout trust zone&lt;/text&gt;
+ &lt;rect data-graph-role=&quot;structural-frame&quot; data-composition-frame-kind=&quot;security-group&quot; data-composition-frame-id=&quot;1&quot; data-composition-frame-label=&quot;Checkout trust zone&quot; x=&quot;400&quot; y=&quot;70&quot; width=&quot;400&quot; height=&quot;260&quot; rx=&quot;8&quot; class=&quot;c-security-group&quot; stroke-width=&quot;1&quot;/&gt;
&lt;!-- Connection paths (before components for correct z-order) --&gt;
&lt;path data-edge-from=&quot;fraud&quot; data-edge-to=&quot;payments&quot; data-edge-label=&quot;authorize&quot; data-edge-key=&quot;0&quot; data-edge-id=&quot;authorize-payment&quot; data-composition-points=&quot;770,130;820,130;915,130;915,250&quot; d=&quot;M 770 130 L 812 130 Q 820 130 828 130 L 907 130 Q 915 130 915 138 L 915 250&quot; class=&quot;a-security&quot; stroke-width=&quot;1.5&quot; marker-end=&quot;url(#arrowhead-security)&quot;/&gt;
@@ -23747,6 +23771,17 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
&lt;text x=&quot;495&quot; y=&quot;376&quot; class=&quot;t-messagebus&quot; font-size=&quot;8&quot; text-anchor=&quot;middle&quot;&gt;accepted&lt;/text&gt;
&lt;/g&gt;
+ &lt;!-- Boundary labels (foreground masks keep routes out of titles) --&gt;
+ &lt;g data-graph-role=&quot;structural-frame-label&quot; data-composition-frame-id=&quot;0&quot; data-composition-frame-kind=&quot;region&quot; data-composition-frame-label=&quot;Production region&quot;&gt;
+ &lt;rect data-graph-role=&quot;structural-frame-label-mask&quot; x=&quot;194&quot; y=&quot;75&quot; width=&quot;101.80000000000001&quot; height=&quot;16&quot; rx=&quot;3&quot; class=&quot;c-mask&quot;/&gt;
+ &lt;text x=&quot;198&quot; y=&quot;88&quot; class=&quot;t-cloud&quot; font-size=&quot;9&quot; font-weight=&quot;600&quot;&gt;Production region&lt;/text&gt;
+ &lt;/g&gt;
+
+ &lt;g data-graph-role=&quot;structural-frame-label&quot; data-composition-frame-id=&quot;1&quot; data-composition-frame-kind=&quot;security-group&quot; data-composition-frame-label=&quot;Checkout trust zone&quot;&gt;
+ &lt;rect data-graph-role=&quot;structural-frame-label-mask&quot; x=&quot;404&quot; y=&quot;75&quot; width=&quot;112.60000000000001&quot; height=&quot;16&quot; rx=&quot;3&quot; class=&quot;c-mask&quot;/&gt;
+ &lt;text x=&quot;408&quot; y=&quot;88&quot; class=&quot;t-security&quot; font-size=&quot;9&quot; font-weight=&quot;600&quot;&gt;Checkout trust zone&lt;/text&gt;
+ &lt;/g&gt;
+
&lt;!-- Legend --&gt;
&lt;g data-legend data-legend-bridge&gt;
&lt;text x=&quot;40&quot; y=&quot;532&quot; class=&quot;t-primary&quot; font-size=&quot;12&quot; font-weight=&quot;650&quot;&gt;Legend&lt;/text&gt;
diff --git a/examples/checkout-platform-delta.receipt.json b/examples/checkout-platform-delta.receipt.json
index 4e0e2028..84cff100 100644
--- a/examples/checkout-platform-delta.receipt.json
+++ b/examples/checkout-platform-delta.receipt.json
@@ -219,8 +219,8 @@
"Boundary identity is conservatively derived from kind + label."
],
"artifact": {
- "sha256": "4da7bfdacfdd1d8b0b80e239c1e09ba4086fb28283ac9c2c15061af74f95b629",
- "bytes": 1841814
+ "sha256": "af5101e5bd753dcdbfd315ca81020e9519a46f73759b83513b5fc745f3de2772",
+ "bytes": 1845693
},
"validation": {
"checksPassed": 28,
diff --git a/examples/dataflow-product-analytics.html b/examples/dataflow-product-analytics.html
index f34dbc3e..57e151b0 100644
--- a/examples/dataflow-product-analytics.html
+++ b/examples/dataflow-product-analytics.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4976,7 +4977,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="100" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Web App</text>
+ <text data-node-label data-detail-anchor x="100" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Web App</text>
<text data-detail="context" x="100" y="165" class="t-muted" font-size="7" text-anchor="middle">browser SDK</text>
<text data-detail="fine" x="100" y="175" class="t-frontend" font-size="7" text-anchor="middle">events</text>
</g>
@@ -4991,7 +4992,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="100" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Mobile</text>
+ <text data-node-label data-detail-anchor x="100" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Mobile</text>
<text data-detail="context" x="100" y="393" class="t-muted" font-size="7" text-anchor="middle">iOS / Android</text>
<text data-detail="fine" x="100" y="403" class="t-frontend" font-size="7" text-anchor="middle">events</text>
</g>
@@ -5003,7 +5004,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(265 248) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Edge API</text>
+ <text data-node-label data-detail-anchor x="315" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Edge API</text>
<text data-detail="context" x="315" y="279" class="t-muted" font-size="7" text-anchor="middle">collector</text>
<text data-detail="fine" x="315" y="289" class="t-cloud" font-size="7" text-anchor="middle">TLS</text>
</g>
@@ -5016,7 +5017,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="530" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Consent Gate</text>
+ <text data-node-label data-detail-anchor x="530" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Consent Gate</text>
<text data-detail="context" x="530" y="165" class="t-muted" font-size="7" text-anchor="middle">policy filter</text>
<text data-detail="fine" x="530" y="175" class="t-security" font-size="7" text-anchor="middle">PII guard</text>
</g>
@@ -5031,7 +5032,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="530" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Event Stream</text>
+ <text data-node-label data-detail-anchor x="530" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Event Stream</text>
<text data-detail="context" x="530" y="393" class="t-muted" font-size="7" text-anchor="middle">Kafka topic</text>
<text data-detail="fine" x="530" y="403" class="t-messagebus" font-size="7" text-anchor="middle">ordered</text>
</g>
@@ -5044,7 +5045,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="745" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">PII Vault</text>
+ <text data-node-label data-detail-anchor x="745" y="149" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">PII Vault</text>
<text data-detail="context" x="745" y="165" class="t-muted" font-size="7" text-anchor="middle">encrypted</text>
<text data-detail="fine" x="745" y="175" class="t-security" font-size="7" text-anchor="middle">restricted</text>
</g>
@@ -5057,7 +5058,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="745" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Warehouse</text>
+ <text data-node-label data-detail-anchor x="745" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Warehouse</text>
<text data-detail="context" x="745" y="393" class="t-muted" font-size="7" text-anchor="middle">analytics tables</text>
<text data-detail="fine" x="745" y="403" class="t-database" font-size="7" text-anchor="middle">curated</text>
</g>
@@ -5070,7 +5071,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="745" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Feature Store</text>
+ <text data-node-label data-detail-anchor x="745" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Feature Store</text>
<text data-detail="context" x="745" y="621" class="t-muted" font-size="7" text-anchor="middle">daily batch</text>
<text data-detail="fine" x="745" y="631" class="t-database" font-size="7" text-anchor="middle">derived</text>
</g>
@@ -5082,7 +5083,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(910 248) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="960" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Dashboards</text>
+ <text data-node-label data-detail-anchor x="960" y="263" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Dashboards</text>
<text data-detail="context" x="960" y="279" class="t-muted" font-size="7" text-anchor="middle">product metrics</text>
<text data-detail="fine" x="960" y="289" class="t-backend" font-size="7" text-anchor="middle">SQL</text>
</g>
@@ -5094,7 +5095,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(910 590) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="960" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">ML Model</text>
+ <text data-node-label data-detail-anchor x="960" y="605" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">ML Model</text>
<text data-detail="context" x="960" y="621" class="t-muted" font-size="7" text-anchor="middle">ranking job</text>
<text data-detail="fine" x="960" y="631" class="t-backend" font-size="7" text-anchor="middle">features</text>
</g>
@@ -10700,6 +10701,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10719,6 +10774,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/examples/lifecycle-agent-run.html b/examples/lifecycle-agent-run.html
index 24b0d269..3200c804 100644
--- a/examples/lifecycle-agent-run.html
+++ b/examples/lifecycle-agent-run.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4966,7 +4967,7 @@
<path d="m7 5.4 3.6 2.6L7 10.6Z" class="sigil-fill"/>
</g>
<text data-detail="fine" x="45" y="140" class="t-frontend" font-size="7" font-weight="700">01</text>
- <text data-detail-anchor x="94" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Queued</text>
+ <text data-node-label data-detail-anchor x="94" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Queued</text>
<text data-detail="context" x="94" y="163" class="t-muted" font-size="7" text-anchor="middle">request accepted</text>
<text data-detail="fine" x="94" y="177" class="t-frontend" font-size="7" text-anchor="middle">entry</text>
</g>
@@ -4979,7 +4980,7 @@
<path d="M2 8h3l1.5-3.5L9 12l1.6-4H14"/>
</g>
<text data-detail="fine" x="199" y="140" class="t-backend" font-size="7" font-weight="700">02</text>
- <text data-detail-anchor x="248" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Planning</text>
+ <text data-node-label data-detail-anchor x="248" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Planning</text>
<text data-detail="context" x="248" y="163" class="t-muted" font-size="7" text-anchor="middle">build task graph</text>
<text data-detail="fine" x="248" y="177" class="t-backend" font-size="7" text-anchor="middle">model</text>
</g>
@@ -4992,7 +4993,7 @@
<path d="M2 8h3l1.5-3.5L9 12l1.6-4H14"/>
</g>
<text data-detail="fine" x="353" y="140" class="t-backend" font-size="7" font-weight="700">03</text>
- <text data-detail-anchor x="402" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Executing</text>
+ <text data-node-label data-detail-anchor x="402" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Executing</text>
<text data-detail="context" x="402" y="163" class="t-muted" font-size="7" text-anchor="middle">tool calls</text>
<text data-detail="fine" x="402" y="177" class="t-backend" font-size="7" text-anchor="middle">work</text>
</g>
@@ -5006,7 +5007,7 @@
<circle cx="8" cy="8" r="1.2" class="sigil-fill"/>
</g>
<text data-detail="fine" x="507" y="140" class="t-security" font-size="7" font-weight="700">04</text>
- <text data-detail-anchor x="556" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Reviewing</text>
+ <text data-node-label data-detail-anchor x="556" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Reviewing</text>
<text data-detail="context" x="556" y="163" class="t-muted" font-size="7" text-anchor="middle">quality gate</text>
<text data-detail="fine" x="556" y="177" class="t-security" font-size="7" text-anchor="middle">check</text>
</g>
@@ -5020,7 +5021,7 @@
<path d="m5.2 8 1.8 1.8 3.8-4"/>
</g>
<text data-detail="fine" x="661" y="140" class="t-database" font-size="7" font-weight="700">05</text>
- <text data-detail-anchor x="710" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Completed</text>
+ <text data-node-label data-detail-anchor x="710" y="147" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Completed</text>
<text data-detail="context" x="710" y="163" class="t-muted" font-size="7" text-anchor="middle">final response</text>
<text data-detail="fine" x="710" y="177" class="t-database" font-size="7" text-anchor="middle">done</text>
</g>
@@ -5032,7 +5033,7 @@
<g aria-hidden="true" data-semantic-sigil="waiting" class="semantic-sigil s-cloud" transform="translate(448 284) scale(0.6875)">
<path d="M4 2.5h8M4 13.5h8M5 3c0 2.8 2 3.2 3 5-1 1.8-3 2.2-3 5M11 3c0 2.8-2 3.2-3 5 1 1.8 3 2.2 3 5"/>
</g>
- <text data-detail-anchor x="402" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Needs Approval</text>
+ <text data-node-label data-detail-anchor x="402" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Needs Approval</text>
<text data-detail="context" x="402" y="315" class="t-muted" font-size="7" text-anchor="middle">human gate</text>
<text data-detail="fine" x="402" y="325" class="t-cloud" font-size="7" text-anchor="middle">pause</text>
</g>
@@ -5044,7 +5045,7 @@
<g aria-hidden="true" data-semantic-sigil="waiting" class="semantic-sigil s-cloud" transform="translate(602 284) scale(0.6875)">
<path d="M4 2.5h8M4 13.5h8M5 3c0 2.8 2 3.2 3 5-1 1.8-3 2.2-3 5M11 3c0 2.8-2 3.2-3 5 1 1.8 3 2.2 3 5"/>
</g>
- <text data-detail-anchor x="556" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Blocked</text>
+ <text data-node-label data-detail-anchor x="556" y="299" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Blocked</text>
<text data-detail="context" x="556" y="315" class="t-muted" font-size="7" text-anchor="middle">missing input</text>
<text data-detail="fine" x="556" y="325" class="t-cloud" font-size="7" text-anchor="middle">wait</text>
</g>
@@ -5057,7 +5058,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="402" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Failed</text>
+ <text data-node-label data-detail-anchor x="402" y="377" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Failed</text>
<text data-detail="context" x="402" y="393" class="t-muted" font-size="7" text-anchor="middle">recoverable error</text>
<text data-detail="fine" x="402" y="403" class="t-security" font-size="7" text-anchor="middle">retryable</text>
</g>
@@ -5070,7 +5071,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="402" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Cancelled</text>
+ <text data-node-label data-detail-anchor x="402" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Cancelled</text>
<text data-detail="context" x="402" y="487" class="t-muted" font-size="7" text-anchor="middle">user stopped</text>
<text data-detail="fine" x="402" y="497" class="t-security" font-size="7" text-anchor="middle">terminal</text>
</g>
@@ -5083,7 +5084,7 @@
<circle cx="8" cy="8" r="5.3"/>
<path d="m5.7 5.7 4.6 4.6m0-4.6-4.6 4.6"/>
</g>
- <text data-detail-anchor x="556" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Expired</text>
+ <text data-node-label data-detail-anchor x="556" y="471" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Expired</text>
<text data-detail="context" x="556" y="487" class="t-muted" font-size="7" text-anchor="middle">timeout</text>
<text data-detail="fine" x="556" y="497" class="t-security" font-size="7" text-anchor="middle">terminal</text>
</g>
@@ -10649,6 +10650,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10668,6 +10723,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/examples/sequence-cache-miss-request.html b/examples/sequence-cache-miss-request.html
index 1427c2b0..ae9d189f 100644
--- a/examples/sequence-cache-miss-request.html
+++ b/examples/sequence-cache-miss-request.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -5087,7 +5088,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="62" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
+ <text data-node-label data-detail-anchor x="62" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
<text data-detail="context" x="62" y="111" class="t-muted" font-size="7" text-anchor="middle">browser session</text>
</g>
@@ -5101,7 +5102,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="170" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Web App</text>
+ <text data-node-label data-detail-anchor x="170" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Web App</text>
<text data-detail="context" x="170" y="111" class="t-muted" font-size="7" text-anchor="middle">React UI</text>
</g>
@@ -5112,7 +5113,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(241 78) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="278" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API</text>
+ <text data-node-label data-detail-anchor x="278" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API</text>
<text data-detail="context" x="278" y="111" class="t-muted" font-size="7" text-anchor="middle">request handler</text>
</g>
@@ -5124,7 +5125,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="386" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth</text>
+ <text data-node-label data-detail-anchor x="386" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth</text>
<text data-detail="context" x="386" y="111" class="t-muted" font-size="7" text-anchor="middle">JWT verify</text>
</g>
@@ -5136,7 +5137,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="494" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
+ <text data-node-label data-detail-anchor x="494" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
<text data-detail="context" x="494" y="111" class="t-muted" font-size="7" text-anchor="middle">cache</text>
</g>
@@ -5148,7 +5149,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="602" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Postgres</text>
+ <text data-node-label data-detail-anchor x="602" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Postgres</text>
<text data-detail="context" x="602" y="111" class="t-muted" font-size="7" text-anchor="middle">source of truth</text>
</g>
@@ -5162,7 +5163,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="710" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace</text>
+ <text data-node-label data-detail-anchor x="710" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace</text>
<text data-detail="context" x="710" y="111" class="t-muted" font-size="7" text-anchor="middle">async event</text>
</g>
@@ -10715,6 +10716,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10734,6 +10789,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/examples/web-app-rendered.html b/examples/web-app-rendered.html
index 62b289f1..7bc5a4f8 100644
--- a/examples/web-app-rendered.html
+++ b/examples/web-app-rendered.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4938,11 +4939,9 @@
<rect width="100%" height="100%" fill="url(#grid)" />
<!-- Boundaries (behind everything) -->
- <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="220" y="120" width="820" height="400" rx="12" class="c-region" stroke-width="1"/>
- <text x="228" y="138" class="t-cloud" font-size="9" font-weight="600">AWS Region: us-west-2</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="AWS Region: us-west-2" x="220" y="120" width="820" height="400" rx="12" class="c-region" stroke-width="1"/>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="430" y="270" width="400" height="110" rx="8" class="c-security-group" stroke-width="1"/>
- <text x="438" y="288" class="t-security" font-size="9" font-weight="600">sg-api :443/:8000</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" data-composition-frame-label="sg-api :443/:8000" x="430" y="270" width="400" height="110" rx="8" class="c-security-group" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
<path data-edge-from="users" data-edge-to="cdn" data-edge-label="HTTPS" data-edge-key="0" data-edge-id="users-to-cdn" data-composition-points="160,330;250,330" d="M 160 330 L 250 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
@@ -4964,7 +4963,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="100" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Users</text>
+ <text data-node-label data-detail-anchor x="100" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Users</text>
<text data-detail="context" x="100" y="344" class="t-muted" font-size="9" text-anchor="middle">Browser / Mobile</text>
</g>
@@ -4976,7 +4975,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="100" y="140" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>
+ <text data-node-label data-detail-anchor x="100" y="140" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>
<text data-detail="context" x="100" y="156" class="t-muted" font-size="9" text-anchor="middle">OAuth 2.0</text>
<text data-detail="fine" x="100" y="166" class="t-security" font-size="7" text-anchor="middle">JWT + PKCE</text>
</g>
@@ -4988,7 +4987,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(256 306) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>
+ <text data-node-label data-detail-anchor x="315" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>
<text data-detail="context" x="315" y="344" class="t-muted" font-size="9" text-anchor="middle">CDN</text>
</g>
@@ -4999,7 +4998,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(466 306) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="525" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>
+ <text data-node-label data-detail-anchor x="525" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>
<text data-detail="context" x="525" y="344" class="t-muted" font-size="9" text-anchor="middle">HTTPS :443</text>
</g>
@@ -5010,7 +5009,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(676 306) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="735" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>
+ <text data-node-label data-detail-anchor x="735" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>
<text data-detail="context" x="735" y="344" class="t-muted" font-size="9" text-anchor="middle">FastAPI :8000</text>
</g>
@@ -5022,7 +5021,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="735" y="178" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
+ <text data-node-label data-detail-anchor x="735" y="178" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
<text data-detail="context" x="735" y="194" class="t-muted" font-size="9" text-anchor="middle">cache :6379</text>
</g>
@@ -5034,7 +5033,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="945" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">PostgreSQL</text>
+ <text data-node-label data-detail-anchor x="945" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">PostgreSQL</text>
<text data-detail="context" x="945" y="344" class="t-muted" font-size="9" text-anchor="middle">primary :5432</text>
</g>
@@ -5045,7 +5044,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(256 446) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">S3</text>
+ <text data-node-label data-detail-anchor x="315" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">S3</text>
<text data-detail="context" x="315" y="484" class="t-muted" font-size="9" text-anchor="middle">static assets</text>
<text data-detail="fine" x="315" y="492" class="t-cloud" font-size="7" text-anchor="middle">OAI protected</text>
</g>
@@ -5060,7 +5059,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="735" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SQS</text>
+ <text data-node-label data-detail-anchor x="735" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SQS</text>
<text data-detail="context" x="735" y="484" class="t-muted" font-size="9" text-anchor="middle">job queue</text>
</g>
@@ -5071,7 +5070,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(886 446) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="945" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Worker</text>
+ <text data-node-label data-detail-anchor x="945" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Worker</text>
<text data-detail="context" x="945" y="484" class="t-muted" font-size="9" text-anchor="middle">async jobs</text>
</g>
@@ -5104,6 +5103,17 @@
</g>
+ <!-- Boundary labels (foreground masks keep routes out of titles) -->
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="0" data-composition-frame-kind="region" data-composition-frame-label="AWS Region: us-west-2">
+ <rect data-graph-role="structural-frame-label-mask" x="224" y="130" width="123.39999999999999" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="228" y="143" class="t-cloud" font-size="9" font-weight="600">AWS Region: us-west-2</text>
+ </g>
+
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="1" data-composition-frame-kind="security-group" data-composition-frame-label="sg-api :443/:8000">
+ <rect data-graph-role="structural-frame-label-mask" x="434" y="280" width="101.8" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="438" y="293" class="t-security" font-size="9" font-weight="600">sg-api :443/:8000</text>
+ </g>
+
<!-- Legend -->
<g data-legend data-legend-bridge>
<text x="40" y="552" class="t-primary" font-size="12" font-weight="650">Legend</text>
@@ -10655,6 +10665,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10674,6 +10738,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/examples/web-app.html b/examples/web-app.html
index 62b289f1..7bc5a4f8 100644
--- a/examples/web-app.html
+++ b/examples/web-app.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4938,11 +4939,9 @@
<rect width="100%" height="100%" fill="url(#grid)" />
<!-- Boundaries (behind everything) -->
- <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="220" y="120" width="820" height="400" rx="12" class="c-region" stroke-width="1"/>
- <text x="228" y="138" class="t-cloud" font-size="9" font-weight="600">AWS Region: us-west-2</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="AWS Region: us-west-2" x="220" y="120" width="820" height="400" rx="12" class="c-region" stroke-width="1"/>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="430" y="270" width="400" height="110" rx="8" class="c-security-group" stroke-width="1"/>
- <text x="438" y="288" class="t-security" font-size="9" font-weight="600">sg-api :443/:8000</text>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" data-composition-frame-label="sg-api :443/:8000" x="430" y="270" width="400" height="110" rx="8" class="c-security-group" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
<path data-edge-from="users" data-edge-to="cdn" data-edge-label="HTTPS" data-edge-key="0" data-edge-id="users-to-cdn" data-composition-points="160,330;250,330" d="M 160 330 L 250 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
@@ -4964,7 +4963,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="100" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Users</text>
+ <text data-node-label data-detail-anchor x="100" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Users</text>
<text data-detail="context" x="100" y="344" class="t-muted" font-size="9" text-anchor="middle">Browser / Mobile</text>
</g>
@@ -4976,7 +4975,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="100" y="140" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>
+ <text data-node-label data-detail-anchor x="100" y="140" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>
<text data-detail="context" x="100" y="156" class="t-muted" font-size="9" text-anchor="middle">OAuth 2.0</text>
<text data-detail="fine" x="100" y="166" class="t-security" font-size="7" text-anchor="middle">JWT + PKCE</text>
</g>
@@ -4988,7 +4987,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(256 306) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>
+ <text data-node-label data-detail-anchor x="315" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>
<text data-detail="context" x="315" y="344" class="t-muted" font-size="9" text-anchor="middle">CDN</text>
</g>
@@ -4999,7 +4998,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(466 306) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="525" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>
+ <text data-node-label data-detail-anchor x="525" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>
<text data-detail="context" x="525" y="344" class="t-muted" font-size="9" text-anchor="middle">HTTPS :443</text>
</g>
@@ -5010,7 +5009,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(676 306) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="735" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>
+ <text data-node-label data-detail-anchor x="735" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>
<text data-detail="context" x="735" y="344" class="t-muted" font-size="9" text-anchor="middle">FastAPI :8000</text>
</g>
@@ -5022,7 +5021,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="735" y="178" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
+ <text data-node-label data-detail-anchor x="735" y="178" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>
<text data-detail="context" x="735" y="194" class="t-muted" font-size="9" text-anchor="middle">cache :6379</text>
</g>
@@ -5034,7 +5033,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="945" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">PostgreSQL</text>
+ <text data-node-label data-detail-anchor x="945" y="328" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">PostgreSQL</text>
<text data-detail="context" x="945" y="344" class="t-muted" font-size="9" text-anchor="middle">primary :5432</text>
</g>
@@ -5045,7 +5044,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(256 446) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="315" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">S3</text>
+ <text data-node-label data-detail-anchor x="315" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">S3</text>
<text data-detail="context" x="315" y="484" class="t-muted" font-size="9" text-anchor="middle">static assets</text>
<text data-detail="fine" x="315" y="492" class="t-cloud" font-size="7" text-anchor="middle">OAI protected</text>
</g>
@@ -5060,7 +5059,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="735" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SQS</text>
+ <text data-node-label data-detail-anchor x="735" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">SQS</text>
<text data-detail="context" x="735" y="484" class="t-muted" font-size="9" text-anchor="middle">job queue</text>
</g>
@@ -5071,7 +5070,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(886 446) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="945" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Worker</text>
+ <text data-node-label data-detail-anchor x="945" y="468" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Worker</text>
<text data-detail="context" x="945" y="484" class="t-muted" font-size="9" text-anchor="middle">async jobs</text>
</g>
@@ -5104,6 +5103,17 @@
</g>
+ <!-- Boundary labels (foreground masks keep routes out of titles) -->
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="0" data-composition-frame-kind="region" data-composition-frame-label="AWS Region: us-west-2">
+ <rect data-graph-role="structural-frame-label-mask" x="224" y="130" width="123.39999999999999" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="228" y="143" class="t-cloud" font-size="9" font-weight="600">AWS Region: us-west-2</text>
+ </g>
+
+ <g data-graph-role="structural-frame-label" data-composition-frame-id="1" data-composition-frame-kind="security-group" data-composition-frame-label="sg-api :443/:8000">
+ <rect data-graph-role="structural-frame-label-mask" x="434" y="280" width="101.8" height="16" rx="3" class="c-mask"/>
+ <text data-boundary-label x="438" y="293" class="t-security" font-size="9" font-weight="600">sg-api :443/:8000</text>
+ </g>
+
<!-- Legend -->
<g data-legend data-legend-bridge>
<text x="40" y="552" class="t-primary" font-size="12" font-weight="650">Legend</text>
@@ -10655,6 +10665,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10674,6 +10738,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};
diff --git a/examples/workflow-agent-tool-call-rendered.html b/examples/workflow-agent-tool-call-rendered.html
index ee020383..bc6acb85 100644
--- a/examples/workflow-agent-tool-call-rendered.html
+++ b/examples/workflow-agent-tool-call-rendered.html
@@ -2805,6 +2805,7 @@
.card { padding: 1rem; }
}
@media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
.header { margin-bottom: 0.875rem; }
.cards { margin-top: 0.75rem; }
}
@@ -4998,7 +4999,7 @@
<rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
<path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
</g>
- <text data-detail-anchor x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
+ <text data-node-label data-detail-anchor x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>
<text data-detail="context" x="88" y="131" class="t-muted" font-size="8" text-anchor="middle">asks for work</text>
</g>
@@ -5012,7 +5013,7 @@
<circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
<circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="220" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Chat Surface</text>
+ <text data-node-label data-detail-anchor x="220" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Chat Surface</text>
<text data-detail="context" x="220" y="131" class="t-muted" font-size="8" text-anchor="middle">thread + files</text>
</g>
@@ -5023,7 +5024,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(585 99) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="625" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Final Reply</text>
+ <text data-node-label data-detail-anchor x="625" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Final Reply</text>
<text data-detail="context" x="625" y="131" class="t-muted" font-size="8" text-anchor="middle">answer + changes</text>
</g>
@@ -5034,7 +5035,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(260 215) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="300" y="230" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Agent Planner</text>
+ <text data-node-label data-detail-anchor x="300" y="230" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Agent Planner</text>
<text data-detail="context" x="300" y="247" class="t-muted" font-size="8" text-anchor="middle">plan next step</text>
<text data-detail="fine" x="300" y="265" class="t-backend" font-size="7" text-anchor="middle">context aware</text>
</g>
@@ -5046,7 +5047,7 @@
<g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(390 223) scale(0.6875)">
<path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
</g>
- <text data-detail-anchor x="430" y="238" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Router</text>
+ <text data-node-label data-detail-anchor x="430" y="238" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Router</text>
<text data-detail="context" x="430" y="255" class="t-muted" font-size="8" text-anchor="middle">choose capability</text>
</g>
@@ -5058,7 +5059,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="430" y="354" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Approval Gate</text>
+ <text data-node-label data-detail-anchor x="430" y="354" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Approval Gate</text>
<text data-detail="context" x="430" y="371" class="t-muted" font-size="8" text-anchor="middle">scope + consent</text>
<text data-detail="fine" x="430" y="389" class="t-security" font-size="7" text-anchor="middle">block risky ops</text>
</g>
@@ -5071,7 +5072,7 @@
<path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
<path d="m5.8 8 1.5 1.5 3-3"/>
</g>
- <text data-detail-anchor x="500" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Blocked</text>
+ <text data-node-label data-detail-anchor x="500" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Blocked</text>
<text data-detail="context" x="500" y="503" class="t-muted" font-size="8" text-anchor="middle">wait or reject</text>
</g>
@@ -5085,7 +5086,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="625" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Retry Path</text>
+ <text data-node-label data-detail-anchor x="625" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Retry Path</text>
<text data-detail="context" x="625" y="503" class="t-muted" font-size="8" text-anchor="middle">revise request</text>
</g>
@@ -5099,7 +5100,7 @@
<circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
<circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
</g>
- <text data-detail-anchor x="500" y="602" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Call</text>
+ <text data-node-label data-detail-anchor x="500" y="602" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Call</text>
<text data-detail="context" x="500" y="619" class="t-muted" font-size="6.6" text-anchor="middle">shell / browser / MCP</text>
<text data-detail="fine" x="500" y="637" class="t-messagebus" font-size="7" text-anchor="middle">structured result</text>
</g>
@@ -5111,7 +5112,7 @@
<g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(585 595) scale(0.6875)">
<path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
</g>
- <text data-detail-anchor x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">External API</text>
+ <text data-node-label data-detail-anchor x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">External API</text>
<text data-detail="context" x="625" y="627" class="t-muted" font-size="8" text-anchor="middle">network service</text>
</g>
@@ -5123,7 +5124,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="220" y="734" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Context Store</text>
+ <text data-node-label data-detail-anchor x="220" y="734" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">Context Store</text>
<text data-detail="context" x="220" y="751" class="t-muted" font-size="8" text-anchor="middle">repo + memory</text>
</g>
@@ -5135,7 +5136,7 @@
<ellipse cx="8" cy="4" rx="5" ry="2"/>
<path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
</g>
- <text data-detail-anchor x="500" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace Log</text>
+ <text data-node-label data-detail-anchor x="500" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace Log</text>
<text data-detail="context" x="500" y="751" class="t-muted" font-size="8" text-anchor="middle">events + output</text>
</g>
@@ -10697,6 +10698,60 @@
if (frame) return;
frame = requestAnimationFrame(measure);
}
+ function stableSnapshot() {
+ var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
+ var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
+ return [
+ lastWidth,
+ html.getAttribute('data-reader-layout') || '',
+ html.getAttribute('data-reader-overflow') || '',
+ Math.ceil(document.documentElement.scrollWidth),
+ Math.ceil(document.documentElement.scrollHeight),
+ Math.ceil(document.body.scrollWidth),
+ Math.ceil(document.body.scrollHeight),
+ Math.round(shellRect.width * 100) / 100,
+ Math.round(shellRect.height * 100) / 100,
+ Math.round(diagramRect.width * 100) / 100,
+ Math.round(diagramRect.height * 100) / 100
+ ].join('|');
+ }
+ function whenStable() {
+ var fontsReady = document.fonts && document.fonts.ready
+ ? document.fonts.ready.catch(function () {})
+ : Promise.resolve();
+ return fontsReady.then(function () {
+ schedule();
+ return new Promise(function (resolve, reject) {
+ var previous = '';
+ var stableFrames = 0;
+ var sampledFrames = 0;
+ function sample() {
+ sampledFrames += 1;
+ if (frame || settleFrame) {
+ previous = '';
+ stableFrames = 0;
+ } else {
+ var current = stableSnapshot();
+ if (current === previous) stableFrames += 1;
+ else {
+ previous = current;
+ stableFrames = 0;
+ }
+ if (stableFrames >= 3) {
+ resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
+ return;
+ }
+ }
+ if (sampledFrames >= 240) {
+ reject(new Error('Adaptive reader layout did not reach stable dimensions.'));
+ return;
+ }
+ requestAnimationFrame(sample);
+ }
+ requestAnimationFrame(sample);
+ });
+ });
+ }
window.addEventListener('resize', schedule, { passive: true });
window.addEventListener('load', schedule, { once: true });
@@ -10716,6 +10771,7 @@
return {
measure: measure,
schedule: schedule,
+ whenStable: whenStable,
active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
receipt: function () { return { ratio: ratio, width: lastWidth }; }
};