Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
HTML agent-skillsai-agentsarchitecture-diagramclaude-codeclaude-skillscodexcoding-agentsdeepseek-harnessdeveloper-toolsdiagramsdiagrams-as-codedsh-pluginflowchartllmmermaidopencodesequence-diagramsoftware-architecturesystem-designvisualization
feat: add architecture delta proof
tt-a1i4aeb07b379f0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d0d69d7e..67869a79 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -5,6 +5,7 @@ All notable changes are documented here. Format loosely follows [Keep a Changelo## [Unreleased]### Added+- **Architecture Delta / PR Proof.** The zero-dependency CLI now exposes `archify compare architecture <base.json> <head.json> [output.html] --json`: it validates both snapshots independently, pairs components and relationships only by authored stable IDs, classifies semantic, evidence, scope, topology, geometry, provenance, and presentation changes separately, and emits deterministic Before / Delta / After HTML plus a complete machine receipt. Removed nodes and relationships retain baseline geometry, moved nodes keep a `MOVE FROM` phantom, endpoint changes show old and new routes, and `+ / ~ / − / ↔` plus line patterns keep meaning independent of color or motion. Formatting, object-key, entity-order, `wraps`, and `sources` set changes preserve the semantic hash and artifact bytes; failures preserve the previous artifact. Repository mismatches, zero shared component IDs, missing relationship IDs, and ambiguous boundary keys fail closed. The proof says `AUTHORED SNAPSHOTS` or, after both repository-evidence gates pass, `REVISION-PINNED INPUTS`; it never claims risk, blast radius, safety, mergeability, or verified PR impact. No sixth diagram type, GitHub API, Git ref parser, LLM, Graphviz, hosted service, dependency, telemetry, or mobile product surface was added.- **Deployment Ownership Engineering Profile.** Architecture diagrams may opt into `meta.engineering_profile: "deployment-ownership"` when the user explicitly wants a fail-closed deployment review. The zero-dependency loader then requires named owners for every non-external component, exactly one region per workload, region and security-group boundaries, private placement for every database, one shared region per security group, and a real label for every connection that changes region/security-group membership. Human and JSON validate/deliver receipts name the passing profile; failures use stable diagnostic codes, exact subjects, evidence, and supported repairs. The Production Deployment proof now exercises the contract and publishes one compact Gallery receipt. The committed ZIP smoke is shared by Ubuntu, macOS, and Windows and runs doctor, all five validators, the deployment render/check path, atomic delivery, open fallback, and an invalid-schema rejection without installing dependencies. Profile-less v1 inputs remain unchanged, and the profile does not infer facts or claim repository/live-environment verification. No new renderer, diagram type, visual preset, dependency, hosted service, telemetry, or mobile product surface was added.- **First-class Cursor onboarding.** README EN/ZH, the landing quick start, and the generated Start surface now name Cursor beside Codex, Claude Code, and OpenCode while keeping one portable `archify/SKILL.md`. The Start page adds a URL-stable, keyboard-operable agent selector that produces explicit global and repository-local `skills` CLI commands with bounded scope and copy mode; it does not advertise the unsupported `skills use --agent cursor` launcher or promise one physical global directory. A pinned `[email protected]` canary verifies the canonical `.agents/skills/archify` package path, `doctor`, and all five zero-dependency validators. A fresh Cursor Agent CLI `2026.07.20-8cc9c0b` session then discovered that Skill, ran doctor, authored six-component typed Architecture JSON, and delivered a 9/9-check showcase artifact; independent browser review confirmed the main and failure paths, authored chapter, and zero console warnings/errors. No Cursor-only Skill, renderer, schema, hosted service, telemetry, or mobile surface was added.- **Structured Repair Receipt.** `archify validate --json` and `archify deliver --json` now return exactly one versioned JSON object on both success and failure. Each failure carries additive `diagnostics[]` with a stable rule code, severity, exact subject, measured evidence, and only renderer-supported repairs for input parsing, schema, repository evidence, Clean Flow, composition, artifact checks, and delivery stages; unclassified internal failures are explicit and offer no guessed fix. Human CLI and Last-Good Preview format the same facts without exposing Node stacks, while Atomic Verified Delivery still removes the candidate and preserves the prior artifact byte-for-byte. Five-mode schema fixtures, validate/deliver Clean Flow parity, evidence failure, checker failure, installed-skill smoke, and the existing two-round perceptual boundary are covered. No auto-fix, LLM call, retry expansion, schema/IR change, renderer geometry change, viewer panel, dependency, hosted service, telemetry, or mobile surface was added.diff --git a/README.md b/README.mdindex 315e06d5..4d55beec 100644--- a/README.md+++ b/README.md@@ -12,9 +12,10 @@**Turn a codebase or system description into a polished, interactive system map — directly in chat.**-Archify is an agent skill for Cursor, Claude Code, Codex CLI, and OpenCode. Give it a system description or repository; get a polished diagram you can open, explore, present, and share.+Archify is an agent skill for Cursor, Claude Code, Codex CLI, and OpenCode. Give it a system description or repository; get an interactive, shareable technical map.- **Open it and present** — five technical diagram types, three visual presets, dark/light themes, and optional finite motion+- **Review architecture changes before merge** — compare two validated snapshots as Before / Delta / After, with exact added, removed, changed, moved, and rerouted facts- **Every interaction stays grounded** — search nodes, optionally open revision-verified source, trace upstream/downstream authored reach and exact routes, compare roles, and play guided stories without inventing topology- **One file, ready to trust and share** — typed JSON IR and deterministic checks produce self-contained HTML plus PNG, SVG, WebM, and 1200×630 share cards@@ -53,7 +54,7 @@ The [Proof Lab](https://tt-a1i.github.io/archify/gallery.html) contains all 11 c[](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)-Archify read [`mco-org/mco`](https://github.com/mco-org/mco) at commit `9f1a1cf`, traced its CLI, policy, provider adapters, invocation runtime, and durable sessions, then produced this checked, interactive map. **[Open the live map ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [trace Command Router reach ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark#focus=router&reach=downstream) · [inspect the typed source](docs/cases/mco-runtime.architecture.json)+Archify traced [`mco-org/mco`](https://github.com/mco-org/mco) at `9f1a1cf` and produced this checked map. **[Open it ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [trace reach ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark#focus=router&reach=downstream) · [typed source](docs/cases/mco-runtime.architecture.json)## Preview@@ -69,11 +70,11 @@ The Export menu copies PNG to the clipboard and downloads static or motion formaUse **Copy Share Card** when you want a canonical 1200×630 image for a README, release, or social post.-After tracing a route, open **Export → Route Share Card** to download the exact authored path as a 1200×630 PNG while retaining the full diagram for context. It is an optional, download-only Share Card variant; ordinary exports remain canonical.+After tracing a route, **Export → Route Share Card** downloads that authored path as a 1200×630 PNG with the full diagram retained for context.-After tracing `Upstream` or `Downstream` authored reach, choose **Export → Reach Share Card** to turn that exact reading into a 1200×630 PNG. The card keeps the complete topology as context and names its direction, origin, nodes, links, and maximum hops—it does not claim runtime impact.+After tracing authored `Upstream` or `Downstream` reach, **Export → Reach Share Card** captures that exact reading without claiming runtime impact.@@ -136,6 +137,12 @@ single-region placement, private database scope, or named boundary crossingsare missing. It is never enabled silently and validates authored facts—not liveinfrastructure. See the [checked deployment proof](https://tt-a1i.github.io/archify/gallery.html#proof-deployment-ownership).+For design or PR review, Architecture Delta compares two validated sources as Before / Delta / After plus a machine receipt—never as risk or merge safety.++`node archify/bin/archify.mjs compare architecture base.json head.json architecture-delta.html --json`++[](examples/checkout-platform-delta.html)+Not sure which one fits? Use the [interactive scenario guide](https://tt-a1i.github.io/archify/guide.html), or ask the zero-dependency CLI:```bash@@ -253,7 +260,7 @@ The complete generation and viewer contract lives in [`archify/SKILL.md`](archif- [Roadmap](ROADMAP.md)- [Generated Proof Lab](https://tt-a1i.github.io/archify/gallery.html)-Archify 2.12 includes typed IR across all five modes, real-repository proof, verified live preview, authored reachability, optional finite motion, guided views, semantic search and relationship exploration, shareable deep links, 1200×630 diagram and route cards, browser-native WebM recording, explicit `standard` / `showcase` quality profiles, and an opt-in deployment ownership contract.+Archify 2.12 includes typed IR across all five modes, real-repository proof, deterministic Architecture Delta review, verified live preview, authored reachability, optional finite motion, guided views, semantic search and relationship exploration, shareable deep links, 1200×630 diagram and route cards, browser-native WebM recording, explicit `standard` / `showcase` quality profiles, and an opt-in deployment ownership contract.Automatic Mermaid parsing, general-purpose auto-layout, hosted sharing, and WYSIWYG editing are intentionally outside the current scope.diff --git a/README_EN.md b/README_EN.mdindex 315e06d5..4d55beec 100644--- a/README_EN.md+++ b/README_EN.md@@ -12,9 +12,10 @@**Turn a codebase or system description into a polished, interactive system map — directly in chat.**-Archify is an agent skill for Cursor, Claude Code, Codex CLI, and OpenCode. Give it a system description or repository; get a polished diagram you can open, explore, present, and share.+Archify is an agent skill for Cursor, Claude Code, Codex CLI, and OpenCode. Give it a system description or repository; get an interactive, shareable technical map.- **Open it and present** — five technical diagram types, three visual presets, dark/light themes, and optional finite motion+- **Review architecture changes before merge** — compare two validated snapshots as Before / Delta / After, with exact added, removed, changed, moved, and rerouted facts- **Every interaction stays grounded** — search nodes, optionally open revision-verified source, trace upstream/downstream authored reach and exact routes, compare roles, and play guided stories without inventing topology- **One file, ready to trust and share** — typed JSON IR and deterministic checks produce self-contained HTML plus PNG, SVG, WebM, and 1200×630 share cards@@ -53,7 +54,7 @@ The [Proof Lab](https://tt-a1i.github.io/archify/gallery.html) contains all 11 c[](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)-Archify read [`mco-org/mco`](https://github.com/mco-org/mco) at commit `9f1a1cf`, traced its CLI, policy, provider adapters, invocation runtime, and durable sessions, then produced this checked, interactive map. **[Open the live map ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [trace Command Router reach ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark#focus=router&reach=downstream) · [inspect the typed source](docs/cases/mco-runtime.architecture.json)+Archify traced [`mco-org/mco`](https://github.com/mco-org/mco) at `9f1a1cf` and produced this checked map. **[Open it ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [trace reach ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark#focus=router&reach=downstream) · [typed source](docs/cases/mco-runtime.architecture.json)## Preview@@ -69,11 +70,11 @@ The Export menu copies PNG to the clipboard and downloads static or motion formaUse **Copy Share Card** when you want a canonical 1200×630 image for a README, release, or social post.-After tracing a route, open **Export → Route Share Card** to download the exact authored path as a 1200×630 PNG while retaining the full diagram for context. It is an optional, download-only Share Card variant; ordinary exports remain canonical.+After tracing a route, **Export → Route Share Card** downloads that authored path as a 1200×630 PNG with the full diagram retained for context.-After tracing `Upstream` or `Downstream` authored reach, choose **Export → Reach Share Card** to turn that exact reading into a 1200×630 PNG. The card keeps the complete topology as context and names its direction, origin, nodes, links, and maximum hops—it does not claim runtime impact.+After tracing authored `Upstream` or `Downstream` reach, **Export → Reach Share Card** captures that exact reading without claiming runtime impact.@@ -136,6 +137,12 @@ single-region placement, private database scope, or named boundary crossingsare missing. It is never enabled silently and validates authored facts—not liveinfrastructure. See the [checked deployment proof](https://tt-a1i.github.io/archify/gallery.html#proof-deployment-ownership).+For design or PR review, Architecture Delta compares two validated sources as Before / Delta / After plus a machine receipt—never as risk or merge safety.++`node archify/bin/archify.mjs compare architecture base.json head.json architecture-delta.html --json`++[](examples/checkout-platform-delta.html)+Not sure which one fits? Use the [interactive scenario guide](https://tt-a1i.github.io/archify/guide.html), or ask the zero-dependency CLI:```bash@@ -253,7 +260,7 @@ The complete generation and viewer contract lives in [`archify/SKILL.md`](archif- [Roadmap](ROADMAP.md)- [Generated Proof Lab](https://tt-a1i.github.io/archify/gallery.html)-Archify 2.12 includes typed IR across all five modes, real-repository proof, verified live preview, authored reachability, optional finite motion, guided views, semantic search and relationship exploration, shareable deep links, 1200×630 diagram and route cards, browser-native WebM recording, explicit `standard` / `showcase` quality profiles, and an opt-in deployment ownership contract.+Archify 2.12 includes typed IR across all five modes, real-repository proof, deterministic Architecture Delta review, verified live preview, authored reachability, optional finite motion, guided views, semantic search and relationship exploration, shareable deep links, 1200×630 diagram and route cards, browser-native WebM recording, explicit `standard` / `showcase` quality profiles, and an opt-in deployment ownership contract.Automatic Mermaid parsing, general-purpose auto-layout, hosted sharing, and WYSIWYG editing are intentionally outside the current scope.diff --git a/README_ZH.md b/README_ZH.mdindex 3ced3d86..4da440b3 100644--- a/README_ZH.md+++ b/README_ZH.md@@ -8,9 +8,10 @@**在对话里,把代码仓库或系统描述变成漂亮、可靠、可交互的系统地图。**-Archify 是适用于 Cursor、Claude Code、Codex CLI 和 OpenCode 的 Agent Skill。给它一段系统描述或一个代码仓库,就能得到可打开、可探索、可演示、可分享的专业技术图。+Archify 是适用于 Cursor、Claude Code、Codex CLI 和 OpenCode 的 Agent Skill。给它系统描述或代码仓库,就能得到可交互、可分享的专业技术地图。- **打开就是成品** —— 五种技术图、三套视觉预设、深浅主题,以及显式启用的有限动态+- **合并前先看清架构变化** —— 把两份已校验快照对比为 Before / Delta / After,准确区分新增、删除、语义变化、移动和重路由- **每次探索都有依据** —— 搜索节点、按需打开版本校验过的源码、追踪作者定义的上下游可达范围与精确路径、对比角色、播放故事,但不编造拓扑- **一个文件即可放心交付** —— Typed JSON IR 和确定性校验生成独立 HTML,并支持 PNG、SVG、WebM 与 1200×630 分享卡片@@ -49,7 +50,7 @@ npx skills add tt-a1i/archify -g[](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)-Archify 读取 [`mco-org/mco`](https://github.com/mco-org/mco) 的 `9f1a1cf` 版本,追踪 CLI、执行策略、Provider Adapter、调用运行时和持久会话,最终生成这张校验通过、可交互的系统地图。**[打开可交互成品 ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [查看 Command Router 下游 ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark#focus=router&reach=downstream) · [查看 Typed Source](docs/cases/mco-runtime.architecture.json)+Archify 追踪 [`mco-org/mco`](https://github.com/mco-org/mco) 的 `9f1a1cf` 版本并生成这张校验地图。**[打开成品 ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [追踪下游 ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark#focus=router&reach=downstream) · [Typed Source](docs/cases/mco-runtime.architecture.json)## 预览@@ -65,11 +66,11 @@ Export 菜单支持复制 PNG,并下载静态或动态格式:需要用于 README、Release 或社交平台的标准 1200×630 图片时,使用 **Copy Share Card**。-路径解析完成后,打开 **Export → Route Share Card**,即可把这条真实有向路径下载为 1200×630 PNG,同时保留完整拓扑作为上下文。它是可选、仅下载的 Share Card 变体;普通导出仍保持 canonical。+路径解析后,**Export → Route Share Card** 会把真实路径下载为 1200×630 PNG,并保留完整拓扑上下文。-完成 `Upstream` 或 `Downstream` authored reach 后,选择 **Export → Reach Share Card**,即可把这次阅读结果变成 1200×630 PNG。卡片保留完整拓扑作为上下文,并写明方向、起点、节点数、关系数与最大跳数;它不会冒充运行时影响分析。+完成 authored `Upstream` 或 `Downstream` reach 后,**Export → Reach Share Card** 会捕获这次阅读结果,但不冒充运行时影响分析。@@ -131,6 +132,12 @@ Redis Session 查询 -> PostgreSQL 回源。把缓存未命中作为次要路径它不会被静默开启,只校验作者写入的事实,不代表线上基础设施已经核验。可查看[通过校验的部署证明](https://tt-a1i.github.io/archify/gallery.html#proof-deployment-ownership)。+做设计或 PR 评审时,Architecture Delta 把两份已校验源文件比较为 Before / Delta / After 和机器回执,不冒充风险或合并安全判断。++`node archify/bin/archify.mjs compare architecture base.json head.json architecture-delta.html --json`++[](examples/checkout-platform-delta.html)+不知道选哪一种?打开[交互式场景指南](https://tt-a1i.github.io/archify/guide.html),或直接询问零依赖 CLI:```bash@@ -252,7 +259,7 @@ Claude.ai 中的上传入口:- [路线图](ROADMAP.md)- [自动生成的 Proof Lab](https://tt-a1i.github.io/archify/gallery.html)-Archify 2.12 已覆盖五种 Typed IR、真实仓库证明、验证后实时预览、作者可达性、可选有限动态、引导视图、语义搜索与关系探索、可分享深链、1200×630 整图与路径卡片、浏览器原生 WebM、显式 `standard` / `showcase` 质量档位,以及按需启用的部署所有权契约。+Archify 2.12 已覆盖五种 Typed IR、真实仓库证明、确定性的 Architecture Delta 评审、验证后实时预览、作者可达性、可选有限动态、引导视图、语义搜索与关系探索、可分享深链、1200×630 整图与路径卡片、浏览器原生 WebM、显式 `standard` / `showcase` 质量档位,以及按需启用的部署所有权契约。自动 Mermaid Parser、通用自动布局、托管分享服务和 WYSIWYG 编辑器目前都不在产品范围内。diff --git a/archify.zip b/archify.zipindex eae1a87b..1718cffa 100644Binary files a/archify.zip and b/archify.zip differdiff --git a/archify/SKILL.md b/archify/SKILL.mdindex a2053fde..4ef0e4e0 100644--- a/archify/SKILL.md+++ b/archify/SKILL.md@@ -152,6 +152,8 @@ Choose the authored `meta.visual_preset` with the user by audience, without chanFor Architecture deployment reviews, choose `meta.engineering_profile: "deployment-ownership"` only after the user explicitly asks for a fail-closed deployment contract. Ordinary Architecture diagrams omit it. The profile requires every non-external component to name its owner in `tag` and belong to exactly one `region`; at least one `region` and one `security-group`; every `database` inside a security group; every security group contained within one shared region; and every connection that changes region/security-group membership to name its real boundary-crossing mechanism in `label`. It validates authored facts only. Never infer owners, regions, private placement, or crossing mechanisms, and never describe a passing profile as live-infrastructure or repository verification. `quality_profile` governs visual composition; `engineering_profile` governs this optional deployment contract.+Architecture Delta is also optional and never part of ordinary generation. Offer it when the user asks what changed between two existing Architecture snapshots, wants a design-review artifact, or wants authored architecture context for a PR. First ask the user to identify the exact base and head JSON files; do not choose a baseline silently. Explain that every `connection` on both sides needs a unique authored `id`, then run `node bin/archify.mjs compare architecture <base.json> <head.json> [output.html] --json`. Never add relationship IDs by matching labels or endpoints, and never interpret a changed ID as a rename. The command validates both snapshots independently, fails closed when they share no component ID or name different repositories, then produces deterministic Before / Delta / After HTML plus a sidecar receipt. Describe the result as an authored snapshot comparison (or revision-pinned inputs only when repository evidence passed on both sides), never as blast radius, risk, safety, mergeability, or verified PR impact.+### Workflow```jsondiff --git a/archify/bin/archify.mjs b/archify/bin/archify.mjsindex 7e5acce2..ee67845d 100755--- a/archify/bin/archify.mjs+++ b/archify/bin/archify.mjs@@ -15,6 +15,7 @@ const TYPES = new Set(['architecture', 'workflow', 'sequence', 'dataflow', 'lifefunction usage() {return `Usage:archify render <type> <input.json> [output.html] [--quality standard|showcase] [--repo-root path]+ archify compare architecture <base.json> <head.json> [output.html] [--receipt path] [--json] [--quality standard|showcase] [--repo-root path]archify deliver <type> <input.json> [output.html] [--json] [--open] [--quality standard|showcase] [--repo-root path]archify preview <type> <input.json> [output.html] [--no-open] [--quality standard|showcase] [--repo-root path]archify validate <type> <input.json> [--json] [--layout-json] [--quality standard|showcase] [--repo-root path]@@ -242,6 +243,286 @@ function exitFrom(result) {process.exit(result.status ?? 1);}+function reportCompareFailure({ json, stage, error, code = 'delta/internal', details = {}, status = 1 }) {+ const receipt = {+ schemaVersion: 1,+ ok: false,+ command: 'compare',+ type: 'architecture',+ stage,+ error,+ diagnostics: [{+ code,+ severity: 'error',+ message: error,+ subject: details.side ? { side: details.side, ...(details.path ? { path: details.path } : {}) } : {},+ evidence: Object.fromEntries(Object.entries(details).filter(([key]) => !['side', 'path', 'supportedFixes'].includes(key))),+ supportedFixes: details.supportedFixes || [],+ }],+ };+ if (json) console.log(JSON.stringify(receipt, null, 2));+ else console.error(formatDiagnostics(error, receipt.diagnostics));+ process.exitCode = status;+}++function extractCompareOptions(args) {+ const positional = [];+ let receipt;+ let json = false;+ for (let index = 0; index < args.length; index += 1) {+ const arg = args[index];+ if (arg === '--json') {+ json = true;+ continue;+ }+ if (arg === '--receipt') {+ receipt = args[index + 1];+ if (!receipt || receipt.startsWith('--')) fail('--receipt requires a JSON output path.');+ index += 1;+ continue;+ }+ if (arg.startsWith('--receipt=')) {+ receipt = arg.slice('--receipt='.length);+ if (!receipt) fail('--receipt requires a JSON output path.');+ continue;+ }+ if (arg.startsWith('--')) fail(`Unknown compare option "${arg}".`);+ positional.push(arg);+ }+ return { positional, receipt, json };+}++function compareReceiptPath(outputPath) {+ const extension = path.extname(outputPath);+ return extension ? `${outputPath.slice(0, -extension.length)}.receipt.json` : `${outputPath}.receipt.json`;+}++function renderValidatedArchitecture(inputPath, outputPath, quality, repoRoot) {+ const render = runNode([rendererPath('architecture'), inputPath, outputPath], {+ stdio: 'pipe',+ env: rendererEnv(quality, repoRoot, true),+ });+ if (render.status !== 0) {+ const failure = rendererFailure(render);+ const error = new Error(failure.error);+ error.compareStage = 'input';+ error.compareStatus = render.status ?? 1;+ error.diagnostics = failure.diagnostics;+ throw error;+ }+ const check = runNode([path.join(skillRoot, 'scripts/check-render-output.mjs'), outputPath], { stdio: 'pipe' });+ if (check.status !== 0) {+ const error = new Error('Validated snapshot failed final artifact checks.');+ error.compareStage = 'check';+ error.compareStatus = check.status ?? 1;+ try {+ error.checker = JSON.parse(check.stdout);+ error.diagnostics = checkerDiagnostics(error.checker);+ } catch {+ error.diagnostics = [];+ }+ throw error;+ }+ const artifact = fs.readFileSync(outputPath);+ return {+ artifact,+ html: artifact.toString('utf8'),+ checks: JSON.parse(check.stdout),+ sourceEvidence: sourceEvidenceFromArtifact(artifact),+ };+}++async function commandCompare(args) {+ const qualityArgs = extractQualityArgs(args);+ const repoArgs = extractRepoRootArgs(qualityArgs.rest);+ const options = extractCompareOptions(repoArgs.rest);+ const [type, baseInput, headInput, requestedOutput] = options.positional;+ if (type !== 'architecture' || !baseInput || !headInput || options.positional.length > 4) fail(usage());+ let deltaRuntime;+ try {+ deltaRuntime = await import(pathToFileURL(path.join(skillRoot, 'delta/architecture-delta.mjs')).href);+ } catch (error) {+ reportCompareFailure({ json: options.json, stage: 'prepare', error: 'Architecture compare runtime is unavailable.', code: 'delta/runtime-missing', details: { reason: error.message, supportedFixes: ['install the complete Archify skill package'] } });+ return;+ }+ const {+ ArchitectureDeltaError,+ annotateArchitectureSideSvg,+ buildDeltaSvg,+ canonicalArchitecture,+ canonicalArchitectureJson,+ compareArchitecture,+ extractArchitectureSvg,+ extractArtifactCss,+ renderArchitectureDeltaHtml,+ validateArchitectureDeltaHtml,+ } = deltaRuntime;++ const basePath = path.resolve(baseInput);+ const headPath = path.resolve(headInput);+ const outputPath = path.resolve(requestedOutput || 'architecture-delta.html');+ const receiptPath = path.resolve(options.receipt || compareReceiptPath(outputPath));+ if (outputPath === receiptPath) fail('Compare artifact and receipt must use different paths.');++ let baseBuffer;+ let headBuffer;+ let base;+ let head;+ try {+ baseBuffer = fs.readFileSync(basePath);+ base = JSON.parse(baseBuffer.toString('utf8'));+ } catch (error) {+ reportCompareFailure({ json: options.json, stage: 'input', error: `Could not read base input: ${error.message}`, code: 'delta/base-input', details: { side: 'base', reason: error.message } });+ return;+ }+ try {+ headBuffer = fs.readFileSync(headPath);+ head = JSON.parse(headBuffer.toString('utf8'));+ } catch (error) {+ reportCompareFailure({ json: options.json, stage: 'input', error: `Could not read head input: ${error.message}`, code: 'delta/head-input', details: { side: 'head', reason: error.message } });+ return;+ }++ const outputDirectory = path.dirname(outputPath);+ if (path.dirname(receiptPath) !== outputDirectory) {+ reportCompareFailure({ json: options.json, stage: 'prepare', error: 'The compare receipt must be written beside the HTML artifact.', code: 'delta/receipt-directory', details: { supportedFixes: ['choose a --receipt path in the same directory as output.html'] } });+ return;+ }+ try {+ fs.mkdirSync(outputDirectory, { recursive: true });+ } catch (error) {+ reportCompareFailure({ json: options.json, stage: 'prepare', error: `Could not create compare output directory: ${error.message}`, code: 'delta/output-directory', details: { reason: error.message } });+ return;+ }++ let stagingDirectory;+ try {+ stagingDirectory = fs.mkdtempSync(path.join(outputDirectory, '.archify-compare-'));+ } catch (error) {+ reportCompareFailure({ json: options.json, stage: 'prepare', error: `Could not create compare candidate: ${error.message}`, code: 'delta/candidate-directory', details: { reason: error.message } });+ return;+ }++ const baseCandidate = path.join(stagingDirectory, 'base.html');+ const headCandidate = path.join(stagingDirectory, 'head.html');+ const canonicalBaseInput = path.join(stagingDirectory, 'base.architecture.json');+ const canonicalHeadInput = path.join(stagingDirectory, 'head.architecture.json');+ const htmlCandidate = path.join(stagingDirectory, path.basename(outputPath));+ const receiptCandidate = path.join(stagingDirectory, path.basename(receiptPath));++ try {+ let baseResult;+ let headResult;+ fs.writeFileSync(canonicalBaseInput, JSON.stringify(canonicalArchitecture(base)));+ fs.writeFileSync(canonicalHeadInput, JSON.stringify(canonicalArchitecture(head)));+ try {+ baseResult = renderValidatedArchitecture(canonicalBaseInput, baseCandidate, qualityArgs.quality, repoArgs.repoRoot);+ } catch (error) {+ const diagnosticEntry = error.diagnostics?.[0];+ reportCompareFailure({+ json: options.json,+ stage: error.compareStage || 'validate',+ error: `Base snapshot failed validation: ${error.message}`,+ code: diagnosticEntry?.code || 'delta/base-validation',+ details: { side: 'base', ...(diagnosticEntry?.subject?.path ? { path: diagnosticEntry.subject.path } : {}), ...(diagnosticEntry?.evidence || {}), supportedFixes: diagnosticEntry?.supportedFixes || [] },+ status: error.compareStatus || 1,+ });+ return;+ }+ try {+ headResult = renderValidatedArchitecture(canonicalHeadInput, headCandidate, qualityArgs.quality, repoArgs.repoRoot);+ } catch (error) {+ const diagnosticEntry = error.diagnostics?.[0];+ reportCompareFailure({+ json: options.json,+ stage: error.compareStage || 'validate',+ error: `Head snapshot failed validation: ${error.message}`,+ code: diagnosticEntry?.code || 'delta/head-validation',+ details: { side: 'head', ...(diagnosticEntry?.subject?.path ? { path: diagnosticEntry.subject.path } : {}), ...(diagnosticEntry?.evidence || {}), supportedFixes: diagnosticEntry?.supportedFixes || [] },+ status: error.compareStatus || 1,+ });+ return;+ }++ const semanticHash = (diagram) => createHash('sha256').update(canonicalArchitectureJson(diagram)).digest('hex');+ let compareIr;+ try {+ compareIr = compareArchitecture(base, head, {+ baseRawSha256: createHash('sha256').update(baseBuffer).digest('hex'),+ headRawSha256: createHash('sha256').update(headBuffer).digest('hex'),+ baseSemanticSha256: semanticHash(base),+ headSemanticSha256: semanticHash(head),+ baseBytes: baseBuffer.byteLength,+ headBytes: headBuffer.byteLength,+ baseVerified: Boolean(baseResult.sourceEvidence),+ headVerified: Boolean(headResult.sourceEvidence),+ });+ } catch (error) {+ if (!(error instanceof ArchitectureDeltaError)) throw error;+ reportCompareFailure({ json: options.json, stage: 'compare', error: error.message, code: error.code, details: error.details });+ return;+ }++ const baseSourceSvg = extractArchitectureSvg(baseResult.html);+ const headSourceSvg = extractArchitectureSvg(headResult.html);+ const baseSvg = annotateArchitectureSideSvg(baseSourceSvg, compareIr, 'base');+ const headSvg = annotateArchitectureSideSvg(headSourceSvg, compareIr, 'head');+ const deltaSvg = buildDeltaSvg(baseSourceSvg, headSourceSvg, compareIr);+ // Raw input hashes and byte counts belong in the sidecar receipt, not the+ // artifact. Keeping them out makes formatting-only input rewrites produce+ // the exact same canonical review HTML and artifact hash.+ const artifactIr = {+ ...compareIr,+ base: Object.fromEntries(Object.entries(compareIr.base).filter(([key]) => !['rawSha256', 'bytes'].includes(key))),+ head: Object.fromEntries(Object.entries(compareIr.head).filter(([key]) => !['rawSha256', 'bytes'].includes(key))),+ };+ const html = renderArchitectureDeltaHtml({+ receipt: artifactIr,+ baseSvg,+ deltaSvg,+ headSvg,+ artifactCss: extractArtifactCss(headResult.html),+ });+ const deltaValidation = validateArchitectureDeltaHtml(html, artifactIr);+ fs.writeFileSync(htmlCandidate, html);+ const artifact = fs.readFileSync(htmlCandidate);+ const baseChecks = baseResult.checks.checks.filter((check) => check.ok).length;+ const headChecks = headResult.checks.checks.filter((check) => check.ok).length;+ const finalReceipt = {+ ...compareIr,+ artifact: { sha256: createHash('sha256').update(artifact).digest('hex'), bytes: artifact.byteLength },+ validation: {+ checksPassed: baseChecks + headChecks + deltaValidation.checksPassed,+ checkCount: baseResult.checks.checks.length + headResult.checks.checks.length + deltaValidation.checkCount,+ baseComposition: baseResult.checks.composition.status,+ headComposition: headResult.checks.composition.status,+ },+ };+ fs.writeFileSync(receiptCandidate, `${JSON.stringify(finalReceipt, null, 2)}\n`);++ fs.renameSync(htmlCandidate, outputPath);+ fs.renameSync(receiptCandidate, receiptPath);+ if (options.json) console.log(JSON.stringify(finalReceipt, null, 2));+ else {+ console.log(`compared architecture ${outputPath}`);+ console.log(`${finalReceipt.validation.checksPassed}/${finalReceipt.validation.checkCount} checks; completeness ${finalReceipt.completeness}; ${finalReceipt.proofLevel}; sha256 ${finalReceipt.artifact.sha256.slice(0, 12)}`);+ console.log(`receipt ${receiptPath}`);+ }+ } catch (error) {+ if (error instanceof ArchitectureDeltaError) {+ reportCompareFailure({ json: options.json, stage: 'artifact', error: error.message, code: error.code, details: error.details });+ } else {+ reportCompareFailure({ json: options.json, stage: 'internal', error: 'Architecture compare failed before commit.', code: 'delta/internal', details: { reason: error.message } });+ }+ } finally {+ try {+ fs.rmSync(stagingDirectory, { recursive: true, force: true });+ } catch (error) {+ console.error(`Warning: could not remove compare staging directory: ${error.message}`);+ }+ }+}+function commandRender(args) {const qualityArgs = extractQualityArgs(args);const repoArgs = extractRepoRootArgs(qualityArgs.rest);@@ -672,6 +953,18 @@ async function commandDoctor() {missing: fs.existsSync(scenarioGuide) ? 0 : 1,});+ const compareRuntime = path.join(skillRoot, 'delta/architecture-delta.mjs');+ const compareFixtures = [+ path.join(skillRoot, 'examples/checkout-platform.base.architecture.json'),+ path.join(skillRoot, 'examples/checkout-platform.head.architecture.json'),+ ];+ const compareMissing = [compareRuntime, ...compareFixtures].filter((file) => !fs.existsSync(file)).length;+ checks.push({+ label: 'Architecture compare runtime and proof fixtures',+ ok: compareMissing === 0,+ missing: compareMissing,+ });+const validators = path.join(skillRoot, 'renderers/shared/generated-validators.mjs');const validatorsExist = fs.existsSync(validators);let validatorsValid = false;@@ -930,6 +1223,9 @@ switch (command) {case 'render':commandRender(args);break;+ case 'compare':+ await commandCompare(args);+ break;case 'deliver':await commandDeliver(args);break;diff --git a/archify/delta/architecture-delta.mjs b/archify/delta/architecture-delta.mjsnew file mode 100644index 00000000..5a6eed92--- /dev/null+++ b/archify/delta/architecture-delta.mjs@@ -0,0 +1,593 @@+const COMPARATOR_VERSION = 1;+const CANONICAL_VERSION = 1;++export class ArchitectureDeltaError extends Error {+ constructor(code, message, details = {}) {+ super(message);+ this.name = 'ArchitectureDeltaError';+ this.code = code;+ this.details = details;+ }+}++const codepointOrder = (left, right) => (left < right ? -1 : left > right ? 1 : 0);+const sorted = (values) => [...values].sort((left, right) => codepointOrder(String(left), String(right)));++function canonical(value) {+ if (Array.isArray(value)) return `[${value.map(canonical).join(',')}]`;+ if (value && typeof value === 'object') {+ return `{${Object.keys(value).sort(codepointOrder).map((key) => `${JSON.stringify(key)}:${canonical(value[key])}`).join(',')}}`;+ }+ return JSON.stringify(value);+}++const equal = (left, right) => canonical(left) === canonical(right);++function sortedObjects(values) {+ return [...values].sort((left, right) => codepointOrder(canonical(left), canonical(right)));+}++function sortedBy(values, keyFor) {+ return [...values].sort((left, right) => codepointOrder(String(keyFor(left)), String(keyFor(right))));+}++function normalizeRepository(repository) {+ if (!repository) return undefined;+ return {+ url: String(repository.url || '').trim().replace(/\.git\/?$/i, '').replace(/\/$/, '').toLowerCase(),+ revision: String(repository.revision || '').toLowerCase(),+ };+}++function normalizeComponent(component) {+ return {+ ...component,+ ...(Array.isArray(component.sources) ? { sources: sortedObjects(component.sources) } : {}),+ };+}++function normalizeBoundary(boundary) {+ return { ...boundary, wraps: sorted(boundary.wraps || []) };+}++export function canonicalArchitecture(diagram) {+ const meta = { ...(diagram.meta || {}) };+ delete meta.output;+ if (meta.repository) meta.repository = normalizeRepository(meta.repository);+ return {+ schema_version: diagram.schema_version,+ diagram_type: diagram.diagram_type,+ meta,+ ...(diagram.layout ? { layout: diagram.layout } : {}),+ components: sortedBy((diagram.components || []).map(normalizeComponent), (component) => component.id),+ boundaries: sortedBy((diagram.boundaries || []).map(normalizeBoundary), boundaryKey),+ connections: sortedBy(diagram.connections || [], (connection) => connection.id || ''),+ ...(diagram.cards ? { cards: diagram.cards } : {}),+ };+}++export function canonicalArchitectureJson(diagram) {+ return canonical(canonicalArchitecture(diagram));+}++function fail(code, message, details) {+ throw new ArchitectureDeltaError(code, message, details);+}++function requireComparableShape(diagram, side) {+ if (diagram?.schema_version !== 1) {+ fail('delta/schema-version-mismatch', `${side} must use schema_version 1.`, { side, path: '/schema_version', actual: diagram?.schema_version });+ }+ if (diagram?.diagram_type !== 'architecture') {+ fail('delta/type-mismatch', `${side} must use diagram_type architecture.`, { side, path: '/diagram_type', actual: diagram?.diagram_type });+ }+}++function stableIndex(items, collection, side, missingCode = 'delta/stable-id-required') {+ const index = new Map();+ const missing = [];+ const duplicates = [];+ (items || []).forEach((item, itemIndex) => {+ if (!item?.id) missing.push(`/${collection}/${itemIndex}/id`);+ else if (index.has(item.id)) duplicates.push(item.id);+ else index.set(item.id, item);+ });+ if (missing.length) {+ fail(missingCode, `${side} ${collection} require authored stable ids for comparison.`, {+ side,+ paths: sorted(missing),+ supportedFixes: [`add a unique id to every ${collection} item`],+ });+ }+ if (duplicates.length) {+ fail('delta/duplicate-stable-id', `${side} ${collection} contain duplicate ids.`, {+ side,+ collection,+ ids: sorted(new Set(duplicates)),+ supportedFixes: [`make every ${collection} id unique`],+ });+ }+ return index;+}++const boundaryKey = (boundary) => `${boundary.kind}\u001f${boundary.label}`;++function boundaryIndex(boundaries, side) {+ const index = new Map();+ const ambiguous = [];+ for (const boundary of boundaries || []) {+ const key = boundaryKey(boundary);+ if (index.has(key)) ambiguous.push(`${boundary.kind}:${boundary.label}`);+ else index.set(key, boundary);+ }+ if (ambiguous.length) {+ fail('delta/boundary-key-ambiguous', `${side} boundary kind + label keys must be unique.`, {+ side,+ boundaries: sorted(new Set(ambiguous)),+ supportedFixes: ['rename one duplicate boundary or add stable boundary ids in a future schema version'],+ });+ }+ return index;+}++function normalizedField(item, field) {+ const value = item?.[field];+ if (field === 'sources' && Array.isArray(value)) return sortedObjects(value);+ if (field === 'wraps' && Array.isArray(value)) return sorted(value);+ return value;+}++function fieldChanges(before, after, groups) {+ const classifications = [];+ const changedFields = [];+ for (const [classification, fields] of Object.entries(groups)) {+ const changed = fields.filter((field) => !equal(normalizedField(before, field), normalizedField(after, field)));+ if (changed.length) classifications.push(classification);+ changedFields.push(...changed.map((field) => `/${field}`));+ }+ return { classifications: sorted(classifications), changedFields: sorted(changedFields) };+}++const COMPONENT_FIELDS = {+ semantic: ['type', 'label', 'sublabel', 'tag'],+ evidence: ['sources'],+ geometry: ['row', 'col', 'pos', 'size'],+};+const CONNECTION_FIELDS = {+ topology: ['from', 'to'],+ semantic: ['label', 'variant'],+ geometry: ['fromSide', 'toSide', 'route', 'via', 'labelAt', 'labelDx', 'labelDy', 'labelSegment', 'width'],+};+const BOUNDARY_FIELDS = { scope: ['wraps'], geometry: ['pad'] };++function statusFor(classifications, kind) {+ if (classifications.some((value) => ['topology', 'semantic', 'scope'].includes(value))) return 'changed';+ if (classifications.includes('evidence')) return 'evidence-changed';+ if (classifications.includes('geometry')) return kind === 'connection' ? 'rerouted' : kind === 'component' ? 'moved' : 'geometry-changed';+ return 'same';+}++function compareEntities(baseIndex, headIndex, kind, groups, describe) {+ const changes = [];+ const identityClassification = kind === 'connection' ? 'topology' : kind === 'boundary' ? 'scope' : 'semantic';+ for (const id of sorted(new Set([...baseIndex.keys(), ...headIndex.keys()]))) {+ const base = baseIndex.get(id);+ const head = headIndex.get(id);+ if (!base) changes.push({ ...describe(id, undefined, head), status: 'added', classifications: [identityClassification], changedFields: [] });+ else if (!head) changes.push({ ...describe(id, base, undefined), status: 'removed', classifications: [identityClassification], changedFields: [] });+ else {+ const fields = fieldChanges(base, head, groups);+ const status = statusFor(fields.classifications, kind);+ if (status !== 'same') changes.push({ ...describe(id, base, head), status, ...fields });+ }+ }+ return changes;+}++function summaryFor(changes, shape) {+ const summary = Object.fromEntries(shape.map((key) => [key, 0]));+ for (const change of changes) {+ const key = change.status.replace(/-([a-z])/g, (_all, letter) => letter.toUpperCase());+ if (Object.hasOwn(summary, key)) summary[key] += 1;+ }+ return summary;+}++function presentationChanged(base, head) {+ const basePresentation = {+ title: base.meta?.title,+ subtitle: base.meta?.subtitle,+ animation: base.meta?.animation,+ visual_preset: base.meta?.visual_preset,+ quality_profile: base.meta?.quality_profile,+ engineering_profile: base.meta?.engineering_profile,+ views: base.meta?.views,+ viewBox: base.meta?.viewBox,+ layout: base.layout,+ cards: base.cards,+ };+ const headPresentation = {+ title: head.meta?.title,+ subtitle: head.meta?.subtitle,+ animation: head.meta?.animation,+ visual_preset: head.meta?.visual_preset,+ quality_profile: head.meta?.quality_profile,+ engineering_profile: head.meta?.engineering_profile,+ views: head.meta?.views,+ viewBox: head.meta?.viewBox,+ layout: head.layout,+ cards: head.cards,+ };+ return !equal(basePresentation, headPresentation);+}++export function compareArchitecture(base, head, evidence = {}) {+ requireComparableShape(base, 'base');+ requireComparableShape(head, 'head');+ const baseComponents = stableIndex(base.components, 'components', 'base');+ const headComponents = stableIndex(head.components, 'components', 'head');+ const shared = sorted([...baseComponents.keys()].filter((id) => headComponents.has(id)));+ if (!shared.length) {+ fail('delta/no-shared-component-id', 'The snapshots share no component id, so Archify cannot prove that they describe the same system.', {+ supportedFixes: ['preserve at least one authored component id across snapshots'],+ });+ }++ const baseConnections = stableIndex(base.connections, 'connections', 'base', 'delta/relationship-id-required');+ const headConnections = stableIndex(head.connections, 'connections', 'head', 'delta/relationship-id-required');+ const baseBoundaries = boundaryIndex(base.boundaries, 'base');+ const headBoundaries = boundaryIndex(head.boundaries, 'head');++ const baseRepository = normalizeRepository(base.meta?.repository);+ const headRepository = normalizeRepository(head.meta?.repository);+ if (baseRepository && headRepository && baseRepository.url !== headRepository.url) {+ fail('delta/repository-mismatch', 'The snapshots name different repositories.', {+ baseRepository: baseRepository.url,+ headRepository: headRepository.url,+ supportedFixes: ['compare snapshots from the same repository or remove repository evidence from both inputs'],+ });+ }+ const proofLevel = baseRepository && headRepository+ && evidence.baseVerified && evidence.headVerified+ && /^[a-f0-9]{40}$/.test(baseRepository.revision)+ && /^[a-f0-9]{40}$/.test(headRepository.revision)+ ? 'revision-pinned'+ : 'authored';++ const components = compareEntities(baseComponents, headComponents, 'component', COMPONENT_FIELDS, (id, before, after) => ({+ id,+ baseLabel: before?.label,+ headLabel: after?.label,+ }));+ const connections = compareEntities(baseConnections, headConnections, 'connection', CONNECTION_FIELDS, (id, before, after) => ({+ id,+ ...(before ? { base: { from: before.from, to: before.to, label: before.label || '' } } : {}),+ ...(after ? { head: { from: after.from, to: after.to, label: after.label || '' } } : {}),+ }));+ const boundaries = compareEntities(baseBoundaries, headBoundaries, 'boundary', BOUNDARY_FIELDS, (_key, before, after) => ({+ key: `${(after || before).kind}:${(after || before).label}`,+ kind: (after || before).kind,+ label: (after || before).label,+ }));+ const provenanceChanged = !equal(baseRepository, headRepository);++ return {+ schemaVersion: 1,+ ok: true,+ command: 'compare',+ type: 'architecture',+ comparatorVersion: COMPARATOR_VERSION,+ canonicalVersion: CANONICAL_VERSION,+ completeness: 'complete',+ proofLevel,+ base: {+ title: base.meta?.title || '',+ ...(evidence.baseRawSha256 ? { rawSha256: evidence.baseRawSha256 } : {}),+ ...(evidence.baseSemanticSha256 ? { semanticSha256: evidence.baseSemanticSha256 } : {}),+ ...(Number.isInteger(evidence.baseBytes) ? { bytes: evidence.baseBytes } : {}),+ ...(baseRepository?.revision ? { revision: baseRepository.revision } : {}),+ },+ head: {+ title: head.meta?.title || '',+ ...(evidence.headRawSha256 ? { rawSha256: evidence.headRawSha256 } : {}),+ ...(evidence.headSemanticSha256 ? { semanticSha256: evidence.headSemanticSha256 } : {}),+ ...(Number.isInteger(evidence.headBytes) ? { bytes: evidence.headBytes } : {}),+ ...(headRepository?.revision ? { revision: headRepository.revision } : {}),+ },+ summary: {+ components: summaryFor(components, ['added', 'changed', 'evidenceChanged', 'removed', 'moved']),+ connections: summaryFor(connections, ['added', 'changed', 'removed', 'rerouted']),+ boundaries: summaryFor(boundaries, ['added', 'changed', 'removed', 'geometryChanged']),+ presentationChanged: presentationChanged(base, head),+ provenanceChanged,+ },+ changes: { components, connections, boundaries },+ identity: {+ components: 'components[].id',+ connections: 'connections[].id (required)',+ boundaries: 'boundaries[].kind + boundaries[].label (derived)',+ },+ view: { visualPreset: head.meta?.visual_preset || 'classic' },+ limitations: [+ 'Authored Architecture IR only; no runtime impact, causality, risk, or mergeability is inferred.',+ 'Boundary identity is conservatively derived from kind + label.',+ ],+ };+}++function esc(value) {+ return String(value ?? '').replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll("'", ''');+}++const safeJson = (value) => JSON.stringify(value, null, 2).replaceAll('<', '\\u003c').replaceAll('>', '\\u003e').replaceAll('&', '\\u0026');++export function extractArchitectureSvg(html) {+ const match = html.match(/<svg viewBox="0 0 [^"]+" role="img"[\s\S]*?<\/svg>/);+ if (!match) fail('delta/svg-missing', 'A validated Architecture artifact did not contain its primary SVG.');+ return match[0];+}++export function extractArtifactCss(html) {+ const match = html.match(/<style>([\s\S]*?)<\/style>/);+ if (!match) fail('delta/css-missing', 'A validated Architecture artifact did not contain its stylesheet.');+ return match[1];+}++function changeMap(changes) {+ return new Map(changes.map((change) => [change.id, change]));+}++function boundaryChangeMap(changes) {+ return new Map(changes.map((change) => [`${change.kind}:${esc(change.label)}`, change]));+}++function addState(tag, change, side, forcedState) {+ const append = (attributes) => tag.endsWith('/>')+ ? tag.replace(/\/>$/, `${attributes}/>`)+ : tag.replace(/>$/, `${attributes}>`);+ if (!change && !forcedState) return append(' data-delta-state="same"');+ let state = forcedState || change.status;+ if (change?.status === 'added' && side === 'base') state = 'same';+ if (change?.status === 'removed' && side === 'head') state = 'same';+ const classes = change?.classifications?.join(',') || '';+ return append(` data-delta-state="${esc(state)}"${classes ? ` data-delta-classifications="${esc(classes)}"` : ''}`);+}++function markerFor(state) {+ return ({ added: '+', removed: '−', changed: '~', moved: '↔', 'moved-from': '↔', rerouted: '↔', 'evidence-changed': 'E' })[state] || '';+}++function addNodeMarker(group, state) {+ const symbol = markerFor(state);+ if (!symbol) return group;+ const box = group.match(/<rect x="([^"]+)" y="([^"]+)" width="([^"]+)"/);+ if (!box) return group;+ const x = Number(box[1]) + Number(box[3]) - 9;+ const y = Number(box[2]) + 9;+ return group.replace(/<\/g>$/, `\n <g class="delta-node-marker" aria-hidden="true"><circle cx="${x}" cy="${y}" r="8"/><text x="${x}" y="${y + 3}" text-anchor="middle">${symbol}</text></g>\n </g>`);+}++function prefixSvgIds(svg, prefix) {+ const ids = [...svg.matchAll(/\sid="([^"]+)"/g)].map((match) => match[1]);+ let result = svg.replace(/(\s)id="([^"]+)"/g, (_match, space, id) => `${space}id="${prefix}-${id}"`);+ for (const id of ids) {+ result = result.replaceAll(`url(#${id})`, `url(#${prefix}-${id})`).replaceAll(`href="#${id}"`, `href="#${prefix}-${id}"`);+ }+ result = result.replace(/aria-labelledby="([^"]+)"/g, (_match, value) => `aria-labelledby="${value.split(/\s+/).map((id) => `${prefix}-${id}`).join(' ')}"`);+ return result;+}++function staticize(svg) {+ return svg.replaceAll('tabindex="0" role="button"', 'role="group"').replaceAll(' aria-pressed="false"', '').replaceAll('aria-label="Focus ', 'aria-label="');+}++function nodeGroupRanges(svg) {+ const ranges = [];+ const opener = /<g\s+[^>]*\bdata-node-id="([^"]+)"[^>]*>/g;+ let open;+ while ((open = opener.exec(svg))) {+ const tags = /<\/?g\b[^>]*>/g;+ tags.lastIndex = open.index;+ let depth = 0;+ let tag;+ while ((tag = tags.exec(svg))) {+ depth += tag[0].startsWith('</') ? -1 : 1;+ if (depth === 0) {+ ranges.push({ id: open[1], start: open.index, end: tags.lastIndex });+ opener.lastIndex = tags.lastIndex;+ break;+ }+ }+ }+ return ranges;+}++function transformNodeGroups(svg, transform) {+ const ranges = nodeGroupRanges(svg);+ let cursor = 0;+ const parts = [];+ for (const range of ranges) {+ parts.push(svg.slice(cursor, range.start));+ parts.push(transform(svg.slice(range.start, range.end), range.id));+ cursor = range.end;+ }+ parts.push(svg.slice(cursor));+ return parts.join('');+}++const BOUNDARY_PAIR_RE = /<rect data-graph-role="structural-frame"[^>]*data-composition-frame-kind="([^"]+)"[^>]*\/>\s*<text[^>]*>([^<]+)<\/text>/g;++function transformBoundaryPairs(svg, transform) {+ return svg.replace(BOUNDARY_PAIR_RE, (pair, kind, label) => transform(pair, `${kind}:${label}`));+}++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) => {+ const change = boundaries.get(key);+ if (!change) return pair;+ return pair+ .replace(/^<rect[^>]+\/>/, (tag) => addState(tag, change, side))+ .replace(/<text[^>]*>/, (tag) => tag.replace(/>$/, ` data-delta-boundary-state="${change.status}">`));+ });+ result = transformNodeGroups(result, (group, id) => {+ const change = nodes.get(id);+ if ((side === 'base' && change?.status === 'added') || (side === 'head' && change?.status === 'removed')) return group;+ const tagged = group.replace(/^<g[^>]+>/, (tag) => addState(tag, change, side));+ return addNodeMarker(tagged, change?.status);+ });+ result = result.replace(/<(?:path|g)\s+[^>]*\bdata-edge-id="([^"]+)"[^>]*>/g, (tag, id) => addState(tag, edges.get(id), side));+ return prefixSvgIds(staticize(result), side);+}++function elementById(svg, kind, id) {+ const safe = id.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');+ if (kind === 'node') {+ const range = nodeGroupRanges(svg).find((candidate) => candidate.id === id);+ return range ? svg.slice(range.start, range.end) : '';+ }+ const path = svg.match(new RegExp(`<path\\s+[^>]*\\bdata-edge-id="${safe}"[^>]*/>`))?.[0] || '';+ const label = svg.match(new RegExp(`<g\\s+[^>]*\\bdata-edge-id="${safe}"[^>]*>[\\s\\S]*?<\\/g>`))?.[0] || '';+ return [path, label].filter(Boolean).join('\n');+}++function forceElementState(markup, state) {+ let result;+ if (markup.includes('data-node-id=')) {+ result = markup.replace(/^<g\s+[^>]*>/, (tag) => addState(tag, undefined, 'delta', state));+ } else {+ result = markup+ .replace(/<path\s+[^>]*\bdata-edge-id="[^"]+"[^>]*\/>/g, (tag) => addState(tag, undefined, 'delta', state))+ .replace(/<g\s+[^>]*\bdata-edge-id="[^"]+"[^>]*>/g, (tag) => addState(tag, undefined, 'delta', state));+ }+ result = result.replace(/\bid="node-/, 'id="base-node-');+ if (markup.includes('data-node-id=')) result = addNodeMarker(result, state);+ 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 forceBoundaryState(markup, state) {+ return markup+ .replace(/^<rect[^>]+\/>/, (tag) => addState(tag, undefined, 'delta', state))+ .replace(/<text[^>]*>/, (tag) => tag.replace(/>$/, ` data-delta-boundary-state="${state}">`));+}++function viewBoxSize(svg) {+ const match = svg.match(/viewBox="0 0 ([\d.]+) ([\d.]+)"/);+ return match ? [Number(match[1]), Number(match[2])] : [0, 0];+}++function edgeSymbolMarkup(markup, state) {+ const symbol = markerFor(state);+ const point = markup.match(/data-composition-points="([\d.-]+),([\d.-]+)/);+ if (!symbol || !point) return '';+ return `<text class="delta-edge-marker" data-delta-state="${state}" x="${Number(point[1]) + 9}" y="${Number(point[2]) - 7}" aria-hidden="true">${symbol}</text>`;+}++export function buildDeltaSvg(baseSvg, headSvg, receipt) {+ const [baseW, baseH] = viewBoxSize(baseSvg);+ const [headW, headH] = viewBoxSize(headSvg);+ const nodes = changeMap(receipt.changes.components);+ const edges = changeMap(receipt.changes.connections);+ const boundaries = boundaryChangeMap(receipt.changes.boundaries);+ const baseNodePhantoms = [];+ const baseEdgePhantoms = [];+ const baseBoundaryPhantoms = [];+ const edgeMarkers = [];++ for (const change of nodes.values()) {+ if (change.status === 'removed') baseNodePhantoms.push(forceElementState(elementById(baseSvg, 'node', change.id), 'removed'));+ else if (change.classifications.includes('geometry')) baseNodePhantoms.push(forceElementState(elementById(baseSvg, 'node', change.id), 'moved-from'));+ }+ for (const change of edges.values()) {+ if (change.status === 'removed' || change.classifications.includes('topology')) {+ const phantom = forceElementState(elementById(baseSvg, 'edge', change.id), 'removed');+ baseEdgePhantoms.push(phantom);+ edgeMarkers.push(edgeSymbolMarkup(phantom, 'removed'));+ } else if (change.status === 'rerouted') {+ const phantom = forceElementState(elementById(baseSvg, 'edge', change.id), 'moved-from');+ baseEdgePhantoms.push(phantom);+ edgeMarkers.push(edgeSymbolMarkup(phantom, 'moved-from'));+ }+ }+ for (const change of boundaries.values()) {+ const renderedKey = `${change.kind}:${esc(change.label)}`;+ if (change.status === 'removed') baseBoundaryPhantoms.push(forceBoundaryState(boundaryPairByKey(baseSvg, renderedKey), 'removed'));+ else if (change.status === 'changed' || change.status === 'geometry-changed') {+ baseBoundaryPhantoms.push(forceBoundaryState(boundaryPairByKey(baseSvg, renderedKey), 'moved-from'));+ }+ }++ 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(' <!-- 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 -->`);++ for (const change of edges.values()) {+ if (change.status === 'added' || change.status === 'changed' || change.status === 'rerouted') {+ const current = elementById(delta, 'edge', change.id);+ edgeMarkers.push(edgeSymbolMarkup(current, change.status === 'changed' && change.classifications.includes('topology') ? 'added' : change.status));+ }+ }+ delta = delta.replace(' <!-- Legend -->', ` <!-- Delta relationship symbols -->\n${edgeMarkers.filter(Boolean).join('\n')}\n\n <!-- Legend -->`);+ return prefixSvgIds(staticize(delta), 'delta');+}++function changeRows(receipt) {+ const rows = [];+ for (const change of receipt.changes.components) rows.push({ kind: 'Component', id: change.id, ...change });+ for (const change of receipt.changes.connections) rows.push({ kind: 'Relationship', id: change.id, ...change });+ for (const change of receipt.changes.boundaries) rows.push({ kind: 'Boundary', id: change.key, ...change });+ return rows.sort((left, right) => codepointOrder(`${left.status}:${left.kind}:${left.id}`, `${right.status}:${right.kind}:${right.id}`));+}++const total = (summary, key) => summary.components[key] + summary.connections[key] + summary.boundaries[key];++export function renderArchitectureDeltaHtml({ receipt, baseSvg, deltaSvg, headSvg, artifactCss }) {+ const rows = changeRows(receipt);+ const changed = total(receipt.summary, 'changed');+ const proof = receipt.proofLevel === 'revision-pinned' ? 'REVISION-PINNED INPUTS' : 'AUTHORED SNAPSHOTS';+ const rowHtml = rows.length ? rows.map((row) => `<li data-change-status="${esc(row.status)}"><span class="token">${esc(markerFor(row.status) || '~')}</span><span>${esc(row.kind)}</span><strong>${esc(row.headLabel || row.baseLabel || row.label || row.id)}</strong><code>${esc(row.id)}</code><span>${esc(row.classifications.join(', '))}</span><span>${esc(row.changedFields.join(', ') || 'identity')}</span></li>`).join('\n') : '<li class="empty">No authored architecture changes.</li>';+ const html = `<!doctype html>+<html lang="en" data-theme="dark" data-preset="${esc(receipt.view.visualPreset)}">+<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${esc(receipt.head.title)} Architecture Delta</title>+<style>+${artifactCss}+:root{color-scheme:dark;--d-add:#34d399;--d-remove:#fb7185;--d-change:#fbbf24;--d-move:#7dd3fc;--d-ink:#e6edf5;--d-muted:#8aa0b5;--d-line:#25384a}+*{box-sizing:border-box}body{min-width:1080px;margin:0;background:#071019;color:var(--d-ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}.proof-page{width:min(1600px,calc(100vw - 64px));margin:auto;padding:30px 0 42px}.proof-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:28px;align-items:end;padding-bottom:20px;border-bottom:1px solid var(--d-line)}.eyebrow{margin:0 0 8px;color:#7dd3fc;font:700 11px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.14em}.proof-head h1{margin:0;font-size:clamp(32px,4vw,56px);line-height:.96;letter-spacing:-.04em}.subtitle{margin:12px 0 0;color:var(--d-muted);font-size:14px}.metrics{display:flex;gap:9px}.metric{min-width:86px;padding:11px 13px;border:1px solid var(--d-line);border-radius:8px;background:#0b1722}.metric strong{display:block;font:700 23px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.metric span{display:block;margin-top:6px;color:var(--d-muted);font:700 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.1em}.add strong{color:var(--d-add)}.remove strong{color:var(--d-remove)}.change strong{color:var(--d-change)}+.proof-tools{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:16px 0}.view-switch{display:inline-flex;padding:3px;border:1px solid var(--d-line);border-radius:8px;background:#0a141e}.view-switch button,.utility{border:0;border-radius:6px;background:transparent;color:var(--d-muted);padding:8px 14px;font:700 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;cursor:pointer}.view-switch button[aria-selected="true"]{background:#173047;color:#fff}.utility{border:1px solid var(--d-line)}.legend{display:flex;gap:16px;color:var(--d-muted);font:650 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.legend span{display:inline-flex;align-items:center;gap:6px}.legend i{width:22px;border-top:3px solid currentColor}.legend .add{color:var(--d-add)}.legend .remove{color:var(--d-remove)}.legend .remove i{border-top-style:dashed}.legend .change{color:var(--d-change)}.legend .change i{border-top-style:dotted}.legend .move{color:var(--d-move)}.legend .move i{border-top-style:double}+.canvas{overflow:hidden;border:1px solid var(--d-line);border-radius:10px;background:#09141e;padding:12px;min-height:520px}.canvas svg{display:block;width:100%;height:auto;max-height:72vh}.canvas[hidden]{display:none}.canvas[data-view="delta"] [data-delta-state="same"]{opacity:.38}g[data-node-id][data-delta-state="added"]>rect:last-of-type{stroke:var(--d-add)!important;stroke-width:3!important}g[data-node-id][data-delta-state="removed"]>rect:last-of-type{stroke:var(--d-remove)!important;stroke-width:3!important;stroke-dasharray:7 5}g[data-node-id][data-delta-state="changed"]>rect:last-of-type{stroke:var(--d-change)!important;stroke-width:3!important;stroke-dasharray:2 3}g[data-node-id][data-delta-state="moved"]>rect:last-of-type,g[data-node-id][data-delta-state="moved-from"]>rect:last-of-type{stroke:var(--d-move)!important;stroke-width:3!important;stroke-dasharray:8 3 2 3}g[data-node-id][data-delta-state="moved-from"],path[data-delta-state="moved-from"]{opacity:.42}path[data-delta-state="added"]{stroke:var(--d-add)!important;stroke-width:3!important}path[data-delta-state="removed"]{stroke:var(--d-remove)!important;stroke-width:3!important;stroke-dasharray:7 5!important}path[data-delta-state="changed"]{stroke:var(--d-change)!important;stroke-width:3!important;stroke-dasharray:2 3!important}path[data-delta-state="rerouted"],path[data-delta-state="moved-from"]{stroke:var(--d-move)!important;stroke-width:2.5!important;stroke-dasharray:8 3 2 3!important}.delta-node-marker circle{fill:#071019;stroke:currentColor;stroke-width:1.5}.delta-node-marker text,.delta-edge-marker{fill:currentColor;font:800 9px ui-monospace,SFMono-Regular,Menlo,monospace}[data-delta-state="added"] .delta-node-marker,.delta-edge-marker[data-delta-state="added"]{color:var(--d-add)}[data-delta-state="removed"] .delta-node-marker,.delta-edge-marker[data-delta-state="removed"]{color:var(--d-remove)}[data-delta-state="changed"] .delta-node-marker,.delta-edge-marker[data-delta-state="changed"]{color:var(--d-change)}[data-delta-state="moved"] .delta-node-marker,[data-delta-state="moved-from"] .delta-node-marker,.delta-edge-marker[data-delta-state="moved-from"],.delta-edge-marker[data-delta-state="rerouted"]{color:var(--d-move)}.delta-edge-marker{paint-order:stroke;stroke:#071019;stroke-width:3px}+rect[data-graph-role="structural-frame"][data-delta-state="added"]{stroke:var(--d-add)!important;stroke-width:2.5!important}rect[data-graph-role="structural-frame"][data-delta-state="removed"]{stroke:var(--d-remove)!important;stroke-width:2.5!important;stroke-dasharray:7 5!important}rect[data-graph-role="structural-frame"][data-delta-state="changed"]{stroke:var(--d-change)!important;stroke-width:2.5!important;stroke-dasharray:2 3!important}rect[data-graph-role="structural-frame"][data-delta-state="moved-from"]{stroke:var(--d-move)!important;stroke-width:2!important;stroke-dasharray:8 3 2 3!important;opacity:.42}text[data-delta-boundary-state="added"]{fill:var(--d-add)!important}text[data-delta-boundary-state="removed"]{fill:var(--d-remove)!important}text[data-delta-boundary-state="changed"]{fill:var(--d-change)!important}text[data-delta-boundary-state="moved-from"]{fill:var(--d-move)!important;opacity:.55}+details{margin-top:12px;border:1px solid var(--d-line);border-radius:9px;background:#0a141e}summary{padding:13px 15px;cursor:pointer;font-weight:700}.changes{list-style:none;margin:0;padding:0 15px 15px}.changes li{display:grid;grid-template-columns:30px 90px minmax(140px,1fr) minmax(100px,.7fr) minmax(120px,.8fr) minmax(140px,1.2fr);gap:10px;padding:9px 0;border-top:1px solid rgba(138,160,181,.16);font-size:11px;align-items:baseline}.token{font:800 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.changes code,.changes li>span:last-child{color:var(--d-muted)}.proof-foot{display:flex;justify-content:space-between;gap:24px;margin-top:14px;color:var(--d-muted);font:650 10px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace}+html[data-theme="dark"] body{background:#071019!important;background-image:none!important}html[data-theme="light"]{color-scheme:light;--d-ink:#10283c;--d-muted:#587187;--d-line:#c8d6e2}html[data-theme="light"] body{background:#eef3f7!important;background-image:none!important;color:var(--d-ink)}html[data-theme="light"] .metric,html[data-theme="light"] .view-switch,html[data-theme="light"] details{background:#fff}html[data-theme="light"] .canvas{background:#f8fbfd}html[data-theme="light"] .view-switch button[aria-selected="true"]{background:#dbeaf5;color:#10283c}html[data-theme="light"] .delta-node-marker circle{fill:#fff}html[data-preset="blueprint"] body{background-image:none!important}+@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}@media print{body{min-width:0;background:#fff;color:#111}.proof-page{width:100%;padding:0}.proof-tools,details{display:none!important}.canvas{display:none!important}.canvas[data-view="delta"]{display:block!important;border:0}.proof-foot{color:#444}}+</style></head>+<body><main class="proof-page"><header class="proof-head"><div><p class="eyebrow">ARCHITECTURE DELTA · ${proof}</p><h1>See what changed<br>before you merge.</h1><p class="subtitle">${esc(receipt.base.title)} → ${esc(receipt.head.title)}</p></div><div class="metrics"><div class="metric add"><strong>${total(receipt.summary, 'added')}</strong><span>ADDED</span></div><div class="metric remove"><strong>${total(receipt.summary, 'removed')}</strong><span>REMOVED</span></div><div class="metric change"><strong>${changed}</strong><span>CHANGED</span></div></div></header>+<div class="proof-tools"><div class="view-switch" role="tablist" aria-label="Architecture snapshot"><button role="tab" data-target="base" aria-selected="false">Before</button><button role="tab" data-target="delta" aria-selected="true">Delta</button><button role="tab" data-target="head" aria-selected="false">After</button></div><div class="legend"><span class="add"><i></i>+ ADD</span><span class="remove"><i></i>− DEL</span><span class="change"><i></i>~ MOD</span><span class="move"><i></i>↔ MOVE</span></div><div><button class="utility" id="preset" type="button">Preset</button> <button class="utility" id="theme" type="button">Theme</button></div></div>+<section class="canvas" data-view="base" hidden>${baseSvg}</section><section class="canvas" data-view="delta">${deltaSvg}</section><section class="canvas" data-view="head" hidden>${headSvg}</section>+<details${rows.length <= 10 ? ' open' : ''}><summary>Exact authored changes · ${rows.length}</summary><ul class="changes">${rowHtml}</ul></details>+<footer class="proof-foot"><span>Stable IDs only · completeness: complete · ${proof}</span><span>Authored IR only · no risk or mergeability inference</span></footer></main>+<script id="archify-compare-receipt" type="application/json">${safeJson(receipt)}</script>+<script>(()=>{const tabs=[...document.querySelectorAll('[role="tab"]')],views=[...document.querySelectorAll('[data-view]')];function show(id){tabs.forEach(t=>t.setAttribute('aria-selected',String(t.dataset.target===id)));views.forEach(v=>v.hidden=v.dataset.view!==id)}tabs.forEach((tab,index)=>{tab.addEventListener('click',()=>show(tab.dataset.target));tab.addEventListener('keydown',event=>{if(!['ArrowLeft','ArrowRight','Home','End'].includes(event.key))return;event.preventDefault();let next=event.key==='Home'?0:event.key==='End'?tabs.length-1:(index+(event.key==='ArrowRight'?1:-1)+tabs.length)%tabs.length;tabs[next].focus();show(tabs[next].dataset.target)})});document.querySelector('#theme').addEventListener('click',()=>{document.documentElement.dataset.theme=document.documentElement.dataset.theme==='dark'?'light':'dark'});const presets=['classic','signal-flow','blueprint'];document.querySelector('#preset').addEventListener('click',()=>{const now=document.documentElement.dataset.preset;document.documentElement.dataset.preset=presets[(presets.indexOf(now)+1)%presets.length]})})();</script></body></html>`;+ return html.replace(/[ \t]+$/gm, '');+}++export function validateArchitectureDeltaHtml(html, receipt) {+ const failures = [];+ if ((html.match(/<section class="canvas" data-view=/g) || []).length !== 3) failures.push('expected exactly three snapshot canvases');+ if (!html.includes('id="archify-compare-receipt"')) failures.push('missing embedded compare receipt');+ if (/\b(?:SAFE|LOW RISK|MERGEABLE|NO IMPACT|VERIFIED PR)\b/i.test(html)) failures.push('contains a forbidden risk or mergeability claim');+ if (/\b(?:NaN|Infinity)\b/.test(html)) failures.push('contains non-finite output');+ if (receipt.completeness !== 'complete') failures.push('receipt is not complete');+ if (failures.length) fail('delta/artifact-invalid', `Architecture Delta artifact failed validation: ${failures.join('; ')}.`, { failures });+ return { ok: true, checksPassed: 5, checkCount: 5 };+}diff --git a/archify/examples/checkout-platform.base.architecture.json b/archify/examples/checkout-platform.base.architecture.jsonnew file mode 100644index 00000000..3fe73c2d--- /dev/null+++ b/archify/examples/checkout-platform.base.architecture.json@@ -0,0 +1,32 @@+{+ "schema_version": 1,+ "diagram_type": "architecture",+ "meta": {+ "title": "Checkout Platform — Baseline",+ "subtitle": "Before fraud screening moved into the payment path",+ "visual_preset": "signal-flow"+ },+ "components": [+ { "id": "buyers", "type": "external", "label": "Buyers", "sublabel": "Web + mobile", "pos": [40, 250], "size": [120, 60] },+ { "id": "edge", "type": "cloud", "label": "Edge Gateway", "sublabel": "TLS + routing", "pos": [220, 250], "size": [130, 60] },+ { "id": "checkout", "type": "backend", "label": "Checkout API", "sublabel": "v1 service", "pos": [430, 250], "size": [130, 60] },+ { "id": "cache", "type": "database", "label": "Session Cache", "sublabel": "Redis", "pos": [430, 100], "size": [130, 60] },+ { "id": "orders", "type": "database", "label": "Orders", "sublabel": "PostgreSQL", "pos": [640, 250], "size": [130, 60] },+ { "id": "queue", "type": "messagebus", "label": "Order Events", "sublabel": "durable queue", "pos": [430, 400], "size": [130, 60] },+ { "id": "worker", "type": "backend", "label": "Fulfilment", "sublabel": "async worker", "pos": [640, 400], "size": [130, 60] },+ { "id": "payments", "type": "external", "label": "Payment Rail", "sublabel": "external", "pos": [850, 250], "size": [130, 60] }+ ],+ "boundaries": [+ { "kind": "region", "label": "Production region", "wraps": ["edge", "checkout", "cache", "orders", "queue", "worker"] },+ { "kind": "security-group", "label": "Checkout trust zone", "wraps": ["checkout", "orders"] }+ ],+ "connections": [+ { "id": "buyer-request", "from": "buyers", "to": "edge", "label": "HTTPS", "variant": "emphasis" },+ { "id": "edge-checkout", "from": "edge", "to": "checkout" },+ { "id": "session-read", "from": "checkout", "to": "cache", "label": "session", "fromSide": "top", "toSide": "bottom", "labelDy": -66 },+ { "id": "persist-order", "from": "checkout", "to": "orders", "label": "SQL" },+ { "id": "publish-order", "from": "checkout", "to": "queue", "label": "accepted", "variant": "dashed", "fromSide": "bottom", "toSide": "top", "labelDy": 66 },+ { "id": "consume-order", "from": "queue", "to": "worker" },+ { "id": "authorize-payment", "from": "orders", "to": "payments", "label": "authorize", "variant": "security" }+ ]+}diff --git a/archify/examples/checkout-platform.head.architecture.json b/archify/examples/checkout-platform.head.architecture.jsonnew file mode 100644index 00000000..b7dd858d--- /dev/null+++ b/archify/examples/checkout-platform.head.architecture.json@@ -0,0 +1,32 @@+{+ "schema_version": 1,+ "diagram_type": "architecture",+ "meta": {+ "title": "Checkout Platform — Fraud Gate",+ "subtitle": "Fraud screening now owns payment authorization",+ "visual_preset": "signal-flow"+ },+ "components": [+ { "id": "buyers", "type": "external", "label": "Buyers", "sublabel": "Web + mobile", "pos": [40, 250], "size": [120, 60] },+ { "id": "edge", "type": "cloud", "label": "Edge Gateway", "sublabel": "TLS + routing", "pos": [220, 250], "size": [130, 60] },+ { "id": "checkout", "type": "backend", "label": "Checkout API", "sublabel": "v2 idempotent", "pos": [430, 250], "size": [130, 60] },+ { "id": "fraud", "type": "security", "label": "Fraud Gate", "sublabel": "policy scoring", "pos": [640, 100], "size": [130, 60], "tag": "new owner" },+ { "id": "orders", "type": "database", "label": "Orders", "sublabel": "PostgreSQL", "pos": [640, 250], "size": [130, 60] },+ { "id": "queue", "type": "messagebus", "label": "Order Events", "sublabel": "durable queue", "pos": [430, 420], "size": [130, 60] },+ { "id": "worker", "type": "backend", "label": "Fulfilment", "sublabel": "async worker", "pos": [640, 400], "size": [130, 60] },+ { "id": "payments", "type": "external", "label": "Payment Rail", "sublabel": "external", "pos": [850, 250], "size": [130, 60] }+ ],+ "boundaries": [+ { "kind": "region", "label": "Production region", "wraps": ["edge", "checkout", "fraud", "orders", "queue", "worker"] },+ { "kind": "security-group", "label": "Checkout trust zone", "wraps": ["checkout", "fraud", "orders"] }+ ],+ "connections": [+ { "id": "buyer-request", "from": "buyers", "to": "edge", "label": "HTTPS", "variant": "emphasis" },+ { "id": "edge-checkout", "from": "edge", "to": "checkout" },+ { "id": "fraud-check", "from": "checkout", "to": "fraud", "label": "screen", "variant": "security", "fromSide": "top", "toSide": "bottom", "labelDy": -66 },+ { "id": "persist-order", "from": "checkout", "to": "orders", "label": "SQL tx" },+ { "id": "publish-order", "from": "checkout", "to": "queue", "label": "accepted", "variant": "dashed", "fromSide": "bottom", "toSide": "top", "labelDy": 76 },+ { "id": "consume-order", "from": "queue", "to": "worker" },+ { "id": "authorize-payment", "from": "fraud", "to": "payments", "label": "authorize", "variant": "security", "fromSide": "right", "toSide": "top", "via": [[820, 130], [915, 130]] }+ ]+}diff --git a/archify/test/architecture-delta.test.mjs b/archify/test/architecture-delta.test.mjsnew file mode 100644index 00000000..01a0e108--- /dev/null+++ b/archify/test/architecture-delta.test.mjs@@ -0,0 +1,194 @@+import { test } from 'node:test';+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 { fileURLToPath } from 'node:url';+import {+ ArchitectureDeltaError,+ canonicalArchitectureJson,+ compareArchitecture,+} from '../delta/architecture-delta.mjs';++const __dirname = path.dirname(fileURLToPath(import.meta.url));+const skillRoot = path.resolve(__dirname, '..');+const cli = path.join(skillRoot, 'bin/archify.mjs');+const baseFixture = path.join(skillRoot, 'examples/checkout-platform.base.architecture.json');+const headFixture = path.join(skillRoot, 'examples/checkout-platform.head.architecture.json');+const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-delta-'));++const read = (file) => JSON.parse(fs.readFileSync(file, 'utf8'));+const run = (args) => spawnSync(process.execPath, [cli, ...args], { cwd: skillRoot, encoding: 'utf8' });++test('architecture compare classifies authored facts separately from geometry and presentation', () => {+ const receipt = compareArchitecture(read(baseFixture), read(headFixture));+ assert.equal(receipt.command, 'compare');+ assert.equal(receipt.completeness, 'complete');+ assert.equal(receipt.proofLevel, 'authored');+ assert.deepEqual(receipt.summary.components, {+ added: 1,+ changed: 1,+ evidenceChanged: 0,+ removed: 1,+ moved: 1,+ });+ assert.deepEqual(receipt.summary.connections, {+ added: 1,+ changed: 2,+ removed: 1,+ rerouted: 1,+ });+ assert.equal(receipt.summary.presentationChanged, true);++ const checkout = receipt.changes.components.find((change) => change.id === 'checkout');+ assert.equal(checkout.status, 'changed');+ assert.deepEqual(checkout.classifications, ['semantic']);+ assert.deepEqual(checkout.changedFields, ['/sublabel']);++ const queue = receipt.changes.components.find((change) => change.id === 'queue');+ assert.equal(queue.status, 'moved');+ assert.deepEqual(queue.classifications, ['geometry']);+ assert.deepEqual(queue.changedFields, ['/pos']);++ const authorization = receipt.changes.connections.find((change) => change.id === 'authorize-payment');+ assert.equal(authorization.status, 'changed');+ assert.deepEqual(authorization.classifications, ['geometry', 'topology']);+ assert.deepEqual(authorization.changedFields, ['/from', '/fromSide', '/toSide', '/via']);++ assert.deepEqual(receipt.changes.connections.find((change) => change.status === 'added').classifications, ['topology']);++ const headWithBoundary = read(headFixture);+ headWithBoundary.boundaries.push({ kind: 'region', label: 'Fraud edge', wraps: ['fraud'] });+ const boundaryReceipt = compareArchitecture(read(baseFixture), headWithBoundary);+ assert.deepEqual(boundaryReceipt.changes.boundaries.find((change) => change.label === 'Fraud edge').classifications, ['scope']);+});++test('canonical architecture ignores formatting, entity order, and set-like order', () => {+ const original = read(baseFixture);+ const reordered = JSON.parse(JSON.stringify(original));+ reordered.components.reverse();+ reordered.connections.reverse();+ reordered.boundaries.reverse();+ reordered.boundaries.forEach((boundary) => boundary.wraps.reverse());+ assert.equal(canonicalArchitectureJson(reordered), canonicalArchitectureJson(original));+});++test('exact identity fails closed instead of guessing relationships or unrelated systems', () => {+ const base = read(baseFixture);+ const missingRelationship = read(headFixture);+ delete missingRelationship.connections[0].id;+ assert.throws(+ () => compareArchitecture(base, missingRelationship),+ (error) => error instanceof ArchitectureDeltaError+ && error.code === 'delta/relationship-id-required'+ && error.details.paths.includes('/connections/0/id'),+ );++ const unrelated = read(headFixture);+ unrelated.components = unrelated.components.map((component, index) => ({ ...component, id: `other${index}` }));+ unrelated.connections = [];+ unrelated.boundaries = [];+ assert.throws(+ () => compareArchitecture(base, unrelated),+ (error) => error instanceof ArchitectureDeltaError && error.code === 'delta/no-shared-component-id',+ );+});++test('same-label node id changes remain one removal plus one addition', () => {+ const base = read(baseFixture);+ const head = read(baseFixture);+ const cache = head.components.find((component) => component.id === 'cache');+ cache.id = 'session-store';+ head.boundaries.forEach((boundary) => {+ boundary.wraps = boundary.wraps.map((id) => (id === 'cache' ? 'session-store' : id));+ });+ head.connections.find((connection) => connection.id === 'session-read').to = 'session-store';++ const receipt = compareArchitecture(base, head);+ assert.equal(receipt.changes.components.find((change) => change.id === 'cache').status, 'removed');+ assert.equal(receipt.changes.components.find((change) => change.id === 'session-store').status, 'added');+ assert.equal(receipt.changes.components.filter((change) => change.headLabel === 'Session Cache' || change.baseLabel === 'Session Cache').length, 2);+});++test('repository mismatch fails and verified matching revisions remain evidence-bounded', () => {+ const base = read(baseFixture);+ const head = read(headFixture);+ base.meta.repository = { url: 'https://github.com/example/one', revision: 'a'.repeat(40) };+ head.meta.repository = { url: 'https://github.com/example/two', revision: 'b'.repeat(40) };+ assert.throws(+ () => compareArchitecture(base, head),+ (error) => error instanceof ArchitectureDeltaError && error.code === 'delta/repository-mismatch',+ );++ head.meta.repository.url = 'https://github.com/EXAMPLE/ONE.git/';+ const receipt = compareArchitecture(base, head, { baseVerified: true, headVerified: true });+ assert.equal(receipt.proofLevel, 'revision-pinned');+ assert.equal(receipt.summary.provenanceChanged, true);+});++test('compare CLI writes a deterministic three-state artifact and complete sidecar receipt', () => {+ const first = path.join(tmp, 'first.html');+ const second = path.join(tmp, 'second.html');+ const result = run(['compare', 'architecture', baseFixture, headFixture, first, '--json']);+ assert.equal(result.status, 0, result.stderr);+ const repeat = run(['compare', 'architecture', baseFixture, headFixture, second, '--json']);+ assert.equal(repeat.status, 0, repeat.stderr);++ const firstHtml = fs.readFileSync(first, 'utf8');+ const secondHtml = fs.readFileSync(second, 'utf8');+ assert.equal(firstHtml, secondHtml);+ assert.equal((firstHtml.match(/<section class="canvas" data-view=/g) || []).length, 3);+ assert.match(firstHtml, /data-view="delta">/);+ assert.match(firstHtml, /data-node-id="cache"[^>]+data-delta-state="removed"/);+ assert.match(firstHtml, /data-node-id="fraud"[^>]+data-delta-state="added"/);+ assert.match(firstHtml, /data-node-id="queue"[^>]+data-delta-state="moved-from"/);+ assert.doesNotMatch(firstHtml, /\b(?:SAFE|LOW RISK|MERGEABLE|NO IMPACT|VERIFIED PR)\b/i);++ const receipt = JSON.parse(result.stdout);+ const sidecar = read(path.join(tmp, 'first.receipt.json'));+ assert.deepEqual(sidecar, receipt);+ assert.equal(receipt.artifact.sha256, JSON.parse(repeat.stdout).artifact.sha256);+ assert.equal(receipt.validation.checksPassed, receipt.validation.checkCount);+ assert.equal(receipt.completeness, 'complete');+ assert.equal(JSON.stringify(receipt).includes(tmp), false);+});++test('formatting-only input changes raw proof but not semantic hash or artifact bytes', () => {+ const reorderedPath = path.join(tmp, 'reordered-base.json');+ const reordered = read(baseFixture);+ reordered.components.reverse();+ reordered.connections.reverse();+ reordered.boundaries.forEach((boundary) => boundary.wraps.reverse());+ fs.writeFileSync(reorderedPath, JSON.stringify(reordered, null, 4));++ const originalOut = path.join(tmp, 'canonical-original.html');+ const reorderedOut = path.join(tmp, 'canonical-reordered.html');+ const original = run(['compare', 'architecture', baseFixture, headFixture, originalOut, '--json']);+ const changed = run(['compare', 'architecture', reorderedPath, headFixture, reorderedOut, '--json']);+ assert.equal(original.status, 0, original.stderr);+ assert.equal(changed.status, 0, changed.stderr);+ const originalReceipt = JSON.parse(original.stdout);+ const changedReceipt = JSON.parse(changed.stdout);+ assert.notEqual(originalReceipt.base.rawSha256, changedReceipt.base.rawSha256);+ assert.equal(originalReceipt.base.semanticSha256, changedReceipt.base.semanticSha256);+ assert.equal(fs.readFileSync(originalOut, 'utf8'), fs.readFileSync(reorderedOut, 'utf8'));+ assert.equal(originalReceipt.artifact.sha256, changedReceipt.artifact.sha256);+});++test('compare failure preserves an existing trusted artifact', () => {+ const invalid = read(headFixture);+ delete invalid.connections[0].id;+ const invalidPath = path.join(tmp, 'invalid-head.json');+ const output = path.join(tmp, 'preserved.html');+ fs.writeFileSync(invalidPath, JSON.stringify(invalid));+ fs.writeFileSync(output, 'trusted artifact');++ const result = run(['compare', 'architecture', baseFixture, invalidPath, output, '--json']);+ assert.notEqual(result.status, 0);+ assert.equal(fs.readFileSync(output, 'utf8'), 'trusted artifact');+ const receipt = JSON.parse(result.stdout);+ assert.equal(receipt.ok, false);+ assert.equal(receipt.diagnostics[0].code, 'delta/relationship-id-required');+ assert.equal(fs.existsSync(path.join(tmp, 'preserved.receipt.json')), false);+});diff --git a/archify/test/cli.test.mjs b/archify/test/cli.test.mjsindex c852672a..c27f4150 100644--- a/archify/test/cli.test.mjs+++ b/archify/test/cli.test.mjs@@ -72,6 +72,7 @@ test('cli: help lists commands and diagram types', () => {const result = run(['--help']);assert.equal(result.status, 0, result.stderr);assert.match(result.stdout, /archify render <type>/);+ assert.match(result.stdout, /archify compare architecture <base\.json> <head\.json>/);assert.match(result.stdout, /archify deliver <type>/);assert.match(result.stdout, /archify preview <type>/);assert.match(result.stdout, /--open/);@@ -89,6 +90,7 @@ test('cli: doctor reports a complete installation is ready', () => {assert.match(result.stdout, /\[ok\] Example renderer/);assert.match(result.stdout, /\[ok\] Live preview runtime/);assert.match(result.stdout, /\[ok\] Scenario recipe guide/);+ assert.match(result.stdout, /\[ok\] Architecture compare runtime and proof fixtures/);assert.match(result.stdout, /\[ok\] Standalone schema validators/);assert.match(result.stdout, /\[ok\] architecture renderer, schema, and example/);assert.match(result.stdout, /\[ok\] lifecycle renderer, schema, and example/);diff --git a/docs/assets/architecture-delta-proof.jpg b/docs/assets/architecture-delta-proof.jpgnew file mode 100644index 00000000..9ce35923Binary files /dev/null and b/docs/assets/architecture-delta-proof.jpg differdiff --git a/docs/research-architecture-delta-pr-proof-2026-07-23.md b/docs/research-architecture-delta-pr-proof-2026-07-23.mdnew file mode 100644index 00000000..2c3cac18--- /dev/null+++ b/docs/research-architecture-delta-pr-proof-2026-07-23.md@@ -0,0 +1,248 @@+# Architecture Delta / PR Proof:研究结论与实现合同++日期:2026-07-23(Asia/Shanghai)+Archify 基线:`codex/architecture-delta-proof@5302d2251ff2aaca56f7c08818ebe8421f41a6f3`++## 结论++下一项值得做的用户可见切片是一个 **Architecture Delta**:给它两份已经存在、已经通过 Archify 校验的 `architecture` JSON,它生成一个离线、自包含、可验证的 HTML,默认回答“架构事实改了什么”,并可切换 Before / Delta / After。**PR Proof 是这个产物的使用场景,不是新的事实来源**;首版不访问 GitHub、不拉取仓库、不分析代码影响,也不声称某个 PR 安全。++它成立的前提不是再加一种红绿风格,而是先冻结四件事:++1. 只用稳定 ID 配对节点与关系,不按标签、位置、类型或相似度猜测。+2. Delta 复用两侧已经验证过的几何;删除项保留 baseline 的原位置,不重新布局整张联合图。+3. “架构事实变化”“证据变化”“布局变化”“展示变化”分开计数,不能都压成一个 `changed`。+4. 比较、渲染、检查、提交和回执是一个 fail-closed 原子流程;证据不足时失败或降级为 `authored`,不能显示虚假的绿色通过。++## 一手证据++### Agents365 drawio-skill:证明评审入口有价值,也暴露了不能照抄的边界++研究快照:[`Agents365-ai/drawio-skill@6f33563`](https://github.com/Agents365-ai/drawio-skill/tree/6f33563adce24450003d1cb61111ebbcc5579f28)。++- `drawiodiff.py` 默认用 draw.io cell ID 配对节点,并说明导入器产生的语义 ID 适合跨快照对齐;它也提供 `--by-label` 给随机 ID 图兜底。节点分为 added / removed / changed / same,关系按端点集合分为 added / removed / same。([source](https://github.com/Agents365-ai/drawio-skill/blob/6f33563adce24450003d1cb61111ebbcc5579f28/skills/drawio-skill/scripts/drawiodiff.py#L2-L31), [matching and output](https://github.com/Agents365-ai/drawio-skill/blob/6f33563adce24450003d1cb61111ebbcc5579f28/skills/drawio-skill/scripts/drawiodiff.py#L107-L160))+- 它把比较结果交给 Graphviz 重新布局,且明确丢弃容器、分组、边标签和原形状,只保留一张扁平状态图。([source](https://github.com/Agents365-ai/drawio-skill/blob/6f33563adce24450003d1cb61111ebbcc5579f28/skills/drawio-skill/scripts/drawiodiff.py#L12-L28))+- `prdiff.py` 从两个 Git ref 提取 changed `.drawio`,为修改文件生成 base / head / diff 三张 PNG,再汇总为 PR Markdown;新增或删除文件只有存在的一侧。([source](https://github.com/Agents365-ai/drawio-skill/blob/6f33563adce24450003d1cb61111ebbcc5579f28/skills/drawio-skill/scripts/prdiff.py#L2-L18), [pipeline](https://github.com/Agents365-ai/drawio-skill/blob/6f33563adce24450003d1cb61111ebbcc5579f28/skills/drawio-skill/scripts/prdiff.py#L30-L110))+- PR bot 用固定 HTML marker 更新同一条 sticky comment,避免每次 push 产生新评论;缺 draw.io CLI 时仍输出文件清单但没有图片。([source](https://github.com/Agents365-ai/drawio-skill/blob/6f33563adce24450003d1cb61111ebbcc5579f28/skills/drawio-skill/references/pr-bot.md#L1-L25), [degradation and sticky comment](https://github.com/Agents365-ai/drawio-skill/blob/6f33563adce24450003d1cb61111ebbcc5579f28/skills/drawio-skill/references/pr-bot.md#L49-L62))++对 Archify 的含义:**吸收 base / delta / head 的评审信息架构和稳定 ID 原则;不吸收按标签猜身份、全图重排、扁平化容器、外部 draw.io / Graphviz 依赖和核心能力对 CLI 缺失的静默降级。**++### GitNexus:事实变化与推断影响必须分层++研究快照:[`abhigyanpatwari/GitNexus@cdbdf21`](https://github.com/abhigyanpatwari/GitNexus/tree/cdbdf219dce797e51cdeb8cfa386e77ab2d35628)。++- `detect_changes` 先把 Git diff hunk 映射到有 ID、文件和行范围的已索引符号,再列出受影响执行流;其输入明确区分 unstaged / staged / all / compare,并处理 linked worktree。([tool contract](https://github.com/abhigyanpatwari/GitNexus/blob/cdbdf219dce797e51cdeb8cfa386e77ab2d35628/gitnexus/src/mcp/tools.ts#L335-L371), [implementation](https://github.com/abhigyanpatwari/GitNexus/blob/cdbdf219dce797e51cdeb8cfa386e77ab2d35628/gitnexus/src/mcp/local/local-backend.ts#L4107-L4211))+- 当前 hunk parser 以 new-side range 建立变更范围,纯删除 hunk 没有 new-side 行时不会进入后续映射;这再次说明 Delta 必须直接解析 base 与 head 两个完整模型,不能只消费 target-side touched symbols。([source](https://github.com/abhigyanpatwari/GitNexus/blob/cdbdf219dce797e51cdeb8cfa386e77ab2d35628/gitnexus/src/storage/git.ts#L516-L548))+- 它把 diff hunk 与符号范围的重叠标为 `touched`,再单独聚合执行流;查询失败会返回 `partial: true`,避免缺失数据伪装成低风险。([source](https://github.com/abhigyanpatwari/GitNexus/blob/cdbdf219dce797e51cdeb8cfa386e77ab2d35628/gitnexus/src/mcp/local/local-backend.ts#L4213-L4335))+- `impact` 的 blast radius 是另一套合同,输出 direct / transitive depth、process、module 和 LOW–CRITICAL / UNKNOWN;模糊目标会要求用 UID 消歧,而不是静默挑一个。([tool contract](https://github.com/abhigyanpatwari/GitNexus/blob/cdbdf219dce797e51cdeb8cfa386e77ab2d35628/gitnexus/src/mcp/tools.ts#L432-L468), [risk calculation](https://github.com/abhigyanpatwari/GitNexus/blob/cdbdf219dce797e51cdeb8cfa386e77ab2d35628/gitnexus/src/mcp/local/local-backend.ts#L6075-L6123))++对 Archify 的含义:Architecture Delta 可以证明“输入模型的哪些事实不同”,但没有代码知识图、运行链和可信映射时,**不得**输出 blast radius、风险等级、“will break”或“safe to merge”。若未来消费 GitNexus 回执,也必须把外部 impact 证据与本地 authored delta 分层展示。++### GitDiagram:路径化诊断、有限审计值得吸收,模型重试不属于 Delta++研究快照:[`ahmedkhaleel2004/gitdiagram@041d2fe`](https://github.com/ahmedkhaleel2004/gitdiagram/tree/041d2feb4a9b1593dcf3bde2ca5b9ae7659becb9)。++- GitDiagram 给验证问题稳定 category、精确字段 path 和 message,并检查重复 node ID、未知 group、真实文件树路径、未知边端点。([source](https://github.com/ahmedkhaleel2004/gitdiagram/blob/041d2feb4a9b1593dcf3bde2ca5b9ae7659becb9/src/server/generate/graph.ts#L12-L38), [validation](https://github.com/ahmedkhaleel2004/gitdiagram/blob/041d2feb4a9b1593dcf3bde2ca5b9ae7659becb9/src/server/generate/graph.ts#L90-L175))+- 图规划最多三次;失败后只把上一份 raw graph 和精确 validation feedback 送入下一次,并为每次尝试保存状态、分类和反馈。([limits and audit shape](https://github.com/ahmedkhaleel2004/gitdiagram/blob/041d2feb4a9b1593dcf3bde2ca5b9ae7659becb9/src/features/diagram/graph.ts#L7-L21), [attempt audit](https://github.com/ahmedkhaleel2004/gitdiagram/blob/041d2feb4a9b1593dcf3bde2ca5b9ae7659becb9/src/features/diagram/graph.ts#L96-L138), [bounded planner](https://github.com/ahmedkhaleel2004/gitdiagram/blob/041d2feb4a9b1593dcf3bde2ca5b9ae7659becb9/src/server/generate/graph-planner.ts#L72-L225))+- 终态审计会去掉成功结果里重复的大对象,失败时保留原始输出和验证反馈,避免回执膨胀但不丢失失败证据。([source](https://github.com/ahmedkhaleel2004/gitdiagram/blob/041d2feb4a9b1593dcf3bde2ca5b9ae7659becb9/src/server/generate/session-audit.ts#L36-L84))++对 Archify 的含义:复用现有 `schemaVersion: 1` repair receipt 的方向,新增 delta 专属的 code / subject / evidence / supportedFixes;**不引入 LLM、重试、provider、SSE、R2/Redis 或托管状态**。比较是纯确定性操作,一次失败就给出可修复诊断。++### 标准约束:模型 ID、差异种类、删除占位与 PR 基线++- The Open Group 的 ArchiMate Exchange XSD 为 element 与 relationship 分别建立 identifier key,并用 keyref 约束 relationship source / target;这说明架构交换合同把节点和关系身份都当作第一等事实。([official schema documentation](https://www.opengroup.org/xsd/archimate/3.0/html-model/))+- Eclipse EMF Compare 的默认 match phase 优先用对象标识符,差异分为 ADD / DELETE / CHANGE / MOVE;其图形比较用 phantom placeholder 标出被删除对象原来的位置。([developer guide](https://help.eclipse.org/latest/topic/org.eclipse.emf.compare.doc/help/developer/developer-guide.html), [user guide](https://eclipse.dev/emfcompare/documentation/latest/user/user-guide.html), [DifferenceKind API](https://help.eclipse.org/latest/topic/org.eclipse.emf.compare.doc/help/developer/javadoc/org/eclipse/emf/compare/DifferenceKind.html))+- GitHub PR 使用 three-dot comparison,以 merge base 到 topic head 表达“这个 PR 引入了什么”;two-dot 是 base tip 与 head tip 的直接比较。([GitHub Docs](https://docs.github.com/en/pull-requests/reference/branches#three-dot-and-two-dot-git-diff-comparisons))+- Git 的 raw diff format 把 A/C/D/M/R 等状态分开,并为 copy/rename 报告相似度分数;rename detection 本身是可配置的相似度推断。因此 Archify 只有显式稳定 ID 才能声称同一实体发生变化,不能把相似 label 当 rename。([Git diff format](https://git-scm.com/docs/diff-format.html), [git-diff](https://git-scm.com/docs/git-diff))+- RFC 8785 说明要对 JSON 做可重复哈希,必须先有不变的规范化表示和确定的属性排序。Archify 不应声称兼容 JCS,除非实现并通过完整兼容测试;但 compare IR 必须采用同样的“先规范化、再哈希”原则。([RFC 8785](https://www.rfc-editor.org/rfc/rfc8785.html))++## 冻结合同++以下规则是首版实现边界。任何一条未满足,都不能把产物称为 Architecture Delta / PR Proof。++### 1. 可比较性++1. 两个输入都必须先独立通过当前 `architecture` schema、关系、视图、Clean Flow、composition 和已启用 engineering profile 校验;不能为了比较而放宽任何一侧。+2. 两侧必须都是 `schema_version: 1`、`diagram_type: "architecture"`。类型或 schema 版本不同直接失败。+3. 两侧至少有一个完全相同的 `components[].id`。零共享节点意味着没有证据证明它们描述同一系统;返回 `delta/no-shared-component-id`,不把全图猜成 remove + add。+4. `meta.repository` 两侧都存在时,规范化后的 repository URL 必须完全相同;不同仓库返回 `delta/repository-mismatch`。只有一侧有 repository 或两侧都没有时仍可比较,但 `proofLevel` 必须是 `authored`。+5. 两侧 repository URL 相同且 revision 都是 40 位 SHA 时,`proofLevel` 可为 `revision-pinned`;这只证明输入声明并通过了 Archify 既有 repository-evidence gate,不能称为 GitHub PR、merge-base 或代码影响验证。+6. 首版命令只比较两个本地 JSON 文件,不接受 Git ref、URL 或 PR number。未来若增加 Git wrapper,PR 模式必须把 baseline 解析为 merge-base(three-dot 语义),并把解析后的 base/head SHA 写入回执,不能把 two-dot 偷换成 PR diff。++建议入口:++```text+archify compare architecture <base.json> <head.json> [output.html] [--json] [--repo-root path]+```++它不是第六种 diagram type,也不是普通 `render` 的默认行为。++### 2. 稳定节点与关系身份++- 节点身份只认 `components[].id`;ID 改名就是一个 removed + 一个 added。不得按 label、type、sources、row/col、位置或内容相似度推断 rename。+- 关系身份只认 `connections[].id`。只要任一侧存在无 ID connection,比较失败并逐条报告 `delta/relationship-id-required`;不得退化为 `(from,to)`,因为平行关系、标签变化和端点迁移都会使该键含糊。+- 相同 relationship ID 而 `from` 或 `to` 变化是 `topology` change;Delta 同时画旧关系和新关系,并在回执中配成一项,不能只画一条橙线掩盖旧端点。+- 连接 ID 在每一侧都必须唯一,端点必须存在。沿用既有 duplicate/dangling diagnostics,不新增静默修复。+- 当前 boundary 没有 ID。首版以精确 `(kind,label)` 作为**保守键**,只允许唯一键;重复键返回 `delta/boundary-key-ambiguous`。label 改名表现为 removed + added,不做 rename 推断。若后续要支持可靠 boundary rename,再单独给 schema 增加稳定 `id`,不能扩大首版猜测范围。++### 3. 字段变化分类++比较先把 object key、component/connection 顺序和 set-like 字段规范化,再按下表分类。数组原始顺序不能制造节点/关系变化;`wraps` 和 `sources` 作为集合按规范键排序,`via` 和 Story `focus` 保持有序。++| 实体 | 分类 | 字段 | 用户含义 |+| --- | --- | --- | --- |+| component | `semantic` | `type`, `label`, `sublabel`, `tag` | 架构角色或说明变了 |+| component | `evidence` | `sources` | 源码证据绑定变了,不等于组件本身变了 |+| component | `geometry` | `row`, `col`, `pos`, `size` | moved/resized;不计入架构 changed |+| connection | `topology` | `from`, `to` | 关系端点变了;同时展示旧/新关系 |+| connection | `semantic` | `label`, `variant` | 关系机制或含义变了 |+| connection | `geometry` | `fromSide`, `toSide`, `route`, `via`, `labelAt`, `labelDx`, `labelDy`, `labelSegment`, `width` | rerouted/restyled;不计入架构 changed |+| boundary | `scope` | `kind`, `label`, `wraps` | 部署/安全范围变了 |+| boundary | `geometry` | `pad` | 仅容器留白变了 |+| provenance | `provenance` | `meta.repository` | 输入证据级别或 revision 变了 |+| presentation | `presentation` | `meta.title`, `subtitle`, `animation`, `visual_preset`, `quality_profile`, `engineering_profile`, `views`, `viewBox`, `layout`, `cards` | 读图、校验或叙事呈现变了 |+| ignored | — | `meta.output` | 本地输出路径不属于图的事实,也不得影响 artifact hash |++实体的主状态优先级固定为:`added` / `removed` → `changed`(topology、semantic、scope)→ `evidence-changed` → `moved` 或 `rerouted` → `same`。一项可以同时带多个 classification,但 headline count 每个实体只计一次。++纯 geometry / presentation change 必须与架构 change 分栏;“换了坐标”不能显示为“服务职责改变”。同理,source path 调整不能自动推断成运行影响。++### 4. 删除项与联合几何++1. Before 使用 base 自己已经验证的几何;After 使用 head 自己已经验证的几何。+2. Delta 的主层是 head。added 用 head bbox/route;removed 用 base bbox/route,作为带 `−` 文本标记的虚线 phantom,保持 baseline 原位置。+3. shared component 若几何改变,Delta 保留 head 实体,同时在 base 位置画轻量 `MOVE FROM` phantom;不得重新布局联合图,也不得把移动后的 head 节点拉回旧位置。+4. removed connection、旧端点版本和所有连接到 removed component 的关系都使用 base route。新增关系使用 head route。相同 ID 但端点变化时旧关系为 `−`、新关系为 `+`。+5. 联合 viewBox 是 base/head 已验证 viewBox 的确定性并集加固定 margin;坐标保持原值。不得为“好看”对 removed 节点做避让,因为那会伪造它原来的位置。+6. removed phantom 在 head layer 后面,透明但仍有文本/线型/符号差异;added `+`、changed `~`、removed `−`、moved `↔` 必须不依赖颜色。+7. 若 removed 与 added 恰好重叠,保持真实几何并在 receipt 分列两项;视觉上用双描边和符号区分,不猜测 replacement/rename。+8. 首版只做静态、即时切换,不增加循环动画。Still / reduced motion 与普通模式信息等价。++这直接吸收 EMF Compare 的 deleted phantom 思路,同时保留 Archify 最强的“作者几何是真相”边界。++### 5. 确定性输出与回执++- 比较器是纯函数:相同已解析输入 → 相同 compare IR;不得读取当前时间、绝对路径、Git 状态、网络、随机数或 locale 排序。+- 所有 ID、changed field JSON Pointer、diagnostic 和 receipt 数组按 Unicode code-point 顺序稳定排序;不能依赖输入数组顺序、对象插入顺序或文件系统顺序。+- 每侧同时记录 `rawSha256` / bytes(证明精确输入)与 `semanticSha256`(对规范化 compare IR 哈希)。语义等价但空白、object key 或实体数组顺序不同的输入,raw hash 可不同,semantic hash 和 HTML 必须相同。+- canonical form 是版本化的 Archify contract(例如 `canonicalVersion: 1`)。除非实现 RFC 8785 全部要求并用官方向量验证,否则文档只称“deterministic canonical JSON”,不称 JCS-compliant。+- 成功 `--json` 回执最小形状:++```json+{+ "schemaVersion": 1,+ "ok": true,+ "command": "compare",+ "type": "architecture",+ "comparatorVersion": 1,+ "completeness": "complete",+ "proofLevel": "authored",+ "base": { "rawSha256": "…", "semanticSha256": "…", "bytes": 0 },+ "head": { "rawSha256": "…", "semanticSha256": "…", "bytes": 0 },+ "summary": {+ "components": { "added": 0, "changed": 0, "evidenceChanged": 0, "removed": 0, "moved": 0 },+ "connections": { "added": 0, "changed": 0, "removed": 0, "rerouted": 0 },+ "boundaries": { "added": 0, "changed": 0, "removed": 0 },+ "presentationChanged": false+ },+ "changes": {+ "components": [{ "id": "api", "status": "changed", "classifications": ["semantic"], "changedFields": ["/label"] }],+ "connections": [],+ "boundaries": []+ },+ "artifact": { "sha256": "…", "bytes": 0 },+ "validation": { "checksPassed": 0, "checkCount": 0 }+}+```++- 回执不嵌入完整 base/head object,不放 generatedAt,不复制成功 artifact 内已有的大对象。失败回执保留精确 code、side、JSON path/subject、measured evidence 和 supported fixes。+- compare 必须像当前 `deliver` 一样在输出旁生成唯一 candidate,完成 base/head validation、delta validation、artifact check 与 hash 后再原子替换;任何失败删除 candidate、保留旧 target。++### 6. Share Card 语义++Share Card 固定从 canonical Delta 状态生成,不取决于用户当前停在 Before 还是 After。它只回答“模型声明发生了什么”,不是审批结论。++- 标题:head `meta.title` + `Architecture Delta`。+- 主统计:components 与 connections 分别显示 `+ added · ~ changed · − removed`;boundary scope 单独一行。+- `moved` / `rerouted` / presentation-only 只放次级统计,不混进 `~ changed`。+- 同 repo + 双 revision 时显示 `REV <base-short> → <head-short>` 与 `REVISION-PINNED INPUTS`;否则显示 `AUTHORED SNAPSHOTS`。+- 绝不显示 `SAFE`, `LOW RISK`, `MERGEABLE`, `NO IMPACT`, `VERIFIED PR`。零变化写 `No authored architecture changes`,不是绿色安全认证。+- 使用 `+ / ~ / − / ↔`、文字与线型共同编码,颜色只是辅助;静态 PNG/分享图与 HTML headline counts 必须来自同一个 compare IR。+- 默认不写 repository URL、绝对路径或 source path,避免分享卡泄露本地/私仓信息。++## 必须失败或明确降级的情况++| 情况 | 行为 |+| --- | --- |+| 任一输入 JSON/schema/diagram validation 失败 | non-zero;side-specific repair receipt;不写 artifact |+| diagram type 或 schema version 不同 | `delta/type-mismatch` 或 `delta/schema-version-mismatch` |+| 零 shared component ID | `delta/no-shared-component-id` |+| 双方 repository URL 不同 | `delta/repository-mismatch` |+| 只有一侧 repository evidence | 允许,但 `proofLevel: authored`,并记录 provenance change |+| connection 缺 ID、重复 ID、dangling endpoint | fail-closed;不按端点或 label 猜 |+| boundary `(kind,label)` 在任一侧重复 | `delta/boundary-key-ambiguous` |+| 同 connection ID 改端点 | 允许,分类为 topology;旧/新两条都画 |+| node ID 改名、label 相同 | removed + added;不推断 rename |+| removed 与 added 同位置 | 保持重叠事实,用双描边/符号和 receipt 区分 |+| 只有 geometry / presentation change | 成功,但 headline architecture counts 为零,次级栏说明 layout/presentation change |+| compare 过程内部只获得部分结果 | 失败;首版本地纯比较没有可接受的 `partial success` |+| artifact checker 或 atomic commit 失败 | non-zero;旧输出保持字节不变 |++## 不复制什么++1. **Agents365 的 `--by-label`**:重复 label 会折叠,rename/同名组件会被错配。Archify 宁可给出修复提示,也不猜身份。+2. **Graphviz 全图重排 diff**:它适合扁平摘要,但会让未变节点位移、删除位置丢失,破坏 reviewer 的空间记忆。+3. **扁平化容器、丢边标签和换统一矩形**:region/security-group、机制标签和 semantic sigil 是 Archify 的事实,不是装饰。+4. **缺渲染器时仍发布“proof”**:文件清单可作普通 CI 信息,但 Architecture Delta artifact 必须完整校验后才成功。+5. **GitNexus 风险分数和 blast-radius 文案**:没有代码图与执行流证据时,这些都是过度声明。+6. **GitDiagram 的 LLM 修复循环与托管状态**:Delta 不需要模型、provider、quota、SSE、R2、Redis 或私仓 token。+7. **EMF Compare 的 proximity/content matcher 与三方 merge UI**:首版只做 two-snapshot exact-ID review,不做冲突解决、merge 或相似度配对。+8. **GitHub bot / sticky comment / Action**:它们是未来消费者,不应进入 core comparator;先把离线 HTML 与机器回执做对。+9. **新的移动端产品、全屏 dashboard 或第二套 viewer**:继续沿用现有桌面画布和 contained fallback,只新增一个紧凑的 Before / Delta / After 控制与状态 legend。++## 最小用户可见实现建议++第一版只交付一个窄而完整的垂直切片:++1. 新增零依赖 `archify compare architecture base.json head.json output.html --json [--repo-root path]`。+2. 复用现有 architecture loader、schema、engineering profile、renderer、artifact checker、atomic delivery 和 share-card pipeline。+3. 新增纯 `compareArchitecture(base, head)`,输出冻结的 versioned compare IR;renderer 只消费 IR,不在 DOM 中重新推断差异。+4. HTML 默认 Delta,顶部现有控制区内放一个紧凑三段切换 `Before | Delta | After` 和 `Δ +A ~C −R`;不增加侧栏。+5. Delta 以 head 为主层,overlay base removed/moved geometry;所有状态有文本/符号/线型,不依赖色。+6. Finder 可显示已有节点,首版不新增 status filter;Story/Focus/Reach/Route 只在当前 Before 或 After 完整状态工作,Delta overlay 不制造新的可导航语义节点。+7. canonical export、print 与 Share Card 固定到完整、静态的 Delta 状态;运行时选择和动画状态不进入 hash。+8. Skill 必须先问用户选择 base/head,并说明 relationship ID 是比较前置;不把 compare 设为普通 architecture 生成的默认能力。++这个切片已经足够形成对外价值:用户可以把一份真正自包含、可审计的架构变更图放进 PR、issue 或设计评审,而 Archify 仍保持离线、稳定、零依赖和不过度声明。++## 验收门++### 合同与确定性++1. same inputs 连续运行三次,HTML、canonical compare IR、semantic hashes、summary、changes 顺序和 artifact SHA-256 字节完全一致;receipt 不含时间、绝对路径或随机值。+2. 只改变 JSON 空白、object key 顺序、components/connections 顺序、`wraps`/`sources` set 顺序,raw hash 可变,但 semantic hash、delta summary 与 HTML 不变。+3. 所有 failure table 场景都有精确稳定 code、side、path/subject、evidence 和 supportedFixes;失败不覆盖已有 target,也不残留 candidate。++### 身份与语义++4. node rename fixture 必须输出 one removed + one added;同 label 不得配对。duplicate label fixture 结果相同。+5. missing relationship ID 必须失败;parallel relationships 用独立 ID 正确比较;同 ID 改端点同时显示旧/新关系并只计一个 changed relationship。+6. semantic、evidence、scope、geometry、presentation fixtures 各自只进入正确 bucket;pure move/reroute 不增加 architecture changed count。+7. repository same/different/one-sided/absent 四组 fixture 分别得到正确 proofLevel 或 failure;没有任何 fixture出现风险或 mergeability 文案。++### 几何与视觉++8. removed node、removed edge、moved shared node、端点变化关系、同位置 remove+add、跨 region/security-group 六组 fixture 保留准确 base/head 坐标;Delta 不执行联合 auto-layout。+9. Blueprint / Signal Flow / Classic 三 preset,深浅主题各做 1280×720 桌面截图;`+ ~ − ↔`、文字、虚线/双描边都清楚,标签无新碰撞,phantom 不遮住 head 主层。+10. Before / Delta / After 鼠标和键盘切换即时稳定;Still、reduced motion、print、embed 与普通模式语义等价;控制不进入 print/embed。+11. Share Card 的 counts、proof label、短 revision 与 compare receipt 完全一致;零变化显示 `No authored architecture changes`,不显示安全结论。++### 回归与发布++12. 没有调用 compare 的普通 architecture artifacts 保持 golden byte-compatible;五种现有 diagram type、Viewer、Finder、Focus、Reach、Route、Story、Share Card 不回归。+13. 全量 `npm test`、WebM/Share Card smoke、gallery/guide/package freshness、ZIP installed smoke(Ubuntu/macOS/Windows)、`unzip -tq`、README mirror 与 `git diff --check` 全绿。+14. 用真实项目两份 architecture snapshot 生成一次成品,在内置浏览器验证 Before / Delta / After、主题、三 preset、Share Card、console zero error/warning;最多两轮聚焦修正,并把失败→修复→通过回执写进 acceptance record。++## 推荐顺序++先实现 compare IR、身份诊断和确定性回执;再做联合几何;最后接三态 viewer 与 Share Card。不要先画一张好看的红绿图再倒推合同——那会把最难修的身份与删除几何问题固化到 UI 中。diff --git a/examples/checkout-platform-delta.html b/examples/checkout-platform-delta.htmlnew file mode 100644index 00000000..eaed9335--- /dev/null+++ b/examples/checkout-platform-delta.html@@ -0,0 +1,4843 @@+<!doctype html>+<html lang="en" data-theme="dark" data-preset="signal-flow">+<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Checkout Platform — Fraud Gate Architecture Delta</title>+<style>++ /* ==========================================================+ THEME VARIABLES — switch by toggling [data-theme] on <html>+ ========================================================== */+ :root,+ [data-theme="dark"] {+ --bg: #020617;+ --grid: #1e293b;+ --text: #ffffff;+ --text-muted: #94a3b8;+ --text-dim: #475569;+ /* UI chrome (menu hints, footer) needs more contrast than SVG .t-dim accents */+ --text-faint: #7d8da1;++ --panel: rgba(15, 23, 42, 0.5);+ --panel-border: #1e293b;+ --lane-fill: rgba(15, 23, 42, 0.22);+ --lane-stroke: #334155;++ --arrow: #64748b;+ --arrow-emphasis: #34d399;++ /* Opaque mask color used behind semi-transparent component fills+ so the arrows drawn underneath are properly hidden. */+ --mask: #0f172a;++ --frontend-fill: rgba(8, 51, 68, 0.4);+ --frontend-stroke: #22d3ee;+ --backend-fill: rgba(6, 78, 59, 0.4);+ --backend-stroke: #34d399;+ --database-fill: rgba(76, 29, 149, 0.4);+ --database-stroke: #a78bfa;+ --cloud-fill: rgba(120, 53, 15, 0.3);+ --cloud-stroke: #fbbf24;+ --security-fill: rgba(136, 19, 55, 0.4);+ --security-stroke: #fb7185;+ --messagebus-fill: rgba(251, 146, 60, 0.3);+ --messagebus-stroke:#fb923c;+ --external-fill: rgba(30, 41, 59, 0.5);+ --external-stroke: #94a3b8;++ --toolbar-bg: rgba(15, 23, 42, 0.8);+ --toolbar-border: #334155;+ --toolbar-text: #e2e8f0;+ --toolbar-hover: rgba(15, 23, 42, 0.95);+ --toolbar-menu-bg: #0f172a;+ }++ [data-theme="light"] {+ --bg: #f8fafc;+ --grid: #e2e8f0;+ --text: #0f172a;+ --text-muted: #64748b;+ --text-dim: #94a3b8;+ --text-faint: #64748b;++ --panel: #ffffff;+ --panel-border: #e2e8f0;+ --lane-fill: rgba(248, 250, 252, 0.65);+ --lane-stroke: #cbd5e1;++ --arrow: #94a3b8;+ --arrow-emphasis: #059669;++ --mask: #ffffff;++ --frontend-fill: rgba(34, 211, 238, 0.15);+ --frontend-stroke: #0891b2;+ --backend-fill: rgba(52, 211, 153, 0.18);+ --backend-stroke: #059669;+ --database-fill: rgba(167, 139, 250, 0.2);+ --database-stroke: #7c3aed;+ --cloud-fill: rgba(251, 191, 36, 0.18);+ --cloud-stroke: #d97706;+ --security-fill: rgba(251, 113, 133, 0.15);+ --security-stroke: #e11d48;+ --messagebus-fill: rgba(251, 146, 60, 0.15);+ --messagebus-stroke:#ea580c;+ --external-fill: rgba(148, 163, 184, 0.18);+ --external-stroke: #64748b;++ --toolbar-bg: rgba(255, 255, 255, 0.92);+ --toolbar-border: #cbd5e1;+ --toolbar-text: #334155;+ --toolbar-hover: #ffffff;+ --toolbar-menu-bg: #ffffff;+ }++ /* ==========================================================+ SIGNAL FLOW — an opt-in, motion-forward visual preset.+ The variables also target a standalone exported SVG, whose+ root carries data-preset and data-theme directly.+ ========================================================== */+ [data-preset="signal-flow"][data-theme="dark"] {+ --bg: #030711;+ --grid: #15233a;+ --panel: rgba(6, 14, 28, 0.78);+ --panel-border: #1d3350;+ --lane-fill: rgba(9, 22, 40, 0.5);+ --lane-stroke: #2c4564;+ --text: #f5fbff;+ --text-muted: #9eb0c7;+ --text-dim: #52667f;+ --text-faint: #7890ad;+ --mask: #07101e;+ --frontend-fill: rgba(6, 182, 212, 0.14);+ --frontend-stroke: #67e8f9;+ --backend-fill: rgba(16, 185, 129, 0.14);+ --backend-stroke: #5eead4;+ --database-fill: rgba(139, 92, 246, 0.16);+ --database-stroke: #c4b5fd;+ --cloud-fill: rgba(245, 158, 11, 0.13);+ --cloud-stroke: #fcd34d;+ --security-fill: rgba(244, 63, 94, 0.13);+ --security-stroke: #fda4af;+ --messagebus-fill: rgba(249, 115, 22, 0.13);+ --messagebus-stroke: #fdba74;+ --external-fill: rgba(71, 85, 105, 0.24);+ --external-stroke: #a5b4c7;+ --arrow: #7890ad;+ --arrow-emphasis: #2dd4bf;+ --toolbar-bg: rgba(7, 16, 30, 0.86);+ --toolbar-border: #29415f;+ --toolbar-menu-bg: #07101e;+ }++ [data-preset="signal-flow"][data-theme="light"] {+ --bg: #f4f9fc;+ --grid: #d4e5ee;+ --panel: rgba(255, 255, 255, 0.82);+ --panel-border: #bfd5e2;+ --lane-fill: rgba(232, 243, 248, 0.62);+ --lane-stroke: #a9c5d5;+ --text: #102638;+ --text-muted: #587287;+ --text-dim: #8aa2b4;+ --text-faint: #668397;+ --mask: #ffffff;+ --frontend-fill: rgba(6, 182, 212, 0.09);+ --frontend-stroke: #0789a1;+ --backend-fill: rgba(5, 150, 105, 0.09);+ --backend-stroke: #087f69;+ --database-fill: rgba(124, 58, 237, 0.09);+ --database-stroke: #7254c7;+ --cloud-fill: rgba(217, 119, 6, 0.08);+ --cloud-stroke: #b9670b;+ --security-fill: rgba(225, 29, 72, 0.08);+ --security-stroke: #c53a59;+ --messagebus-fill: rgba(234, 88, 12, 0.08);+ --messagebus-stroke: #c65f27;+ --external-fill: rgba(100, 116, 139, 0.1);+ --external-stroke: #607a8c;+ --arrow: #7b97aa;+ --arrow-emphasis: #0d9488;+ }++ /* ==========================================================+ BLUEPRINT — a review-first drafting preset for deployment,+ infrastructure, and technical design documentation. It keeps+ the same semantic palette and geometry while trading glow for+ precise grid contrast, squared materials, and drafting marks.+ ========================================================== */+ [data-preset="blueprint"][data-theme="dark"] {+ --bg: #06131f;+ --grid: #17425a;+ --panel: rgba(7, 27, 43, 0.9);+ --panel-border: #27627f;+ --lane-fill: rgba(10, 43, 66, 0.36);+ --lane-stroke: #34799a;+ --text: #e3f6ff;+ --text-muted: #91b8ca;+ --text-dim: #557e92;+ --text-faint: #739caf;+ --mask: #0a2031;+ --frontend-fill: rgba(26, 157, 193, 0.14);+ --frontend-stroke: #66d9ef;+ --backend-fill: rgba(31, 155, 124, 0.13);+ --backend-stroke: #69dfbd;+ --database-fill: rgba(120, 105, 196, 0.14);+ --database-stroke: #b4a8ff;+ --cloud-fill: rgba(197, 145, 43, 0.13);+ --cloud-stroke: #ffd166;+ --security-fill: rgba(199, 76, 104, 0.13);+ --security-stroke: #ff8da1;+ --messagebus-fill: rgba(207, 112, 49, 0.13);+ --messagebus-stroke: #ffad66;+ --external-fill: rgba(84, 119, 139, 0.18);+ --external-stroke: #a7cad9;+ --arrow: #78a3b7;+ --arrow-emphasis: #64dfc1;+ --toolbar-bg: rgba(7, 28, 45, 0.92);+ --toolbar-border: #34799a;+ --toolbar-text: #d8f3ff;+ --toolbar-hover: rgba(18, 58, 83, 0.95);+ --toolbar-menu-bg: #0a2031;+ }++ [data-preset="blueprint"][data-theme="light"] {+ --bg: #edf7fa;+ --grid: #b5d5e1;+ --panel: rgba(249, 253, 255, 0.94);+ --panel-border: #78aabd;+ --lane-fill: rgba(210, 232, 240, 0.42);+ --lane-stroke: #83b2c4;+ --text: #123344;+ --text-muted: #4e7486;+ --text-dim: #86a6b4;+ --text-faint: #668c9d;+ --mask: #f9fdff;+ --frontend-fill: rgba(8, 145, 178, 0.08);+ --frontend-stroke: #087f9c;+ --backend-fill: rgba(5, 128, 101, 0.08);+ --backend-stroke: #08755f;+ --database-fill: rgba(100, 75, 180, 0.08);+ --database-stroke: #6757a8;+ --cloud-fill: rgba(181, 120, 15, 0.08);+ --cloud-stroke: #a86609;+ --security-fill: rgba(190, 48, 80, 0.07);+ --security-stroke: #b32f50;+ --messagebus-fill: rgba(196, 81, 22, 0.07);+ --messagebus-stroke: #b65120;+ --external-fill: rgba(79, 112, 128, 0.08);+ --external-stroke: #506f7e;+ --arrow: #6d93a5;+ --arrow-emphasis: #087f69;+ --toolbar-bg: rgba(247, 252, 254, 0.94);+ --toolbar-border: #8ab5c5;+ --toolbar-text: #294f61;+ --toolbar-hover: #ffffff;+ --toolbar-menu-bg: #f9fdff;+ }++ * { margin: 0; padding: 0; box-sizing: border-box; }++ body {+ font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;+ background: var(--bg);+ min-height: 100vh;+ padding: 2rem;+ color: var(--text);+ transition: background 0.2s ease, color 0.2s ease;+ }++ html[data-preset="signal-flow"] body {+ background-image:+ radial-gradient(circle at 18% -8%, rgba(34, 211, 238, 0.14), transparent 34rem),+ radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.12), transparent 30rem);+ background-attachment: fixed;+ }+ html[data-preset="signal-flow"][data-theme="light"] body {+ background-image:+ radial-gradient(circle at 18% -8%, rgba(6, 182, 212, 0.12), transparent 34rem),+ radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.08), transparent 30rem);+ }+ html[data-preset="blueprint"] body {+ background-image:+ linear-gradient(var(--grid) 1px, transparent 1px),+ linear-gradient(90deg, var(--grid) 1px, transparent 1px);+ background-size: 32px 32px;+ background-position: -1px -1px;+ background-attachment: fixed;+ }++ /* Gallery/embed mode keeps the generated artifact as the source of truth+ while presenting only its diagram surface inside a proof card. */+ html[data-embed="true"] body {+ min-height: 0;+ padding: 0;+ overflow: hidden;+ background: var(--bg);+ background-image: none;+ }+ html[data-embed="true"] .toolbar,+ html[data-embed="true"] .header,+ html[data-embed="true"] .cards,+ html[data-embed="true"] .footer,+ html[data-embed="true"] .diagram-nav,+ html[data-embed="true"] .overview-map,+ html[data-embed="true"] .focus-chip,+ html[data-embed="true"] .route-probe,+ html[data-embed="true"] .semantic-lens,+ html[data-embed="true"] .diagram-guide,+ html[data-embed="true"] .node-finder,+ html[data-embed="true"] .guided-views { display: none !important; }+ html[data-embed="true"] .container { max-width: none; }+ html[data-embed="true"] .diagram-container {+ padding: 0.5rem;+ border: 0;+ border-radius: 0;+ box-shadow: none;+ }+ html[data-embed="true"] .diagram-container svg { min-width: 0; }++ /* Share Chapter Cue lives in the HTML viewer layer, not inside the SVG.+ It gives one-shot embeds a title, authored note, truthful stop order,+ and lifecycle state while canonical diagram geometry stays untouched. */+ .share-chapter-cue { display: none; }+ html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden]),+ html[data-embed="true"][data-share-moment="true"] .share-chapter-cue:not([hidden]) {+ position: absolute;+ z-index: 18;+ top: 0.85rem;+ left: 50%;+ display: grid;+ grid-template-columns: auto minmax(9rem, 13.5rem) minmax(0, 1fr);+ align-items: center;+ gap: 0.45rem 0.85rem;+ width: min(52rem, calc(100% - 1.5rem));+ min-height: 3.35rem;+ padding: 0.55rem 0.75rem 0.65rem;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 42%, var(--toolbar-border));+ border-radius: 0.75rem;+ background:+ linear-gradient(115deg, color-mix(in srgb, var(--frontend-fill) 52%, transparent), transparent 45%),+ color-mix(in srgb, var(--toolbar-menu-bg) 92%, transparent);+ color: var(--toolbar-text);+ box-shadow: 0 14px 42px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.045);+ backdrop-filter: blur(16px);+ pointer-events: none;+ animation: archify-share-cue-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both;+ }+ html[data-preset="blueprint"] .share-chapter-cue {+ border-radius: 0.2rem;+ background:+ linear-gradient(90deg, color-mix(in srgb, var(--frontend-fill) 46%, transparent), transparent 36%),+ var(--toolbar-menu-bg);+ box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);+ backdrop-filter: none;+ }+ .share-chapter-index {+ display: grid;+ gap: 0.12rem;+ min-width: 5rem;+ padding-right: 0.75rem;+ border-right: 1px solid var(--toolbar-border);+ }+ .share-chapter-state {+ display: inline-flex;+ align-items: center;+ gap: 0.36rem;+ color: var(--frontend-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.14em;+ text-transform: uppercase;+ }+ .share-chapter-state::before {+ width: 0.38rem;+ height: 0.38rem;+ border-radius: 50%;+ background: currentColor;+ box-shadow: 0 0 10px currentColor;+ content: '';+ }+ .share-chapter-cue[data-state="playing"] .share-chapter-state::before {+ animation: archify-share-cue-pulse 1.15s ease-in-out infinite;+ }+ .share-chapter-count {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 700;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ }+ .share-chapter-copy { min-width: 0; }+ .share-chapter-copy strong,+ .share-chapter-copy small,+ .share-chapter-route {+ display: block;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .share-chapter-copy strong {+ color: var(--toolbar-text);+ font-size: 0.6875rem;+ line-height: 1.35;+ }+ .share-chapter-copy small {+ margin-top: 0.08rem;+ color: var(--text-muted);+ font-size: 0.5rem;+ line-height: 1.35;+ }+ .share-chapter-route {+ color: color-mix(in srgb, var(--frontend-stroke) 76%, var(--text-muted));+ font-size: 0.5625rem;+ font-weight: 650;+ letter-spacing: 0.015em;+ text-align: right;+ }+ .share-chapter-progress {+ position: absolute;+ right: 0;+ bottom: 0;+ left: 0;+ height: 2px;+ overflow: hidden;+ background: color-mix(in srgb, var(--toolbar-border) 72%, transparent);+ }+ .share-chapter-progress span {+ display: block;+ width: 100%;+ height: 100%;+ background: linear-gradient(90deg, var(--frontend-stroke), var(--database-stroke));+ box-shadow: 0 0 12px var(--frontend-stroke);+ transform: scaleX(0);+ transform-origin: left center;+ }++ /* Presentation Stage is a viewer-only layer: it gives the live diagram+ the viewport while keeping guided views, theme, focus, and exports real.+ Embed mode wins when both query parameters are present. */+ html[data-present="true"]:not([data-embed="true"]) body {+ height: 100dvh;+ min-height: 0;+ padding: 1rem;+ overflow: hidden;+ }+ html[data-present="true"]:not([data-embed="true"]) .container {+ display: flex;+ flex-direction: column;+ gap: 0.75rem;+ width: 100%;+ max-width: none;+ height: calc(100dvh - 2rem);+ }+ html[data-present="true"]:not([data-embed="true"]) .header {+ flex: none;+ min-width: 0;+ margin: 0;+ padding-right: 23rem;+ }+ html[data-present="true"]:not([data-embed="true"]) .header-row { margin-bottom: 0.25rem; }+ html[data-present="true"]:not([data-embed="true"]) .subtitle {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ html[data-present="true"]:not([data-embed="true"]) .guided-views {+ flex: none;+ margin-bottom: 0;+ }+ html[data-present="true"]:not([data-embed="true"]) .diagram-container {+ display: flex;+ flex: 1 1 auto;+ align-items: center;+ justify-content: center;+ min-height: 0;+ padding: 0.75rem;+ }+ html[data-present="true"]:not([data-embed="true"]) .diagram-container > svg {+ width: 100%;+ height: 100%;+ min-width: 0;+ }+ html[data-present="true"]:not([data-embed="true"]) .cards,+ html[data-present="true"]:not([data-embed="true"]) .footer { display: none; }+ html[data-present="true"]:not([data-embed="true"]) #btn-present {+ border-color: var(--frontend-stroke);+ color: var(--frontend-stroke);+ }++ .container { max-width: 1200px; margin: 0 auto; }++ .header { margin-bottom: 2rem; padding-right: 29.5rem; }++ html[data-preset="signal-flow"] .header,+ html[data-preset="blueprint"] .header { padding-right: 29.5rem; }++ .header-row {+ display: flex;+ align-items: center;+ gap: 1rem;+ margin-bottom: 0.5rem;+ }++ .pulse-dot {+ width: 12px;+ height: 12px;+ background: var(--frontend-stroke);+ border-radius: 50%;+ animation: none;+ }++ html[data-motion-capable="true"] .pulse-dot { animation: pulse 2s infinite; }++ @keyframes pulse {+ 0%, 100% { opacity: 1; }+ 50% { opacity: 0.5; }+ }++ h1 {+ font-size: 1.5rem;+ font-weight: 700;+ letter-spacing: -0.025em;+ }++ .subtitle {+ color: var(--text-muted);+ font-size: 0.875rem;+ margin-left: 1.75rem;+ }++ html[data-preset="signal-flow"] .header-row::after {+ content: "SIGNAL FLOW";+ margin-left: auto;+ color: var(--frontend-stroke);+ border: 1px solid var(--frontend-stroke);+ border-radius: 999px;+ padding: 0.28rem 0.6rem;+ font-size: 0.625rem;+ letter-spacing: 0.12em;+ opacity: 0.82;+ box-shadow: 0 0 20px rgba(34, 211, 238, 0.12);+ white-space: nowrap;+ }++ html[data-preset="blueprint"] .pulse-dot {+ width: 10px;+ height: 10px;+ border: 1px solid var(--frontend-stroke);+ border-radius: 1px;+ background: transparent;+ box-shadow: inset 0 0 0 2px var(--bg);+ transform: rotate(45deg);+ animation: none;+ }+ html[data-preset="blueprint"] .header-row::after {+ content: "BLUEPRINT / REV 01";+ margin-left: auto;+ padding: 0.28rem 0.55rem;+ border-top: 1px solid var(--frontend-stroke);+ border-bottom: 1px solid var(--frontend-stroke);+ color: var(--frontend-stroke);+ font-size: 0.5625rem;+ font-weight: 700;+ letter-spacing: 0.14em;+ white-space: nowrap;+ }++ .diagram-container {+ background: var(--panel);+ border-radius: 1rem;+ border: 1px solid var(--panel-border);+ padding: 1.5rem;+ overflow: hidden;+ position: relative;+ }++ html[data-preset="signal-flow"] .diagram-container {+ position: relative;+ overflow: hidden;+ background: linear-gradient(180deg, rgba(8, 20, 38, 0.82), rgba(3, 8, 18, 0.94));+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 28px 80px rgba(0, 0, 0, 0.34);+ }+ html[data-preset="signal-flow"][data-theme="light"] .diagram-container {+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(237, 246, 250, 0.94));+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 24px 60px rgba(45, 78, 99, 0.12);+ }+ html[data-preset="blueprint"] .diagram-container {+ border-color: var(--panel-border);+ border-radius: 0.35rem;+ background: var(--panel);+ box-shadow:+ inset 0 0 0 1px color-mix(in srgb, var(--panel-border) 34%, transparent),+ 0 18px 48px rgba(0, 0, 0, 0.16);+ }+ html[data-preset="blueprint"] .diagram-container::after {+ content: "";+ position: absolute;+ z-index: 10;+ inset: 0.7rem;+ pointer-events: none;+ background:+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left top / 1.35rem 1px no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left top / 1px 1.35rem no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right top / 1.35rem 1px no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right top / 1px 1.35rem no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left bottom / 1.35rem 1px no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left bottom / 1px 1.35rem no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right bottom / 1.35rem 1px no-repeat,+ linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right bottom / 1px 1.35rem no-repeat;+ opacity: 0.58;+ }+ html[data-motion-capable="true"][data-preset="signal-flow"][data-ambient-motion="running"] .diagram-container::before {+ content: "";+ position: absolute;+ inset: 0;+ pointer-events: none;+ background: linear-gradient(115deg, transparent 28%, rgba(103, 232, 249, 0.035) 48%, transparent 68%);+ transform: translateX(-70%);+ animation: archify-signal-scan 4.8s ease-in-out 1 both;+ }++ /* Motion Governor gives the reader a real static state and gives the+ strongest semantic action the only motion budget. Atmosphere resets to+ its authored base instead of freezing mid-cycle. Static artifacts never+ start a decorative pulse or scan. */+ html:not([data-motion-capable="true"]) svg[data-animation="trace"] [data-animate] {+ animation: none !important;+ }+ html[data-motion="still"] .pulse-dot,+ html[data-motion="still"] .diagram-container::before,+ html[data-motion="still"] svg[data-animation="trace"] [data-animate],+ html[data-motion-owner] .pulse-dot,+ html[data-motion-owner] .diagram-container::before,+ html[data-motion-owner] svg[data-animation="trace"] [data-animate],+ html[data-embed="true"] .pulse-dot,+ html[data-embed="true"] .diagram-container::before,+ html[data-share-playback="true"] .pulse-dot,+ html[data-share-playback="true"] .diagram-container::before,+ html[data-document-hidden="true"] .pulse-dot,+ html[data-document-hidden="true"] .diagram-container::before,+ html[data-document-hidden="true"] svg[data-animation="trace"] [data-animate] {+ animation: none !important;+ }+ html[data-motion="still"] .diagram-container::before,+ html[data-motion-owner] .diagram-container::before,+ html[data-embed="true"] .diagram-container::before,+ html[data-share-playback="true"] .diagram-container::before {+ opacity: 0;+ }+ html[data-motion="still"] .guided-view-progress span,+ html[data-motion="still"] .guided-story-caption,+ html[data-motion="still"] .story-trail-flow,+ html[data-motion="still"] .intent-trace-flow,+ html[data-motion="still"] .route-probe-flow,+ html[data-motion="still"] .route-journey-flow,+ html[data-motion="still"] .semantic-lens-flow,+ html[data-motion="still"] .diagram-guide,+ html[data-motion="still"] [data-story-step],+ html[data-motion="still"] .overview-map-live,+ html[data-motion="still"] .guided-view-stop,+ html[data-motion="still"] .share-chapter-cue,+ html[data-motion="still"] .share-chapter-state::before,+ html[data-motion="still"] .share-chapter-progress span,+ html[data-document-hidden="true"] .guided-view-progress span,+ html[data-document-hidden="true"] .story-trail-flow,+ html[data-document-hidden="true"] .intent-trace-flow,+ html[data-document-hidden="true"] .route-probe-flow,+ html[data-document-hidden="true"] .route-journey-flow,+ html[data-document-hidden="true"] .semantic-lens-flow,+ html[data-document-hidden="true"] .diagram-guide,+ html[data-document-hidden="true"] [data-story-step],+ html[data-document-hidden="true"] .overview-map-live,+ html[data-document-hidden="true"] .guided-view-stop,+ html[data-document-hidden="true"] .share-chapter-cue,+ html[data-document-hidden="true"] .share-chapter-state::before,+ html[data-document-hidden="true"] .share-chapter-progress span {+ animation: none !important;+ }+ html[data-motion="still"] .guided-view-progress span {+ transform: scaleX(1) !important;+ }+ html[data-motion="still"] svg[data-story-playing="true"] .story-trail-flow {+ stroke-dasharray: none;+ stroke-dashoffset: 0;+ opacity: 0.55;+ }+ html[data-motion="still"] .intent-trace-flow,+ html[data-motion="still"] .route-probe-flow {+ stroke-dasharray: none;+ stroke-dashoffset: 0;+ opacity: 0.72;+ }+ html[data-motion="still"] .route-journey-overlay,+ html[data-document-hidden="true"] .route-journey-overlay { display: none !important; }+ html[data-motion="still"] .relationship-pulse-overlay,+ html[data-motion="still"] .story-carrier-overlay,+ html[data-document-hidden="true"] .story-carrier-overlay { display: none !important; }+ html[data-motion="still"] .chapter-handoff-overlay { display: none !important; }+ html[data-motion="still"] .chapter-handoff-anchor { animation: none !important; }+ html[data-motion="still"] .guided-view-chapter,+ html[data-motion="still"] svg [data-node-id],+ html[data-motion="still"] svg [data-edge-from],+ html[data-motion="still"] svg [data-detail],+ html[data-motion="still"] svg [data-detail-anchor],+ html[data-motion="still"] svg [data-legend-hit],+ html[data-motion="still"] svg {+ transition: none !important;+ }++ svg {+ width: 100%;+ min-width: min(900px, 100%);+ display: block;+ transform-origin: 0 0;+ transition: transform 0.18s ease;+ }++ .diagram-container.is-camera-moving svg {+ transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);+ }+ .diagram-container.is-camera-transaction svg { transition: none; }+ .diagram-container.is-pannable { cursor: grab; }+ .diagram-container.is-panning { cursor: grabbing; user-select: none; }+ .diagram-container.is-panning svg { transition: none; }++ .diagram-nav {+ position: absolute;+ right: 1rem;+ bottom: 1rem;+ z-index: 12;+ display: inline-flex;+ align-items: center;+ padding: 0.25rem;+ gap: 0.2rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.65rem;+ background: var(--toolbar-bg);+ box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);+ backdrop-filter: blur(10px);+ }+ .diagram-nav button,+ .focus-chip button,+ .guided-views button {+ border: 0;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ cursor: pointer;+ }+ .diagram-nav button {+ min-width: 2rem;+ height: 2rem;+ padding: 0 0.45rem;+ border-radius: 0.4rem;+ font-size: 0.75rem;+ font-weight: 600;+ }+ .diagram-nav button:hover,+ .diagram-nav button:focus-visible,+ .focus-chip button:hover,+ .focus-chip button:focus-visible,+ .guided-views button:hover,+ .guided-views button:focus-visible { background: var(--toolbar-hover); }+ .diagram-nav button:focus-visible,+ .focus-chip button:focus-visible,+ .guided-views button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .diagram-nav button:disabled { opacity: 0.38; cursor: default; }+ .diagram-nav [data-view="reset"] { min-width: 3.35rem; font-size: 0.625rem; }+ .diagram-container[data-camera-indicator="true"] .diagram-nav [data-view="reset"] {+ min-width: 5.2rem;+ color: var(--frontend-stroke);+ }+ .diagram-nav #btn-diagram-guide[aria-expanded="true"] {+ color: var(--cloud-stroke);+ background: var(--toolbar-hover);+ }++ /* Semantic Radar is a deliberately simplified, viewer-only overview. It+ uses authored node bounds and the live camera viewport rather than+ cloning the canonical SVG, so IDs, filters, animation, and export state+ stay singular and deterministic. */+ .overview-map {+ position: absolute;+ right: 1rem;+ bottom: 4.15rem;+ z-index: 12;+ width: 11.25rem;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));+ border-radius: 0.78rem;+ background: var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);+ backdrop-filter: blur(16px);+ font-size: 0.625rem;+ }+ .overview-map[hidden] { display: none; }+ .overview-map[data-docked="true"] {+ position: fixed;+ right: var(--archify-radar-right, 1rem);+ top: var(--archify-radar-top, 1rem);+ bottom: auto;+ }+ .overview-map[data-docked="true"][data-dock-side="left"] {+ right: auto;+ left: var(--archify-radar-left, 1rem);+ }+ html[data-preset="blueprint"] .overview-map { border-radius: 0.28rem; }+ .overview-map-head {+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ align-items: center;+ gap: 0.45rem;+ min-height: 2.25rem;+ padding: 0.42rem 0.48rem 0.38rem 0.55rem;+ border-bottom: 1px solid var(--toolbar-border);+ background: linear-gradient(110deg, color-mix(in srgb, var(--frontend-fill) 45%, transparent), transparent 68%);+ }+ .overview-map-live {+ width: 0.42rem;+ height: 0.42rem;+ border-radius: 50%;+ background: var(--backend-stroke);+ box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent);+ animation: archify-radar-live 2.4s ease-out infinite;+ }+ .overview-map-copy { min-width: 0; line-height: 1.1; }+ .overview-map-copy strong {+ display: block;+ overflow: hidden;+ color: var(--frontend-stroke);+ font-size: 0.59rem;+ letter-spacing: 0.12em;+ text-transform: uppercase;+ white-space: nowrap;+ text-overflow: ellipsis;+ }+ .overview-map-copy small {+ display: block;+ margin-top: 0.18rem;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.52rem;+ letter-spacing: 0.04em;+ white-space: nowrap;+ text-overflow: ellipsis;+ }+ .overview-map-close {+ width: 1.55rem;+ height: 1.55rem;+ padding: 0;+ border: 0;+ border-radius: 0.34rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ font-size: 0.9rem;+ cursor: pointer;+ }+ .overview-map-close:hover,+ .overview-map-close:focus-visible { background: var(--toolbar-hover); }+ .overview-map-close:focus-visible,+ .overview-map-surface:focus-visible,+ .overview-map-node:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .overview-map-surface {+ position: relative;+ height: 7rem;+ margin: 0.42rem;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--panel-border) 72%, transparent);+ border-radius: 0.42rem;+ background:+ linear-gradient(color-mix(in srgb, var(--panel-border) 26%, transparent) 1px, transparent 1px),+ linear-gradient(90deg, color-mix(in srgb, var(--panel-border) 26%, transparent) 1px, transparent 1px),+ color-mix(in srgb, var(--bg) 86%, transparent);+ background-size: 12px 12px;+ cursor: crosshair;+ touch-action: none;+ }+ html[data-preset="blueprint"] .overview-map-surface { border-radius: 0.1rem; }+ .overview-map-surface > svg {+ width: 100%;+ height: 100%;+ min-width: 0;+ transform: none !important;+ transition: none !important;+ display: block;+ overflow: visible;+ }+ .overview-map-node {+ fill: var(--backend-stroke);+ fill-opacity: 0.52;+ stroke: var(--backend-stroke);+ stroke-opacity: 0.86;+ vector-effect: non-scaling-stroke;+ cursor: pointer;+ transition: fill-opacity 140ms ease, stroke-width 140ms ease, filter 140ms ease;+ }+ .overview-map-node[data-kind="frontend"],+ .overview-map-node[data-kind="start"] { fill: var(--frontend-stroke); stroke: var(--frontend-stroke); }+ .overview-map-node[data-kind="database"],+ .overview-map-node[data-kind="success"] { fill: var(--database-stroke); stroke: var(--database-stroke); }+ .overview-map-node[data-kind="cloud"],+ .overview-map-node[data-kind="waiting"] { fill: var(--cloud-stroke); stroke: var(--cloud-stroke); }+ .overview-map-node[data-kind="messagebus"] { fill: var(--messagebus-stroke); stroke: var(--messagebus-stroke); }+ .overview-map-node[data-kind="security"],+ .overview-map-node[data-kind="decision"],+ .overview-map-node[data-kind="failure"] { fill: var(--security-stroke); stroke: var(--security-stroke); }+ .overview-map-node[data-kind="external"],+ .overview-map-node[data-kind="neutral"] { fill: var(--external-stroke); stroke: var(--external-stroke); }+ .overview-map-node[data-radar-active="true"],+ .overview-map-node:hover,+ .overview-map-node:focus-visible {+ fill-opacity: 0.92;+ stroke-width: 2.2;+ filter: drop-shadow(0 0 3px currentColor);+ }+ .overview-map-viewport {+ fill: color-mix(in srgb, var(--frontend-fill) 56%, transparent);+ stroke: var(--frontend-stroke);+ stroke-width: 2;+ vector-effect: non-scaling-stroke;+ pointer-events: none;+ filter: drop-shadow(0 0 3px color-mix(in srgb, var(--frontend-stroke) 54%, transparent));+ }+ .overview-map-hint {+ display: flex;+ justify-content: space-between;+ gap: 0.5rem;+ padding: 0 0.52rem 0.46rem;+ color: var(--text-faint);+ font-size: 0.49rem;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ }+ .diagram-nav #btn-overview-map[aria-expanded="true"] {+ color: var(--frontend-stroke);+ background: var(--toolbar-hover);+ }+ .diagram-nav #btn-route-probe[aria-pressed="true"] {+ color: var(--backend-stroke);+ background: var(--toolbar-hover);+ }+ .diagram-nav #btn-semantic-lens[aria-expanded="true"],+ .diagram-nav #btn-semantic-lens[aria-pressed="true"] {+ color: var(--database-stroke);+ background: var(--toolbar-hover);+ }++ /* Semantic Lens turns the compiled node-kind palette into an analytical+ legend. One kind reveals its real traffic; two kinds compare only their+ direct authored relationships. Geometry and the canonical SVG stay put. */+ .semantic-lens {+ position: absolute;+ right: 1rem;+ bottom: 4.15rem;+ z-index: 24;+ width: min(20rem, calc(100% - 2rem));+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--database-stroke) 58%, var(--toolbar-border));+ border-radius: 0.82rem;+ background:+ linear-gradient(135deg, color-mix(in srgb, var(--database-fill) 34%, transparent), transparent 48%),+ var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36);+ backdrop-filter: blur(18px);+ animation: archify-lens-in 180ms cubic-bezier(0.22, 1, 0.36, 1);+ }+ .semantic-lens[hidden] { display: none; }+ .semantic-lens[data-dock-side="left"] { left: 1rem; right: auto; }+ .semantic-lens[data-dock-side="right"] { left: auto; right: 1rem; }+ html[data-preset="blueprint"] .semantic-lens { border-radius: 0.28rem; }+ .semantic-lens-head {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ align-items: start;+ gap: 0.75rem;+ padding: 0.72rem 0.78rem 0.62rem;+ border-bottom: 1px solid var(--toolbar-border);+ }+ .semantic-lens-eyebrow {+ display: block;+ color: var(--database-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.16em;+ text-transform: uppercase;+ }+ .semantic-lens-title {+ display: block;+ margin-top: 0.16rem;+ color: var(--text);+ font-size: 0.82rem;+ letter-spacing: -0.02em;+ }+ .semantic-lens-close {+ width: 1.75rem;+ height: 1.75rem;+ padding: 0;+ border: 0;+ border-radius: 0.35rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ font-size: 1rem;+ cursor: pointer;+ }+ .semantic-lens-close:hover,+ .semantic-lens-close:focus-visible { background: var(--toolbar-hover); }+ .semantic-lens-instruction {+ margin: 0;+ padding: 0.52rem 0.78rem 0.48rem;+ color: var(--text-faint);+ font-size: 0.55rem;+ line-height: 1.45;+ }+ .semantic-lens-kinds {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 0.3rem;+ max-height: min(15rem, 40vh);+ padding: 0 0.5rem 0.5rem;+ overflow-y: auto;+ scrollbar-width: thin;+ }+ .semantic-lens-kind {+ --lens-color: var(--external-stroke);+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ align-items: center;+ gap: 0.42rem;+ min-width: 0;+ min-height: 2.15rem;+ padding: 0.35rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--lens-color) 24%, var(--toolbar-border));+ border-radius: 0.45rem;+ background: color-mix(in srgb, var(--panel) 76%, transparent);+ color: var(--toolbar-text);+ font: inherit;+ text-align: left;+ cursor: pointer;+ transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;+ }+ html[data-preset="blueprint"] .semantic-lens-kind { border-radius: 0.12rem; }+ .semantic-lens-kind[data-kind="frontend"],+ .semantic-lens-kind[data-kind="start"] { --lens-color: var(--frontend-stroke); }+ .semantic-lens-kind[data-kind="backend"],+ .semantic-lens-kind[data-kind="active"] { --lens-color: var(--backend-stroke); }+ .semantic-lens-kind[data-kind="database"],+ .semantic-lens-kind[data-kind="success"] { --lens-color: var(--database-stroke); }+ .semantic-lens-kind[data-kind="cloud"],+ .semantic-lens-kind[data-kind="waiting"] { --lens-color: var(--cloud-stroke); }+ .semantic-lens-kind[data-kind="messagebus"] { --lens-color: var(--messagebus-stroke); }+ .semantic-lens-kind[data-kind="security"],+ .semantic-lens-kind[data-kind="decision"],+ .semantic-lens-kind[data-kind="failure"] { --lens-color: var(--security-stroke); }+ .semantic-lens-kind:hover,+ .semantic-lens-kind:focus-visible,+ .semantic-lens-kind[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--lens-color) 78%, var(--toolbar-border));+ background: color-mix(in srgb, var(--lens-color) 11%, var(--panel));+ }+ .semantic-lens-kind:focus-visible,+ .semantic-lens-close:focus-visible,+ .semantic-lens-actions button:focus-visible {+ outline: 2px solid var(--database-stroke);+ outline-offset: 1px;+ }+ .semantic-lens-kind:disabled { opacity: 0.34; cursor: default; }+ .semantic-lens-swatch {+ width: 0.48rem;+ height: 0.48rem;+ border-radius: 50%;+ background: var(--lens-color);+ box-shadow: 0 0 8px color-mix(in srgb, var(--lens-color) 58%, transparent);+ }+ .semantic-lens-kind strong {+ overflow: hidden;+ color: var(--text);+ font-size: 0.61rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-lens-kind em {+ color: var(--lens-color);+ font-size: 0.54rem;+ font-style: normal;+ font-weight: 800;+ }+ .semantic-lens-status {+ min-height: 2.5rem;+ margin: 0;+ padding: 0.55rem 0.78rem;+ border-top: 1px solid var(--toolbar-border);+ color: var(--text-faint);+ font-size: 0.55rem;+ line-height: 1.45;+ }+ .semantic-lens-status strong { color: var(--database-stroke); font-weight: 800; }+ .semantic-lens-actions {+ display: flex;+ justify-content: flex-end;+ gap: 0.28rem;+ padding: 0 0.62rem 0.62rem;+ }+ .semantic-lens-actions button {+ min-height: 1.8rem;+ padding: 0.28rem 0.48rem;+ border: 0;+ border-radius: 0.35rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ font-size: 0.56rem;+ cursor: pointer;+ }+ .semantic-lens-actions button:hover { background: var(--toolbar-hover); }+ .semantic-lens-actions #semantic-lens-copy { color: var(--database-stroke); }+ @keyframes archify-lens-in {+ from { opacity: 0; transform: translateY(5px) scale(0.985); }+ to { opacity: 1; transform: translateY(0) scale(1); }+ }++ /* Route Probe answers a reader question over the compiled semantic graph:+ choose two stable nodes and reveal the shortest authored directed route.+ The receipt and signal live entirely in the viewer layer. */+ .route-probe {+ position: absolute;+ left: 1rem;+ bottom: 1rem;+ z-index: 12;+ width: min(46rem, calc(100% - 25rem));+ min-width: 18rem;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--backend-stroke) 62%, var(--toolbar-border));+ border-radius: 0.82rem;+ background:+ linear-gradient(115deg, color-mix(in srgb, var(--backend-fill) 50%, transparent), transparent 62%),+ var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);+ backdrop-filter: blur(16px);+ font-size: 0.625rem;+ }+ .route-probe[hidden] { display: none; }+ .route-probe[data-route-dock="top"] {+ top: 1rem;+ bottom: auto;+ }+ html[data-preset="blueprint"] .route-probe { border-radius: 0.25rem; }+ .route-probe-head {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ align-items: start;+ gap: 0.65rem;+ padding: 0.52rem 0.58rem 0.44rem;+ border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 80%, transparent);+ }+ .route-probe-copy { min-width: 0; }+ .route-probe-eyebrow {+ display: block;+ color: var(--backend-stroke);+ font-size: 0.48rem;+ font-weight: 800;+ letter-spacing: 0.15em;+ text-transform: uppercase;+ }+ .route-probe-title {+ display: block;+ margin-top: 0.14rem;+ overflow: hidden;+ color: var(--toolbar-text);+ font-size: 0.72rem;+ line-height: 1.25;+ white-space: nowrap;+ text-overflow: ellipsis;+ }+ .route-probe-actions { display: flex; gap: 0.2rem; }+ .route-probe button {+ min-height: 1.55rem;+ padding: 0.25rem 0.42rem;+ border: 0;+ border-radius: 0.36rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ cursor: pointer;+ }+ .route-probe button:hover,+ .route-probe button:focus-visible { background: var(--toolbar-hover); }+ .route-probe button:focus-visible {+ outline: 2px solid var(--backend-stroke);+ outline-offset: 1px;+ }+ .route-probe-copy-link { color: var(--frontend-stroke) !important; }+ .route-probe-find { color: var(--backend-stroke) !important; }+ .route-probe-copy-link[hidden] { display: none; }+ .route-probe-find[hidden] { display: none; }+ .route-probe-path {+ display: flex;+ align-items: center;+ min-height: 2.2rem;+ padding: 0.42rem 0.58rem 0.24rem;+ overflow-x: auto;+ scrollbar-width: thin;+ white-space: nowrap;+ }+ .route-probe-node,+ .route-probe button.route-probe-node {+ flex: none;+ max-width: 9.5rem;+ overflow: hidden;+ min-height: 1.75rem !important;+ padding: 0.22rem 0.38rem;+ border: 1px solid color-mix(in srgb, var(--backend-stroke) 46%, var(--toolbar-border));+ border-radius: 999px;+ background: color-mix(in srgb, var(--backend-fill) 52%, transparent);+ color: var(--text);+ font-size: 0.56rem;+ font-weight: 700;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .route-probe-node[data-endpoint="start"] {+ border-color: var(--frontend-stroke);+ color: var(--frontend-stroke);+ }+ .route-probe-node[data-endpoint="end"] {+ border-color: var(--security-stroke);+ color: var(--security-stroke);+ }+ .route-probe-node[data-route-journey-state="past"] { opacity: 0.66; }+ .route-probe-node[data-route-journey-state="future"] { opacity: 0.48; }+ .route-probe-node[aria-current="step"] {+ border-color: var(--backend-stroke);+ background: color-mix(in srgb, var(--backend-fill) 82%, var(--toolbar-menu-bg));+ color: var(--text);+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--backend-stroke) 42%, transparent), 0 0 14px color-mix(in srgb, var(--backend-stroke) 34%, transparent);+ opacity: 1;+ }+ html[data-preset="blueprint"] .route-probe-node[aria-current="step"] {+ border-style: double;+ border-width: 3px;+ border-radius: 0.2rem;+ box-shadow: none;+ }+ .route-probe-arrow {+ flex: none;+ padding: 0 0.28rem;+ color: var(--text-faint);+ font-size: 0.65rem;+ }+ .route-probe-placeholder {+ color: var(--text-faint);+ font-size: 0.56rem;+ letter-spacing: 0.03em;+ }+ .route-probe-status {+ display: block;+ min-height: 1.45rem;+ padding: 0.08rem 0.58rem 0.44rem;+ color: var(--text-faint);+ font-size: 0.52rem;+ line-height: 1.35;+ }+ .route-journey-controls {+ display: grid;+ grid-template-columns: 2rem minmax(5.8rem, auto) 2rem minmax(4.8rem, auto);+ justify-content: start;+ gap: 0.22rem;+ padding: 0.08rem 0.58rem 0.28rem;+ }+ .route-journey-controls[hidden] { display: none; }+ .route-journey-controls button {+ min-height: 1.8rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--toolbar-bg) 72%, transparent);+ font-size: 0.54rem;+ font-weight: 700;+ }+ .route-journey-controls button:disabled {+ cursor: default;+ opacity: 0.34;+ }+ .route-journey-play { color: var(--backend-stroke) !important; }+ .route-journey-overview { color: var(--frontend-stroke) !important; }+ .route-journey-controls[data-playing="true"] .route-journey-play {+ border-color: color-mix(in srgb, var(--backend-stroke) 64%, var(--toolbar-border));+ background: color-mix(in srgb, var(--backend-fill) 62%, transparent);+ }+ .route-probe[data-state="error"] {+ border-color: color-mix(in srgb, var(--security-stroke) 72%, var(--toolbar-border));+ }+ .route-probe[data-state="error"] .route-probe-status { color: var(--security-stroke); }++ .focus-chip {+ position: absolute;+ left: 1rem;+ top: 1rem;+ z-index: 12;+ display: block;+ width: min(22rem, calc(100% - 13rem));+ max-width: calc(100% - 13rem);+ overflow: hidden;+ border: 1px solid var(--frontend-stroke);+ border-radius: 0.85rem;+ background: var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);+ backdrop-filter: blur(16px);+ font-size: 0.6875rem;+ }+ .focus-chip[hidden] { display: none; }+ html[data-preset="blueprint"] .focus-chip { border-radius: 0.3rem; }+ .focus-chip button {+ flex: none;+ padding: 0.3rem 0.45rem;+ border-radius: 0.35rem;+ font-size: 0.625rem;+ }+ .relationship-lens-head {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ align-items: start;+ gap: 0.75rem;+ padding: 0.7rem 0.75rem 0.65rem;+ border-bottom: 1px solid var(--toolbar-border);+ background: linear-gradient(120deg, color-mix(in srgb, var(--frontend-fill) 34%, transparent), transparent 72%);+ }+ .relationship-lens-copy { min-width: 0; }+ .relationship-lens-actions {+ display: flex;+ flex-direction: column;+ align-items: stretch;+ gap: 0.18rem;+ }+ .relationship-lens-actions button { white-space: nowrap; }+ .relationship-lens-actions #btn-focus-copy { color: var(--frontend-stroke); }+ .relationship-lens-actions #btn-focus-relations { display: none; }+ .relationship-lens-eyebrow {+ display: block;+ margin-bottom: 0.18rem;+ color: var(--frontend-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.14em;+ text-transform: uppercase;+ }+ .relationship-lens-title {+ display: block;+ overflow: hidden;+ color: var(--text);+ font-size: 0.8rem;+ line-height: 1.35;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-passport-detail {+ display: block;+ margin-top: 0.12rem;+ overflow: hidden;+ color: var(--text-muted);+ font-size: 0.625rem;+ line-height: 1.4;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-passport-detail[hidden] { display: none; }+ .semantic-passport-meta {+ display: flex;+ flex-wrap: wrap;+ gap: 0.24rem;+ margin-top: 0.42rem;+ }+ .semantic-passport-meta span,+ .semantic-passport-meta code {+ max-width: 100%;+ overflow: hidden;+ padding: 0.14rem 0.34rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 82%, transparent);+ border-radius: 999px;+ background: color-mix(in srgb, var(--panel) 68%, transparent);+ color: var(--text-faint);+ font: inherit;+ font-size: 0.5rem;+ letter-spacing: 0.04em;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-passport-meta [data-passport="kind"] {+ border-color: color-mix(in srgb, var(--frontend-stroke) 50%, var(--toolbar-border));+ color: var(--frontend-stroke);+ font-weight: 800;+ text-transform: uppercase;+ }+ .semantic-passport-meta [data-passport="tag"] { color: var(--cloud-stroke); }+ .semantic-passport-meta [hidden] { display: none; }+ html[data-preset="blueprint"] .semantic-passport-meta span,+ html[data-preset="blueprint"] .semantic-passport-meta code { border-radius: 0.1rem; }+ .semantic-passport-evidence {+ margin-top: 0.52rem;+ padding: 0.5rem;+ border: 1px solid color-mix(in srgb, var(--backend-stroke) 32%, var(--toolbar-border));+ border-radius: 0.55rem;+ background: color-mix(in srgb, var(--backend-fill) 18%, var(--panel));+ }+ .semantic-passport-evidence[hidden] { display: none; }+ html[data-preset="blueprint"] .semantic-passport-evidence { border-radius: 0.18rem; }+ .semantic-passport-evidence-head {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.55rem;+ margin-bottom: 0.35rem;+ }+ .semantic-passport-evidence-status {+ display: inline-flex;+ align-items: center;+ gap: 0.28rem;+ color: var(--backend-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ }+ .semantic-passport-evidence-status::before {+ content: '';+ width: 0.38rem;+ height: 0.38rem;+ border-radius: 50%;+ background: var(--backend-stroke);+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--backend-stroke) 14%, transparent);+ }+ .semantic-passport-repository {+ min-width: 0;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.5rem;+ text-decoration: none;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-passport-repository:hover,+ .semantic-passport-repository:focus-visible { color: var(--backend-stroke); }+ .semantic-passport-evidence-links { display: grid; gap: 0.22rem; }+ .semantic-passport-source {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ gap: 0.15rem 0.45rem;+ align-items: center;+ padding: 0.34rem 0.4rem;+ border: 1px solid transparent;+ border-radius: 0.38rem;+ color: var(--text-muted);+ text-decoration: none;+ }+ .semantic-passport-source:hover,+ .semantic-passport-source:focus-visible {+ border-color: color-mix(in srgb, var(--backend-stroke) 42%, transparent);+ background: color-mix(in srgb, var(--backend-fill) 32%, transparent);+ color: var(--text);+ }+ .semantic-passport-source strong {+ overflow: hidden;+ font-size: 0.5625rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .semantic-passport-source code {+ color: var(--backend-stroke);+ font: inherit;+ font-size: 0.5rem;+ }+ .semantic-passport-source small {+ grid-column: 1 / -1;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.5rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .relationship-lens-summary {+ display: block;+ margin-top: 0.12rem;+ color: var(--text-faint);+ font-size: 0.5625rem;+ }+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }+ .relationship-lens-list {+ max-height: min(18rem, 46vh);+ overflow: auto;+ padding: 0.4rem;+ scrollbar-width: thin;+ scrollbar-color: var(--frontend-stroke) transparent;+ }+ .relationship-lens-list::-webkit-scrollbar { width: 4px; }+ .relationship-lens-list::-webkit-scrollbar-thumb {+ border-radius: 999px;+ background: color-mix(in srgb, var(--frontend-stroke) 68%, transparent);+ }+ .relationship-lens-group + .relationship-lens-group { margin-top: 0.35rem; }+ .relationship-lens-group-title {+ display: block;+ padding: 0.24rem 0.38rem 0.16rem;+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.12em;+ text-transform: uppercase;+ }+ .relationship-lens-row {+ display: grid;+ grid-template-columns: 2.1rem minmax(0, 1fr);+ gap: 0.06rem 0.45rem;+ width: 100%;+ padding: 0.45rem 0.5rem !important;+ text-align: left;+ }+ .relationship-lens-row:hover,+ .relationship-lens-row:focus-visible,+ .relationship-lens-row[data-preview-active="true"] {+ background: var(--toolbar-hover);+ box-shadow: inset 2px 0 0 var(--frontend-stroke);+ }+ .relationship-lens-row:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: -2px;+ }+ .relationship-lens-direction {+ grid-row: 1 / 3;+ align-self: center;+ color: var(--frontend-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.08em;+ }+ .relationship-lens-row[data-direction="in"] .relationship-lens-direction { color: var(--database-stroke); }+ .relationship-lens-row[data-direction="loop"] .relationship-lens-direction { color: var(--security-stroke); }+ .relationship-lens-row strong {+ overflow: hidden;+ color: var(--text);+ font-size: 0.6875rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .relationship-lens-row small {+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.5625rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .relationship-lens-empty {+ margin: 0;+ padding: 0.75rem;+ color: var(--text-faint);+ font-size: 0.625rem;+ text-align: center;+ }++ /* Diagram Guide keeps the artifact's growing reader vocabulary+ discoverable without widening the permanent control bar. It derives+ honest counts at runtime and delegates every action to an existing+ production interaction instead of creating a second command system. */+ .diagram-guide {+ position: absolute;+ top: 1rem;+ right: 1rem;+ z-index: 26;+ width: min(32rem, calc(100% - 2rem));+ max-height: min(42rem, calc(100% - 2rem));+ overflow: auto;+ border: 1px solid color-mix(in srgb, var(--cloud-stroke) 58%, var(--toolbar-border));+ border-radius: 0.82rem;+ background:+ linear-gradient(135deg, color-mix(in srgb, var(--cloud-fill) 32%, transparent), transparent 42%),+ var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 22px 64px rgba(0, 0, 0, 0.4);+ backdrop-filter: blur(18px);+ animation: archify-guide-in 180ms cubic-bezier(0.22, 1, 0.36, 1);+ }+ .diagram-guide[hidden] { display: none; }+ html[data-preset="blueprint"] .diagram-guide { border-radius: 0.28rem; }+ .diagram-guide-head {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ align-items: start;+ gap: 1rem;+ padding: 0.82rem 0.9rem 0.68rem;+ border-bottom: 1px solid var(--toolbar-border);+ }+ .diagram-guide-eyebrow {+ display: block;+ color: var(--cloud-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.16em;+ text-transform: uppercase;+ }+ .diagram-guide-title {+ display: block;+ margin-top: 0.16rem;+ color: var(--text);+ font-size: 0.86rem;+ letter-spacing: -0.02em;+ }+ .diagram-guide-close {+ width: 1.8rem;+ height: 1.8rem;+ border: 0;+ border-radius: 0.35rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ font-size: 1rem;+ cursor: pointer;+ }+ .diagram-guide-close:hover,+ .diagram-guide-close:focus-visible { background: var(--toolbar-hover); }+ .diagram-guide-stats {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ margin: 0;+ padding: 0.54rem 0.9rem;+ border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 74%, transparent);+ color: var(--text-faint);+ font-size: 0.56rem;+ letter-spacing: 0.025em;+ }+ .diagram-guide-stats::before {+ content: '';+ width: 0.42rem;+ height: 0.42rem;+ flex: none;+ border-radius: 50%;+ background: var(--backend-stroke);+ box-shadow: 0 0 10px color-mix(in srgb, var(--backend-stroke) 72%, transparent);+ }+ .diagram-guide-actions {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 0.38rem;+ padding: 0.62rem;+ }+ .diagram-guide-action {+ --guide-accent: var(--frontend-stroke);+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ align-items: center;+ gap: 0.55rem;+ min-height: 4.15rem;+ padding: 0.55rem 0.58rem;+ border: 1px solid color-mix(in srgb, var(--guide-accent) 22%, var(--toolbar-border));+ border-radius: 0.55rem;+ background: color-mix(in srgb, var(--panel) 78%, transparent);+ color: var(--toolbar-text);+ font: inherit;+ text-align: left;+ cursor: pointer;+ transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;+ }+ .diagram-guide-action[data-guide-action="route"] { --guide-accent: var(--backend-stroke); }+ .diagram-guide-action[data-guide-action="map"] { --guide-accent: var(--database-stroke); }+ .diagram-guide-action[data-guide-action="lens"] { --guide-accent: var(--messagebus-stroke); }+ .diagram-guide-action[data-guide-action="story"] { --guide-accent: var(--security-stroke); }+ .diagram-guide-action[data-guide-action="present"] {+ --guide-accent: var(--cloud-stroke);+ }+ .diagram-guide-action:hover,+ .diagram-guide-action:focus-visible {+ border-color: color-mix(in srgb, var(--guide-accent) 76%, var(--toolbar-border));+ background: color-mix(in srgb, var(--guide-accent) 9%, var(--panel));+ transform: translateY(-1px);+ }+ .diagram-guide-action:focus-visible,+ .diagram-guide-close:focus-visible {+ outline: 2px solid var(--cloud-stroke);+ outline-offset: 1px;+ }+ .diagram-guide-action:disabled {+ opacity: 0.42;+ cursor: default;+ transform: none;+ }+ .diagram-guide-index {+ display: grid;+ place-items: center;+ width: 1.65rem;+ height: 1.65rem;+ border: 1px solid color-mix(in srgb, var(--guide-accent) 64%, var(--toolbar-border));+ border-radius: 0.35rem;+ color: var(--guide-accent);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.06em;+ }+ .diagram-guide-action-copy { min-width: 0; }+ .diagram-guide-action strong {+ display: block;+ overflow: hidden;+ color: var(--text);+ font-size: 0.66rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .diagram-guide-action small {+ display: -webkit-box;+ margin-top: 0.18rem;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.5rem;+ line-height: 1.35;+ -webkit-box-orient: vertical;+ -webkit-line-clamp: 2;+ }+ .diagram-guide kbd {+ align-self: start;+ min-width: 1.45rem;+ padding: 0.12rem 0.3rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.25rem;+ color: var(--text-faint);+ font: inherit;+ font-size: 0.5rem;+ text-align: center;+ }+ .diagram-guide-shortcuts {+ display: flex;+ flex-wrap: wrap;+ gap: 0.34rem 0.62rem;+ padding: 0.58rem 0.9rem 0.68rem;+ border-top: 1px solid var(--toolbar-border);+ color: var(--text-faint);+ font-size: 0.5rem;+ }+ .diagram-guide-shortcuts span {+ display: inline-flex;+ align-items: center;+ gap: 0.28rem;+ white-space: nowrap;+ }+ .diagram-guide-feedback {+ min-height: 1rem;+ margin: -0.18rem 0.9rem 0.62rem;+ color: var(--security-stroke);+ font-size: 0.5rem;+ }+ .diagram-guide-feedback:empty { display: none; }+ @keyframes archify-guide-in {+ from { opacity: 0; transform: translateY(-5px) scale(0.985); }+ to { opacity: 1; transform: translateY(0) scale(1); }+ }++ .node-finder {+ position: absolute;+ top: 1rem;+ left: 1rem;+ z-index: 24;+ display: flex;+ flex-direction: column;+ width: min(22rem, calc(100% - 2rem));+ max-height: calc(100% - 2rem);+ overflow: hidden;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.85rem;+ background: var(--toolbar-menu-bg);+ color: var(--toolbar-text);+ box-shadow: 0 6px 8px rgba(0, 0, 0, 0.22);+ backdrop-filter: blur(16px);+ }+ .node-finder[hidden] { display: none; }+ .node-finder[data-context="route-source"] {+ border-color: color-mix(in srgb, var(--frontend-stroke) 68%, var(--toolbar-border));+ }+ .node-finder[data-context="route-target"] {+ border-color: color-mix(in srgb, var(--security-stroke) 68%, var(--toolbar-border));+ }+ html[data-preset="blueprint"] .node-finder { border-radius: 0.3rem; }+ .node-finder-head {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 1rem;+ padding: 0.7rem 0.8rem 0.45rem;+ }+ .node-finder-head strong {+ color: var(--text);+ font-size: 0.6875rem;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ }+ .node-finder[data-context="route-source"] .node-finder-head strong { color: var(--frontend-stroke); }+ .node-finder[data-context="route-target"] .node-finder-head strong { color: var(--security-stroke); }+ .node-finder-close {+ width: 1.75rem;+ height: 1.75rem;+ border: 0;+ border-radius: 0.35rem;+ background: transparent;+ color: var(--toolbar-text);+ font: inherit;+ font-size: 1rem;+ cursor: pointer;+ }+ .node-finder-close:hover,+ .node-finder-close:focus-visible { background: var(--toolbar-hover); }+ .node-finder-close:focus-visible,+ .node-finder-result:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: -2px;+ }+ .node-finder-search {+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ align-items: center;+ gap: 0.55rem;+ margin: 0 0.55rem 0.55rem;+ padding: 0 0.7rem;+ min-height: 2.6rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.55rem;+ background: color-mix(in srgb, var(--panel) 78%, transparent);+ transition: border-color 160ms ease-out, box-shadow 160ms ease-out;+ }+ html[data-preset="blueprint"] .node-finder-search { border-radius: 0.18rem; }+ .node-finder-search > span { color: var(--frontend-stroke); font-size: 0.875rem; }+ .node-finder-search:focus-within {+ border-color: var(--frontend-stroke);+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--frontend-stroke) 20%, transparent);+ }+ .node-finder-input {+ appearance: none;+ width: 100%;+ min-width: 0;+ border: 0;+ outline: 0;+ background: transparent;+ color: var(--text);+ font: inherit;+ font-size: 0.75rem;+ }+ .node-finder-input:focus-visible { outline: none; }+ .node-finder-input::placeholder { color: var(--text-faint); }+ .node-finder kbd {+ padding: 0.1rem 0.32rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.25rem;+ color: var(--text-faint);+ font: inherit;+ font-size: 0.5625rem;+ }+ .node-finder-results {+ display: grid;+ flex: 1 1 auto;+ gap: 0;+ min-height: 0;+ max-height: min(18rem, 48vh);+ margin: 0 0.55rem 0.45rem;+ padding: 0;+ overflow-y: auto;+ overscroll-behavior: contain;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 78%, transparent);+ border-radius: 0.55rem;+ background: color-mix(in srgb, var(--panel) 54%, transparent);+ scroll-padding-block: 0.25rem;+ scrollbar-width: thin;+ }+ html[data-preset="blueprint"] .node-finder-results { border-radius: 0.18rem; }+ .node-finder-result {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ gap: 0.2rem 0.75rem;+ width: 100%;+ min-height: 3.25rem;+ padding: 0.58rem 0.65rem;+ border: 0;+ border-radius: 0;+ background: transparent;+ color: var(--text);+ font: inherit;+ text-align: left;+ cursor: pointer;+ transition: background-color 160ms ease-out;+ }+ .node-finder-result:not(:last-child) {+ border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 62%, transparent);+ }+ .node-finder-result:hover,+ .node-finder-result:focus-visible {+ position: relative;+ z-index: 1;+ background: color-mix(in srgb, var(--frontend-fill) 48%, var(--toolbar-hover));+ }+ .node-finder-result strong {+ overflow: hidden;+ font-size: 0.75rem;+ line-height: 1.25;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .node-finder-result small {+ grid-column: 1 / -1;+ overflow: hidden;+ color: var(--text-faint);+ font-size: 0.5625rem;+ letter-spacing: 0.015em;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .node-finder-result em {+ align-self: center;+ color: var(--frontend-stroke);+ font-size: 0.625rem;+ font-style: normal;+ }+ .node-finder[data-context^="route-"] .node-finder-result em {+ padding: 0.1rem 0.3rem;+ border: 1px solid color-mix(in srgb, currentColor 52%, transparent);+ border-radius: 999px;+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.05em;+ text-transform: uppercase;+ }+ .node-finder[data-context="route-target"] .node-finder-result em { color: var(--security-stroke); }+ .node-finder-empty {+ padding: 1.1rem 0.75rem 1.25rem;+ color: var(--text-faint);+ font-size: 0.6875rem;+ text-align: center;+ }+ .node-finder-status {+ margin: 0;+ padding: 0.1rem 0.8rem 0.65rem;+ color: var(--text-faint);+ font-size: 0.5625rem;+ }++ .guided-views {+ display: grid;+ grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem auto;+ align-items: stretch;+ gap: 0.35rem;+ min-width: 0;+ margin: 0 0 0.75rem;+ padding: 0.35rem;+ border: 1px solid var(--toolbar-border);+ border-radius: 0.85rem;+ background: var(--toolbar-bg);+ background: linear-gradient(120deg, var(--toolbar-bg), color-mix(in srgb, var(--toolbar-bg) 82%, var(--frontend-fill)));+ box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);+ backdrop-filter: blur(12px);+ }+ .guided-views[hidden] { display: none; }++ html[data-preset="blueprint"] .guided-views {+ border-color: var(--panel-border);+ border-radius: 0.35rem;+ background:+ linear-gradient(90deg, color-mix(in srgb, var(--frontend-fill) 36%, transparent), transparent 24%),+ var(--toolbar-bg);+ box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);+ }+ html[data-preset="blueprint"] .guided-views button { border-radius: 0.2rem; }+ html[data-preset="blueprint"] .guided-view-progress { border-radius: 0; }+ html[data-preset="blueprint"] .guided-view-progress span { border-radius: 0; }+ .guided-views button {+ min-width: 0;+ padding: 0.45rem 0.6rem;+ border-radius: 0.55rem;+ font-size: 0.75rem;+ }+ .guided-views > #guided-view-prev,+ .guided-views > #guided-view-next { min-width: 2.75rem; min-height: 2.75rem; }+ .guided-views button:disabled { opacity: 0.3; cursor: default; }+ .guided-view-copy {+ min-width: 0;+ padding: 0.2rem 0.5rem;+ border-left: 1px solid var(--toolbar-border);+ overflow: hidden;+ }+ .guided-view-meta {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ min-height: 1rem;+ margin-bottom: 0.12rem;+ color: var(--frontend-stroke);+ font-size: 0.5625rem;+ font-weight: 700;+ letter-spacing: 0.12em;+ text-transform: uppercase;+ }+ .guided-view-handoff {+ box-sizing: border-box;+ height: 1rem;+ min-width: 0;+ max-width: 15rem;+ overflow: hidden;+ padding: 0 0.38rem;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 46%, transparent);+ border-radius: 999px;+ color: var(--toolbar-text);+ background: color-mix(in srgb, var(--frontend-fill) 44%, transparent);+ font-size: 0.5rem;+ line-height: calc(1rem - 2px);+ letter-spacing: 0.06em;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .guided-view-handoff[hidden] { display: none; }+ html[data-preset="blueprint"] .guided-view-handoff { border-radius: 0.15rem; }+ .chapter-handoff-overlay { pointer-events: none; }+ .chapter-handoff-anchor {+ fill: color-mix(in srgb, var(--frontend-fill) 10%, transparent);+ stroke: var(--frontend-stroke);+ stroke-width: 2;+ stroke-dasharray: 4 4;+ vector-effect: non-scaling-stroke;+ opacity: 0.96;+ animation: archify-chapter-anchor 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;+ }+ svg[data-chapter-handoff] [data-node-id][data-chapter-role="stay"] { opacity: 1; }+ svg[data-chapter-handoff] [data-node-id][data-chapter-role="enter"] { opacity: 0.78; }+ svg[data-chapter-handoff] [data-node-id][data-chapter-role="leave"] { opacity: 0.26; }+ @keyframes archify-chapter-anchor {+ 0% { opacity: 0.35; stroke-dashoffset: 8; }+ 45% { opacity: 1; }+ 100% { opacity: 0.72; stroke-dashoffset: 0; }+ }+ .guided-view-progress {+ width: 3.5rem;+ height: 2px;+ overflow: hidden;+ border-radius: 999px;+ background: var(--toolbar-border);+ }+ .guided-view-progress span {+ display: block;+ width: 100%;+ height: 100%;+ border-radius: inherit;+ background: var(--frontend-stroke);+ transform: scaleX(0);+ transform-origin: left center;+ }+ .guided-view-copy strong,+ .guided-view-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+ .guided-view-copy strong { color: var(--toolbar-text); font-size: 0.75rem; line-height: 1.35; }+ .guided-view-copy small { margin-top: 0; color: var(--text-muted); font-size: 0.625rem; line-height: 1.35; }+ .guided-story-caption {+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ gap: 0.12rem 0.55rem;+ align-items: center;+ min-width: 0;+ margin-top: 0.18rem;+ padding: 0.3rem 0.5rem;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 32%, var(--toolbar-border));+ border-radius: 0.58rem;+ background: color-mix(in srgb, var(--frontend-fill) 26%, transparent);+ animation: archify-story-caption-in 140ms cubic-bezier(0.22, 1, 0.36, 1) both;+ }+ .guided-story-caption[hidden] { display: none; }+ .guided-story-caption-index {+ grid-row: 1 / span 2;+ align-self: stretch;+ display: inline-grid;+ min-width: 3.3rem;+ place-items: center;+ padding-right: 0.52rem;+ border-right: 1px solid color-mix(in srgb, var(--frontend-stroke) 28%, var(--toolbar-border));+ color: var(--frontend-stroke);+ font-size: 0.5625rem;+ font-weight: 800;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ }+ .guided-story-caption strong,+ .guided-story-caption small {+ display: block;+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .guided-story-caption strong { color: var(--toolbar-text); font-size: 0.6875rem; line-height: 1.3; }+ .guided-story-caption small { color: var(--text-muted); font-size: 0.5625rem; line-height: 1.35; }+ .guided-story-caption-next {+ grid-column: 3;+ grid-row: 1 / span 2;+ display: grid;+ min-width: 6.4rem;+ max-width: 9.5rem;+ align-self: stretch;+ align-content: center;+ padding-left: 0.58rem;+ border-left: 1px solid color-mix(in srgb, var(--frontend-stroke) 22%, var(--toolbar-border));+ }+ .guided-story-caption-next[hidden] { display: none; }+ .guided-story-caption-next small {+ color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--text-muted));+ font-weight: 800;+ letter-spacing: 0.09em;+ text-transform: uppercase;+ }+ .guided-story-caption-next strong { color: var(--text-muted); font-weight: 700; }+ html[data-preset="blueprint"] .guided-story-caption { border-radius: 0.2rem; }+ .guided-views[data-story-beat] .guided-view-copy > #guided-view-label,+ .guided-views[data-story-beat] .guided-view-copy > #guided-view-note { display: none; }+ @keyframes archify-story-caption-in {+ from { opacity: 0; transform: translateY(3px); }+ to { opacity: 1; transform: translateY(0); }+ }+ .guided-view-trail {+ display: flex;+ align-items: center;+ gap: 0.28rem;+ min-width: 0;+ min-height: 1.7rem;+ margin-top: 0;+ padding: 0;+ overflow-x: auto;+ color: var(--text-faint);+ overscroll-behavior-x: contain;+ touch-action: pan-x;+ scrollbar-width: none;+ white-space: nowrap;+ }+ .guided-view-trail[hidden] { display: none; }+ .guided-view-trail::-webkit-scrollbar { display: none; }+ .guided-view-trail .guided-view-stop {+ appearance: none;+ box-sizing: border-box;+ display: inline-flex;+ flex: 0 0 auto;+ align-items: center;+ gap: 0.28rem;+ min-height: 1.5rem;+ padding: 0.1rem 0.3rem 0.1rem 0.18rem;+ border: 1px solid transparent;+ border-radius: 999px;+ background: transparent;+ color: var(--text-muted);+ cursor: pointer;+ font-family: inherit;+ font-size: 0.5625rem;+ font-weight: 650;+ letter-spacing: 0.02em;+ line-height: 1;+ transition: background 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;+ }+ .guided-view-stop:hover {+ border-color: color-mix(in srgb, var(--frontend-stroke) 36%, transparent);+ background: color-mix(in srgb, var(--frontend-fill) 34%, transparent);+ }+ .guided-view-stop:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .guided-view-stop:disabled { cursor: wait; }+ .guided-view-stop::before {+ display: inline-grid;+ width: 1rem;+ height: 1rem;+ place-items: center;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 54%, var(--toolbar-border));+ border-radius: 50%;+ background: color-mix(in srgb, var(--frontend-fill) 58%, var(--toolbar-bg));+ color: var(--frontend-stroke);+ content: attr(data-story-number);+ font-size: 0.5rem;+ line-height: 1;+ }+ .guided-view-stop + .guided-view-stop::after {+ order: -1;+ color: color-mix(in srgb, var(--frontend-stroke) 58%, var(--text-faint));+ content: '\00b7';+ font-size: 0.65rem;+ }+ .guided-view-stop[data-story-link="forward"]::after { content: '\2192'; }+ .guided-view-stop[data-story-link="reverse"]::after { content: '\2190'; }+ .guided-view-stop[data-story-link="multiple"]::after { content: '\21c4'; }+ .guided-view-stop[data-story-beat-state="pending"] { opacity: 0.38; }+ .guided-view-stop[data-story-beat-state="next"] {+ border-style: dashed;+ border-color: color-mix(in srgb, var(--frontend-stroke) 42%, var(--toolbar-border));+ color: color-mix(in srgb, var(--toolbar-text) 68%, var(--text-muted));+ opacity: 0.58;+ }+ .guided-view-stop[data-story-beat-state="past"] { color: var(--text-muted); opacity: 0.76; }+ .guided-view-stop[data-story-beat-state="active"] {+ border-color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--frontend-fill) 42%, transparent);+ color: var(--toolbar-text);+ font-weight: 800;+ opacity: 1;+ }+ .guided-view-stop[data-story-beat-state="active"]::before {+ border-color: var(--frontend-stroke);+ box-shadow: 0 0 10px color-mix(in srgb, var(--frontend-stroke) 54%, transparent);+ }+ html[data-preset="blueprint"] .guided-view-stop,+ html[data-preset="blueprint"] .guided-view-stop::before { border-radius: 0.1rem; }+ html[data-preset="blueprint"] .guided-view-stop[data-story-beat-state="active"]::before { box-shadow: none; }+ .guided-view-actions { display: flex; align-items: stretch; gap: 0.2rem; }+ .guided-view-actions button { white-space: nowrap; }+ .guided-view-play {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 0.38rem;+ min-width: 6.25rem !important;+ color: var(--frontend-stroke) !important;+ font-size: 0.625rem !important;+ }+ .guided-view-play[aria-pressed="true"] { background: var(--toolbar-hover); }+ .guided-view-all { min-width: 3.25rem !important; color: var(--text-muted) !important; font-size: 0.625rem !important; }+ .guided-view-beat-link {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 0.3rem;+ min-width: 5.4rem !important;+ min-height: 1.5rem;+ color: var(--text-muted) !important;+ font-size: 0.5625rem !important;+ letter-spacing: 0.025em;+ transition: background 140ms ease, border-color 140ms ease, color 140ms ease;+ }+ .guided-view-beat-link:not(:disabled):hover {+ border-color: color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));+ color: var(--frontend-stroke) !important;+ }+ .guided-view-beat-link[data-copy-state="copied"] {+ border-color: color-mix(in srgb, var(--backend-stroke) 58%, var(--toolbar-border));+ background: color-mix(in srgb, var(--backend-fill) 46%, transparent);+ color: var(--backend-stroke) !important;+ }+ .guided-view-index {+ grid-column: 1 / -1;+ min-width: 0;+ padding: 0.28rem 0.12rem 0.08rem;+ overflow: hidden;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);+ }+ @media (min-width: 721px) {+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-index,+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-beat-link,+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-all,+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-trail,+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-copy > #guided-view-label,+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-copy > #guided-view-note { display: none; }+ html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-story-caption { margin-top: 0.08rem; }+ }+ .guided-view-chapters {+ display: flex;+ gap: 0.28rem;+ min-width: 0;+ margin: 0;+ padding: 0.08rem 0.05rem 0.2rem;+ overflow-x: auto;+ list-style: none;+ scroll-padding-inline: 0.05rem;+ scroll-snap-type: x proximity;+ scrollbar-width: none;+ }+ .guided-view-chapters::-webkit-scrollbar { display: none; }+ .guided-view-chapters li {+ display: flex;+ flex: 1 1 0;+ min-width: 9.5rem;+ scroll-snap-align: center;+ }+ .guided-view-chapter {+ position: relative;+ display: grid !important;+ grid-template-columns: 1.55rem minmax(0, 1fr) auto;+ align-items: center;+ width: 100%;+ min-height: 2.75rem;+ padding: 0.36rem 0.48rem !important;+ overflow: hidden;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent) !important;+ border-radius: 0.48rem !important;+ background: color-mix(in srgb, var(--toolbar-bg) 88%, transparent) !important;+ color: var(--text-muted) !important;+ text-align: left;+ transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;+ }+ .guided-view-chapter:hover {+ border-color: color-mix(in srgb, var(--frontend-stroke) 58%, var(--toolbar-border)) !important;+ background: color-mix(in srgb, var(--frontend-fill) 42%, var(--toolbar-bg)) !important;+ }+ .guided-view-chapter:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .guided-view-chapter-index {+ display: inline-grid;+ width: 1.32rem;+ height: 1.32rem;+ place-items: center;+ border: 1px solid color-mix(in srgb, var(--frontend-stroke) 48%, var(--toolbar-border));+ border-radius: 50%;+ color: var(--frontend-stroke);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.03em;+ }+ .guided-view-chapter-title {+ min-width: 0;+ overflow: hidden;+ color: var(--toolbar-text);+ font-size: 0.625rem;+ font-weight: 700;+ line-height: 1.3;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .guided-view-chapter-count {+ grid-column: 3;+ grid-row: 1;+ margin-left: 0.38rem;+ color: var(--text-faint);+ font-size: 0.5rem;+ font-style: normal;+ font-weight: 650;+ white-space: nowrap;+ }+ .guided-view-chapter-delta {+ display: inline-flex;+ grid-column: 3;+ grid-row: 1;+ align-items: center;+ gap: 0.22rem;+ margin-left: 0.38rem;+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 750;+ letter-spacing: 0.01em;+ white-space: nowrap;+ }+ .guided-view-chapter-delta[hidden] { display: none; }+ .guided-view-chapter-delta [data-delta-kind="stay"] { color: var(--text-muted); }+ .guided-view-chapter-delta [data-delta-kind="enter"] { color: var(--frontend-stroke); }+ .guided-view-chapter-delta [data-delta-kind="leave"] { color: var(--security-stroke); }+ .guided-view-chapter[data-preview-active="true"] {+ border-color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--toolbar-border)) !important;+ background: color-mix(in srgb, var(--frontend-fill) 54%, var(--toolbar-bg)) !important;+ }+ .guided-view-chapter[data-chapter-position="current"] {+ border: 2px solid var(--frontend-stroke) !important;+ padding: calc(0.36rem - 1px) calc(0.48rem - 1px) !important;+ box-shadow: inset 3px 0 0 var(--frontend-stroke);+ color: var(--toolbar-text) !important;+ }+ .guided-view-chapter[data-chapter-position="current"] .guided-view-chapter-index {+ background: var(--frontend-stroke);+ color: var(--bg);+ }+ .guided-view-chapter[data-chapter-position="before"] {+ border-style: solid !important;+ opacity: 0.72;+ }+ .guided-view-chapter[data-chapter-position="after"] { border-style: dashed !important; }+ html[data-preset="signal-flow"] .guided-view-chapter[data-chapter-position="current"] {+ box-shadow: inset 3px 0 0 var(--frontend-stroke), 0 0 18px color-mix(in srgb, var(--frontend-stroke) 18%, transparent);+ }+ html[data-preset="blueprint"] .guided-view-chapter,+ html[data-preset="blueprint"] .guided-view-chapter-index { border-radius: 0.12rem !important; }++ /* Story Shelf — keep every authored chapter and the Play action visible,+ but do not spend a second row on unavailable director controls before+ the reader enters a chapter. Existing data-active-view state expands+ the full guided surface without a new toggle or stored preference. */+ .guided-views[data-active-view="all"] {+ grid-template-columns: minmax(11rem, .72fr) auto minmax(0, 2fr);+ align-items: center;+ padding: 0.28rem 0.35rem;+ }+ .guided-views[data-active-view="all"] > #guided-view-prev,+ .guided-views[data-active-view="all"] > #guided-view-next,+ .guided-views[data-active-view="all"] .guided-view-beat-link,+ .guided-views[data-active-view="all"] .guided-view-all { display: none; }+ .guided-views[data-active-view="all"] .guided-view-copy {+ grid-column: 1;+ grid-row: 1;+ padding: 0.1rem 0.55rem;+ }+ .guided-views[data-active-view="all"] .guided-view-copy > #guided-view-note { display: none; }+ .guided-views[data-active-view="all"] .guided-view-actions {+ display: block;+ grid-column: 2;+ grid-row: 1;+ }+ .guided-views[data-active-view="all"] .guided-view-play { min-height: 2.75rem; }+ .guided-views[data-active-view="all"] .guided-view-index {+ grid-column: 3;+ grid-row: 1;+ padding: 0 0.08rem 0 0.42rem;+ border-top: 0;+ border-left: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);+ }+ .guided-views[data-active-view="all"] .guided-view-chapters {+ gap: 0.3rem;+ padding: 0;+ }++ .cards {+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));+ gap: 1rem;+ margin-top: 2rem;+ }++ .card {+ background: var(--panel);+ border-radius: 0.75rem;+ border: 1px solid var(--panel-border);+ padding: 1.25rem;+ }++ html[data-preset="signal-flow"] .card {+ background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);+ }+ html[data-preset="signal-flow"][data-theme="light"] .card {+ background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);+ }++ html[data-preset="blueprint"] .card {+ position: relative;+ border-color: var(--panel-border);+ border-radius: 0.3rem;+ background: var(--panel);+ box-shadow: none;+ }+ html[data-preset="blueprint"] .card::before {+ content: "";+ position: absolute;+ top: -1px;+ left: 1rem;+ width: 2.5rem;+ border-top: 2px solid var(--frontend-stroke);+ }++ .card-header {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ margin-bottom: 0.75rem;+ }++ .card-dot {+ width: 8px;+ height: 8px;+ border-radius: 50%;+ }++ .card-dot.cyan { background: var(--frontend-stroke); }+ .card-dot.emerald { background: var(--backend-stroke); }+ .card-dot.violet { background: var(--database-stroke); }+ .card-dot.amber { background: var(--cloud-stroke); }+ .card-dot.rose { background: var(--security-stroke); }+ .card-dot.orange { background: var(--messagebus-stroke); }+ .card-dot.slate { background: var(--external-stroke); }++ .card h3 { font-size: 0.875rem; font-weight: 600; color: var(--text); }++ .card ul {+ list-style: none;+ color: var(--text-muted);+ font-size: 0.75rem;+ }++ .card li { margin-bottom: 0.375rem; }++ .footer {+ text-align: center;+ margin-top: 1.5rem;+ color: var(--text-faint);+ font-size: 0.75rem;+ }++ .footer .artifact-start-link {+ color: var(--text-faint);+ text-decoration-color: color-mix(in srgb, var(--frontend-stroke) 48%, transparent);+ text-underline-offset: 0.22em;+ transition: color 0.15s ease, text-decoration-color 0.15s ease;+ }++ .footer .artifact-start-link:hover,+ .footer .artifact-start-link:focus-visible {+ color: var(--frontend-stroke);+ text-decoration-color: currentColor;+ }++ /* ==========================================================+ Print stylesheet — hide interactive controls, force light,+ drop the grid so the diagram doesn't waste ink, use landscape+ so wide diagrams fit, pack summary cards into 2 columns to+ avoid an orphan card on a trailing page.+ ========================================================== */+ @page { size: landscape; margin: 1.5cm; }++ @media print {+ /* Force the FULL light palette — including component fills/strokes and+ lane/arrow colors — so printing from dark theme doesn't put neon+ strokes and translucent dark fills on white paper. */+ :root, [data-theme="dark"], [data-theme="light"] {+ --bg: #ffffff;+ --grid: transparent;+ --panel: #ffffff;+ --panel-border: #e2e8f0;+ --text: #0f172a;+ --text-muted: #475569;+ --text-dim: #94a3b8;+ --text-faint: #64748b;+ --mask: #ffffff;+ --lane-fill: rgba(248, 250, 252, 0.65);+ --lane-stroke: #cbd5e1;+ --arrow: #94a3b8;+ --arrow-emphasis: #059669;+ --frontend-fill: rgba(34, 211, 238, 0.15);+ --frontend-stroke: #0891b2;+ --backend-fill: rgba(52, 211, 153, 0.18);+ --backend-stroke: #059669;+ --database-fill: rgba(167, 139, 250, 0.2);+ --database-stroke: #7c3aed;+ --cloud-fill: rgba(251, 191, 36, 0.18);+ --cloud-stroke: #d97706;+ --security-fill: rgba(251, 113, 133, 0.15);+ --security-stroke: #e11d48;+ --messagebus-fill: rgba(251, 146, 60, 0.15);+ --messagebus-stroke:#ea580c;+ --external-fill: rgba(148, 163, 184, 0.18);+ --external-stroke: #64748b;+ }+ body { background: #ffffff !important; padding: 0; }+ .container { max-width: none; }+ .toolbar, .diagram-nav, .focus-chip, .guided-views, .archify-toast, .no-print { display: none !important; }+ .chapter-handoff-overlay { display: none !important; }+ svg [data-node-id][data-chapter-role] { opacity: 1 !important; }+ svg[data-chapter-preview] [data-node-id],+ svg[data-chapter-preview] [data-edge-from] { opacity: 1 !important; filter: none !important; }+ .diagram-container, .card { box-shadow: none; border-color: #e2e8f0; }+ html[data-preset="signal-flow"] .diagram-container,+ html[data-preset="signal-flow"] .card { background: #ffffff; }+ .cards { grid-template-columns: 1fr 1fr; }+ /* Ensure elements break sensibly across pages */+ .card { break-inside: avoid; page-break-inside: avoid; }+ .diagram-container { break-inside: avoid; page-break-inside: avoid; }+ .diagram-container svg [data-detail] {+ opacity: 1 !important;+ pointer-events: auto !important;+ }+ .diagram-container svg [data-detail-anchor] { transform: none !important; }+ .diagram-container svg[data-lens-active] [data-node-id],+ .diagram-container svg[data-lens-active] [data-edge-from],+ .diagram-container svg[data-legend-preview-active] [data-node-id],+ .diagram-container svg[data-legend-preview-active] [data-edge-from] {+ opacity: 1 !important;+ filter: none !important;+ }+ [data-legend-bridge-runtime] { display: none !important; }+ .semantic-lens-overlay { display: none !important; }+ .relationship-hit-overlay { display: none !important; }+ .relationship-pulse-overlay { display: none !important; }+ .route-probe-overlay, .route-journey-overlay { display: none !important; }+ .story-trail-overlay,+ .story-carrier-overlay { display: none !important; }+ .diagram-container svg[data-focus-active] [data-node-id],+ .diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],+ .diagram-container svg[data-story-beat] [data-story-step],+ .diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],+ .diagram-container svg[data-route-active] [data-node-id],+ .diagram-container svg[data-route-active] [data-edge-from] {+ opacity: 1 !important;+ filter: none !important;+ animation: none !important;+ }+ h1, .subtitle { color: #0f172a; }+ }++ /* ==========================================================+ TOOLBAR (theme toggle + export menu)+ ========================================================== */+ .toolbar {+ position: fixed;+ top: 1rem;+ right: 1rem;+ display: flex;+ gap: 0.5rem;+ z-index: 100;+ }+ .toolbar button {+ background: var(--toolbar-bg);+ color: var(--toolbar-text);+ border: 1px solid var(--toolbar-border);+ padding: 0.5rem 0.875rem;+ border-radius: 0.5rem;+ font-family: inherit;+ font-size: 0.75rem;+ font-weight: 500;+ cursor: pointer;+ backdrop-filter: blur(8px);+ transition: background 0.15s, border-color 0.15s;+ display: inline-flex;+ align-items: center;+ gap: 0.375rem;+ min-height: 2.75rem;+ }+ .toolbar button:hover {+ background: var(--toolbar-hover);+ border-color: var(--arrow);+ }+ .toolbar button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 2px;+ }+ .toolbar #btn-motion[hidden] { display: none !important; }+ .toolbar #btn-motion { min-width: 4.4rem; }+ .toolbar #btn-motion:disabled { cursor: default; opacity: 0.58; }+ .toolbar #btn-preset { min-width: 5.4rem; }+ .preset-control-mark {+ width: 0.58rem;+ height: 0.58rem;+ flex: 0 0 auto;+ border: 1px solid var(--frontend-stroke);+ border-radius: 0.2rem;+ background: color-mix(in srgb, var(--frontend-stroke) 28%, transparent);+ transition: border-radius 0.15s, box-shadow 0.15s, transform 0.15s;+ }+ #btn-preset[data-preset-option="signal-flow"] .preset-control-mark {+ border-radius: 50%;+ box-shadow: 0 0 10px color-mix(in srgb, var(--frontend-stroke) 78%, transparent);+ }+ #btn-preset[data-preset-option="blueprint"] .preset-control-mark {+ border-radius: 0.06rem;+ background: transparent;+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--frontend-stroke) 32%, transparent);+ transform: rotate(45deg) scale(0.84);+ }+ .motion-control-dot {+ width: 0.46rem;+ height: 0.46rem;+ flex: 0 0 auto;+ border: 1px solid var(--frontend-stroke);+ border-radius: 50%;+ background: var(--frontend-stroke);+ box-shadow: 0 0 9px color-mix(in srgb, var(--frontend-stroke) 72%, transparent);+ }+ #btn-motion[aria-pressed="false"] .motion-control-dot {+ background: transparent;+ box-shadow: none;+ }+ .toolbar .export-wrap { position: relative; }+ .toolbar .export-menu {+ position: absolute;+ top: calc(100% + 0.375rem);+ right: 0;+ background: var(--toolbar-menu-bg);+ border: 1px solid var(--toolbar-border);+ border-radius: 0.5rem;+ padding: 0.375rem;+ min-width: 160px;+ display: none;+ flex-direction: column;+ box-shadow: 0 4px 20px rgba(0,0,0,0.25);+ }+ .toolbar .export-menu.open { display: flex; }+ .toolbar .export-menu button {+ background: transparent;+ border: 0;+ justify-content: space-between;+ width: 100%;+ text-align: left;+ padding: 0.5rem 0.75rem;+ }+ .toolbar .export-menu button[hidden] { display: none; }+ .toolbar .export-menu button:hover {+ background: var(--toolbar-hover);+ }+ .toolbar .export-menu .hint {+ color: var(--text-faint);+ font-size: 0.625rem;+ }+ .toolbar .export-menu hr {+ border: 0;+ border-top: 1px solid var(--toolbar-border);+ margin: 0.25rem 0.375rem;+ opacity: 0.5;+ }++ /* Toast — brief feedback for actions like "copied" */+ .archify-toast {+ position: fixed;+ top: 1rem;+ left: 50%;+ transform: translateX(-50%) translateY(-8px);+ background: var(--toolbar-menu-bg);+ color: var(--text);+ border: 1px solid var(--toolbar-border);+ padding: 0.5rem 1rem;+ border-radius: 0.5rem;+ font-family: inherit;+ font-size: 0.75rem;+ opacity: 0;+ transition: opacity 0.2s, transform 0.2s;+ z-index: 200;+ pointer-events: none;+ box-shadow: 0 4px 20px rgba(0,0,0,0.25);+ }+ .archify-toast.show {+ opacity: 1;+ transform: translateX(-50%) translateY(0);+ }++ @media (max-width: 720px) {+ body { padding: 1rem; }+ .toolbar {+ position: static;+ justify-content: flex-end;+ margin-bottom: 1rem;+ }+ .header { margin-bottom: 1.25rem; padding-right: 0; }+ html[data-preset="signal-flow"] .header,+ html[data-preset="blueprint"] .header { padding-right: 0; }+ .header-row {+ gap: 0.75rem;+ align-items: flex-start;+ }+ html[data-preset="signal-flow"] .header-row,+ html[data-preset="blueprint"] .header-row { flex-wrap: wrap; }+ html[data-preset="signal-flow"] .header-row::after {+ margin-left: 0;+ order: 3;+ }+ html[data-preset="blueprint"] .header-row::after {+ margin-left: 0;+ order: 3;+ }+ h1 {+ font-size: 1.25rem;+ line-height: 1.25;+ }+ .subtitle {+ margin-left: 0;+ font-size: 0.8125rem;+ line-height: 1.55;+ }+ .diagram-container {+ padding: 0.75rem;+ border-radius: 0.75rem;+ }+ html:not([data-embed="true"]) .diagram-container {+ padding: 0.75rem 0.75rem 4.25rem;+ }+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] {+ overflow-x: auto;+ overflow-y: hidden;+ overscroll-behavior-x: contain;+ scrollbar-width: thin;+ scroll-behavior: smooth;+ }+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] > svg {+ min-width: 720px;+ }+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .diagram-nav,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .overview-map,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .focus-chip,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .route-probe,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .semantic-lens,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .diagram-guide,+ html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .node-finder {+ transform: translateX(var(--archify-scroll-x, 0px));+ }+ .diagram-nav { right: 0.5rem; bottom: 0.5rem; }+ .overview-map {+ right: 0.5rem;+ bottom: 3.7rem;+ width: min(10.25rem, calc(100% - 1rem));+ }+ .overview-map[data-docked="true"] {+ right: 0.5rem;+ top: var(--archify-radar-top, 0.5rem);+ bottom: auto;+ transform: none !important;+ }+ .overview-map[data-docked="true"][data-dock-side="left"] {+ right: auto;+ left: 0.5rem;+ }+ .overview-map-surface { height: 4rem; }+ .semantic-lens {+ right: 0.5rem;+ bottom: 3.7rem;+ width: calc(100% - 1rem);+ max-height: calc(100% - 4.2rem);+ }+ .semantic-lens[data-dock-side] { left: auto; right: 0.5rem; }+ .semantic-lens-kinds { max-height: min(12rem, 34vh); }+ .focus-chip {+ left: 0.5rem;+ top: 0.5rem;+ width: calc(100% - 1rem);+ max-width: none;+ }+ .relationship-lens-list { max-height: min(12rem, 38vh); }+ .relationship-lens-actions #btn-focus-relations { display: block; color: var(--database-stroke); }+ .focus-chip:not([data-relations-expanded="true"]) .relationship-lens-head { border-bottom-color: transparent; }+ .focus-chip:not([data-relations-expanded="true"]) .relationship-lens-list { display: none; }+ /* While a mobile reader previews one relationship, turn the full Lens+ into a compact peek card. This keeps the exact source and target on+ canvas instead of covering them with a long, scrollable list. */+ .focus-chip[data-relationship-previewing="true"] .relationship-lens-list {+ max-height: none;+ padding: 0.35rem;+ overflow: hidden;+ }+ .focus-chip[data-relationship-previewing="true"] .relationship-lens-group { margin: 0; }+ .focus-chip[data-relationship-previewing="true"] .relationship-lens-group-title,+ .focus-chip[data-relationship-previewing="true"] .relationship-lens-row:not([data-preview-active="true"]) {+ display: none;+ }+ .node-finder {+ top: 0.5rem;+ left: 0.5rem;+ width: min(22rem, calc(100% - 1rem));+ max-height: calc(100% - 1rem);+ }+ .diagram-guide {+ top: 0.5rem;+ right: 0.5rem;+ left: 0.5rem;+ width: auto;+ max-height: calc(100% - 1rem);+ }+ .diagram-guide-head { padding: 0.62rem 0.7rem 0.52rem; }+ .diagram-guide-stats { padding: 0.42rem 0.7rem; }+ .diagram-guide-actions {+ grid-template-columns: 1fr;+ gap: 0.28rem;+ padding: 0.42rem;+ }+ .diagram-guide-action {+ min-height: 3.1rem;+ padding: 0.42rem 0.48rem;+ }+ .diagram-guide-action small {+ display: block;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .diagram-guide-index {+ width: 1.5rem;+ height: 1.5rem;+ }+ .diagram-guide-shortcuts { padding: 0.46rem 0.7rem 0.52rem; }+ .diagram-guide-action[data-guide-action="present"] { grid-column: auto; }+ .route-probe[data-guide-open="true"] {+ visibility: hidden;+ pointer-events: none;+ }+ .node-finder-results { max-height: min(16rem, 38vh); }+ .route-probe {+ left: 0.5rem;+ bottom: 3.7rem;+ width: calc(100% - 1rem);+ min-width: 0;+ }+ .route-probe[data-route-dock="top"] {+ top: 0.5rem;+ bottom: auto;+ }+ .route-probe[data-finder-open="true"] {+ visibility: hidden;+ pointer-events: none;+ }+ .route-probe-head { padding: 0.45rem 0.48rem 0.38rem; }+ .route-probe-path { padding: 0.35rem 0.48rem 0.2rem; }+ .route-probe-node { min-height: 2.75rem !important; }+ .route-journey-controls {+ grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem minmax(0, 1fr);+ padding: 0.08rem 0.48rem 0.32rem;+ }+ .route-journey-controls button { min-height: 2.75rem; }+ .route-probe-status { padding: 0.05rem 0.48rem 0.38rem; }+ .route-probe-node { max-width: 7.5rem; }+ .guided-views {+ grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;+ gap: 0.2rem;+ padding: 0.25rem;+ }+ .guided-view-actions {+ grid-column: 1 / -1;+ display: grid;+ grid-template-columns: repeat(3, minmax(0, 1fr));+ }+ .guided-views > #guided-view-prev,+ .guided-views > #guided-view-next {+ align-self: center;+ height: 2.75rem;+ }+ .guided-view-play,+ .guided-view-all,+ .guided-view-beat-link { min-height: 2.75rem; }+ .guided-view-copy small { white-space: normal; }+ .guided-story-caption { padding: 0.32rem 0.45rem; }+ .guided-story-caption-index { min-width: 2.9rem; padding-right: 0.42rem; }+ .guided-story-caption strong,+ .guided-story-caption small { white-space: normal; }+ .guided-story-caption-next { display: none; }+ .guided-view-trail { min-height: 2rem; }+ .guided-view-trail .guided-view-stop {+ min-height: 2rem;+ padding: 0.22rem 0.42rem 0.22rem 0.28rem;+ }+ .guided-view-handoff { max-width: min(9rem, 32vw); }+ .guided-view-index { padding-top: 0.35rem; }+ .guided-view-chapters {+ gap: 0.35rem;+ scroll-padding-inline: 0.2rem;+ }+ .guided-view-chapters li {+ flex: 0 0 min(14rem, 78vw);+ min-width: 0;+ }+ .guided-view-chapter { min-height: 2.75rem; }+ .guided-views[data-active-view="all"] {+ grid-template-columns: minmax(0, 1fr) auto;+ gap: 0.2rem;+ padding: 0.25rem;+ }+ .guided-views[data-active-view="all"] .guided-view-copy {+ grid-column: 1;+ grid-row: 1;+ }+ .guided-views[data-active-view="all"] .guided-view-actions {+ grid-column: 2;+ grid-row: 1;+ }+ .guided-views[data-active-view="all"] .guided-view-play {+ min-width: 6rem !important;+ min-height: 2.75rem;+ }+ .guided-views[data-active-view="all"] .guided-view-index {+ grid-column: 1 / -1;+ grid-row: 2;+ padding: 0.3rem 0.08rem 0;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);+ border-left: 0;+ }+ html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden]),+ html[data-embed="true"][data-share-moment="true"] .share-chapter-cue:not([hidden]) {+ top: 0.5rem;+ grid-template-columns: auto minmax(0, 1fr);+ gap: 0.28rem 0.55rem;+ width: calc(100% - 1rem);+ min-height: 0;+ padding: 0.45rem 0.55rem 0.55rem;+ }+ html[data-embed="true"][data-share-playback="true"] .diagram-container {+ padding-top: 4.25rem;+ }+ html[data-embed="true"][data-share-moment="true"] .diagram-container {+ padding-top: 4.25rem;+ }+ .share-chapter-index {+ min-width: 4.4rem;+ padding-right: 0.5rem;+ }+ .share-chapter-copy small { font-size: 0.46rem; }+ .share-chapter-route {+ grid-column: 1 / -1;+ font-size: 0.5rem;+ text-align: left;+ }+ .cards {+ grid-template-columns: 1fr;+ margin-top: 1rem;+ }+ html[data-present="true"]:not([data-embed="true"]) body { padding: 0.5rem; }+ html[data-present="true"]:not([data-embed="true"]) .container {+ gap: 0.5rem;+ height: calc(100dvh - 1rem);+ }+ html[data-present="true"]:not([data-embed="true"]) .toolbar {+ position: fixed;+ top: 0.5rem;+ right: 0.5rem;+ margin: 0;+ gap: 0.25rem;+ }+ html[data-present="true"]:not([data-embed="true"]) .toolbar button {+ min-height: 2.75rem;+ padding: 0.42rem 0.58rem;+ }+ html[data-present="true"]:not([data-embed="true"]) .header {+ min-height: 2.25rem;+ padding: 3.5rem 0 0;+ }+ html[data-present="true"]:not([data-embed="true"]) .header-row {+ min-height: 2.25rem;+ margin: 0;+ align-items: center;+ flex-wrap: nowrap;+ }+ html[data-present="true"]:not([data-embed="true"]) .header-row::after,+ html[data-present="true"]:not([data-embed="true"]) .pulse-dot,+ html[data-present="true"]:not([data-embed="true"]) .subtitle { display: none; }+ html[data-present="true"]:not([data-embed="true"]) h1 {+ flex: 1 1 auto;+ min-width: 0;+ max-width: 100%;+ overflow: hidden;+ font-size: 0.875rem;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ html[data-present="true"]:not([data-embed="true"]) .guided-views {+ padding: 0.2rem;+ }+ html[data-present="true"]:not([data-embed="true"]) .guided-view-copy small { display: none; }+ html[data-present="true"]:not([data-embed="true"]) .guided-story-caption small { display: block; }+ html[data-present="true"]:not([data-embed="true"]) .diagram-container { padding: 0.5rem 0.5rem 3.75rem; }+ html[data-present="true"]:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] > svg {+ width: 720px;+ height: auto;+ min-width: 720px;+ }+ }++ @media (prefers-reduced-motion: reduce) {+ .guided-story-caption { animation: none !important; }+ }++ @media (max-width: 360px) {+ .toolbar { gap: 0.25rem; }+ .toolbar button { padding-right: 0.58rem; padding-left: 0.58rem; }+ .toolbar #btn-motion { min-width: 4.4rem; padding-right: 0.58rem; padding-left: 0.58rem; }+ #theme-label, #preset-label, #present-label { display: none; }+ .guided-view-handoff { max-width: 6.5rem; }+ }++ /* ==========================================================+ SVG SEMANTIC CLASSES — use these instead of inline fill/stroke+ ========================================================== */+ .c-grid { stroke: var(--grid); fill: none; }+ .c-mask { fill: var(--mask); stroke: none; }++ .c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }+ .c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }+ .c-database { fill: var(--database-fill); stroke: var(--database-stroke); }+ .c-cloud { fill: var(--cloud-fill); stroke: var(--cloud-stroke); }+ .c-security { fill: var(--security-fill); stroke: var(--security-stroke); }+ .c-messagebus { fill: var(--messagebus-fill); stroke: var(--messagebus-stroke); }+ .c-external { fill: var(--external-fill); stroke: var(--external-stroke); }++ /* Text helpers */+ .t-primary { fill: var(--text); }+ .t-muted { fill: var(--text-muted); }+ .t-dim { fill: var(--text-dim); }+ .t-frontend { fill: var(--frontend-stroke); }+ .t-backend { fill: var(--backend-stroke); }+ .t-database { fill: var(--database-stroke); }+ .t-cloud { fill: var(--cloud-stroke); }+ .t-security { fill: var(--security-stroke); }+ .t-messagebus { fill: var(--messagebus-stroke); }+ .t-external { fill: var(--external-stroke); }++ /* Semantic Sigils are small authored role stamps, not icons from a brand+ pack and not viewer controls. Prefix selectors with svg so the canonical+ export's SVG-only stylesheet collector keeps them automatically. */+ svg .semantic-sigil {+ fill: none;+ stroke: currentColor;+ stroke-width: 1.35;+ stroke-linecap: round;+ stroke-linejoin: round;+ opacity: 0.76;+ pointer-events: none;+ }+ svg .semantic-sigil > * { vector-effect: non-scaling-stroke; }+ svg .semantic-sigil .sigil-fill { fill: currentColor; stroke: none; }+ svg .s-frontend { color: var(--frontend-stroke); }+ svg .s-backend { color: var(--backend-stroke); }+ svg .s-database { color: var(--database-stroke); }+ svg .s-cloud { color: var(--cloud-stroke); }+ svg .s-security { color: var(--security-stroke); }+ svg .s-messagebus { color: var(--messagebus-stroke); }+ svg .s-external { color: var(--external-stroke); }++ /* Reading Depth is a viewer-only level-of-detail layer. MAP preserves the+ authored structure and primary labels, READ restores relationship labels+ and node context, and FULL restores tags and fine annotations. Semantic+ intent can reveal the relevant detail without moving any geometry. */+ svg [data-detail] { transition: opacity 160ms ease; }+ svg [data-detail-anchor] {+ transform-box: fill-box;+ transform-origin: center;+ transition: transform 160ms ease;+ }+ .diagram-container[data-detail-level="map"] svg [data-detail="context"],+ .diagram-container[data-detail-level="map"] svg [data-detail="fine"],+ .diagram-container[data-detail-level="read"] svg [data-detail="fine"] {+ opacity: 0;+ pointer-events: none;+ }+ .diagram-container[data-detail-level="map"] svg [data-detail-anchor] {+ transform: translateY(8px);+ }++ /* Focus, lens, preview, route, and story states are stronger reader intent than+ the global zoom level. Reveal only their exact semantic matches. */+ svg[data-focus-active] [data-focus-match][data-detail],+ svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],+ svg[data-lens-active] [data-lens-match][data-detail],+ svg[data-lens-active] [data-lens-match] [data-detail],+ svg[data-legend-preview-active] [data-legend-preview-match][data-detail],+ svg[data-legend-preview-active] [data-legend-preview-match] [data-detail],+ svg[data-intent-trace-active] [data-intent-trace-match][data-detail],+ svg[data-intent-trace-active] [data-intent-trace-match] [data-detail],+ svg[data-route-active] [data-route-match][data-detail],+ svg[data-route-active] [data-route-match] [data-detail],+ svg[data-story-active] [data-story-step][data-detail],+ svg[data-story-active] [data-story-step] [data-detail],+ svg[data-relationship-preview-active] [data-relationship-preview][data-detail],+ svg[data-relationship-preview-active] [data-relationship-preview] [data-detail],+ svg [data-node-id]:hover [data-detail],+ svg [data-node-id]:focus-visible [data-detail] {+ opacity: 1;+ pointer-events: auto;+ }+ svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],+ svg[data-lens-active] [data-lens-match] [data-detail-anchor],+ svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],+ svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],+ svg[data-route-active] [data-route-match] [data-detail-anchor],+ svg[data-story-active] [data-story-step] [data-detail-anchor],+ svg [data-node-id]:hover [data-detail-anchor],+ svg [data-node-id]:focus-visible [data-detail-anchor] { transform: none; }++ /* Arrows */+ .a-default { stroke: var(--arrow); fill: none; }+ .a-emphasis { stroke: var(--arrow-emphasis); fill: none; }+ .a-security { stroke: var(--security-stroke); fill: none; stroke-dasharray: 5,5; }+ .a-dashed { stroke: var(--database-stroke); fill: none; stroke-dasharray: 4,4; }++ /* Arrowhead markers reference these */+ .m-default { fill: var(--arrow); }+ .m-emphasis { fill: var(--arrow-emphasis); }+ .m-security { fill: var(--security-stroke); }+ .m-dashed { fill: var(--database-stroke); }++ /* Stable semantic exploration hooks emitted by every renderer. */+ svg [data-node-id] {+ cursor: pointer;+ transition: opacity 0.18s ease, filter 0.18s ease;+ }+ svg [data-edge-from] { transition: opacity 0.18s ease, filter 0.18s ease; }+ svg [data-node-id]:hover,+ svg [data-node-id]:focus-visible {+ filter: drop-shadow(0 0 7px var(--frontend-stroke));+ outline: none;+ }+ /* Verified Source Beacons are installed at runtime only for nodes whose+ repository evidence passed the local revision/blob/line checks. They+ live inside the owning node so every focus, route, story, and guided+ view keeps one coherent opacity state. Export serialization removes+ them before producing the canonical SVG or any derived visual. */+ .source-evidence-beacon {+ pointer-events: none;+ opacity: 0.76;+ transition: opacity 160ms ease, filter 160ms ease;+ }+ .source-evidence-beacon rect {+ fill: color-mix(in srgb, var(--mask) 92%, var(--backend-stroke));+ stroke: color-mix(in srgb, var(--backend-stroke) 82%, var(--panel-border));+ stroke-width: 1;+ vector-effect: non-scaling-stroke;+ }+ .source-evidence-beacon text {+ fill: var(--backend-stroke);+ font-size: 5.5px;+ font-weight: 800;+ letter-spacing: 0.06em;+ text-anchor: middle;+ text-transform: uppercase;+ }+ svg [data-node-id]:hover .source-evidence-beacon,+ svg [data-node-id]:focus-visible .source-evidence-beacon,+ svg [data-node-id][data-focus-selected] .source-evidence-beacon {+ opacity: 1;+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="signal-flow"] .source-evidence-beacon { opacity: 0.9; }+ svg[data-preset="blueprint"] .source-evidence-beacon rect {+ rx: 0.8px;+ filter: none;+ }+ svg [data-legend-kind][role="button"] { cursor: pointer; }+ svg [data-legend-kind]:focus { outline: none; }+ svg [data-legend-hit] {+ fill: transparent;+ stroke: transparent;+ stroke-width: 1.4;+ pointer-events: all;+ vector-effect: non-scaling-stroke;+ transition: stroke 150ms ease, stroke-width 150ms ease, filter 150ms ease;+ }+ svg [data-legend-count-badge] { pointer-events: none; }+ svg [data-legend-count-badge] rect {+ fill: var(--mask);+ stroke: var(--panel-border);+ stroke-width: 1;+ vector-effect: non-scaling-stroke;+ }+ svg [data-legend-count-badge] text {+ fill: var(--text-muted);+ font-size: 7px;+ font-weight: 700;+ text-anchor: middle;+ }+ svg [data-legend-kind][role="button"]:hover [data-legend-hit] {+ stroke: color-mix(in srgb, var(--database-stroke) 58%, transparent);+ }+ svg [data-legend-kind][role="button"]:focus-visible [data-legend-hit] {+ stroke: var(--frontend-stroke);+ stroke-width: 1.8;+ filter: drop-shadow(0 0 3px var(--frontend-stroke));+ }+ svg [data-legend-kind][data-legend-selected] [data-legend-hit] {+ stroke: var(--database-stroke);+ stroke-width: 2.2;+ stroke-dasharray: 3 2;+ }+ svg [data-legend-kind][data-legend-selected] [data-legend-count-badge] rect {+ stroke: var(--database-stroke);+ stroke-width: 1.8;+ }+ svg [data-legend-kind][data-legend-zero] { opacity: 0.44; }+ svg[data-preset="signal-flow"] [data-legend-kind][data-legend-selected] [data-legend-hit] {+ filter: drop-shadow(0 0 4px var(--database-stroke));+ }+ svg[data-preset="blueprint"] [data-legend-hit],+ svg[data-preset="blueprint"] [data-legend-count-badge] rect { rx: 0; filter: none; }+ svg[data-legend-preview-active] [data-node-id],+ svg[data-legend-preview-active] [data-edge-from] { opacity: 0.11; }+ svg[data-legend-preview-active] [data-legend-preview-match] { opacity: 1; }+ svg[data-legend-preview-active] [data-legend-preview-peer] { opacity: 0.62; }+ svg[data-legend-preview-active] [data-legend-preview-selected] {+ filter: drop-shadow(0 0 8px var(--database-stroke));+ }+ svg[data-lens-active] [data-node-id],+ svg[data-lens-active] [data-edge-from] { opacity: 0.11; }+ svg[data-lens-active] [data-lens-match] { opacity: 1; }+ svg[data-lens-active] [data-lens-peer] { opacity: 0.62; }+ svg[data-lens-active] [data-lens-selected] {+ filter: drop-shadow(0 0 10px var(--database-stroke));+ }+ .semantic-lens-overlay { pointer-events: none; }+ .semantic-lens-flow {+ fill: none;+ stroke-width: 3.05;+ stroke-linecap: round;+ stroke-dasharray: 0.075 0.925;+ stroke-dashoffset: 0;+ vector-effect: non-scaling-stroke;+ opacity: 0.9;+ animation: archify-semantic-lens-flow 1.35s linear 1 both;+ animation-delay: var(--lens-flow-delay, 0s);+ }+ .semantic-lens-flow[data-direction="out"],+ .semantic-lens-flow[data-direction="forward"] {+ stroke: var(--frontend-stroke);+ filter: drop-shadow(0 0 3px var(--frontend-stroke));+ }+ .semantic-lens-flow[data-direction="in"],+ .semantic-lens-flow[data-direction="reverse"] {+ stroke: var(--database-stroke);+ filter: drop-shadow(0 0 3px var(--database-stroke));+ }+ .semantic-lens-flow[data-direction="within"] {+ stroke: var(--messagebus-stroke);+ filter: drop-shadow(0 0 3px var(--messagebus-stroke));+ }+ svg[data-preset="signal-flow"] .semantic-lens-flow {+ stroke-width: 3.7;+ opacity: 1;+ }+ svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="out"],+ svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="forward"] {+ filter: drop-shadow(0 0 6px var(--frontend-stroke));+ }+ svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="in"],+ svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="reverse"] {+ filter: drop-shadow(0 0 6px var(--database-stroke));+ }+ svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="within"] {+ filter: drop-shadow(0 0 6px var(--messagebus-stroke));+ }+ svg[data-preset="blueprint"] .semantic-lens-flow {+ stroke-width: 2.45;+ stroke-linecap: square;+ filter: none;+ opacity: 0.78;+ }+ html[data-embed="true"] .semantic-lens-overlay { display: none; }+ svg[data-focus-active] [data-node-id],+ svg[data-focus-active] [data-edge-from] { opacity: 0.13; }+ svg[data-focus-active] [data-focus-match] { opacity: 1; }+ svg[data-focus-active] [data-focus-selected] {+ filter: drop-shadow(0 0 10px var(--frontend-stroke));+ }++ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }++ /* Direct Relationship Explorer makes authored paths a real input surface+ without changing their visible stroke or canonical SVG. A transparent+ runtime rail supplies forgiving pointer geometry; the exact authored+ path and endpoints continue to carry every visible state. */+ .relationship-hit-overlay { pointer-events: none; }+ .relationship-hit-target { outline: none; }+ .relationship-hit-rail {+ fill: none;+ stroke: transparent;+ stroke-width: 24;+ stroke-linecap: round;+ stroke-linejoin: round;+ vector-effect: non-scaling-stroke;+ pointer-events: stroke;+ cursor: pointer;+ }+ .relationship-focus-rail {+ fill: none;+ stroke: color-mix(in srgb, var(--frontend-stroke) 34%, transparent);+ stroke-width: 6;+ stroke-dasharray: 2 4;+ stroke-linecap: round;+ stroke-linejoin: round;+ vector-effect: non-scaling-stroke;+ pointer-events: none;+ opacity: 0;+ }+ .relationship-hit-target:focus-visible .relationship-focus-rail {+ opacity: 1;+ }+ svg[data-preset="blueprint"] .relationship-hit-target:focus-visible .relationship-focus-rail {+ stroke-linecap: square;+ filter: none;+ }+ svg[data-relationship-direct-active] [data-node-id],+ svg[data-relationship-direct-active] [data-edge-from] { opacity: 0.16; }+ svg[data-relationship-direct-active] [data-relationship-preview],+ svg[data-relationship-direct-active] [data-relationship-preview-node] { opacity: 1; }+ svg[data-focus-active]:not([data-relationship-pin-active]) .relationship-hit-rail,+ svg[data-story-active] .relationship-hit-rail,+ svg[data-route-picking] .relationship-hit-rail,+ svg[data-route-active] .relationship-hit-rail,+ svg[data-lens-active] .relationship-hit-rail,+ svg[data-chapter-preview] .relationship-hit-rail { pointer-events: none; }+ html[data-embed="true"] .relationship-hit-overlay { display: none; }+ @media (hover: none), (pointer: coarse) {+ .relationship-hit-rail { stroke-width: 24; }+ }++ /* Relationship Preview is temporary exploration state layered on top of+ neighborhood focus. It changes emphasis only; exported geometry and the+ relationship's original solid/dashed visual language stay untouched. */+ svg[data-relationship-preview-active] [data-focus-match] { opacity: 0.18; }+ svg[data-relationship-preview-active] [data-relationship-preview],+ svg[data-relationship-preview-active] [data-relationship-preview-node] { opacity: 1; }+ svg[data-relationship-preview-active] [data-relationship-preview] {+ filter: drop-shadow(0 0 5px var(--arrow-emphasis));+ }+ svg[data-relationship-preview-active] [data-relationship-preview] path,+ svg[data-relationship-preview-active] path[data-relationship-preview],+ svg[data-relationship-preview-active] [data-relationship-preview] line,+ svg[data-relationship-preview-active] line[data-relationship-preview],+ svg[data-relationship-preview-active] [data-relationship-preview] polyline,+ svg[data-relationship-preview-active] polyline[data-relationship-preview] {+ stroke-width: 2.75;+ }+ svg[data-relationship-preview-active] [data-relationship-preview-source] {+ filter: drop-shadow(0 0 7px var(--frontend-stroke));+ }+ svg[data-relationship-preview-active] [data-relationship-preview-target] {+ filter: drop-shadow(0 0 7px var(--database-stroke));+ }+ .relationship-pulse-overlay { pointer-events: none; }+ .relationship-flow-pulse {+ fill: none;+ stroke: var(--arrow-emphasis);+ stroke-width: 3.35;+ stroke-linecap: round;+ stroke-dasharray: 0.085 0.915;+ stroke-dashoffset: 0;+ vector-effect: non-scaling-stroke;+ opacity: 0;+ filter: drop-shadow(0 0 4px var(--arrow-emphasis));+ animation: archify-relationship-pulse 1.2s linear 1 both;+ }+ svg[data-preset="signal-flow"] .relationship-flow-pulse {+ stroke: var(--frontend-stroke);+ stroke-width: 3.85;+ filter: drop-shadow(0 0 7px var(--frontend-stroke));+ }+ svg[data-preset="blueprint"] .relationship-flow-pulse {+ stroke-width: 2.5;+ stroke-linecap: square;+ filter: none;+ }+ .semantic-flow-token {+ color: var(--frontend-stroke);+ opacity: 0;+ pointer-events: none;+ }+ .relationship-flow-token {+ animation: archify-relationship-token-life 1.2s linear 1 both;+ }+ .story-flow-token {+ animation: archify-relationship-token-life 0.78s linear 1 both;+ }+ .semantic-flow-token-halo {+ fill: var(--mask);+ stroke: currentColor;+ stroke-width: 1.1;+ vector-effect: non-scaling-stroke;+ opacity: 0.96;+ }+ .relationship-flow-token-shape {+ fill: var(--mask);+ stroke: currentColor;+ stroke-width: 1.35;+ stroke-linecap: round;+ stroke-linejoin: round;+ vector-effect: non-scaling-stroke;+ }+ .relationship-flow-token-ink {+ fill: none;+ stroke: currentColor;+ stroke-width: 1.05;+ stroke-linecap: round;+ vector-effect: non-scaling-stroke;+ }+ .relationship-flow-token-dot { fill: currentColor; stroke: none; }+ .semantic-flow-token[data-token-kind="data"] { color: var(--database-stroke); }+ .semantic-flow-token[data-token-kind="event"] { color: var(--messagebus-stroke); }+ .semantic-flow-token[data-token-kind="security"] { color: var(--security-stroke); }+ .semantic-flow-token[data-token-kind="state"] { color: var(--cloud-stroke); }+ svg[data-preset="signal-flow"] .semantic-flow-token {+ filter: drop-shadow(0 0 5px currentColor);+ }+ svg[data-preset="blueprint"] .semantic-flow-token { filter: none; }+ html[data-embed="true"] .relationship-pulse-overlay { display: none; }++ /* Intent Trace is a temporary, pre-click exploration layer. Related+ topology stays readable while a short viewer-only signal runs over+ cloned edge geometry; the authored edge remains untouched underneath. */+ svg[data-intent-trace-active] [data-node-id],+ svg[data-intent-trace-active] [data-edge-from] { opacity: 0.2; }+ svg[data-intent-trace-active] [data-intent-trace-match] { opacity: 1; }+ svg[data-intent-trace-active] [data-intent-trace-selected] {+ filter: drop-shadow(0 0 10px var(--frontend-stroke));+ }+ .intent-trace-overlay { pointer-events: none; }+ .intent-trace-flow {+ fill: none;+ stroke-width: 3.1;+ stroke-linecap: round;+ stroke-dasharray: 0.1 0.9;+ stroke-dashoffset: 0;+ vector-effect: non-scaling-stroke;+ opacity: 0.94;+ animation: archify-intent-trace-flow 1.15s linear 1 both;+ }+ .intent-trace-flow[data-direction="out"] {+ stroke: var(--frontend-stroke);+ filter: drop-shadow(0 0 4px var(--frontend-stroke));+ }+ .intent-trace-flow[data-direction="in"] {+ stroke: var(--database-stroke);+ filter: drop-shadow(0 0 4px var(--database-stroke));+ animation-direction: reverse;+ }+ .intent-trace-flow[data-direction="loop"] {+ stroke: var(--security-stroke);+ filter: drop-shadow(0 0 4px var(--security-stroke));+ }+ svg[data-preset="blueprint"] [data-intent-trace-selected],+ svg[data-preset="blueprint"] .intent-trace-flow {+ filter: none;+ stroke-linecap: square;+ }+ .intent-trace-status {+ position: absolute;+ width: 1px;+ height: 1px;+ padding: 0;+ margin: -1px;+ overflow: hidden;+ clip: rect(0, 0, 0, 0);+ clip-path: inset(50%);+ white-space: nowrap;+ border: 0;+ }++ /* Route Probe separates a durable two-point query from selection and+ one-hop hover. Only the chosen shortest directed path stays prominent;+ the traveling signal is cloned viewer geometry and never authored SVG. */+ svg[data-route-picking="target"] [data-node-id] { opacity: 0.24; }+ svg[data-route-picking="target"] [data-route-candidate],+ svg[data-route-picking="target"] [data-route-start] { opacity: 1; }+ svg[data-route-picking] [data-node-id] { cursor: crosshair; }+ svg[data-route-picking] [data-route-start] {+ filter: drop-shadow(0 0 10px var(--frontend-stroke));+ }+ svg[data-route-active] [data-node-id],+ svg[data-route-active] [data-edge-from] { opacity: 0.11; }+ svg[data-route-active] [data-route-match] { opacity: 1; }+ svg[data-route-active] [data-route-start] {+ filter: drop-shadow(0 0 11px var(--frontend-stroke));+ }+ svg[data-route-active] [data-route-end] {+ filter: drop-shadow(0 0 11px var(--security-stroke));+ }+ svg[data-route-active] [data-route-step]:not([data-route-start]):not([data-route-end]) {+ filter: drop-shadow(0 0 7px var(--backend-stroke));+ }+ svg[data-route-journey] [data-route-match][data-route-journey-state="past"] { opacity: 0.62; }+ svg[data-route-journey] [data-route-match][data-route-journey-state="future"] { opacity: 0.34; }+ svg[data-route-journey] [data-route-match][data-route-journey-state="current"] { opacity: 1; }+ svg[data-route-journey] [data-node-id][data-route-journey-current] {+ filter: drop-shadow(0 0 10px var(--backend-stroke));+ }+ svg[data-route-journey] [data-edge-from][data-route-journey-current] {+ opacity: 1;+ filter: drop-shadow(0 0 6px var(--backend-stroke));+ }+ .route-probe-overlay { pointer-events: none; }+ .route-journey-overlay { pointer-events: none; }+ .route-probe-flow {+ fill: none;+ stroke: var(--backend-stroke);+ stroke-width: 3.25;+ stroke-linecap: round;+ stroke-dasharray: 0.085 0.915;+ stroke-dashoffset: 0;+ vector-effect: non-scaling-stroke;+ opacity: 0.96;+ filter: drop-shadow(0 0 5px var(--backend-stroke));+ animation: archify-route-probe-flow 1.1s cubic-bezier(0.22, 1, 0.36, 1) 1 both;+ animation-delay: calc(var(--route-step, 0) * 0.16s);+ }+ .route-journey-flow {+ fill: none;+ stroke: var(--backend-stroke);+ stroke-width: 3.5;+ stroke-linecap: round;+ stroke-dasharray: 0.1 0.9;+ stroke-dashoffset: 0;+ vector-effect: non-scaling-stroke;+ opacity: 0;+ filter: drop-shadow(0 0 6px var(--backend-stroke));+ animation: archify-route-journey-flow 780ms cubic-bezier(0.22, 1, 0.36, 1) 1 both;+ }+ svg[data-preset="blueprint"] [data-route-start],+ svg[data-preset="blueprint"] [data-route-end],+ svg[data-preset="blueprint"] [data-route-step],+ svg[data-preset="blueprint"] .route-probe-flow {+ filter: none;+ stroke-linecap: square;+ }+ svg[data-preset="blueprint"] .route-journey-flow {+ filter: none;+ stroke-linecap: square;+ }++ svg[data-preset="blueprint"] .c-grid {+ stroke-dasharray: 1 3;+ opacity: 0.78;+ }+ svg[data-preset="blueprint"] .c-region {+ fill: color-mix(in srgb, var(--cloud-fill) 58%, transparent);+ stroke-dasharray: 12 4 2 4;+ }+ svg[data-preset="blueprint"] .c-security-group,+ svg[data-preset="blueprint"] .c-lane { stroke-dasharray: 7 3; }+ svg[data-preset="blueprint"] [data-node-id]:hover,+ svg[data-preset="blueprint"] [data-node-id]:focus-visible {+ filter: drop-shadow(0 0 3px var(--frontend-stroke));+ }+ svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {+ filter: drop-shadow(0 0 3px var(--frontend-stroke));+ }+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }+ svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],+ svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],+ svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {+ filter: drop-shadow(0 0 3px var(--frontend-stroke));+ }++ /* Story Trail is a viewer-only overlay derived from the ordered focus IDs+ of the active guided view. The authored edge stays underneath with its+ original color, dash pattern, marker, and geometry intact. */+ .story-trail-overlay { pointer-events: none; }+ .story-carrier-overlay { pointer-events: none; }+ .story-trail-flow {+ fill: none;+ stroke: var(--frontend-stroke);+ stroke-width: 2.8;+ stroke-linecap: round;+ vector-effect: non-scaling-stroke;+ opacity: 0.34;+ filter: drop-shadow(0 0 2px var(--frontend-stroke));+ }+ svg[data-story-beat] [data-story-step] {+ opacity: 0.22;+ filter: saturate(0.42);+ transition: opacity 180ms ease, filter 180ms ease;+ }+ svg[data-story-beat] [data-story-step][data-story-beat-state="past"] {+ opacity: 0.72;+ filter: saturate(0.82);+ }+ svg[data-story-beat] [data-story-step][data-story-beat-state="next"] {+ opacity: 0.5;+ filter: saturate(0.66);+ }+ svg[data-story-beat] [data-story-step][data-story-beat-state="active"] {+ opacity: 1;+ filter: drop-shadow(0 0 7px var(--frontend-stroke));+ animation: archify-story-beat-node 360ms cubic-bezier(0.22, 1, 0.36, 1) both;+ }+ svg[data-story-beat] [data-edge-from][data-story-beat-step] {+ opacity: 0.16;+ transition: opacity 160ms ease;+ }+ svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="past"] { opacity: 0.58; }+ svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="next"] { opacity: 0.34; }+ svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="active"] { opacity: 1; }+ svg[data-story-beat] .story-trail-flow { opacity: 0; transition: opacity 160ms ease; }+ svg[data-story-beat] .story-trail-flow[data-story-beat-state="past"] { opacity: 0.34; }+ svg[data-story-beat] .story-trail-flow[data-story-beat-state="next"] { opacity: 0.2; }+ svg[data-story-beat] .story-trail-flow[data-story-beat-state="active"] { opacity: 0.92; }+ svg[data-story-beat] .story-trail-flow[data-story-pulse="true"] {+ stroke-dasharray: 2 13;+ stroke-dashoffset: 30;+ opacity: 0.92;+ animation: archify-story-flow 0.78s linear 1 both;+ }+ svg[data-preset="blueprint"] .story-trail-flow {+ stroke-linecap: square;+ filter: none;+ opacity: 0.5;+ }+ svg[data-preset="blueprint"][data-story-beat] [data-story-step][data-story-beat-state="active"] {+ filter: none;+ animation: none;+ }++ /* Chapter Delta Preview is a static, pre-commit comparison between two+ chapter focus sets. Symbols in the rail carry the meaning without color;+ these SVG rules only make exact stable-ID membership easier to scan. */+ svg[data-chapter-preview] [data-node-id],+ svg[data-chapter-preview] [data-edge-from] {+ opacity: 0.1 !important;+ filter: none !important;+ transition: none !important;+ }+ svg[data-chapter-preview] .story-trail-overlay { opacity: 0.08 !important; }+ svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="stay"] {+ opacity: 0.76 !important;+ filter: saturate(0.7) !important;+ }+ svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="enter"] {+ opacity: 1 !important;+ filter: saturate(1.2) !important;+ }+ svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="leave"] {+ opacity: 0.28 !important;+ filter: grayscale(0.72) !important;+ }+ svg[data-preset="blueprint"][data-chapter-preview] [data-node-id] { filter: none !important; }++ /* Dashed boundary variants */+ .c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }+ .c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }+ .c-lane { fill: var(--lane-fill); stroke: var(--lane-stroke); stroke-dasharray: 6,6; }++ /* Optional trace animation, enabled only by meta.animation = "trace".+ The ordinary viewer performs one ambient pass and then restores the+ authored solid/security/async line language. WebM samples the same+ authored geometry into an explicit canvas timeline. */+ html[data-ambient-motion="running"] svg[data-animation="trace"] [data-animate="edge"] {+ animation: archify-edge-flow 2.4s linear 1;+ animation-delay: calc(var(--step, 0) * 160ms);+ }+ html[data-ambient-motion="running"] svg[data-animation="trace"] [data-animate="node"] {+ transform-box: fill-box;+ transform-origin: center;+ animation: archify-node-pulse 3.6s ease-in-out 1;+ animation-delay: calc(var(--step, 0) * 160ms);+ }+ svg[data-preset="signal-flow"][data-animation="trace"] [data-animate="edge"] {+ stroke-linecap: round;+ filter: drop-shadow(0 0 3px var(--arrow-emphasis));+ animation-duration: 1.75s;+ }+ svg[data-preset="signal-flow"][data-animation="trace"] [data-animate="node"] {+ animation-duration: 3.1s;+ }+ svg[data-preset="blueprint"][data-animation="trace"] [data-animate="edge"] {+ stroke-linecap: square;+ filter: none;+ animation-duration: 2.15s;+ }+ svg[data-preset="blueprint"][data-animation="trace"] [data-animate="node"] {+ animation-name: archify-blueprint-node-pulse;+ animation-duration: 3.8s;+ }+ /* Embedded proofs are static until a named Story Trail chapter is played.+ This keeps proof grids calm and ensures ?play=1 stops all viewer motion+ after one 3.2 second chapter instead of leaving ambient trace loops on. */+ html[data-embed="true"] svg[data-animation="trace"] [data-animate],+ html[data-share-playback="true"] svg[data-animation="trace"] [data-animate] {+ animation: none !important;+ stroke-dashoffset: 0;+ }+ @keyframes archify-edge-flow {+ 0% { stroke-dasharray: 10 8; stroke-dashoffset: 54; opacity: 0.42; }+ 88% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }+ 99.9% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }+ 100% { stroke-dashoffset: 0; opacity: 1; }+ }+ @keyframes archify-node-pulse {+ 0%, 72%, 100% { filter: none; stroke-width: 1.5; }+ 18%, 36% {+ filter: drop-shadow(0 0 8px var(--arrow-emphasis));+ stroke-width: 2.4;+ }+ }+ @keyframes archify-blueprint-node-pulse {+ 0%, 72%, 100% { opacity: 1; filter: none; }+ 18%, 36% { opacity: 0.72; filter: drop-shadow(0 0 2px var(--frontend-stroke)); }+ }+ @keyframes archify-signal-scan {+ 0%, 18% { opacity: 1; transform: translateX(-70%); }+ 70% { opacity: 1; transform: translateX(70%); }+ 100% { opacity: 0; transform: translateX(70%); }+ }+ @keyframes archify-radar-live {+ 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent); }+ 55%, 100% { box-shadow: 0 0 0 0.32rem transparent; }+ }+ @keyframes archify-guided-progress {+ from { transform: scaleX(var(--guided-progress-start, 0)); }+ to { transform: scaleX(1); }+ }+ @keyframes archify-story-flow {+ to { stroke-dashoffset: 0; }+ }+ @keyframes archify-intent-trace-flow {+ 0% { opacity: 0.28; stroke-dashoffset: 0; }+ 12%, 78% { opacity: 0.94; }+ 100% { opacity: 0; stroke-dashoffset: -1; }+ }+ @keyframes archify-route-probe-flow {+ 0% { stroke-dashoffset: 0; opacity: 0.96; }+ 78% { stroke-dashoffset: -1; opacity: 0.96; }+ 100% { stroke-dasharray: none; stroke-dashoffset: 0; opacity: 0.58; }+ }+ @keyframes archify-route-journey-flow {+ 0% { opacity: 0.16; stroke-dashoffset: 0; }+ 14%, 76% { opacity: 1; }+ 100% { opacity: 0; stroke-dashoffset: -1; }+ }+ @keyframes archify-semantic-lens-flow {+ 0% { opacity: 0.2; stroke-dashoffset: 0; }+ 12%, 78% { opacity: 0.9; }+ 100% { opacity: 0; stroke-dashoffset: -1; }+ }+ @keyframes archify-relationship-pulse {+ 0% { opacity: 0.18; stroke-dashoffset: 0; }+ 10%, 76% { opacity: 0.98; }+ 100% { opacity: 0; stroke-dashoffset: -1; }+ }+ @keyframes archify-relationship-token-life {+ 0%, 7% { opacity: 0; }+ 13%, 82% { opacity: 1; }+ 100% { opacity: 0; }+ }+ @keyframes archify-story-beat-node {+ from { opacity: 0.48; filter: saturate(0.6); }+ 58% { opacity: 1; filter: drop-shadow(0 0 10px var(--frontend-stroke)); }+ to { opacity: 1; filter: drop-shadow(0 0 7px var(--frontend-stroke)); }+ }+ @keyframes archify-share-cue-enter {+ from { opacity: 0; transform: translate(-50%, -0.45rem); }+ to { opacity: 1; transform: translate(-50%, 0); }+ }+ @keyframes archify-share-cue-pulse {+ 0%, 100% { opacity: 1; transform: scale(1); }+ 50% { opacity: 0.48; transform: scale(0.78); }+ }+ @media (prefers-reduced-motion: reduce) {+ html[data-preset="signal-flow"] .diagram-container::before {+ animation: none !important;+ }+ .pulse-dot { animation: none !important; }+ svg[data-animation="trace"] [data-animate] {+ animation: none !important;+ stroke-dashoffset: 0;+ }+ .guided-view-progress span {+ animation: none !important;+ transform: scaleX(1) !important;+ }+ .story-trail-flow,+ .intent-trace-flow,+ .route-probe-flow,+ .semantic-lens,+ .diagram-guide,+ [data-story-step],+ .overview-map-live,+ .guided-view-stop,+ .share-chapter-cue,+ .chapter-handoff-anchor,+ .share-chapter-state::before,+ .share-chapter-progress span { animation: none !important; }+ .guided-view-chapter,+ svg[data-chapter-preview] [data-node-id],+ svg[data-chapter-preview] [data-edge-from] { transition: none !important; }+ svg[data-story-playing="true"] .story-trail-flow {+ stroke-dasharray: none;+ stroke-dashoffset: 0;+ opacity: 0.55;+ }+ .intent-trace-flow {+ animation: none !important;+ stroke-dasharray: none;+ stroke-dashoffset: 0;+ opacity: 0.72;+ }+ .route-probe-flow {+ animation: none !important;+ stroke-dasharray: none;+ stroke-dashoffset: 0;+ opacity: 0.78;+ }+ .route-journey-overlay,+ .story-carrier-overlay { display: none !important; }+ .semantic-lens-flow {+ animation: none !important;+ stroke-dasharray: none;+ stroke-width: 2.2;+ opacity: 0.34;+ filter: none;+ }+ .relationship-pulse-overlay { display: none !important; }+ .guided-view-chapter { transition: none !important; }+ .source-evidence-beacon,+ svg [data-node-id], svg [data-edge-from], svg [data-detail], svg [data-detail-anchor], svg [data-legend-hit], svg { transition: none !important; }+ }++:root{color-scheme:dark;--d-add:#34d399;--d-remove:#fb7185;--d-change:#fbbf24;--d-move:#7dd3fc;--d-ink:#e6edf5;--d-muted:#8aa0b5;--d-line:#25384a}+*{box-sizing:border-box}body{min-width:1080px;margin:0;background:#071019;color:var(--d-ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}.proof-page{width:min(1600px,calc(100vw - 64px));margin:auto;padding:30px 0 42px}.proof-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:28px;align-items:end;padding-bottom:20px;border-bottom:1px solid var(--d-line)}.eyebrow{margin:0 0 8px;color:#7dd3fc;font:700 11px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.14em}.proof-head h1{margin:0;font-size:clamp(32px,4vw,56px);line-height:.96;letter-spacing:-.04em}.subtitle{margin:12px 0 0;color:var(--d-muted);font-size:14px}.metrics{display:flex;gap:9px}.metric{min-width:86px;padding:11px 13px;border:1px solid var(--d-line);border-radius:8px;background:#0b1722}.metric strong{display:block;font:700 23px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.metric span{display:block;margin-top:6px;color:var(--d-muted);font:700 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.1em}.add strong{color:var(--d-add)}.remove strong{color:var(--d-remove)}.change strong{color:var(--d-change)}+.proof-tools{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:16px 0}.view-switch{display:inline-flex;padding:3px;border:1px solid var(--d-line);border-radius:8px;background:#0a141e}.view-switch button,.utility{border:0;border-radius:6px;background:transparent;color:var(--d-muted);padding:8px 14px;font:700 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;cursor:pointer}.view-switch button[aria-selected="true"]{background:#173047;color:#fff}.utility{border:1px solid var(--d-line)}.legend{display:flex;gap:16px;color:var(--d-muted);font:650 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.legend span{display:inline-flex;align-items:center;gap:6px}.legend i{width:22px;border-top:3px solid currentColor}.legend .add{color:var(--d-add)}.legend .remove{color:var(--d-remove)}.legend .remove i{border-top-style:dashed}.legend .change{color:var(--d-change)}.legend .change i{border-top-style:dotted}.legend .move{color:var(--d-move)}.legend .move i{border-top-style:double}+.canvas{overflow:hidden;border:1px solid var(--d-line);border-radius:10px;background:#09141e;padding:12px;min-height:520px}.canvas svg{display:block;width:100%;height:auto;max-height:72vh}.canvas[hidden]{display:none}.canvas[data-view="delta"] [data-delta-state="same"]{opacity:.38}g[data-node-id][data-delta-state="added"]>rect:last-of-type{stroke:var(--d-add)!important;stroke-width:3!important}g[data-node-id][data-delta-state="removed"]>rect:last-of-type{stroke:var(--d-remove)!important;stroke-width:3!important;stroke-dasharray:7 5}g[data-node-id][data-delta-state="changed"]>rect:last-of-type{stroke:var(--d-change)!important;stroke-width:3!important;stroke-dasharray:2 3}g[data-node-id][data-delta-state="moved"]>rect:last-of-type,g[data-node-id][data-delta-state="moved-from"]>rect:last-of-type{stroke:var(--d-move)!important;stroke-width:3!important;stroke-dasharray:8 3 2 3}g[data-node-id][data-delta-state="moved-from"],path[data-delta-state="moved-from"]{opacity:.42}path[data-delta-state="added"]{stroke:var(--d-add)!important;stroke-width:3!important}path[data-delta-state="removed"]{stroke:var(--d-remove)!important;stroke-width:3!important;stroke-dasharray:7 5!important}path[data-delta-state="changed"]{stroke:var(--d-change)!important;stroke-width:3!important;stroke-dasharray:2 3!important}path[data-delta-state="rerouted"],path[data-delta-state="moved-from"]{stroke:var(--d-move)!important;stroke-width:2.5!important;stroke-dasharray:8 3 2 3!important}.delta-node-marker circle{fill:#071019;stroke:currentColor;stroke-width:1.5}.delta-node-marker text,.delta-edge-marker{fill:currentColor;font:800 9px ui-monospace,SFMono-Regular,Menlo,monospace}[data-delta-state="added"] .delta-node-marker,.delta-edge-marker[data-delta-state="added"]{color:var(--d-add)}[data-delta-state="removed"] .delta-node-marker,.delta-edge-marker[data-delta-state="removed"]{color:var(--d-remove)}[data-delta-state="changed"] .delta-node-marker,.delta-edge-marker[data-delta-state="changed"]{color:var(--d-change)}[data-delta-state="moved"] .delta-node-marker,[data-delta-state="moved-from"] .delta-node-marker,.delta-edge-marker[data-delta-state="moved-from"],.delta-edge-marker[data-delta-state="rerouted"]{color:var(--d-move)}.delta-edge-marker{paint-order:stroke;stroke:#071019;stroke-width:3px}+rect[data-graph-role="structural-frame"][data-delta-state="added"]{stroke:var(--d-add)!important;stroke-width:2.5!important}rect[data-graph-role="structural-frame"][data-delta-state="removed"]{stroke:var(--d-remove)!important;stroke-width:2.5!important;stroke-dasharray:7 5!important}rect[data-graph-role="structural-frame"][data-delta-state="changed"]{stroke:var(--d-change)!important;stroke-width:2.5!important;stroke-dasharray:2 3!important}rect[data-graph-role="structural-frame"][data-delta-state="moved-from"]{stroke:var(--d-move)!important;stroke-width:2!important;stroke-dasharray:8 3 2 3!important;opacity:.42}text[data-delta-boundary-state="added"]{fill:var(--d-add)!important}text[data-delta-boundary-state="removed"]{fill:var(--d-remove)!important}text[data-delta-boundary-state="changed"]{fill:var(--d-change)!important}text[data-delta-boundary-state="moved-from"]{fill:var(--d-move)!important;opacity:.55}+details{margin-top:12px;border:1px solid var(--d-line);border-radius:9px;background:#0a141e}summary{padding:13px 15px;cursor:pointer;font-weight:700}.changes{list-style:none;margin:0;padding:0 15px 15px}.changes li{display:grid;grid-template-columns:30px 90px minmax(140px,1fr) minmax(100px,.7fr) minmax(120px,.8fr) minmax(140px,1.2fr);gap:10px;padding:9px 0;border-top:1px solid rgba(138,160,181,.16);font-size:11px;align-items:baseline}.token{font:800 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.changes code,.changes li>span:last-child{color:var(--d-muted)}.proof-foot{display:flex;justify-content:space-between;gap:24px;margin-top:14px;color:var(--d-muted);font:650 10px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace}+html[data-theme="dark"] body{background:#071019!important;background-image:none!important}html[data-theme="light"]{color-scheme:light;--d-ink:#10283c;--d-muted:#587187;--d-line:#c8d6e2}html[data-theme="light"] body{background:#eef3f7!important;background-image:none!important;color:var(--d-ink)}html[data-theme="light"] .metric,html[data-theme="light"] .view-switch,html[data-theme="light"] details{background:#fff}html[data-theme="light"] .canvas{background:#f8fbfd}html[data-theme="light"] .view-switch button[aria-selected="true"]{background:#dbeaf5;color:#10283c}html[data-theme="light"] .delta-node-marker circle{fill:#fff}html[data-preset="blueprint"] body{background-image:none!important}+@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}@media print{body{min-width:0;background:#fff;color:#111}.proof-page{width:100%;padding:0}.proof-tools,details{display:none!important}.canvas{display:none!important}.canvas[data-view="delta"]{display:block!important;border:0}.proof-foot{color:#444}}+</style></head>+<body><main class="proof-page"><header class="proof-head"><div><p class="eyebrow">ARCHITECTURE DELTA · AUTHORED SNAPSHOTS</p><h1>See what changed<br>before you merge.</h1><p class="subtitle">Checkout Platform — Baseline → Checkout Platform — Fraud Gate</p></div><div class="metrics"><div class="metric add"><strong>2</strong><span>ADDED</span></div><div class="metric remove"><strong>2</strong><span>REMOVED</span></div><div class="metric change"><strong>5</strong><span>CHANGED</span></div></div></header>+<div class="proof-tools"><div class="view-switch" role="tablist" aria-label="Architecture snapshot"><button role="tab" data-target="base" aria-selected="false">Before</button><button role="tab" data-target="delta" aria-selected="true">Delta</button><button role="tab" data-target="head" aria-selected="false">After</button></div><div class="legend"><span class="add"><i></i>+ ADD</span><span class="remove"><i></i>− DEL</span><span class="change"><i></i>~ MOD</span><span class="move"><i></i>↔ MOVE</span></div><div><button class="utility" id="preset" type="button">Preset</button> <button class="utility" id="theme" type="button">Theme</button></div></div>+<section class="canvas" data-view="base" hidden><svg viewBox="0 0 1020 548" role="img" aria-labelledby="base-archify-diagram-title base-archify-diagram-description" data-preset="signal-flow" data-quality-profile="standard" data-quality-gates="advisory">+ <title id="base-archify-diagram-title">Checkout Platform — Baseline</title>+ <desc id="base-archify-diagram-description">Before fraud screening moved into the payment path</desc>+ <!-- Definitions -->+ <defs>+ <marker id="base-arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-default" />+ </marker>+ <marker id="base-arrowhead-emphasis" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-emphasis" />+ </marker>+ <marker id="base-arrowhead-security" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-security" />+ </marker>+ <marker id="base-arrowhead-dashed" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-dashed" />+ </marker>+ <pattern id="base-grid" width="40" height="40" patternUnits="userSpaceOnUse">+ <path d="M 40 0 L 0 0 0 40" class="c-grid" stroke-width="0.5"/>+ </pattern>+ </defs>++ <!-- Background Grid -->+ <rect width="100%" height="100%" fill="url(#base-grid)" />++ <!-- 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="410" rx="12" class="c-region" stroke-width="1" data-delta-state="changed" data-delta-classifications="scope"/>+ <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-boundary-state="changed">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="changed" data-delta-classifications="scope"/>+ <text x="408" y="238" class="t-security" font-size="9" font-weight="600" data-delta-boundary-state="changed">Checkout trust zone</text>++ <!-- Connection paths (before components for correct z-order) -->+ <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(#base-arrowhead-security)" data-delta-state="changed" data-delta-classifications="geometry,topology"/>+ <path data-edge-from="buyers" data-edge-to="edge" data-edge-label="HTTPS" data-edge-key="1" data-edge-id="buyer-request" data-composition-points="160,280;220,280" d="M 160 280 L 220 280" class="a-emphasis" stroke-width="1.8" marker-end="url(#base-arrowhead-emphasis)" data-delta-state="same"/>+ <path data-edge-from="queue" data-edge-to="worker" data-edge-key="2" data-edge-id="consume-order" data-composition-points="560,430;640,430" d="M 560 430 L 640 430" class="a-default" stroke-width="1.5" marker-end="url(#base-arrowhead)" data-delta-state="same"/>+ <path data-edge-from="edge" data-edge-to="checkout" data-edge-key="3" data-edge-id="edge-checkout" data-composition-points="350,280;430,280" d="M 350 280 L 430 280" class="a-default" stroke-width="1.5" marker-end="url(#base-arrowhead)" data-delta-state="same"/>+ <path data-edge-from="checkout" data-edge-to="orders" data-edge-label="SQL" data-edge-key="4" data-edge-id="persist-order" data-composition-points="560,280;640,280" d="M 560 280 L 640 280" class="a-default" stroke-width="1.5" marker-end="url(#base-arrowhead)" data-delta-state="changed" data-delta-classifications="semantic"/>+ <path data-edge-from="checkout" data-edge-to="queue" data-edge-label="accepted" data-edge-key="5" data-edge-id="publish-order" data-composition-points="495,310;495,400" d="M 495 310 L 495 400" class="a-dashed" stroke-width="1.5" marker-end="url(#base-arrowhead-dashed)" data-delta-state="rerouted" data-delta-classifications="geometry"/>+ <path data-edge-from="checkout" data-edge-to="cache" data-edge-label="session" data-edge-key="6" data-edge-id="session-read" data-composition-points="495,250;495,160" d="M 495 250 L 495 160" class="a-default" stroke-width="1.5" marker-end="url(#base-arrowhead)" data-delta-state="removed" data-delta-classifications="topology"/>++ <!-- Components -->+ <g id="base-node-buyers" data-node-id="buyers" data-node-label="Buyers" role="group" aria-label="Buyers, Web + mobile, Architecture component" data-node-kind="external" data-node-sublabel="Web + mobile" data-node-context="Architecture component" data-delta-state="same">+ <title>Buyers · Web + mobile · Architecture component</title>+ <rect x="40" y="250" width="120" height="60" rx="6" class="c-mask"/>+ <rect x="40" y="250" width="120" height="60" rx="6" class="c-external" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(46 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="100" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Buyers</text>+ <text data-detail="context" x="100" y="294" class="t-muted" font-size="9" text-anchor="middle">Web + mobile</text>+ </g>++ <g id="base-node-cache" data-node-id="cache" data-node-label="Session Cache" role="group" aria-label="Session Cache, Redis, Production region" data-node-kind="database" data-node-sublabel="Redis" data-node-context="Production region" data-delta-state="removed" data-delta-classifications="semantic">+ <title>Session Cache · Redis · Production region</title>+ <rect x="430" y="100" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="430" y="100" width="130" height="60" rx="6" class="c-database" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(436 106) 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="495" y="128" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Session Cache</text>+ <text data-detail="context" x="495" y="144" class="t-muted" font-size="9" text-anchor="middle">Redis</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="551" cy="109" r="8"/><text x="551" y="112" text-anchor="middle">−</text></g>+ </g>++ <g id="base-node-checkout" data-node-id="checkout" data-node-label="Checkout API" role="group" aria-label="Checkout API, v1 service, Production region › Checkout trust zone" data-node-kind="backend" data-node-sublabel="v1 service" data-node-context="Production region › Checkout trust zone" data-delta-state="changed" data-delta-classifications="semantic">+ <title>Checkout API · v1 service · Production region › Checkout trust zone</title>+ <rect x="430" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="430" y="250" width="130" height="60" rx="6" class="c-backend" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(436 256) scale(0.6875)">+ <path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>+ </g>+ <text data-detail-anchor x="495" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Checkout API</text>+ <text data-detail="context" x="495" y="294" class="t-muted" font-size="9" text-anchor="middle">v1 service</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="551" cy="259" r="8"/><text x="551" y="262" text-anchor="middle">~</text></g>+ </g>++ <g id="base-node-edge" data-node-id="edge" data-node-label="Edge Gateway" role="group" aria-label="Edge Gateway, TLS + routing, Production region" data-node-kind="cloud" data-node-sublabel="TLS + routing" data-node-context="Production region" data-delta-state="same">+ <title>Edge Gateway · TLS + routing · Production region</title>+ <rect x="220" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="220" y="250" width="130" height="60" rx="6" class="c-cloud" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(226 256) 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="285" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Edge Gateway</text>+ <text data-detail="context" x="285" y="294" class="t-muted" font-size="9" text-anchor="middle">TLS + routing</text>+ </g>++ <g id="base-node-orders" data-node-id="orders" data-node-label="Orders" role="group" aria-label="Orders, PostgreSQL, Production region › Checkout trust zone" data-node-kind="database" data-node-sublabel="PostgreSQL" data-node-context="Production region › Checkout trust zone" data-delta-state="same">+ <title>Orders · PostgreSQL · Production region › Checkout trust zone</title>+ <rect x="640" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="640" y="250" width="130" height="60" rx="6" class="c-database" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(646 256) 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="705" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Orders</text>+ <text data-detail="context" x="705" y="294" class="t-muted" font-size="9" text-anchor="middle">PostgreSQL</text>+ </g>++ <g id="base-node-payments" data-node-id="payments" data-node-label="Payment Rail" role="group" aria-label="Payment Rail, external, Architecture component" data-node-kind="external" data-node-sublabel="external" data-node-context="Architecture component" data-delta-state="same">+ <title>Payment Rail · external · Architecture component</title>+ <rect x="850" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="850" y="250" width="130" height="60" rx="6" class="c-external" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(856 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="915" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Payment Rail</text>+ <text data-detail="context" x="915" y="294" class="t-muted" font-size="9" text-anchor="middle">external</text>+ </g>++ <g id="base-node-queue" data-node-id="queue" data-node-label="Order Events" role="group" aria-label="Order Events, durable queue, Production region" data-node-kind="messagebus" data-node-sublabel="durable queue" data-node-context="Production region" data-delta-state="moved" data-delta-classifications="geometry">+ <title>Order Events · durable queue · Production region</title>+ <rect x="430" y="400" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="430" y="400" width="130" height="60" rx="6" class="c-messagebus" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="messagebus" class="semantic-sigil s-messagebus" transform="translate(436 406) 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="495" y="428" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Order Events</text>+ <text data-detail="context" x="495" y="444" class="t-muted" font-size="9" text-anchor="middle">durable queue</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="551" cy="409" r="8"/><text x="551" y="412" text-anchor="middle">↔</text></g>+ </g>++ <g id="base-node-worker" data-node-id="worker" data-node-label="Fulfilment" role="group" aria-label="Fulfilment, async worker, Production region" data-node-kind="backend" data-node-sublabel="async worker" data-node-context="Production region" data-delta-state="same">+ <title>Fulfilment · async worker · Production region</title>+ <rect x="640" y="400" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="640" y="400" width="130" height="60" rx="6" class="c-backend" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(646 406) scale(0.6875)">+ <path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>+ </g>+ <text data-detail-anchor x="705" y="428" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Fulfilment</text>+ <text data-detail="context" x="705" y="444" class="t-muted" font-size="9" text-anchor="middle">async worker</text>+ </g>++ <!-- Connection labels -->+ <g data-detail="context" data-edge-from="orders" data-edge-to="payments" data-edge-label="authorize" data-edge-key="0" data-edge-id="authorize-payment" data-delta-state="changed" data-delta-classifications="geometry,topology">+ <rect x="783.4" y="260" width="53.199999999999996" height="14" rx="3" class="c-mask"/>+ <text x="810" y="270" class="t-security" font-size="8" text-anchor="middle">authorize</text>+ </g>+ <g data-detail="context" data-edge-from="buyers" data-edge-to="edge" data-edge-label="HTTPS" data-edge-key="1" data-edge-id="buyer-request" data-delta-state="same">+ <rect x="173" y="260" width="34" height="14" rx="3" class="c-mask"/>+ <text x="190" y="270" class="t-backend" font-size="8" text-anchor="middle">HTTPS</text>+ </g>+++ <g data-detail="context" data-edge-from="checkout" data-edge-to="orders" data-edge-label="SQL" data-edge-key="4" data-edge-id="persist-order" data-delta-state="changed" data-delta-classifications="semantic">+ <rect x="585" y="260" width="30" height="14" rx="3" class="c-mask"/>+ <text x="600" y="270" class="t-muted" font-size="8" text-anchor="middle">SQL</text>+ </g>+ <g data-detail="context" data-edge-from="checkout" data-edge-to="queue" data-edge-label="accepted" data-edge-key="5" data-edge-id="publish-order" data-delta-state="rerouted" data-delta-classifications="geometry">+ <rect x="470.8" y="356" width="48.4" height="14" rx="3" class="c-mask"/>+ <text x="495" y="366" class="t-messagebus" font-size="8" text-anchor="middle">accepted</text>+ </g>+ <g data-detail="context" data-edge-from="checkout" data-edge-to="cache" data-edge-label="session" data-edge-key="6" data-edge-id="session-read" data-delta-state="removed" data-delta-classifications="topology">+ <rect x="473.2" y="164" width="43.6" height="14" rx="3" class="c-mask"/>+ <text x="495" y="174" class="t-muted" font-size="8" text-anchor="middle">session</text>+ </g>++ <!-- Legend -->+ <g data-legend-bridge>+ <text x="40" y="519" class="t-primary" font-size="9" font-weight="600">Legend</text>+ <g data-legend-kind="external">+ <rect x="40" y="524" width="14" height="9" rx="2" class="c-external" stroke-width="1"/>+ <text x="60" y="532" class="t-muted" font-size="8">External</text>+ </g>+ <g data-legend-kind="database">+ <rect x="144" y="524" width="14" height="9" rx="2" class="c-database" stroke-width="1"/>+ <text x="164" y="532" class="t-muted" font-size="8">Database</text>+ </g>+ <g data-legend-kind="backend">+ <rect x="248" y="524" width="14" height="9" rx="2" class="c-backend" stroke-width="1"/>+ <text x="268" y="532" class="t-muted" font-size="8">Backend</text>+ </g>+ <g data-legend-kind="cloud">+ <rect x="347" y="524" width="14" height="9" rx="2" class="c-cloud" stroke-width="1"/>+ <text x="367" y="532" class="t-muted" font-size="8">Cloud</text>+ </g>+ <g data-legend-kind="messagebus">+ <rect x="436" y="524" width="14" height="9" rx="2" class="c-messagebus" stroke-width="1"/>+ <text x="456" y="532" class="t-muted" font-size="8">Message bus</text>+ </g>+ </g>+ </svg></section><section class="canvas" data-view="delta"><svg viewBox="0 0 1044 592" role="img" aria-labelledby="delta-head-archify-diagram-title delta-head-archify-diagram-description" data-preset="signal-flow" data-quality-profile="standard" data-quality-gates="advisory">+ <title id="delta-head-archify-diagram-title">Checkout Platform — Fraud Gate</title>+ <desc id="delta-head-archify-diagram-description">Fraud screening now owns payment authorization</desc>+ <!-- Definitions -->+ <defs>+ <marker id="delta-head-arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-default" />+ </marker>+ <marker id="delta-head-arrowhead-emphasis" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-emphasis" />+ </marker>+ <marker id="delta-head-arrowhead-security" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-security" />+ </marker>+ <marker id="delta-head-arrowhead-dashed" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-dashed" />+ </marker>+ <pattern id="delta-head-grid" width="40" height="40" patternUnits="userSpaceOnUse">+ <path d="M 40 0 L 0 0 0 40" class="c-grid" stroke-width="0.5"/>+ </pattern>+ </defs>++ <!-- 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"/>+ <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-boundary-state="moved-from">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"/>+ <text x="408" y="238" class="t-security" font-size="9" font-weight="600" data-delta-boundary-state="moved-from">Checkout trust zone</text>++ <!-- 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"/>+ <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-boundary-state="changed">Production region</text>++ <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"/>+ <text x="408" y="88" class="t-security" font-size="9" font-weight="600" data-delta-boundary-state="changed">Checkout trust zone</text>++ <!-- 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"/>+<g data-detail="context" data-edge-from="orders" data-edge-to="payments" data-edge-label="authorize" data-edge-key="0" data-edge-id="authorize-payment" data-delta-state="removed">+ <rect x="783.4" y="260" width="53.199999999999996" height="14" rx="3" class="c-mask"/>+ <text x="810" y="270" class="t-security" font-size="8" text-anchor="middle">authorize</text>+ </g>++<path data-edge-from="checkout" data-edge-to="queue" data-edge-label="accepted" data-edge-key="5" data-edge-id="publish-order" data-composition-points="495,310;495,400" d="M 495 310 L 495 400" class="a-dashed" stroke-width="1.5" marker-end="url(#arrowhead-dashed)" data-delta-state="moved-from"/>+<g data-detail="context" data-edge-from="checkout" data-edge-to="queue" data-edge-label="accepted" data-edge-key="5" data-edge-id="publish-order" data-delta-state="moved-from">+ <rect x="470.8" y="356" width="48.4" height="14" rx="3" class="c-mask"/>+ <text x="495" y="366" class="t-messagebus" font-size="8" text-anchor="middle">accepted</text>+ </g>+<path data-edge-from="checkout" data-edge-to="cache" data-edge-label="session" data-edge-key="6" data-edge-id="session-read" data-composition-points="495,250;495,160" d="M 495 250 L 495 160" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)" data-delta-state="removed"/>+<g data-detail="context" data-edge-from="checkout" data-edge-to="cache" data-edge-label="session" data-edge-key="6" data-edge-id="session-read" data-delta-state="removed">+ <rect x="473.2" y="164" width="43.6" height="14" rx="3" class="c-mask"/>+ <text x="495" y="174" class="t-muted" font-size="8" text-anchor="middle">session</text>+ </g>++ <!-- Connection paths (before components for correct z-order) -->+ <path data-edge-from="fraud" data-edge-to="payments" data-edge-label="authorize" data-edge-key="0" data-edge-id="authorize-payment" data-composition-points="770,130;820,130;915,130;915,250" d="M 770 130 L 812 130 Q 820 130 828 130 L 907 130 Q 915 130 915 138 L 915 250" class="a-security" stroke-width="1.5" marker-end="url(#delta-head-arrowhead-security)" data-delta-state="changed" data-delta-classifications="geometry,topology"/>+ <path data-edge-from="buyers" data-edge-to="edge" data-edge-label="HTTPS" data-edge-key="1" data-edge-id="buyer-request" data-composition-points="160,280;220,280" d="M 160 280 L 220 280" class="a-emphasis" stroke-width="1.8" marker-end="url(#delta-head-arrowhead-emphasis)" data-delta-state="same"/>+ <path data-edge-from="queue" data-edge-to="worker" data-edge-key="2" data-edge-id="consume-order" data-composition-points="560,450;600,450;600,430;640,430" d="M 560 450 L 592 450 Q 600 450 600 442 L 600 438 Q 600 430 608 430 L 640 430" class="a-default" stroke-width="1.5" marker-end="url(#delta-head-arrowhead)" data-delta-state="same"/>+ <path data-edge-from="edge" data-edge-to="checkout" data-edge-key="3" data-edge-id="edge-checkout" data-composition-points="350,280;430,280" d="M 350 280 L 430 280" class="a-default" stroke-width="1.5" marker-end="url(#delta-head-arrowhead)" data-delta-state="same"/>+ <path data-edge-from="checkout" data-edge-to="fraud" data-edge-label="screen" data-edge-key="4" data-edge-id="fraud-check" data-composition-points="495,250;600,250;600,160;705,160" d="M 495 250 L 592 250 Q 600 250 600 242 L 600 168 Q 600 160 608 160 L 705 160" class="a-security" stroke-width="1.5" marker-end="url(#delta-head-arrowhead-security)" data-delta-state="added" data-delta-classifications="topology"/>+ <path data-edge-from="checkout" data-edge-to="orders" data-edge-label="SQL tx" data-edge-key="5" data-edge-id="persist-order" data-composition-points="560,280;640,280" d="M 560 280 L 640 280" class="a-default" stroke-width="1.5" marker-end="url(#delta-head-arrowhead)" data-delta-state="changed" data-delta-classifications="semantic"/>+ <path data-edge-from="checkout" data-edge-to="queue" data-edge-label="accepted" data-edge-key="6" data-edge-id="publish-order" data-composition-points="495,310;495,420" d="M 495 310 L 495 420" class="a-dashed" stroke-width="1.5" marker-end="url(#delta-head-arrowhead-dashed)" data-delta-state="rerouted" data-delta-classifications="geometry"/>++ <!-- Baseline removed and move-from component phantoms -->+<g id="delta-base-node-cache" data-node-id="cache" data-node-label="Session Cache" role="group" aria-label="Session Cache, Redis, Production region" data-node-kind="database" data-node-sublabel="Redis" data-node-context="Production region" data-delta-state="removed">+ <title>Session Cache · Redis · Production region</title>+ <rect x="430" y="100" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="430" y="100" width="130" height="60" rx="6" class="c-database" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(436 106) 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="495" y="128" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Session Cache</text>+ <text data-detail="context" x="495" y="144" class="t-muted" font-size="9" text-anchor="middle">Redis</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="551" cy="109" r="8"/><text x="551" y="112" text-anchor="middle">−</text></g>+ </g>+<g id="delta-base-node-queue" data-node-id="queue" data-node-label="Order Events" role="group" aria-label="Order Events, durable queue, Production region" data-node-kind="messagebus" data-node-sublabel="durable queue" data-node-context="Production region" data-delta-state="moved-from">+ <title>Order Events · durable queue · Production region</title>+ <rect x="430" y="400" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="430" y="400" width="130" height="60" rx="6" class="c-messagebus" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="messagebus" class="semantic-sigil s-messagebus" transform="translate(436 406) 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="495" y="428" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Order Events</text>+ <text data-detail="context" x="495" y="444" class="t-muted" font-size="9" text-anchor="middle">durable queue</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="551" cy="409" r="8"/><text x="551" y="412" text-anchor="middle">↔</text></g>+ </g>++ <!-- Components -->+ <g id="delta-head-node-buyers" data-node-id="buyers" data-node-label="Buyers" role="group" aria-label="Buyers, Web + mobile, Architecture component" data-node-kind="external" data-node-sublabel="Web + mobile" data-node-context="Architecture component" data-delta-state="same">+ <title>Buyers · Web + mobile · Architecture component</title>+ <rect x="40" y="250" width="120" height="60" rx="6" class="c-mask"/>+ <rect x="40" y="250" width="120" height="60" rx="6" class="c-external" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(46 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="100" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Buyers</text>+ <text data-detail="context" x="100" y="294" class="t-muted" font-size="9" text-anchor="middle">Web + mobile</text>+ </g>++ <g id="delta-head-node-checkout" data-node-id="checkout" data-node-label="Checkout API" role="group" aria-label="Checkout API, v2 idempotent, Production region › Checkout trust zone" data-node-kind="backend" data-node-sublabel="v2 idempotent" data-node-context="Production region › Checkout trust zone" data-delta-state="changed" data-delta-classifications="semantic">+ <title>Checkout API · v2 idempotent · Production region › Checkout trust zone</title>+ <rect x="430" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="430" y="250" width="130" height="60" rx="6" class="c-backend" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(436 256) scale(0.6875)">+ <path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>+ </g>+ <text data-detail-anchor x="495" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Checkout API</text>+ <text data-detail="context" x="495" y="294" class="t-muted" font-size="9" text-anchor="middle">v2 idempotent</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="551" cy="259" r="8"/><text x="551" y="262" text-anchor="middle">~</text></g>+ </g>++ <g id="delta-head-node-edge" data-node-id="edge" data-node-label="Edge Gateway" role="group" aria-label="Edge Gateway, TLS + routing, Production region" data-node-kind="cloud" data-node-sublabel="TLS + routing" data-node-context="Production region" data-delta-state="same">+ <title>Edge Gateway · TLS + routing · Production region</title>+ <rect x="220" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="220" y="250" width="130" height="60" rx="6" class="c-cloud" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(226 256) 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="285" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Edge Gateway</text>+ <text data-detail="context" x="285" y="294" class="t-muted" font-size="9" text-anchor="middle">TLS + routing</text>+ </g>++ <g id="delta-head-node-fraud" data-node-id="fraud" data-node-label="Fraud Gate" role="group" aria-label="Fraud Gate, policy scoring, Production region › Checkout trust zone" data-node-kind="security" data-node-sublabel="policy scoring" data-node-tag="new owner" data-node-context="Production region › Checkout trust zone" data-delta-state="added" data-delta-classifications="semantic">+ <title>Fraud Gate · policy scoring · Production region › Checkout trust zone · new owner</title>+ <rect x="640" y="100" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="640" y="100" width="130" height="60" rx="6" class="c-security" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="security" class="semantic-sigil s-security" transform="translate(646 106) 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="705" y="128" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Fraud Gate</text>+ <text data-detail="context" x="705" y="144" class="t-muted" font-size="9" text-anchor="middle">policy scoring</text>+ <text data-detail="fine" x="705" y="152" class="t-security" font-size="7" text-anchor="middle">new owner</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="761" cy="109" r="8"/><text x="761" y="112" text-anchor="middle">+</text></g>+ </g>++ <g id="delta-head-node-orders" data-node-id="orders" data-node-label="Orders" role="group" aria-label="Orders, PostgreSQL, Production region › Checkout trust zone" data-node-kind="database" data-node-sublabel="PostgreSQL" data-node-context="Production region › Checkout trust zone" data-delta-state="same">+ <title>Orders · PostgreSQL · Production region › Checkout trust zone</title>+ <rect x="640" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="640" y="250" width="130" height="60" rx="6" class="c-database" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(646 256) 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="705" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Orders</text>+ <text data-detail="context" x="705" y="294" class="t-muted" font-size="9" text-anchor="middle">PostgreSQL</text>+ </g>++ <g id="delta-head-node-payments" data-node-id="payments" data-node-label="Payment Rail" role="group" aria-label="Payment Rail, external, Architecture component" data-node-kind="external" data-node-sublabel="external" data-node-context="Architecture component" data-delta-state="same">+ <title>Payment Rail · external · Architecture component</title>+ <rect x="850" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="850" y="250" width="130" height="60" rx="6" class="c-external" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(856 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="915" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Payment Rail</text>+ <text data-detail="context" x="915" y="294" class="t-muted" font-size="9" text-anchor="middle">external</text>+ </g>++ <g id="delta-head-node-queue" data-node-id="queue" data-node-label="Order Events" role="group" aria-label="Order Events, durable queue, Production region" data-node-kind="messagebus" data-node-sublabel="durable queue" data-node-context="Production region" data-delta-state="moved" data-delta-classifications="geometry">+ <title>Order Events · durable queue · Production region</title>+ <rect x="430" y="420" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="430" y="420" width="130" height="60" rx="6" class="c-messagebus" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="messagebus" class="semantic-sigil s-messagebus" transform="translate(436 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="495" y="448" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Order Events</text>+ <text data-detail="context" x="495" y="464" class="t-muted" font-size="9" text-anchor="middle">durable queue</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="551" cy="429" r="8"/><text x="551" y="432" text-anchor="middle">↔</text></g>+ </g>++ <g id="delta-head-node-worker" data-node-id="worker" data-node-label="Fulfilment" role="group" aria-label="Fulfilment, async worker, Production region" data-node-kind="backend" data-node-sublabel="async worker" data-node-context="Production region" data-delta-state="same">+ <title>Fulfilment · async worker · Production region</title>+ <rect x="640" y="400" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="640" y="400" width="130" height="60" rx="6" class="c-backend" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(646 406) scale(0.6875)">+ <path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>+ </g>+ <text data-detail-anchor x="705" y="428" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Fulfilment</text>+ <text data-detail="context" x="705" y="444" class="t-muted" font-size="9" text-anchor="middle">async worker</text>+ </g>++ <!-- Connection labels -->+ <g data-detail="context" data-edge-from="fraud" data-edge-to="payments" data-edge-label="authorize" data-edge-key="0" data-edge-id="authorize-payment" data-delta-state="changed" data-delta-classifications="geometry,topology">+ <rect x="840.9" y="110" width="53.199999999999996" height="14" rx="3" class="c-mask"/>+ <text x="867.5" y="120" class="t-security" font-size="8" text-anchor="middle">authorize</text>+ </g>+ <g data-detail="context" data-edge-from="buyers" data-edge-to="edge" data-edge-label="HTTPS" data-edge-key="1" data-edge-id="buyer-request" data-delta-state="same">+ <rect x="173" y="260" width="34" height="14" rx="3" class="c-mask"/>+ <text x="190" y="270" class="t-backend" font-size="8" text-anchor="middle">HTTPS</text>+ </g>+++ <g data-detail="context" data-edge-from="checkout" data-edge-to="fraud" data-edge-label="screen" data-edge-key="4" data-edge-id="fraud-check" data-delta-state="added" data-delta-classifications="topology">+ <rect x="580.6" y="119" width="38.8" height="14" rx="3" class="c-mask"/>+ <text x="600" y="129" class="t-security" font-size="8" text-anchor="middle">screen</text>+ </g>+ <g data-detail="context" data-edge-from="checkout" data-edge-to="orders" data-edge-label="SQL tx" data-edge-key="5" data-edge-id="persist-order" data-delta-state="changed" data-delta-classifications="semantic">+ <rect x="580.6" y="260" width="38.8" height="14" rx="3" class="c-mask"/>+ <text x="600" y="270" class="t-muted" font-size="8" text-anchor="middle">SQL tx</text>+ </g>+ <g data-detail="context" data-edge-from="checkout" data-edge-to="queue" data-edge-label="accepted" data-edge-key="6" data-edge-id="publish-order" data-delta-state="rerouted" data-delta-classifications="geometry">+ <rect x="470.8" y="366" width="48.4" height="14" rx="3" class="c-mask"/>+ <text x="495" y="376" class="t-messagebus" font-size="8" text-anchor="middle">accepted</text>+ </g>++ <!-- Delta relationship symbols -->+<text class="delta-edge-marker" data-delta-state="removed" x="779" y="273" aria-hidden="true">−</text>+<text class="delta-edge-marker" data-delta-state="moved-from" x="504" y="303" aria-hidden="true">↔</text>+<text class="delta-edge-marker" data-delta-state="removed" x="504" y="243" aria-hidden="true">−</text>+<text class="delta-edge-marker" data-delta-state="added" x="779" y="273" aria-hidden="true">+</text>+<text class="delta-edge-marker" data-delta-state="added" x="504" y="243" aria-hidden="true">+</text>+<text class="delta-edge-marker" data-delta-state="changed" x="569" y="273" aria-hidden="true">~</text>+<text class="delta-edge-marker" data-delta-state="rerouted" x="504" y="303" aria-hidden="true">↔</text>++ <!-- Legend -->+ <g data-legend-bridge>+ <text x="40" y="539" class="t-primary" font-size="9" font-weight="600">Legend</text>+ <g data-legend-kind="external">+ <rect x="40" y="544" width="14" height="9" rx="2" class="c-external" stroke-width="1"/>+ <text x="60" y="552" class="t-muted" font-size="8">External</text>+ </g>+ <g data-legend-kind="backend">+ <rect x="144" y="544" width="14" height="9" rx="2" class="c-backend" stroke-width="1"/>+ <text x="164" y="552" class="t-muted" font-size="8">Backend</text>+ </g>+ <g data-legend-kind="cloud">+ <rect x="243" y="544" width="14" height="9" rx="2" class="c-cloud" stroke-width="1"/>+ <text x="263" y="552" class="t-muted" font-size="8">Cloud</text>+ </g>+ <g data-legend-kind="security">+ <rect x="332" y="544" width="14" height="9" rx="2" class="c-security" stroke-width="1"/>+ <text x="352" y="552" class="t-muted" font-size="8">Security</text>+ </g>+ <g data-legend-kind="database">+ <rect x="436" y="544" width="14" height="9" rx="2" class="c-database" stroke-width="1"/>+ <text x="456" y="552" class="t-muted" font-size="8">Database</text>+ </g>+ <g data-legend-kind="messagebus">+ <rect x="540" y="544" width="14" height="9" rx="2" class="c-messagebus" stroke-width="1"/>+ <text x="560" y="552" class="t-muted" font-size="8">Message bus</text>+ </g>+ </g>+ </svg></section><section class="canvas" data-view="head" hidden><svg viewBox="0 0 1020 568" role="img" aria-labelledby="head-archify-diagram-title head-archify-diagram-description" data-preset="signal-flow" data-quality-profile="standard" data-quality-gates="advisory">+ <title id="head-archify-diagram-title">Checkout Platform — Fraud Gate</title>+ <desc id="head-archify-diagram-description">Fraud screening now owns payment authorization</desc>+ <!-- Definitions -->+ <defs>+ <marker id="head-arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-default" />+ </marker>+ <marker id="head-arrowhead-emphasis" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-emphasis" />+ </marker>+ <marker id="head-arrowhead-security" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-security" />+ </marker>+ <marker id="head-arrowhead-dashed" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-dashed" />+ </marker>+ <pattern id="head-grid" width="40" height="40" patternUnits="userSpaceOnUse">+ <path d="M 40 0 L 0 0 0 40" class="c-grid" stroke-width="0.5"/>+ </pattern>+ </defs>++ <!-- Background Grid -->+ <rect width="100%" height="100%" fill="url(#head-grid)" />++ <!-- 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"/>+ <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-boundary-state="changed">Production region</text>++ <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"/>+ <text x="408" y="88" class="t-security" font-size="9" font-weight="600" data-delta-boundary-state="changed">Checkout trust zone</text>++ <!-- Connection paths (before components for correct z-order) -->+ <path data-edge-from="fraud" data-edge-to="payments" data-edge-label="authorize" data-edge-key="0" data-edge-id="authorize-payment" data-composition-points="770,130;820,130;915,130;915,250" d="M 770 130 L 812 130 Q 820 130 828 130 L 907 130 Q 915 130 915 138 L 915 250" class="a-security" stroke-width="1.5" marker-end="url(#head-arrowhead-security)" data-delta-state="changed" data-delta-classifications="geometry,topology"/>+ <path data-edge-from="buyers" data-edge-to="edge" data-edge-label="HTTPS" data-edge-key="1" data-edge-id="buyer-request" data-composition-points="160,280;220,280" d="M 160 280 L 220 280" class="a-emphasis" stroke-width="1.8" marker-end="url(#head-arrowhead-emphasis)" data-delta-state="same"/>+ <path data-edge-from="queue" data-edge-to="worker" data-edge-key="2" data-edge-id="consume-order" data-composition-points="560,450;600,450;600,430;640,430" d="M 560 450 L 592 450 Q 600 450 600 442 L 600 438 Q 600 430 608 430 L 640 430" class="a-default" stroke-width="1.5" marker-end="url(#head-arrowhead)" data-delta-state="same"/>+ <path data-edge-from="edge" data-edge-to="checkout" data-edge-key="3" data-edge-id="edge-checkout" data-composition-points="350,280;430,280" d="M 350 280 L 430 280" class="a-default" stroke-width="1.5" marker-end="url(#head-arrowhead)" data-delta-state="same"/>+ <path data-edge-from="checkout" data-edge-to="fraud" data-edge-label="screen" data-edge-key="4" data-edge-id="fraud-check" data-composition-points="495,250;600,250;600,160;705,160" d="M 495 250 L 592 250 Q 600 250 600 242 L 600 168 Q 600 160 608 160 L 705 160" class="a-security" stroke-width="1.5" marker-end="url(#head-arrowhead-security)" data-delta-state="added" data-delta-classifications="topology"/>+ <path data-edge-from="checkout" data-edge-to="orders" data-edge-label="SQL tx" data-edge-key="5" data-edge-id="persist-order" data-composition-points="560,280;640,280" d="M 560 280 L 640 280" class="a-default" stroke-width="1.5" marker-end="url(#head-arrowhead)" data-delta-state="changed" data-delta-classifications="semantic"/>+ <path data-edge-from="checkout" data-edge-to="queue" data-edge-label="accepted" data-edge-key="6" data-edge-id="publish-order" data-composition-points="495,310;495,420" d="M 495 310 L 495 420" class="a-dashed" stroke-width="1.5" marker-end="url(#head-arrowhead-dashed)" data-delta-state="rerouted" data-delta-classifications="geometry"/>++ <!-- Components -->+ <g id="head-node-buyers" data-node-id="buyers" data-node-label="Buyers" role="group" aria-label="Buyers, Web + mobile, Architecture component" data-node-kind="external" data-node-sublabel="Web + mobile" data-node-context="Architecture component" data-delta-state="same">+ <title>Buyers · Web + mobile · Architecture component</title>+ <rect x="40" y="250" width="120" height="60" rx="6" class="c-mask"/>+ <rect x="40" y="250" width="120" height="60" rx="6" class="c-external" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(46 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="100" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Buyers</text>+ <text data-detail="context" x="100" y="294" class="t-muted" font-size="9" text-anchor="middle">Web + mobile</text>+ </g>++ <g id="head-node-checkout" data-node-id="checkout" data-node-label="Checkout API" role="group" aria-label="Checkout API, v2 idempotent, Production region › Checkout trust zone" data-node-kind="backend" data-node-sublabel="v2 idempotent" data-node-context="Production region › Checkout trust zone" data-delta-state="changed" data-delta-classifications="semantic">+ <title>Checkout API · v2 idempotent · Production region › Checkout trust zone</title>+ <rect x="430" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="430" y="250" width="130" height="60" rx="6" class="c-backend" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(436 256) scale(0.6875)">+ <path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>+ </g>+ <text data-detail-anchor x="495" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Checkout API</text>+ <text data-detail="context" x="495" y="294" class="t-muted" font-size="9" text-anchor="middle">v2 idempotent</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="551" cy="259" r="8"/><text x="551" y="262" text-anchor="middle">~</text></g>+ </g>++ <g id="head-node-edge" data-node-id="edge" data-node-label="Edge Gateway" role="group" aria-label="Edge Gateway, TLS + routing, Production region" data-node-kind="cloud" data-node-sublabel="TLS + routing" data-node-context="Production region" data-delta-state="same">+ <title>Edge Gateway · TLS + routing · Production region</title>+ <rect x="220" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="220" y="250" width="130" height="60" rx="6" class="c-cloud" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(226 256) 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="285" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Edge Gateway</text>+ <text data-detail="context" x="285" y="294" class="t-muted" font-size="9" text-anchor="middle">TLS + routing</text>+ </g>++ <g id="head-node-fraud" data-node-id="fraud" data-node-label="Fraud Gate" role="group" aria-label="Fraud Gate, policy scoring, Production region › Checkout trust zone" data-node-kind="security" data-node-sublabel="policy scoring" data-node-tag="new owner" data-node-context="Production region › Checkout trust zone" data-delta-state="added" data-delta-classifications="semantic">+ <title>Fraud Gate · policy scoring · Production region › Checkout trust zone · new owner</title>+ <rect x="640" y="100" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="640" y="100" width="130" height="60" rx="6" class="c-security" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="security" class="semantic-sigil s-security" transform="translate(646 106) 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="705" y="128" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Fraud Gate</text>+ <text data-detail="context" x="705" y="144" class="t-muted" font-size="9" text-anchor="middle">policy scoring</text>+ <text data-detail="fine" x="705" y="152" class="t-security" font-size="7" text-anchor="middle">new owner</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="761" cy="109" r="8"/><text x="761" y="112" text-anchor="middle">+</text></g>+ </g>++ <g id="head-node-orders" data-node-id="orders" data-node-label="Orders" role="group" aria-label="Orders, PostgreSQL, Production region › Checkout trust zone" data-node-kind="database" data-node-sublabel="PostgreSQL" data-node-context="Production region › Checkout trust zone" data-delta-state="same">+ <title>Orders · PostgreSQL · Production region › Checkout trust zone</title>+ <rect x="640" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="640" y="250" width="130" height="60" rx="6" class="c-database" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(646 256) 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="705" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Orders</text>+ <text data-detail="context" x="705" y="294" class="t-muted" font-size="9" text-anchor="middle">PostgreSQL</text>+ </g>++ <g id="head-node-payments" data-node-id="payments" data-node-label="Payment Rail" role="group" aria-label="Payment Rail, external, Architecture component" data-node-kind="external" data-node-sublabel="external" data-node-context="Architecture component" data-delta-state="same">+ <title>Payment Rail · external · Architecture component</title>+ <rect x="850" y="250" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="850" y="250" width="130" height="60" rx="6" class="c-external" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(856 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="915" y="278" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Payment Rail</text>+ <text data-detail="context" x="915" y="294" class="t-muted" font-size="9" text-anchor="middle">external</text>+ </g>++ <g id="head-node-queue" data-node-id="queue" data-node-label="Order Events" role="group" aria-label="Order Events, durable queue, Production region" data-node-kind="messagebus" data-node-sublabel="durable queue" data-node-context="Production region" data-delta-state="moved" data-delta-classifications="geometry">+ <title>Order Events · durable queue · Production region</title>+ <rect x="430" y="420" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="430" y="420" width="130" height="60" rx="6" class="c-messagebus" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="messagebus" class="semantic-sigil s-messagebus" transform="translate(436 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="495" y="448" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Order Events</text>+ <text data-detail="context" x="495" y="464" class="t-muted" font-size="9" text-anchor="middle">durable queue</text>++ <g class="delta-node-marker" aria-hidden="true"><circle cx="551" cy="429" r="8"/><text x="551" y="432" text-anchor="middle">↔</text></g>+ </g>++ <g id="head-node-worker" data-node-id="worker" data-node-label="Fulfilment" role="group" aria-label="Fulfilment, async worker, Production region" data-node-kind="backend" data-node-sublabel="async worker" data-node-context="Production region" data-delta-state="same">+ <title>Fulfilment · async worker · Production region</title>+ <rect x="640" y="400" width="130" height="60" rx="6" class="c-mask"/>+ <rect x="640" y="400" width="130" height="60" rx="6" class="c-backend" stroke-width="1.5"/>+ <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(646 406) scale(0.6875)">+ <path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>+ </g>+ <text data-detail-anchor x="705" y="428" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Fulfilment</text>+ <text data-detail="context" x="705" y="444" class="t-muted" font-size="9" text-anchor="middle">async worker</text>+ </g>++ <!-- Connection labels -->+ <g data-detail="context" data-edge-from="fraud" data-edge-to="payments" data-edge-label="authorize" data-edge-key="0" data-edge-id="authorize-payment" data-delta-state="changed" data-delta-classifications="geometry,topology">+ <rect x="840.9" y="110" width="53.199999999999996" height="14" rx="3" class="c-mask"/>+ <text x="867.5" y="120" class="t-security" font-size="8" text-anchor="middle">authorize</text>+ </g>+ <g data-detail="context" data-edge-from="buyers" data-edge-to="edge" data-edge-label="HTTPS" data-edge-key="1" data-edge-id="buyer-request" data-delta-state="same">+ <rect x="173" y="260" width="34" height="14" rx="3" class="c-mask"/>+ <text x="190" y="270" class="t-backend" font-size="8" text-anchor="middle">HTTPS</text>+ </g>+++ <g data-detail="context" data-edge-from="checkout" data-edge-to="fraud" data-edge-label="screen" data-edge-key="4" data-edge-id="fraud-check" data-delta-state="added" data-delta-classifications="topology">+ <rect x="580.6" y="119" width="38.8" height="14" rx="3" class="c-mask"/>+ <text x="600" y="129" class="t-security" font-size="8" text-anchor="middle">screen</text>+ </g>+ <g data-detail="context" data-edge-from="checkout" data-edge-to="orders" data-edge-label="SQL tx" data-edge-key="5" data-edge-id="persist-order" data-delta-state="changed" data-delta-classifications="semantic">+ <rect x="580.6" y="260" width="38.8" height="14" rx="3" class="c-mask"/>+ <text x="600" y="270" class="t-muted" font-size="8" text-anchor="middle">SQL tx</text>+ </g>+ <g data-detail="context" data-edge-from="checkout" data-edge-to="queue" data-edge-label="accepted" data-edge-key="6" data-edge-id="publish-order" data-delta-state="rerouted" data-delta-classifications="geometry">+ <rect x="470.8" y="366" width="48.4" height="14" rx="3" class="c-mask"/>+ <text x="495" y="376" class="t-messagebus" font-size="8" text-anchor="middle">accepted</text>+ </g>++ <!-- Legend -->+ <g data-legend-bridge>+ <text x="40" y="539" class="t-primary" font-size="9" font-weight="600">Legend</text>+ <g data-legend-kind="external">+ <rect x="40" y="544" width="14" height="9" rx="2" class="c-external" stroke-width="1"/>+ <text x="60" y="552" class="t-muted" font-size="8">External</text>+ </g>+ <g data-legend-kind="backend">+ <rect x="144" y="544" width="14" height="9" rx="2" class="c-backend" stroke-width="1"/>+ <text x="164" y="552" class="t-muted" font-size="8">Backend</text>+ </g>+ <g data-legend-kind="cloud">+ <rect x="243" y="544" width="14" height="9" rx="2" class="c-cloud" stroke-width="1"/>+ <text x="263" y="552" class="t-muted" font-size="8">Cloud</text>+ </g>+ <g data-legend-kind="security">+ <rect x="332" y="544" width="14" height="9" rx="2" class="c-security" stroke-width="1"/>+ <text x="352" y="552" class="t-muted" font-size="8">Security</text>+ </g>+ <g data-legend-kind="database">+ <rect x="436" y="544" width="14" height="9" rx="2" class="c-database" stroke-width="1"/>+ <text x="456" y="552" class="t-muted" font-size="8">Database</text>+ </g>+ <g data-legend-kind="messagebus">+ <rect x="540" y="544" width="14" height="9" rx="2" class="c-messagebus" stroke-width="1"/>+ <text x="560" y="552" class="t-muted" font-size="8">Message bus</text>+ </g>+ </g>+ </svg></section>+<details><summary>Exact authored changes · 11</summary><ul class="changes"><li data-change-status="added"><span class="token">+</span><span>Component</span><strong>Fraud Gate</strong><code>fraud</code><span>semantic</span><span>identity</span></li>+<li data-change-status="added"><span class="token">+</span><span>Relationship</span><strong>fraud-check</strong><code>fraud-check</code><span>topology</span><span>identity</span></li>+<li data-change-status="changed"><span class="token">~</span><span>Component</span><strong>Checkout API</strong><code>checkout</code><span>semantic</span><span>/sublabel</span></li>+<li data-change-status="changed"><span class="token">~</span><span>Relationship</span><strong>authorize-payment</strong><code>authorize-payment</code><span>geometry, topology</span><span>/from, /fromSide, /toSide, /via</span></li>+<li data-change-status="changed"><span class="token">~</span><span>Relationship</span><strong>persist-order</strong><code>persist-order</code><span>semantic</span><span>/label</span></li>+<li data-change-status="changed"><span class="token">~</span><span>region</span><strong>Production region</strong><code>region:Production region</code><span>scope</span><span>/wraps</span></li>+<li data-change-status="changed"><span class="token">~</span><span>security-group</span><strong>Checkout trust zone</strong><code>security-group:Checkout trust zone</code><span>scope</span><span>/wraps</span></li>+<li data-change-status="moved"><span class="token">↔</span><span>Component</span><strong>Order Events</strong><code>queue</code><span>geometry</span><span>/pos</span></li>+<li data-change-status="removed"><span class="token">−</span><span>Component</span><strong>Session Cache</strong><code>cache</code><span>semantic</span><span>identity</span></li>+<li data-change-status="removed"><span class="token">−</span><span>Relationship</span><strong>session-read</strong><code>session-read</code><span>topology</span><span>identity</span></li>+<li data-change-status="rerouted"><span class="token">↔</span><span>Relationship</span><strong>publish-order</strong><code>publish-order</code><span>geometry</span><span>/labelDy</span></li></ul></details>+<footer class="proof-foot"><span>Stable IDs only · completeness: complete · AUTHORED SNAPSHOTS</span><span>Authored IR only · no risk or mergeability inference</span></footer></main>+<script id="archify-compare-receipt" type="application/json">{+ "schemaVersion": 1,+ "ok": true,+ "command": "compare",+ "type": "architecture",+ "comparatorVersion": 1,+ "canonicalVersion": 1,+ "completeness": "complete",+ "proofLevel": "authored",+ "base": {+ "title": "Checkout Platform — Baseline",+ "semanticSha256": "c6abe82520a9a634a275f2c38f07bdb9497275dbecaa76054cec6c28925579cb"+ },+ "head": {+ "title": "Checkout Platform — Fraud Gate",+ "semanticSha256": "66eaa8c327626376defe232a771d5da22509047f44ffb82e2f04d76b0243bf63"+ },+ "summary": {+ "components": {+ "added": 1,+ "changed": 1,+ "evidenceChanged": 0,+ "removed": 1,+ "moved": 1+ },+ "connections": {+ "added": 1,+ "changed": 2,+ "removed": 1,+ "rerouted": 1+ },+ "boundaries": {+ "added": 0,+ "changed": 2,+ "removed": 0,+ "geometryChanged": 0+ },+ "presentationChanged": true,+ "provenanceChanged": false+ },+ "changes": {+ "components": [+ {+ "id": "cache",+ "baseLabel": "Session Cache",+ "status": "removed",+ "classifications": [+ "semantic"+ ],+ "changedFields": []+ },+ {+ "id": "checkout",+ "baseLabel": "Checkout API",+ "headLabel": "Checkout API",+ "status": "changed",+ "classifications": [+ "semantic"+ ],+ "changedFields": [+ "/sublabel"+ ]+ },+ {+ "id": "fraud",+ "headLabel": "Fraud Gate",+ "status": "added",+ "classifications": [+ "semantic"+ ],+ "changedFields": []+ },+ {+ "id": "queue",+ "baseLabel": "Order Events",+ "headLabel": "Order Events",+ "status": "moved",+ "classifications": [+ "geometry"+ ],+ "changedFields": [+ "/pos"+ ]+ }+ ],+ "connections": [+ {+ "id": "authorize-payment",+ "base": {+ "from": "orders",+ "to": "payments",+ "label": "authorize"+ },+ "head": {+ "from": "fraud",+ "to": "payments",+ "label": "authorize"+ },+ "status": "changed",+ "classifications": [+ "geometry",+ "topology"+ ],+ "changedFields": [+ "/from",+ "/fromSide",+ "/toSide",+ "/via"+ ]+ },+ {+ "id": "fraud-check",+ "head": {+ "from": "checkout",+ "to": "fraud",+ "label": "screen"+ },+ "status": "added",+ "classifications": [+ "topology"+ ],+ "changedFields": []+ },+ {+ "id": "persist-order",+ "base": {+ "from": "checkout",+ "to": "orders",+ "label": "SQL"+ },+ "head": {+ "from": "checkout",+ "to": "orders",+ "label": "SQL tx"+ },+ "status": "changed",+ "classifications": [+ "semantic"+ ],+ "changedFields": [+ "/label"+ ]+ },+ {+ "id": "publish-order",+ "base": {+ "from": "checkout",+ "to": "queue",+ "label": "accepted"+ },+ "head": {+ "from": "checkout",+ "to": "queue",+ "label": "accepted"+ },+ "status": "rerouted",+ "classifications": [+ "geometry"+ ],+ "changedFields": [+ "/labelDy"+ ]+ },+ {+ "id": "session-read",+ "base": {+ "from": "checkout",+ "to": "cache",+ "label": "session"+ },+ "status": "removed",+ "classifications": [+ "topology"+ ],+ "changedFields": []+ }+ ],+ "boundaries": [+ {+ "key": "region:Production region",+ "kind": "region",+ "label": "Production region",+ "status": "changed",+ "classifications": [+ "scope"+ ],+ "changedFields": [+ "/wraps"+ ]+ },+ {+ "key": "security-group:Checkout trust zone",+ "kind": "security-group",+ "label": "Checkout trust zone",+ "status": "changed",+ "classifications": [+ "scope"+ ],+ "changedFields": [+ "/wraps"+ ]+ }+ ]+ },+ "identity": {+ "components": "components[].id",+ "connections": "connections[].id (required)",+ "boundaries": "boundaries[].kind + boundaries[].label (derived)"+ },+ "view": {+ "visualPreset": "signal-flow"+ },+ "limitations": [+ "Authored Architecture IR only; no runtime impact, causality, risk, or mergeability is inferred.",+ "Boundary identity is conservatively derived from kind + label."+ ]+}</script>+<script>(()=>{const tabs=[...document.querySelectorAll('[role="tab"]')],views=[...document.querySelectorAll('[data-view]')];function show(id){tabs.forEach(t=>t.setAttribute('aria-selected',String(t.dataset.target===id)));views.forEach(v=>v.hidden=v.dataset.view!==id)}tabs.forEach((tab,index)=>{tab.addEventListener('click',()=>show(tab.dataset.target));tab.addEventListener('keydown',event=>{if(!['ArrowLeft','ArrowRight','Home','End'].includes(event.key))return;event.preventDefault();let next=event.key==='Home'?0:event.key==='End'?tabs.length-1:(index+(event.key==='ArrowRight'?1:-1)+tabs.length)%tabs.length;tabs[next].focus();show(tabs[next].dataset.target)})});document.querySelector('#theme').addEventListener('click',()=>{document.documentElement.dataset.theme=document.documentElement.dataset.theme==='dark'?'light':'dark'});const presets=['classic','signal-flow','blueprint'];document.querySelector('#preset').addEventListener('click',()=>{const now=document.documentElement.dataset.preset;document.documentElement.dataset.preset=presets[(presets.indexOf(now)+1)%presets.length]})})();</script></body></html>\ No newline at end of filediff --git a/examples/checkout-platform-delta.receipt.json b/examples/checkout-platform-delta.receipt.jsonnew file mode 100644index 00000000..363c67b3--- /dev/null+++ b/examples/checkout-platform-delta.receipt.json@@ -0,0 +1,231 @@+{+ "schemaVersion": 1,+ "ok": true,+ "command": "compare",+ "type": "architecture",+ "comparatorVersion": 1,+ "canonicalVersion": 1,+ "completeness": "complete",+ "proofLevel": "authored",+ "base": {+ "title": "Checkout Platform — Baseline",+ "rawSha256": "3cc9e5b6075aa77b51a892d2cfeba16e0f8eb0f00416e0337e94ec8ec6300d8c",+ "semanticSha256": "c6abe82520a9a634a275f2c38f07bdb9497275dbecaa76054cec6c28925579cb",+ "bytes": 2304+ },+ "head": {+ "title": "Checkout Platform — Fraud Gate",+ "rawSha256": "54982cff83d1a91316097e27fde009b10e7c07a2e321e8bff94ec21ef902e5f2",+ "semanticSha256": "66eaa8c327626376defe232a771d5da22509047f44ffb82e2f04d76b0243bf63",+ "bytes": 2434+ },+ "summary": {+ "components": {+ "added": 1,+ "changed": 1,+ "evidenceChanged": 0,+ "removed": 1,+ "moved": 1+ },+ "connections": {+ "added": 1,+ "changed": 2,+ "removed": 1,+ "rerouted": 1+ },+ "boundaries": {+ "added": 0,+ "changed": 2,+ "removed": 0,+ "geometryChanged": 0+ },+ "presentationChanged": true,+ "provenanceChanged": false+ },+ "changes": {+ "components": [+ {+ "id": "cache",+ "baseLabel": "Session Cache",+ "status": "removed",+ "classifications": [+ "semantic"+ ],+ "changedFields": []+ },+ {+ "id": "checkout",+ "baseLabel": "Checkout API",+ "headLabel": "Checkout API",+ "status": "changed",+ "classifications": [+ "semantic"+ ],+ "changedFields": [+ "/sublabel"+ ]+ },+ {+ "id": "fraud",+ "headLabel": "Fraud Gate",+ "status": "added",+ "classifications": [+ "semantic"+ ],+ "changedFields": []+ },+ {+ "id": "queue",+ "baseLabel": "Order Events",+ "headLabel": "Order Events",+ "status": "moved",+ "classifications": [+ "geometry"+ ],+ "changedFields": [+ "/pos"+ ]+ }+ ],+ "connections": [+ {+ "id": "authorize-payment",+ "base": {+ "from": "orders",+ "to": "payments",+ "label": "authorize"+ },+ "head": {+ "from": "fraud",+ "to": "payments",+ "label": "authorize"+ },+ "status": "changed",+ "classifications": [+ "geometry",+ "topology"+ ],+ "changedFields": [+ "/from",+ "/fromSide",+ "/toSide",+ "/via"+ ]+ },+ {+ "id": "fraud-check",+ "head": {+ "from": "checkout",+ "to": "fraud",+ "label": "screen"+ },+ "status": "added",+ "classifications": [+ "topology"+ ],+ "changedFields": []+ },+ {+ "id": "persist-order",+ "base": {+ "from": "checkout",+ "to": "orders",+ "label": "SQL"+ },+ "head": {+ "from": "checkout",+ "to": "orders",+ "label": "SQL tx"+ },+ "status": "changed",+ "classifications": [+ "semantic"+ ],+ "changedFields": [+ "/label"+ ]+ },+ {+ "id": "publish-order",+ "base": {+ "from": "checkout",+ "to": "queue",+ "label": "accepted"+ },+ "head": {+ "from": "checkout",+ "to": "queue",+ "label": "accepted"+ },+ "status": "rerouted",+ "classifications": [+ "geometry"+ ],+ "changedFields": [+ "/labelDy"+ ]+ },+ {+ "id": "session-read",+ "base": {+ "from": "checkout",+ "to": "cache",+ "label": "session"+ },+ "status": "removed",+ "classifications": [+ "topology"+ ],+ "changedFields": []+ }+ ],+ "boundaries": [+ {+ "key": "region:Production region",+ "kind": "region",+ "label": "Production region",+ "status": "changed",+ "classifications": [+ "scope"+ ],+ "changedFields": [+ "/wraps"+ ]+ },+ {+ "key": "security-group:Checkout trust zone",+ "kind": "security-group",+ "label": "Checkout trust zone",+ "status": "changed",+ "classifications": [+ "scope"+ ],+ "changedFields": [+ "/wraps"+ ]+ }+ ]+ },+ "identity": {+ "components": "components[].id",+ "connections": "connections[].id (required)",+ "boundaries": "boundaries[].kind + boundaries[].label (derived)"+ },+ "view": {+ "visualPreset": "signal-flow"+ },+ "limitations": [+ "Authored Architecture IR only; no runtime impact, causality, risk, or mergeability is inferred.",+ "Boundary identity is conservatively derived from kind + label."+ ],+ "artifact": {+ "sha256": "405c40ca58c1cd309266fe6bf64820b050db32f139036f90676172a6906e0ac2",+ "bytes": 226757+ },+ "validation": {+ "checksPassed": 23,+ "checkCount": 23,+ "baseComposition": "pass",+ "headComposition": "pass"+ }+}diff --git a/scripts/package-smoke.mjs b/scripts/package-smoke.mjsindex 4da3a4ca..cec8efcc 100644--- a/scripts/package-smoke.mjs+++ b/scripts/package-smoke.mjs@@ -86,6 +86,17 @@ try {run(['render', 'architecture', path.join(skillRoot, 'examples', fixtures[0][1]), deployment]);run(['check', deployment]);+ const compareReceipt = JSON.parse(run([+ 'compare', 'architecture',+ path.join(skillRoot, 'examples', 'checkout-platform.base.architecture.json'),+ path.join(skillRoot, 'examples', 'checkout-platform.head.architecture.json'),+ path.join(scratch, 'architecture-delta.html'), '--json',+ ]));+ if (!compareReceipt.ok || compareReceipt.completeness !== 'complete'+ || compareReceipt.validation?.checksPassed !== compareReceipt.validation?.checkCount) {+ throw new Error('packaged Architecture compare did not return a complete passing receipt');+ }+const delivered = JSON.parse(run(['deliver', 'workflow', path.join(skillRoot, 'examples', fixtures[1][1]),path.join(scratch, 'workflow-delivered.html'), '--quality', 'showcase', '--json',