Skip to content

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

feat: add exact delta review navigator

tt-a1i78be40ccf80a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3e9fe7c8..4984997a 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
+- **Exact-ID Architecture Delta Review Navigator.** Every validated Architecture Delta proof now keeps a compact Overview / Previous / Review / Next strip above the unchanged three-state canvas and turns its deterministic authored-change list into native exact-ID controls. Selecting a component, relationship, or boundary highlights only matching `data-node-id`, `data-edge-id`, or derived boundary identity; one deliberate Review activation advances through the same stable order once at 1400ms per change, never loops, and yields to manual navigation, view changes, page hiding, print, or dynamic reduced motion. Generation and runtime validators require one unambiguous primary identity with the receipt's exact state and classification, otherwise the navigator fails closed while the static Before / Delta / After proof remains usable. Roving keyboard navigation, Overview/Escape cleanup, dark/light and all three presets add no URL, history, storage, schema, comparator inference, dependency, GitHub integration, risk claim, or mobile product surface.
- **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.
diff --git a/README.md b/README.md
index 4d55beec..d5bd613b 100644
--- a/README.md
+++ b/README.md
@@ -137,7 +137,7 @@ single-region placement, private database scope, or named boundary crossings
are missing. It is never enabled silently and validates authored facts—not live
infrastructure. 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.
+For design or PR review, Architecture Delta compares validated Before / Delta / After snapshots with a machine receipt. Select an exact authored change or play one finite Review—viewer-only, with no impact, risk, or merge-safety inference.
`node archify/bin/archify.mjs compare architecture base.json head.json architecture-delta.html --json`
@@ -260,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, 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.
+Archify 2.12 includes typed IR across all five modes, real-repository proof, deterministic exact-ID 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.md
index 4d55beec..d5bd613b 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -137,7 +137,7 @@ single-region placement, private database scope, or named boundary crossings
are missing. It is never enabled silently and validates authored facts—not live
infrastructure. 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.
+For design or PR review, Architecture Delta compares validated Before / Delta / After snapshots with a machine receipt. Select an exact authored change or play one finite Review—viewer-only, with no impact, risk, or merge-safety inference.
`node archify/bin/archify.mjs compare architecture base.json head.json architecture-delta.html --json`
@@ -260,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, 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.
+Archify 2.12 includes typed IR across all five modes, real-repository proof, deterministic exact-ID 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.md
index 4da440b3..38f19d10 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -132,7 +132,7 @@ Redis Session 查询 -> PostgreSQL 回源。把缓存未命中作为次要路径
它不会被静默开启,只校验作者写入的事实,不代表线上基础设施已经核验。可查看
[通过校验的部署证明](https://tt-a1i.github.io/archify/gallery.html#proof-deployment-ownership)。
-做设计或 PR 评审时,Architecture Delta 把两份已校验源文件比较为 Before / Delta / After 和机器回执,不冒充风险或合并安全判断。
+做设计或 PR 评审时,Architecture Delta 生成已校验的 Before / Delta / After 和机器回执。精确选择任一作者变更,或播放一次有限 Review;全程只读,不推断影响、风险或合并安全。
`node archify/bin/archify.mjs compare architecture base.json head.json architecture-delta.html --json`
@@ -259,7 +259,7 @@ Claude.ai 中的上传入口:
- [路线图](ROADMAP.md)
- [自动生成的 Proof Lab](https://tt-a1i.github.io/archify/gallery.html)
-Archify 2.12 已覆盖五种 Typed IR、真实仓库证明、确定性的 Architecture Delta 评审、验证后实时预览、作者可达性、可选有限动态、引导视图、语义搜索与关系探索、可分享深链、1200×630 整图与路径卡片、浏览器原生 WebM、显式 `standard` / `showcase` 质量档位,以及按需启用的部署所有权契约。
+Archify 2.12 已覆盖五种 Typed IR、真实仓库证明、基于精确 ID 的确定性 Architecture Delta 评审、验证后实时预览、作者可达性、可选有限动态、引导视图、语义搜索与关系探索、可分享深链、1200×630 整图与路径卡片、浏览器原生 WebM、显式 `standard` / `showcase` 质量档位,以及按需启用的部署所有权契约。
自动 Mermaid Parser、通用自动布局、托管分享服务和 WYSIWYG 编辑器目前都不在产品范围内。
diff --git a/ROADMAP.md b/ROADMAP.md
index 4a49edf3..a78f9109 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -2,6 +2,8 @@
As of v2.12.0, the coordinate-stability work has shipped as JSON IR plus typed renderers for architecture, workflow, sequence, data-flow, and lifecycle diagrams. Workflow diagrams now also have phase/group/exception-lane structure, happy-path linting, trace animation, and route-crossing guards. The shared viewer adds deterministic semantic node IDs, optional author-controlled relationship IDs with durable `#relation=` links, a pre-click Intent Trace for exact one-hop traffic, a two-endpoint Route Probe with an inspectable Route Journey over deterministic shortest authored paths, searchable Node Finder navigation, read-only one-hop focus with a renderer-owned Semantic Passport and copyable focus link, upstream/downstream Authored Reachability, a runtime-built Semantic Radar for desktop viewport navigation, bounded typed guided views with a visible Named Chapter Rail, pre-commit Chapter Delta Preview, Shared Anchor Handoff, and path-aware Semantic Story Beats, a reader-controlled Live/Still Motion Governor, share-ready one-shot chapters with a title/route/step/state/progress cue, a viewport-filling Presentation Stage, Semantic Camera framing, pan/zoom, three reader-switchable visual presets, a contain-only 1200×630 Share Card, route-focused Route Share Card and authored-reach Reach Share Card variants, and browser-native WebM export. A generated Proof Lab publishes 11 live scenario artifacts with their exact sources, three named reader views, 99 artifact checks, and named composition receipts; its preview grid stays static while deliberate proof links play one named chapter once. The landing-page Live Proof Stage promotes three of those generated artifacts into the first bounded motion proof, and the README motion reel carries the same proof-first story onto GitHub without claiming SVG animation support. A question-first scenario guide maps concrete user needs to those 11 bounded recipes across the five modes, with one shared source for CLI and GitHub Pages and direct proof navigation. A unified CLI (`bin/archify.mjs`) wraps guide, render, preview, deliver, validate, check, and examples, with optional last-good desktop preview and verified post-commit open handoffs. This file records the design decisions that led there, plus the ideas that were explicitly declined. The original v2.4 / v2.5 backlog (export-scale URL param, color-blind palette, gzip+base64 share links) was considered and dropped — see [Not planned](#not-planned) for the rationale on each.
+The latest Architecture Delta review slice adds an Exact-ID Review Navigator without expanding comparator truth. The proof still opens as a static Before / Delta / After overview and complete sidecar receipt; a reader may select any deterministic authored-change row or deliberately run one finite 1400ms-per-change pass. Components, relationships, and boundaries resolve only through exact generated identity, with generation-time and runtime state/classification checks that disable the navigator on missing, duplicate, or conflicting targets while preserving the static proof. Manual navigation, roving keyboard focus, Escape/Overview cleanup, reduced motion, hidden/print lifecycles, dark/light themes, and all three presets share the same bounded contract. No URL, history, storage, inferred impact, risk, mergeability, GitHub/CI integration, schema, dependency, hosted service, or mobile product surface was added.
+
The latest engineering-truth slice adds the opt-in Architecture `deployment-ownership` profile. When the user deliberately selects a fail-closed deployment review, every non-external component must name an owner and belong to exactly one region, region and security-group boundaries must exist, databases must be private, each private group must stay inside one shared region, and every membership-changing connection must name its real crossing mechanism. The shared zero-dependency loader enforces those authored facts before rendering; structured diagnostics and validate/deliver receipts expose the exact result, while the Production Deployment proof publishes the passing contract in Gallery. The same no-install package smoke now runs on Ubuntu, macOS, and Windows so the release gate verifies all five modes plus the deployment profile from the committed ZIP. Profile-less v1 diagrams retain their previous bytes and behavior. This is not infrastructure discovery or repository/live-environment verification, and it adds no new renderer, diagram type, visual preset, layout algorithm, viewer panel, dependency, hosted service, telemetry, or mobile surface.
The latest distribution slice makes Cursor a first-class onboarding choice without introducing a second Skill. README EN/ZH, landing copy, and the generated Start page now share explicit `cursor`, `codex`, `claude-code`, and `opencode` targets; `?agent=` is bounded to those four values, keyboard navigation and language switching preserve the selection, and the page emits exact global or repository-local copy-mode commands while carrying no repository content. The installer canary unpacks the zero-dependency archive at Cursor's supported `.agents/skills/archify` root and validates all five modes. A fresh Cursor Agent CLI session independently discovered the same `SKILL.md`, ran doctor, authored typed Architecture source, and delivered a 9/9-check artifact; built-in-browser review confirmed its main and failure paths and zero console errors. The contract intentionally omits `skills use --agent cursor`, automatic updates, a fixed `~/.cursor` location, universal model-quality claims, Cursor-only renderer/schema behavior, and mobile scope.
diff --git a/archify.zip b/archify.zip
index 1470293a..03136db1 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/SKILL.md b/archify/SKILL.md
index 4ef0e4e0..43517520 100644
--- a/archify/SKILL.md
+++ b/archify/SKILL.md
@@ -152,7 +152,7 @@ Choose the authored `meta.visual_preset` with the user by audience, without chan
For 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.
+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. The result opens as a static overview; each validated row can focus its exact authored component, relationship, or boundary ID, and the reader may deliberately start one finite Review pass. This navigator is viewer-only, never changes the receipt or URL, leaves manual navigation available under reduced motion, and disables itself when DOM identity is missing, duplicated, or conflicting. 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
diff --git a/archify/delta/architecture-delta.mjs b/archify/delta/architecture-delta.mjs
index 5a6eed92..f72e851c 100644
--- a/archify/delta/architecture-delta.mjs
+++ b/archify/delta/architecture-delta.mjs
@@ -429,8 +429,8 @@ export function annotateArchitectureSideSvg(svg, receipt, side) {
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}">`));
+ .replace(/^<rect[^>]+\/>/, (tag) => addState(tag, change, side).replace(/\/>$/, ` data-delta-boundary-key="${esc(change.key)}"/>`))
+ .replace(/<text[^>]*>/, (tag) => tag.replace(/>$/, ` data-delta-state="${change.status}" data-delta-boundary-state="${change.status}" data-delta-boundary-key="${esc(change.key)}">`));
});
result = transformNodeGroups(result, (group, id) => {
const change = nodes.get(id);
@@ -453,14 +453,14 @@ function elementById(svg, kind, id) {
return [path, label].filter(Boolean).join('\n');
}
-function forceElementState(markup, state) {
+function forceElementState(markup, state, classifications = []) {
let result;
if (markup.includes('data-node-id=')) {
- result = markup.replace(/^<g\s+[^>]*>/, (tag) => addState(tag, undefined, 'delta', state));
+ result = markup.replace(/^<g\s+[^>]*>/, (tag) => addState(tag, { classifications }, '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));
+ .replace(/<path\s+[^>]*\bdata-edge-id="[^"]+"[^>]*\/>/g, (tag) => addState(tag, { classifications }, 'delta', state))
+ .replace(/<g\s+[^>]*\bdata-edge-id="[^"]+"[^>]*>/g, (tag) => addState(tag, { classifications }, 'delta', state));
}
result = result.replace(/\bid="node-/, 'id="base-node-');
if (markup.includes('data-node-id=')) result = addNodeMarker(result, state);
@@ -474,10 +474,10 @@ function boundaryPairByKey(svg, key) {
return '';
}
-function forceBoundaryState(markup, state) {
+function forceBoundaryState(markup, state, key, classifications = []) {
return markup
- .replace(/^<rect[^>]+\/>/, (tag) => addState(tag, undefined, 'delta', state))
- .replace(/<text[^>]*>/, (tag) => tag.replace(/>$/, ` data-delta-boundary-state="${state}">`));
+ .replace(/^<rect[^>]+\/>/, (tag) => addState(tag, { classifications }, 'delta', state).replace(/\/>$/, ` data-delta-boundary-key="${esc(key)}"/>`))
+ .replace(/<text[^>]*>/, (tag) => tag.replace(/>$/, ` data-delta-state="${state}" data-delta-boundary-state="${state}" data-delta-boundary-key="${esc(key)}">`));
}
function viewBoxSize(svg) {
@@ -488,8 +488,9 @@ function viewBoxSize(svg) {
function edgeSymbolMarkup(markup, state) {
const symbol = markerFor(state);
const point = markup.match(/data-composition-points="([\d.-]+),([\d.-]+)/);
+ const edgeId = markup.match(/\bdata-edge-id="([^"]+)"/)?.[1];
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>`;
+ return `<text class="delta-edge-marker" data-delta-state="${state}"${edgeId ? ` data-edge-id="${esc(edgeId)}"` : ''} x="${Number(point[1]) + 9}" y="${Number(point[2]) - 7}" aria-hidden="true">${symbol}</text>`;
}
export function buildDeltaSvg(baseSvg, headSvg, receipt) {
@@ -504,25 +505,25 @@ export function buildDeltaSvg(baseSvg, headSvg, receipt) {
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'));
+ if (change.status === 'removed') baseNodePhantoms.push(forceElementState(elementById(baseSvg, 'node', change.id), 'removed', change.classifications));
+ else if (change.classifications.includes('geometry')) baseNodePhantoms.push(forceElementState(elementById(baseSvg, 'node', change.id), 'moved-from', change.classifications));
}
for (const change of edges.values()) {
if (change.status === 'removed' || change.classifications.includes('topology')) {
- const phantom = forceElementState(elementById(baseSvg, 'edge', change.id), 'removed');
+ const phantom = forceElementState(elementById(baseSvg, 'edge', change.id), 'removed', change.classifications);
baseEdgePhantoms.push(phantom);
edgeMarkers.push(edgeSymbolMarkup(phantom, 'removed'));
- } else if (change.status === 'rerouted') {
- const phantom = forceElementState(elementById(baseSvg, 'edge', change.id), 'moved-from');
+ } else if (change.classifications.includes('geometry')) {
+ const phantom = forceElementState(elementById(baseSvg, 'edge', change.id), 'moved-from', change.classifications);
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'));
+ if (change.status === 'removed') baseBoundaryPhantoms.push(forceBoundaryState(boundaryPairByKey(baseSvg, renderedKey), 'removed', change.key, change.classifications));
else if (change.status === 'changed' || change.status === 'geometry-changed') {
- baseBoundaryPhantoms.push(forceBoundaryState(boundaryPairByKey(baseSvg, renderedKey), 'moved-from'));
+ baseBoundaryPhantoms.push(forceBoundaryState(boundaryPairByKey(baseSvg, renderedKey), 'moved-from', change.key, change.classifications));
}
}
@@ -542,52 +543,427 @@ export function buildDeltaSvg(baseSvg, headSvg, receipt) {
return prefixSvgIds(staticize(delta), 'delta');
}
-function changeRows(receipt) {
+export function architectureDeltaChangeRows(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 });
+ for (const change of receipt.changes.components) rows.push({ ...change, kind: 'Component', kindKey: 'component', key: `component:${change.id}`, id: change.id });
+ for (const change of receipt.changes.connections) rows.push({ ...change, kind: 'Relationship', kindKey: 'relationship', key: `relationship:${change.id}`, id: change.id });
+ for (const change of receipt.changes.boundaries) rows.push({ ...change, kind: 'Boundary', kindKey: 'boundary', key: `boundary:${change.key}`, id: change.key });
return rows.sort((left, right) => codepointOrder(`${left.status}:${left.kind}:${left.id}`, `${right.status}:${right.kind}:${right.id}`));
}
+function reviewPrimaryStates(row) {
+ if (row.kindKey === 'component' && row.classifications.includes('geometry')) return [row.status, 'moved-from'];
+ if (row.kindKey === 'relationship' && row.status === 'changed' && row.classifications.includes('topology')) return ['changed', 'removed'];
+ if (row.kindKey === 'relationship' && row.classifications.includes('geometry')) return ['moved-from', row.status];
+ if (row.kindKey === 'boundary' && ['changed', 'geometry-changed'].includes(row.status)) return [row.status, 'moved-from'].sort();
+ return [row.status];
+}
+
+function reviewIdentity(row) {
+ const attribute = row.kindKey === 'component' ? 'data-node-id' : row.kindKey === 'relationship' ? 'data-edge-id' : 'data-delta-boundary-key';
+ return { attribute, value: esc(row.id) };
+}
+
+function reviewTargetTags(deltaMarkup, row) {
+ const { attribute, value } = reviewIdentity(row);
+ const safeValue = value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ const identity = new RegExp(`\\b${attribute}="${safeValue}"`);
+ return [...deltaMarkup.matchAll(/<([a-z][\w:-]*)\s+[^>]*>/g)]
+ .map((match) => ({ name: match[1], tag: match[0] }))
+ .filter(({ tag }) => identity.test(tag));
+}
+
+function primaryReviewTags(deltaMarkup, row) {
+ const tagName = row.kindKey === 'component' ? 'g' : row.kindKey === 'relationship' ? 'path' : 'rect';
+ return reviewTargetTags(deltaMarkup, row).filter(({ name }) => name === tagName).map(({ tag }) => tag);
+}
+
+function reviewTargetSignature(tags) {
+ return tags.map(({ name, tag }) => {
+ const state = tag.match(/\bdata-delta-state="([^"]+)"/)?.[1] || '';
+ const classifications = tag.match(/\bdata-delta-classifications="([^"]*)"/)?.[1] || '';
+ return `${name}:${state}:${classifications}`;
+ }).sort(codepointOrder).join('|');
+}
+
+function expectedReviewTargetSignature(row) {
+ const classifications = row.classifications.join(',');
+ const descriptors = [];
+ if (row.kindKey === 'component') {
+ for (const state of reviewPrimaryStates(row)) descriptors.push(`g:${state}:${classifications}`);
+ } else if (row.kindKey === 'boundary') {
+ for (const state of reviewPrimaryStates(row)) {
+ descriptors.push(`rect:${state}:${classifications}`, `text:${state}:`);
+ }
+ } else {
+ const forms = row.status === 'added'
+ ? [{ state: 'added', marker: 'added', label: row.head?.label }]
+ : row.status === 'removed'
+ ? [{ state: 'removed', marker: 'removed', label: row.base?.label }]
+ : row.classifications.includes('topology')
+ ? [
+ { state: 'removed', marker: 'removed', label: row.base?.label },
+ { state: 'changed', marker: 'added', label: row.head?.label },
+ ]
+ : row.classifications.includes('geometry')
+ ? [
+ { state: 'moved-from', marker: 'moved-from', label: row.base?.label },
+ { state: row.status, marker: row.status, label: row.head?.label },
+ ]
+ : [{ state: 'changed', marker: 'changed', label: row.head?.label }];
+ for (const form of forms) {
+ descriptors.push(`path:${form.state}:${classifications}`, `text:${form.marker}:`);
+ if (form.label) descriptors.push(`g:${form.state}:${classifications}`);
+ }
+ }
+ return descriptors.sort(codepointOrder).join('|');
+}
+
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 rows = architectureDeltaChangeRows(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 rowHtml = rows.length ? rows.map((row, index) => {
+ const label = row.headLabel || row.baseLabel || row.head?.label || row.base?.label || row.label || row.id;
+ const targetSignature = expectedReviewTargetSignature(row);
+ return `<li data-change-status="${esc(row.status)}"><button class="change-row" type="button" data-change-index="${index}" data-change-key="${esc(row.key)}" data-change-kind="${esc(row.kindKey)}" data-change-id="${esc(row.id)}" data-change-label="${esc(label)}" data-change-status="${esc(row.status)}" data-change-classifications="${esc(row.classifications.join(', '))}" data-change-target-signature="${esc(targetSignature)}"><span class="token">${esc(markerFor(row.status) || '~')}</span><span>${esc(row.kind)}</span><strong>${esc(label)}</strong><code>${esc(row.id)}</code><span>${esc(row.classifications.join(', '))}</span><span>${esc(row.changedFields.join(', ') || 'identity')}</span></button></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}
+:root{color-scheme:dark;--d-add:#34d399;--d-remove:#fb7185;--d-change:#fbbf24;--d-move:#7dd3fc;--d-focus:#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}
+.proof-tools{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:16px 0 10px}.view-switch{display:inline-flex;padding:3px;border:1px solid var(--d-line);border-radius:8px;background:#0a141e}.view-switch button,.utility,.review-step{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)}.view-switch button:focus-visible,.utility:focus-visible,.review-step:focus-visible,.change-row:focus-visible{outline:2px solid var(--d-focus);outline-offset:2px}.utility:disabled,.review-step:disabled{cursor:not-allowed;opacity:.45}.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}
+.review-strip{display:grid;grid-template-columns:auto auto auto auto minmax(0,1fr);align-items:center;gap:5px;margin:0 0 10px;padding:7px 8px;border-block:1px solid var(--d-line);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.review-step{min-height:34px;border:1px solid var(--d-line);padding-inline:11px}.review-step[aria-pressed="true"]{border-color:var(--d-focus);color:var(--d-ink)}.review-status{min-width:0;padding-left:9px;color:var(--d-muted);font-size:10px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.review-status strong{color:var(--d-ink);font-weight:750}.review-status[data-state="unavailable"]{color:var(--d-remove)}
+.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}.canvas[data-delta-review-active]{--review-same-opacity:.14;--review-change-opacity:.28}.canvas[data-delta-review-active] [data-delta-state="same"]{opacity:var(--review-same-opacity)!important}.canvas[data-delta-review-active] [data-delta-state]:not([data-delta-state="same"]):not([data-delta-review-current]){opacity:var(--review-change-opacity)!important}.canvas[data-delta-review-active] [data-delta-review-current]{opacity:1!important;transition:opacity .16s ease-out}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}}
+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 8px 8px}.changes li{border-top:1px solid rgba(138,160,181,.16)}.change-row{display:grid;grid-template-columns:30px 90px minmax(140px,1fr) minmax(100px,.7fr) minmax(120px,.8fr) minmax(140px,1.2fr);gap:10px;width:100%;margin:0;padding:9px 7px;border:0;border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:11px;text-align:left;align-items:baseline;cursor:pointer}.change-row:hover{background:rgba(125,211,252,.06)}.change-row[aria-current="step"]{background:rgba(125,211,252,.1);box-shadow:inset 0 0 0 1px var(--d-focus)}.change-row:disabled{cursor:default}.token{font:800 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.changes code,.change-row>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;--d-focus:#006b8f}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}.canvas[data-delta-review-active] [data-delta-review-current]{transition:none!important}}@media print{body{min-width:0;background:#fff;color:#111}.proof-page{width:100%;padding:0}.proof-tools,.review-strip,details{display:none!important}.canvas{display:none!important}.canvas[data-view="delta"]{display:block!important;border:0}.canvas[data-delta-review-active]{--review-same-opacity:1;--review-change-opacity:1}.canvas[data-delta-review-active] [data-delta-review-current]{opacity:1!important;transition:none!important}.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>
+<nav class="review-strip" aria-label="Authored change review"><button class="review-step" id="review-overview" type="button" disabled>Overview</button><button class="review-step" id="review-previous" type="button" aria-label="Previous authored change" disabled>←</button><button class="review-step" id="review-play" type="button" aria-pressed="false"${rows.length ? '' : ' disabled'}>Review</button><button class="review-step" id="review-next" type="button" aria-label="Next authored change" disabled>→</button><div class="review-status" id="review-status" role="status" aria-live="polite">Overview · ${rows.length} authored changes</div></nav>
<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>`;
+<script>(()=>{
+ const REVIEW_DWELL_MS = 1400;
+ const tabs = [...document.querySelectorAll('[role="tab"]')];
+ const views = [...document.querySelectorAll('[data-view]')];
+ const deltaCanvas = document.querySelector('[data-view="delta"]');
+ const rowButtons = [...document.querySelectorAll('.change-row')];
+ const overviewButton = document.querySelector('#review-overview');
+ const previousButton = document.querySelector('#review-previous');
+ const playButton = document.querySelector('#review-play');
+ const nextButton = document.querySelector('#review-next');
+ const status = document.querySelector('#review-status');
+ const receiptNode = document.querySelector('#archify-compare-receipt');
+ const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
+ let activeIndex = -1;
+ let playbackToken = 0;
+ let playbackTimer = 0;
+ let playing = false;
+ let reviewAvailable = false;
+ let reviewSources = [];
+
+ function show(id) {
+ tabs.forEach((tab) => tab.setAttribute('aria-selected', String(tab.dataset.target === id)));
+ views.forEach((view) => { view.hidden = view.dataset.view !== id; });
+ }
+
+ function stopPlayback() {
+ playbackToken += 1;
+ if (playbackTimer) window.clearTimeout(playbackTimer);
+ playbackTimer = 0;
+ playing = false;
+ playButton.setAttribute('aria-pressed', 'false');
+ playButton.textContent = activeIndex === rowButtons.length - 1 && rowButtons.length ? 'Replay' : 'Review';
+ status.setAttribute('aria-live', 'polite');
+ }
+
+ function failReview() {
+ stopPlayback();
+ reviewAvailable = false;
+ activeIndex = -1;
+ deltaCanvas?.removeAttribute('data-delta-review-active');
+ deltaCanvas?.querySelectorAll('[data-delta-review-current]').forEach((element) => element.removeAttribute('data-delta-review-current'));
+ rowButtons.forEach((row) => {
+ row.disabled = true;
+ row.tabIndex = -1;
+ row.removeAttribute('aria-current');
+ });
+ [overviewButton, previousButton, playButton, nextButton].forEach((button) => { button.disabled = true; });
+ status.dataset.state = 'unavailable';
+ status.textContent = 'Review unavailable · compare identity mismatch';
+ }
+
+ function receiptRows(receipt) {
+ const definitions = [
+ { collection: 'components', kind: 'component', id: 'id', statuses: ['added', 'changed', 'evidence-changed', 'removed', 'moved'] },
+ { collection: 'connections', kind: 'relationship', id: 'id', statuses: ['added', 'changed', 'removed', 'rerouted'] },
+ { collection: 'boundaries', kind: 'boundary', id: 'key', statuses: ['added', 'changed', 'removed', 'geometry-changed'] },
+ ];
+ const rows = [];
+ for (const definition of definitions) {
+ const changes = receipt.changes[definition.collection];
+ if (!Array.isArray(changes)) return null;
+ for (const change of changes) {
+ if (!change || typeof change !== 'object' || Array.isArray(change)) return null;
+ const id = change[definition.id];
+ if (typeof id !== 'string' || !id || !definition.statuses.includes(change.status)) return null;
+ if (!Array.isArray(change.classifications) || !change.classifications.length || change.classifications.some((value) => typeof value !== 'string')) return null;
+ if (new Set(change.classifications).size !== change.classifications.length) return null;
+ if (!Array.isArray(change.changedFields) || change.changedFields.some((value) => typeof value !== 'string')) return null;
+ rows.push({ ...change, kind: definition.kind, key: definition.kind + ':' + id, id });
+ }
+ }
+ return rows;
+ }
+
+ function exactTargets(row) {
+ const attribute = row.dataset.changeKind === 'component'
+ ? 'data-node-id'
+ : row.dataset.changeKind === 'relationship'
+ ? 'data-edge-id'
+ : 'data-delta-boundary-key';
+ return [...deltaCanvas.querySelectorAll('[' + attribute + ']')]
+ .filter((element) => element.getAttribute(attribute) === row.dataset.changeId);
+ }
+
+ function targetSignature(matches) {
+ return matches.map((element) => {
+ const tag = element.tagName.toLowerCase();
+ const state = element.dataset.deltaState || '';
+ const classifications = element.dataset.deltaClassifications || '';
+ return tag + ':' + state + ':' + classifications;
+ }).sort().join('|');
+ }
+
+ function targetsMatch(source, row, matches) {
+ if (!source || !matches.length || !row.dataset.changeTargetSignature) return false;
+ if (row.dataset.changeKind !== source.kind || row.dataset.changeId !== source.id || row.dataset.changeStatus !== source.status) return false;
+ if (row.dataset.changeClassifications !== source.classifications.join(', ')) return false;
+ return row.dataset.changeTargetSignature === targetSignature(matches);
+ }
+
+ function validateReview() {
+ try {
+ if (document.querySelectorAll('#archify-compare-receipt').length !== 1 || !receiptNode) return false;
+ if (!deltaCanvas || !['base', 'delta', 'head'].every((id) => document.querySelectorAll('[data-view="' + id + '"]').length === 1)) return false;
+ if (deltaCanvas.children.length !== 1 || deltaCanvas.firstElementChild?.tagName.toLowerCase() !== 'svg') return false;
+ const receipt = JSON.parse(receiptNode.textContent);
+ if (!receipt || receipt.schemaVersion !== 1 || receipt.command !== 'compare' || receipt.completeness !== 'complete' || !receipt.changes) return false;
+ const sources = receiptRows(receipt);
+ if (!sources || sources.length !== rowButtons.length) return false;
+ const sourceByKey = new Map(sources.map((source) => [source.key, source]));
+ if (sourceByKey.size !== sources.length) return false;
+ const seen = new Set();
+ const orderedSources = [];
+ for (let index = 0; index < rowButtons.length; index += 1) {
+ const row = rowButtons[index];
+ const source = sourceByKey.get(row.dataset.changeKey);
+ if (!source || seen.has(source.key) || row.dataset.changeIndex !== String(index)) return false;
+ const matches = exactTargets(row);
+ if (!targetsMatch(source, row, matches)) return false;
+ seen.add(source.key);
+ orderedSources.push(source);
+ }
+ if (seen.size !== sourceByKey.size) return false;
+ reviewSources = orderedSources;
+ return true;
+ } catch {
+ return false;
+ }
+ }
+
+ function updateControls() {
+ overviewButton.disabled = !reviewAvailable || activeIndex < 0;
+ previousButton.disabled = !reviewAvailable || activeIndex <= 0;
+ nextButton.disabled = !reviewAvailable || activeIndex < 0 || activeIndex >= rowButtons.length - 1;
+ }
+
+ function selectChange(index, fromPlayback = false) {
+ if (!reviewAvailable || index < 0 || index >= rowButtons.length) return false;
+ const row = rowButtons[index];
+ const matches = exactTargets(row);
+ if (!targetsMatch(reviewSources[index], row, matches)) { failReview(); return false; }
+ show('delta');
+ deltaCanvas.querySelectorAll('[data-delta-review-current]').forEach((element) => element.removeAttribute('data-delta-review-current'));
+ matches.forEach((element) => element.setAttribute('data-delta-review-current', 'true'));
+ deltaCanvas.setAttribute('data-delta-review-active', 'true');
+ rowButtons.forEach((button, rowIndex) => {
+ button.tabIndex = rowIndex === index ? 0 : -1;
+ if (rowIndex === index) button.setAttribute('aria-current', 'step');
+ else button.removeAttribute('aria-current');
+ });
+ activeIndex = index;
+ updateControls();
+ const kind = row.dataset.changeKind.charAt(0).toUpperCase() + row.dataset.changeKind.slice(1);
+ status.textContent = String(index + 1).padStart(2, '0') + ' / ' + String(rowButtons.length).padStart(2, '0') + ' · ' + kind + ' · ' + row.dataset.changeLabel + ' [' + row.dataset.changeId + '] · ' + row.dataset.changeClassifications;
+ if (fromPlayback) status.setAttribute('aria-live', 'off');
+ return true;
+ }
+
+ function overview() {
+ if (!reviewAvailable) { failReview(); return; }
+ stopPlayback();
+ activeIndex = -1;
+ deltaCanvas.removeAttribute('data-delta-review-active');
+ deltaCanvas.querySelectorAll('[data-delta-review-current]').forEach((element) => element.removeAttribute('data-delta-review-current'));
+ rowButtons.forEach((row, index) => {
+ row.tabIndex = index === 0 ? 0 : -1;
+ row.removeAttribute('aria-current');
+ });
+ show('delta');
+ status.removeAttribute('data-state');
+ status.textContent = 'Overview · ' + rowButtons.length + ' authored changes';
+ updateControls();
+ }
+
+ function schedulePlayback(token) {
+ if (!playing || token !== playbackToken || activeIndex >= rowButtons.length - 1) {
+ if (activeIndex >= rowButtons.length - 1) stopPlayback();
+ return;
+ }
+ playbackTimer = window.setTimeout(() => {
+ if (!playing || token !== playbackToken) return;
+ if (!selectChange(activeIndex + 1, true)) return;
+ schedulePlayback(token);
+ }, REVIEW_DWELL_MS);
+ }
+
+ function startReview() {
+ if (!reviewAvailable) return;
+ if (playing) { stopPlayback(); return; }
+ stopPlayback();
+ if (!selectChange(0, false)) return;
+ if (reducedMotion.matches || rowButtons.length < 2) return;
+ playing = true;
+ const token = ++playbackToken;
+ playButton.textContent = 'Pause';
+ playButton.setAttribute('aria-pressed', 'true');
+ status.setAttribute('aria-live', 'off');
+ schedulePlayback(token);
+ }
+
+ tabs.forEach((tab, index) => {
+ tab.addEventListener('click', () => { stopPlayback(); show(tab.dataset.target); });
+ tab.addEventListener('keydown', (event) => {
+ if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return;
+ event.preventDefault();
+ stopPlayback();
+ const 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);
+ });
+ });
+
+ rowButtons.forEach((row, index) => {
+ row.tabIndex = index === 0 ? 0 : -1;
+ row.addEventListener('click', () => { stopPlayback(); selectChange(index); });
+ row.addEventListener('keydown', (event) => {
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault();
+ stopPlayback();
+ selectChange(index);
+ return;
+ }
+ if (!['ArrowUp', 'ArrowDown', 'Home', 'End'].includes(event.key)) return;
+ event.preventDefault();
+ stopPlayback();
+ const next = event.key === 'Home' ? 0 : event.key === 'End' ? rowButtons.length - 1 : (index + (event.key === 'ArrowDown' ? 1 : -1) + rowButtons.length) % rowButtons.length;
+ rowButtons.forEach((button, rowIndex) => { button.tabIndex = rowIndex === next ? 0 : -1; });
+ rowButtons[next].focus();
+ });
+ });
+
+ overviewButton.addEventListener('click', overview);
+ previousButton.addEventListener('click', () => { stopPlayback(); selectChange(activeIndex - 1); });
+ nextButton.addEventListener('click', () => { stopPlayback(); selectChange(activeIndex + 1); });
+ playButton.addEventListener('click', startReview);
+ document.addEventListener('focusin', (event) => {
+ if (playing && event.target.closest('button')) stopPlayback();
+ });
+ document.addEventListener('visibilitychange', () => { if (document.hidden) stopPlayback(); });
+ window.addEventListener('beforeprint', overview);
+ reducedMotion.addEventListener('change', () => { if (reducedMotion.matches) stopPlayback(); });
+ document.addEventListener('keydown', (event) => {
+ if (event.key === 'Escape' && activeIndex >= 0) {
+ event.preventDefault();
+ overview();
+ playButton.focus();
+ }
+ });
+
+ 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]; });
+
+ reviewAvailable = validateReview();
+ if (!reviewAvailable) failReview();
+ else {
+ status.removeAttribute('data-state');
+ updateControls();
+ }
+})();</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');
+ const rows = architectureDeltaChangeRows(receipt);
+ const deltaMarkup = html.match(/<section class="canvas" data-view="delta">([\s\S]*?)<\/section>/)?.[1] || '';
+ const svgTags = [...deltaMarkup.matchAll(/<\/?svg\b[^>]*>/g)];
+ let svgDepth = 0;
+ let svgRoots = 0;
+ let rootStart = -1;
+ let rootEnd = -1;
+ let svgBalanced = true;
+ for (const match of svgTags) {
+ if (match[0].startsWith('</')) {
+ svgDepth -= 1;
+ if (svgDepth < 0) svgBalanced = false;
+ if (svgDepth === 0) rootEnd = match.index + match[0].length;
+ } else {
+ if (svgDepth === 0) {
+ svgRoots += 1;
+ if (rootStart < 0) rootStart = match.index;
+ }
+ svgDepth += 1;
+ }
+ }
+ if (!['base', 'delta', 'head'].every((id) => (html.match(new RegExp(`<section class="canvas" data-view="${id}"`, 'g')) || []).length === 1)) failures.push('expected one Before, Delta, and After canvas');
+ if (!svgBalanced || svgDepth !== 0 || svgRoots !== 1 || deltaMarkup.slice(0, rootStart).trim() || deltaMarkup.slice(rootEnd).trim()) failures.push('expected exactly one root SVG in the Delta canvas');
+ if ((html.match(/id="archify-compare-receipt"/g) || []).length !== 1) failures.push('expected exactly one embedded compare receipt');
+ if (!html.includes('aria-label="Authored change review"')) failures.push('missing exact-ID change navigator');
+ if ((html.match(/class="change-row"/g) || []).length !== rows.length) failures.push('change navigator row count does not match the receipt');
+ for (const [index, row] of rows.entries()) {
+ const safeKey = esc(row.key).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ const rowMatches = [...html.matchAll(new RegExp(`<button class="change-row"[^>]*data-change-key="${safeKey}"[^>]*>`, 'g'))].map((match) => match[0]);
+ if (rowMatches.length !== 1) failures.push(`expected exactly one change row ${row.key}`);
+ const targets = reviewTargetTags(deltaMarkup, row);
+ if (!targets.length) failures.push(`missing Delta identity ${row.key}`);
+ if (targets.some(({ tag }) => !/\bdata-delta-state="[^"]+"/.test(tag))) failures.push(`missing Delta target state ${row.key}`);
+ const signature = reviewTargetSignature(targets);
+ const expectedSignature = expectedReviewTargetSignature(row);
+ const storedSignature = rowMatches[0]?.match(/\bdata-change-target-signature="([^"]*)"/)?.[1];
+ if (!signature || signature !== expectedSignature || storedSignature !== expectedSignature) failures.push(`ambiguous Delta target signature ${row.key}`);
+ if (rowMatches[0]?.match(/\bdata-change-index="([^"]+)"/)?.[1] !== String(index)) failures.push(`incorrect change row order ${row.key}`);
+ const primary = primaryReviewTags(deltaMarkup, row);
+ const states = primary.map((tag) => tag.match(/\bdata-delta-state="([^"]+)"/)?.[1]).filter(Boolean).sort();
+ if (JSON.stringify(states) !== JSON.stringify(reviewPrimaryStates(row).sort())) failures.push(`ambiguous Delta identity ${row.key}`);
+ const classifications = row.classifications.join(',');
+ if (primary.some((tag) => tag.match(/\bdata-delta-classifications="([^"]*)"/)?.[1] !== classifications)) failures.push(`conflicting Delta classification ${row.key}`);
+ }
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 };
+ return { ok: true, checksPassed: 8, checkCount: 8 };
}
diff --git a/archify/test/architecture-delta.test.mjs b/archify/test/architecture-delta.test.mjs
index ba1b8e9a..f7fb8be6 100644
--- a/archify/test/architecture-delta.test.mjs
+++ b/archify/test/architecture-delta.test.mjs
@@ -7,8 +7,10 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import {
ArchitectureDeltaError,
+ architectureDeltaChangeRows,
canonicalArchitectureJson,
compareArchitecture,
+ validateArchitectureDeltaHtml,
} from '../delta/architecture-delta.mjs';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -74,6 +76,26 @@ test('canonical architecture ignores formatting, entity order, and set-like orde
assert.equal(canonicalArchitectureJson(reordered), canonicalArchitectureJson(original));
});
+test('change navigator order is exact-ID based, complete, unique, and stable', () => {
+ const receipt = compareArchitecture(read(baseFixture), read(headFixture));
+ const rows = architectureDeltaChangeRows(receipt);
+ assert.deepEqual(rows.map((row) => row.key), [
+ 'component:fraud',
+ 'relationship:fraud-check',
+ 'boundary:region:Production region',
+ 'boundary:security-group:Checkout trust zone',
+ 'component:checkout',
+ 'relationship:authorize-payment',
+ 'relationship:persist-order',
+ 'component:queue',
+ 'component:cache',
+ 'relationship:session-read',
+ 'relationship:publish-order',
+ ]);
+ assert.equal(new Set(rows.map((row) => row.key)).size, rows.length);
+ assert.equal(rows.length, receipt.changes.components.length + receipt.changes.connections.length + receipt.changes.boundaries.length);
+});
+
test('exact identity fails closed instead of guessing relationships or unrelated systems', () => {
const base = read(baseFixture);
const missingRelationship = read(headFixture);
@@ -95,6 +117,55 @@ test('exact identity fails closed instead of guessing relationships or unrelated
);
});
+test('evidence-only component changes keep an enabled exact review contract', () => {
+ const base = read(baseFixture);
+ const head = read(baseFixture);
+ base.components[0].sources = [{ path: 'src/entry.js', line: 1, label: 'baseline' }];
+ head.components[0].sources = [{ path: 'src/entry.js', line: 2, label: 'head' }];
+ const receipt = compareArchitecture(base, head);
+ assert.equal(receipt.changes.components.length, 1);
+ assert.equal(receipt.changes.components[0].status, 'evidence-changed');
+ assert.deepEqual(receipt.changes.components[0].classifications, ['evidence']);
+ const runtime = fs.readFileSync(path.join(skillRoot, 'delta/architecture-delta.mjs'), 'utf8');
+ assert.match(runtime, /statuses: \['added', 'changed', 'evidence-changed', 'removed', 'moved'\]/);
+});
+
+test('mixed semantic and geometry component changes retain both exact forms', () => {
+ const head = read(headFixture);
+ head.components.find((component) => component.id === 'queue').sublabel = 'durable queue v2';
+ const headPath = path.join(tmp, 'mixed-component-head.json');
+ const output = path.join(tmp, 'mixed-component-delta.html');
+ fs.writeFileSync(headPath, JSON.stringify(head));
+
+ const result = run(['compare', 'architecture', baseFixture, headPath, output, '--json']);
+ assert.equal(result.status, 0, result.stderr);
+ const receipt = JSON.parse(result.stdout);
+ const queue = receipt.changes.components.find((change) => change.id === 'queue');
+ assert.equal(queue.status, 'changed');
+ assert.deepEqual(queue.classifications, ['geometry', 'semantic']);
+ const html = fs.readFileSync(output, 'utf8');
+ assert.match(html, /data-change-key="component:queue"[^>]+data-change-target-signature="g:changed:geometry,semantic\|g:moved-from:geometry,semantic"/);
+ assert.deepEqual(validateArchitectureDeltaHtml(html, receipt), { ok: true, checksPassed: 8, checkCount: 8 });
+});
+
+test('mixed semantic and geometry relationship changes retain both exact routes', () => {
+ const head = read(headFixture);
+ head.connections.find((connection) => connection.id === 'publish-order').label = 'accepted event';
+ const headPath = path.join(tmp, 'mixed-relationship-head.json');
+ const output = path.join(tmp, 'mixed-relationship-delta.html');
+ fs.writeFileSync(headPath, JSON.stringify(head));
+
+ const result = run(['compare', 'architecture', baseFixture, headPath, output, '--json']);
+ assert.equal(result.status, 0, result.stderr);
+ const receipt = JSON.parse(result.stdout);
+ const publishOrder = receipt.changes.connections.find((change) => change.id === 'publish-order');
+ assert.equal(publishOrder.status, 'changed');
+ assert.deepEqual(publishOrder.classifications, ['geometry', 'semantic']);
+ const html = fs.readFileSync(output, 'utf8');
+ assert.match(html, /data-change-key="relationship:publish-order"[^>]+data-change-target-signature="g:changed:geometry,semantic\|g:moved-from:geometry,semantic\|path:changed:geometry,semantic\|path:moved-from:geometry,semantic\|text:changed:\|text:moved-from:"/);
+ assert.deepEqual(validateArchitectureDeltaHtml(html, receipt), { ok: true, checksPassed: 8, checkCount: 8 });
+});
+
test('same-label node id changes remain one removal plus one addition', () => {
const base = read(baseFixture);
const head = read(baseFixture);
@@ -143,6 +214,26 @@ test('compare CLI writes a deterministic three-state artifact and complete sidec
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.match(firstHtml, /aria-label="Authored change review"/);
+ assert.equal((firstHtml.match(/class="change-row"/g) || []).length, 11);
+ assert.match(firstHtml, /data-change-key="component:fraud"/);
+ assert.match(firstHtml, /data-change-key="relationship:authorize-payment"/);
+ assert.match(firstHtml, /data-change-key="boundary:region:Production region"/);
+ assert.match(firstHtml, /data-change-target-signature="[^"]+"/);
+ assert.match(firstHtml, /data-delta-boundary-key="region:Production region"/);
+ assert.match(firstHtml, /const REVIEW_DWELL_MS = 1400;/);
+ assert.match(firstHtml, /prefers-reduced-motion: reduce/);
+ assert.match(firstHtml, /:not\(\[data-delta-review-current\]\)/);
+ assert.match(firstHtml, /--review-same-opacity:1;--review-change-opacity:1/);
+ assert.match(firstHtml, /--d-focus:#006b8f/);
+ assert.match(firstHtml, /document\.querySelectorAll\('#archify-compare-receipt'\)\.length !== 1/);
+ assert.match(firstHtml, /targetsMatch\(reviewSources\[index\], row, matches\)/);
+ assert.match(firstHtml, /document\.addEventListener\('visibilitychange'/);
+ assert.match(firstHtml, /window\.addEventListener\('beforeprint', overview\)/);
+ assert.match(firstHtml, /aria-current', 'step'/);
+ assert.match(firstHtml, /event\.key === 'Enter' \|\| event\.key === ' '/);
+ assert.doesNotMatch(firstHtml, /localStorage|sessionStorage|history\.(?:pushState|replaceState)/);
+ assert.doesNotMatch(firstHtml, /setInterval\(/);
assert.doesNotMatch(firstHtml, /\b(?:SAFE|LOW RISK|MERGEABLE|NO IMPACT|VERIFIED PR)\b/i);
const receipt = JSON.parse(result.stdout);
@@ -152,6 +243,92 @@ test('compare CLI writes a deterministic three-state artifact and complete sidec
assert.equal(receipt.validation.checksPassed, receipt.validation.checkCount);
assert.equal(receipt.completeness, 'complete');
assert.equal(JSON.stringify(receipt).includes(tmp), false);
+ assert.deepEqual(validateArchitectureDeltaHtml(firstHtml, receipt), { ok: true, checksPassed: 8, checkCount: 8 });
+});
+
+test('artifact validation fails closed on missing, duplicate, or self-blessed review identity', () => {
+ const output = path.join(tmp, 'review-identity.html');
+ const result = run(['compare', 'architecture', baseFixture, headFixture, output, '--json']);
+ assert.equal(result.status, 0, result.stderr);
+ const receipt = JSON.parse(result.stdout);
+ const html = fs.readFileSync(output, 'utf8');
+ const deltaSection = html.match(/<section class="canvas" data-view="delta">([\s\S]*?)<\/section>/)?.[1];
+ assert.ok(deltaSection);
+ const fraudTag = deltaSection.match(/<g\s+[^>]*\bdata-node-id="fraud"[^>]*>/)?.[0];
+ assert.ok(fraudTag);
+
+ const missing = html.replace(fraudTag, fraudTag.replace('data-node-id="fraud"', 'data-node-id="tampered"'));
+ assert.throws(
+ () => validateArchitectureDeltaHtml(missing, receipt),
+ (error) => error instanceof ArchitectureDeltaError
+ && error.code === 'delta/artifact-invalid'
+ && error.details.failures.includes('ambiguous Delta identity component:fraud'),
+ );
+
+ const duplicate = html.replace(fraudTag, `${fraudTag}${fraudTag}`);
+ assert.throws(
+ () => validateArchitectureDeltaHtml(duplicate, receipt),
+ (error) => error instanceof ArchitectureDeltaError
+ && error.code === 'delta/artifact-invalid'
+ && error.details.failures.includes('ambiguous Delta identity component:fraud'),
+ );
+
+ const relationshipGroup = deltaSection.match(/<g\s+[^>]*\bdata-edge-id="fraud-check"[^>]*>[\s\S]*?<\/g>/)?.[0];
+ assert.ok(relationshipGroup);
+ const duplicateCompanion = html.replace(relationshipGroup, `${relationshipGroup}${relationshipGroup}`);
+ assert.throws(
+ () => validateArchitectureDeltaHtml(duplicateCompanion, receipt),
+ (error) => error instanceof ArchitectureDeltaError
+ && error.code === 'delta/artifact-invalid'
+ && error.details.failures.includes('ambiguous Delta target signature relationship:fraud-check'),
+ );
+
+ const duplicateRowTag = duplicateCompanion.match(/<button class="change-row"[^>]*data-change-key="relationship:fraud-check"[^>]*>/)?.[0];
+ const storedSignature = duplicateRowTag?.match(/data-change-target-signature="([^"]+)"/)?.[1];
+ assert.ok(duplicateRowTag && storedSignature);
+ const selfBlessedSignature = [...storedSignature.split('|'), 'g:added:topology'].sort().join('|');
+ const selfBlessed = duplicateCompanion.replace(
+ duplicateRowTag,
+ duplicateRowTag.replace(`data-change-target-signature="${storedSignature}"`, `data-change-target-signature="${selfBlessedSignature}"`),
+ );
+ assert.throws(
+ () => validateArchitectureDeltaHtml(selfBlessed, receipt),
+ (error) => error instanceof ArchitectureDeltaError
+ && error.code === 'delta/artifact-invalid'
+ && error.details.failures.includes('ambiguous Delta target signature relationship:fraud-check'),
+ );
+
+ const missingCompanionState = html.replace(
+ relationshipGroup,
+ relationshipGroup.replace(/\sdata-delta-state="[^"]+"/, ''),
+ );
+ assert.throws(
+ () => validateArchitectureDeltaHtml(missingCompanionState, receipt),
+ (error) => error instanceof ArchitectureDeltaError
+ && error.code === 'delta/artifact-invalid'
+ && error.details.failures.includes('missing Delta target state relationship:fraud-check'),
+ );
+
+ const receiptNode = html.match(/<script id="archify-compare-receipt"[\s\S]*?<\/script>/)?.[0];
+ assert.ok(receiptNode);
+ const duplicateReceipt = html.replace(receiptNode, `${receiptNode}${receiptNode}`);
+ assert.throws(
+ () => validateArchitectureDeltaHtml(duplicateReceipt, receipt),
+ (error) => error instanceof ArchitectureDeltaError
+ && error.code === 'delta/artifact-invalid'
+ && error.details.failures.includes('expected exactly one embedded compare receipt'),
+ );
+
+ const extraDeltaSvg = html.replace(
+ '<section class="canvas" data-view="delta">',
+ '<section class="canvas" data-view="delta"><svg viewBox="0 0 1 1"></svg>',
+ );
+ assert.throws(
+ () => validateArchitectureDeltaHtml(extraDeltaSvg, receipt),
+ (error) => error instanceof ArchitectureDeltaError
+ && error.code === 'delta/artifact-invalid'
+ && error.details.failures.includes('expected exactly one root SVG in the Delta canvas'),
+ );
});
test('formatting-only input changes raw proof but not semantic hash or artifact bytes', () => {
diff --git a/archify/test/webm-artifact.smoke.mjs b/archify/test/webm-artifact.smoke.mjs
index 86a1c1e5..99a1a630 100644
--- a/archify/test/webm-artifact.smoke.mjs
+++ b/archify/test/webm-artifact.smoke.mjs
@@ -295,6 +295,209 @@ try {
assert.equal(ready, true, `${label} did not expose its browser export surface`);
}
+ async function verifyArchitectureDeltaNavigator(file) {
+ const readyCondition = '!!document.querySelector("#review-play") && !document.querySelector("#review-play").disabled';
+ async function waitForSelected(changeKey, label) {
+ for (let attempt = 0; attempt < 80; attempt += 1) {
+ if (await evaluate(cdp, sessionId, `document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey === ${JSON.stringify(changeKey)}`)) return;
+ await delay(50);
+ }
+ assert.fail(`${label} did not select ${changeKey} within the bounded wait`);
+ }
+ async function waitForReviewFinished(label) {
+ for (let attempt = 0; attempt < 400; attempt += 1) {
+ const done = await evaluate(cdp, sessionId, `document.querySelector('#review-play').getAttribute('aria-pressed') === 'false' && document.querySelector('#review-play').textContent === 'Replay'`);
+ if (done) return;
+ await delay(50);
+ }
+ assert.fail(`${label} did not finish within the bounded wait`);
+ }
+ await navigateReady(file, readyCondition, 'architecture-delta navigator');
+ const initial = await evaluate(cdp, sessionId, `({
+ status: document.querySelector('#review-status').textContent,
+ selected: document.querySelectorAll('.change-row[aria-current="step"]').length,
+ current: document.querySelectorAll('[data-delta-review-current]').length,
+ rows: document.querySelectorAll('.change-row').length
+ })`);
+ assert.deepEqual(initial, { status: 'Overview · 11 authored changes', selected: 0, current: 0, rows: 11 });
+
+ await evaluate(cdp, sessionId, `document.querySelector('#review-play').click()`);
+ await waitForSelected('relationship:fraud-check', 'architecture-delta initial playback');
+ const advanced = await evaluate(cdp, sessionId, `({
+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed')
+ })`);
+ assert.deepEqual(advanced, { selected: 'relationship:fraud-check', pressed: 'true' });
+
+ await evaluate(cdp, sessionId, `document.querySelector('[role="tab"][data-target="base"]').click()`);
+ const pausedKey = await evaluate(cdp, sessionId, `document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey`);
+ await delay(1550);
+ assert.equal(await evaluate(cdp, sessionId, `document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey`), pausedKey);
+ assert.equal(await evaluate(cdp, sessionId, `document.querySelector('#review-play').getAttribute('aria-pressed')`), 'false');
+
+ const overview = await evaluate(cdp, sessionId, `(() => {
+ document.querySelector('[role="tab"][data-target="delta"]').click();
+ document.querySelector('#review-overview').click();
+ return {
+ active: document.querySelector('[data-view="delta"]').hasAttribute('data-delta-review-active'),
+ current: document.querySelectorAll('[data-delta-review-current]').length,
+ selected: document.querySelectorAll('.change-row[aria-current="step"]').length
+ };
+ })()`);
+ assert.deepEqual(overview, { active: false, current: 0, selected: 0 });
+
+ await navigateReady(file, readyCondition, 'architecture-delta manual lifecycle navigator');
+ await evaluate(cdp, sessionId, `document.querySelector('#review-play').click()`);
+ await waitForSelected('relationship:fraud-check', 'architecture-delta previous control');
+ const previousPause = await evaluate(cdp, sessionId, `(() => {
+ document.querySelector('#review-previous').click();
+ return {
+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed')
+ };
+ })()`);
+ assert.deepEqual(previousPause, { selected: 'component:fraud', pressed: 'false' });
+ await delay(1450);
+ assert.equal(await evaluate(cdp, sessionId, `document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey`), 'component:fraud');
+
+ await evaluate(cdp, sessionId, `document.querySelector('#review-play').click()`);
+ const nextPause = await evaluate(cdp, sessionId, `(() => {
+ document.querySelector('#review-next').click();
+ return {
+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed')
+ };
+ })()`);
+ assert.deepEqual(nextPause, { selected: 'relationship:fraud-check', pressed: 'false' });
+
+ await evaluate(cdp, sessionId, `document.querySelector('#review-play').click()`);
+ const rowPause = await evaluate(cdp, sessionId, `(() => {
+ document.querySelector('.change-row[data-change-key="component:queue"]').click();
+ return {
+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed')
+ };
+ })()`);
+ assert.deepEqual(rowPause, { selected: 'component:queue', pressed: 'false' });
+
+ await navigateReady(file, readyCondition, 'architecture-delta focus lifecycle navigator');
+ const focusedPause = await evaluate(cdp, sessionId, `(() => {
+ document.querySelector('#review-play').click();
+ document.querySelector('#review-next').focus();
+ return {
+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed')
+ };
+ })()`);
+ assert.deepEqual(focusedPause, { selected: 'component:fraud', pressed: 'false' });
+ await delay(1450);
+ assert.equal(await evaluate(cdp, sessionId, `document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey`), 'component:fraud');
+
+ await navigateReady(file, readyCondition, 'architecture-delta hidden lifecycle navigator');
+ const hiddenPause = await evaluate(cdp, sessionId, `(() => {
+ document.querySelector('#review-play').click();
+ Object.defineProperty(document, 'hidden', { configurable: true, get: function () { return true; } });
+ document.dispatchEvent(new Event('visibilitychange'));
+ return {
+ hidden: document.hidden,
+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed')
+ };
+ })()`);
+ assert.deepEqual(hiddenPause, { hidden: true, selected: 'component:fraud', pressed: 'false' });
+ await delay(1450);
+ assert.equal(await evaluate(cdp, sessionId, `document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey`), 'component:fraud');
+
+ await navigateReady(file, readyCondition, 'architecture-delta print lifecycle navigator');
+ const printPause = await evaluate(cdp, sessionId, `(() => {
+ document.querySelector('#review-play').click();
+ window.dispatchEvent(new Event('beforeprint'));
+ return {
+ status: document.querySelector('#review-status').textContent,
+ selected: document.querySelectorAll('.change-row[aria-current="step"]').length,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed')
+ };
+ })()`);
+ assert.deepEqual(printPause, { status: 'Overview · 11 authored changes', selected: 0, pressed: 'false' });
+ await delay(1450);
+ assert.equal(await evaluate(cdp, sessionId, `document.querySelectorAll('.change-row[aria-current="step"]').length`), 0);
+
+ const keyboard = await evaluate(cdp, sessionId, `(() => {
+ document.querySelector('details').open = true;
+ var first = document.querySelector('.change-row');
+ first.click();
+ first.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true }));
+ var focused = document.activeElement.dataset.changeKey;
+ document.activeElement.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }));
+ return { focused: focused, selected: document.querySelector('.change-row[aria-current="step"]').dataset.changeKey };
+ })()`);
+ assert.deepEqual(keyboard, { focused: 'relationship:fraud-check', selected: 'relationship:fraud-check' });
+
+ await cdp.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-reduced-motion', value: 'reduce' }] }, sessionId);
+ await navigateReady(file, readyCondition, 'architecture-delta reduced-motion navigator');
+ await evaluate(cdp, sessionId, `document.querySelector('#review-play').click()`);
+ await delay(1550);
+ const reduced = await evaluate(cdp, sessionId, `({
+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed'),
+ nextDisabled: document.querySelector('#review-next').disabled
+ })`);
+ assert.deepEqual(reduced, { selected: 'component:fraud', pressed: 'false', nextDisabled: false });
+ await evaluate(cdp, sessionId, `document.querySelector('#review-next').click()`);
+
+ await evaluate(cdp, sessionId, `document.querySelector('.change-row').click()`);
+ await cdp.send('Emulation.setEmulatedMedia', { media: 'print' }, sessionId);
+ await delay(200);
+ const printState = await evaluate(cdp, sessionId, `({
+ strip: getComputedStyle(document.querySelector('.review-strip')).display,
+ base: getComputedStyle(document.querySelector('[data-view="base"]')).display,
+ delta: getComputedStyle(document.querySelector('[data-view="delta"]')).display,
+ head: getComputedStyle(document.querySelector('[data-view="head"]')).display,
+ current: getComputedStyle(document.querySelector('[data-delta-review-current]')).opacity,
+ same: getComputedStyle(document.querySelector('[data-view="delta"] [data-delta-state="same"]')).opacity
+ })`);
+ assert.deepEqual(printState, { strip: 'none', base: 'none', delta: 'block', head: 'none', current: '1', same: '1' });
+ await cdp.send('Emulation.setEmulatedMedia', { media: 'screen', features: [] }, sessionId);
+
+ await navigateReady(file, readyCondition, 'architecture-delta tamper navigator');
+ const tampered = await evaluate(cdp, sessionId, `(() => {
+ var companion = document.querySelector('[data-view="delta"] g[data-edge-id="fraud-check"]');
+ companion.parentNode.insertBefore(companion.cloneNode(true), companion.nextSibling);
+ document.querySelector('.change-row[data-change-key="relationship:fraud-check"]').click();
+ return {
+ status: document.querySelector('#review-status').textContent,
+ disabled: Array.from(document.querySelectorAll('.review-step,.change-row')).every(function (button) { return button.disabled; }),
+ canvases: document.querySelectorAll('[data-view]').length
+ };
+ })()`);
+ assert.deepEqual(tampered, { status: 'Review unavailable · compare identity mismatch', disabled: true, canvases: 3 });
+
+ await navigateReady(file, readyCondition, 'architecture-delta finite navigator');
+ await evaluate(cdp, sessionId, `document.querySelector('#review-play').click()`);
+ await waitForReviewFinished('architecture-delta finite playback');
+ const finished = await evaluate(cdp, sessionId, `({
+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey,
+ label: document.querySelector('#review-play').textContent,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed')
+ })`);
+ assert.deepEqual(finished, { selected: 'relationship:publish-order', label: 'Replay', pressed: 'false' });
+ await evaluate(cdp, sessionId, `document.querySelector('#review-play').click()`);
+ const replayStarted = await evaluate(cdp, sessionId, `({
+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey,
+ label: document.querySelector('#review-play').textContent,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed')
+ })`);
+ assert.deepEqual(replayStarted, { selected: 'component:fraud', label: 'Pause', pressed: 'true' });
+ await waitForReviewFinished('architecture-delta replay playback');
+ const replayFinished = await evaluate(cdp, sessionId, `({
+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey,
+ label: document.querySelector('#review-play').textContent,
+ pressed: document.querySelector('#review-play').getAttribute('aria-pressed')
+ })`);
+ assert.deepEqual(replayFinished, { selected: 'relationship:publish-order', label: 'Replay', pressed: 'false' });
+ console.log('ok Architecture Delta navigator: exact identity, lifecycle, reduced motion, print, and finite review');
+ }
+
async function captureShareCard(file, label) {
await navigateReady(file, '!!(window.Archify && Archify.exportMenu && Archify.exportMenu.shareCard)', label);
const sharePayload = await withTimeout(evaluate(cdp, sessionId, String.raw`(async function () {
@@ -1179,6 +1382,7 @@ try {
console.log(`ok ${label} Reach Card: ${reachPayload.size} bytes, ${reachPayload.snapshot.nodeIds.length} nodes, ${reachPayload.snapshot.edges.length} authored links`);
}
+ await verifyArchitectureDeltaNavigator(path.resolve(skillRoot, '../examples/checkout-platform-delta.html'));
await captureShareCard(output, 'architecture-wide');
await captureShareCard(sequenceOutput, 'sequence-tall');
await captureCopiedShareCard(output, 'architecture-wide');
diff --git a/docs/assets/architecture-delta-proof.jpg b/docs/assets/architecture-delta-proof.jpg
index 9ce35923..ad7bfbdb 100644
Binary files a/docs/assets/architecture-delta-proof.jpg and b/docs/assets/architecture-delta-proof.jpg differ
diff --git a/docs/research-next-stability-delight-2026-07-23.md b/docs/research-next-stability-delight-2026-07-23.md
new file mode 100644
index 00000000..8ca6ffc6
--- /dev/null
+++ b/docs/research-next-stability-delight-2026-07-23.md
@@ -0,0 +1,194 @@
+# Architecture Delta 之后的下一刀:Exact-ID Delta Review Navigator
+
+研究日期:2026-07-23
+Archify 基线:[`4aeb07b`](https://github.com/tt-a1i/archify/tree/4aeb07b379f09a8fc026df33e2402ad50ef9821e)
+
+## 唯一推荐
+
+下一项只做 **Exact-ID Delta Review Navigator(逐项架构变更审阅器)**:在现有 Architecture Delta HTML 内,把已经生成的确定性 change rows 变成可选择的审阅步骤,并加入 `Previous / Review / Next / Overview`。用户可以手动逐项看,也可以主动开始一次有限、不循环的审阅播放;每一步只突出 compare receipt 已经证明的那一个 component、connection 或 boundary,完整 Delta 仍留在原位作为上下文。
+
+它不是第二个 diff 算法,也不是影响分析。它只把当前已经可信、但仍偏“总览 + 表格”的 Delta 变成更容易讲解和复核的视觉审阅流程。
+
+## 为什么这是一个真实缺口
+
+当前 Archify 已经明确发布下列能力,因此它们全部排除,不再包装成“下一特性”:
+
+- Last-Good Live Preview 已经有独立、loopback-only、last-known-good 合同。([current Skill](https://github.com/tt-a1i/archify/blob/4aeb07b379f09a8fc026df33e2402ad50ef9821e/archify/SKILL.md#L84))
+- revision-pinned Repository Evidence、HTML-only source beacons 已经存在。([current Skill](https://github.com/tt-a1i/archify/blob/4aeb07b379f09a8fc026df33e2402ad50ef9821e/archify/SKILL.md#L285-L311))
+- Structured Repair Receipt 已覆盖 input、schema、repository evidence、composition、artifact 和 delivery failures。([current Skill](https://github.com/tt-a1i/archify/blob/4aeb07b379f09a8fc026df33e2402ad50ef9821e/archify/SKILL.md#L88))
+- Cursor onboarding、`deployment-ownership` profile 和 Architecture Delta 都已发布并带回归证据。([current changelog](https://github.com/tt-a1i/archify/blob/4aeb07b379f09a8fc026df33e2402ad50ef9821e/CHANGELOG.md#L8-L11))
+
+Architecture Delta 当前已经:
+
+1. 生成确定性 `Before / Delta / After` 三视图;
+2. 把 components、connections、boundaries 的变化排序成 exact change rows;
+3. 显示 counts、proof level、classifications 和 changed fields;
+4. 严禁 risk、mergeability 或 verified-PR 结论。
+
+但 current artifact 里的 change rows 只是静态 `<li>`;顶部只有视图、preset 和 theme 控制,没有 change-level selection、previous/next 或 review playback。([Delta renderer](https://github.com/tt-a1i/archify/blob/4aeb07b379f09a8fc026df33e2402ad50ef9821e/archify/delta/architecture-delta.mjs#L545-L580))
+
+因此缺口不是“再生成一种图”,而是:**当变化多于三四项时,审阅者怎样不离开完整上下文,逐项确认每条已经证明的变化。**
+
+## 一手资料结论
+
+### Fireworks Tech Graph:借语义顺序和固定场景,不借循环特效
+
+Fireworks 的 motion contract 要求 metadata 不完整时 fail closed,不把已审核 motion 套到任意同风格拓扑;其通用规则是按 semantic order 展开,同时固定 nodes、labels、containers、marker geometry 和 camera。([motion input contract](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/50c819d68fd4fee330b3010988cd13e98b678d44/references/motion-effects.md#L26-L36), [fixed-scene rules](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/50c819d68fd4fee330b3010988cd13e98b678d44/references/motion-effects.md#L38-L52)) 它还把 repeated roles 用 exact `(role, stage, order)` 独立寻址,并说明剥离 motion metadata 后应恢复原静态几何。([identity and static recovery](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/50c819d68fd4fee330b3010988cd13e98b678d44/references/motion-effects.md#L251-L273))
+
+**吸收:** Review Navigator 使用现有 receipt 的确定性顺序、精确实体身份和一次性有限播放;选中时不移动或重排图。
+**不吸收:** 无限 GIF、ambient flow、任意 motion preset、对缺失身份的猜测。
+
+### GitDiagram:交互必须落回已经校验的结构
+
+GitDiagram 的生成流程先得到 size-bounded graph AST,再验证 identifiers、connectivity 和真实 repository paths,之后才 deterministic compile;最终交互节点仍指向已经验证的 source path。([generation contract](https://github.com/ahmedkhaleel2004/gitdiagram/blob/041d2feb4a9b1593dcf3bde2ca5b9ae7659becb9/README.md#L49-L59)) 它也把“click component”和 PNG export 当作核心用户行为,而不是让交互重新解释图。([product surface](https://github.com/ahmedkhaleel2004/gitdiagram/blob/041d2feb4a9b1593dcf3bde2ca5b9ae7659becb9/README.md#L14-L21))
+
+**吸收:** change row activation 只能定位到现有 validated DOM identity。
+**不吸收:** hosted ingestion、LLM generation、storage、private-token flow。
+
+### drawio-skill:PR summary 值得保留为下一候选,但不是本轮
+
+drawio-skill 的 `prdiff.py` 会从 git refs 找出变化的 `.drawio`,输出 base/head/diff PNG 和 Markdown report;没有 draw.io CLI 时会明确降级为文件清单。([PR diff contract](https://github.com/Agents365-ai/drawio-skill/blob/6f33563adce24450003d1cb61111ebbcc5579f28/skills/drawio-skill/scripts/prdiff.py#L1-L18), [Markdown renderer](https://github.com/Agents365-ai/drawio-skill/blob/6f33563adce24450003d1cb61111ebbcc5579f28/skills/drawio-skill/scripts/prdiff.py#L114-L155)) 它的 underlying diagram diff 默认按 cell ID 对齐,但仍提供 `--by-label` 给随机 ID 的手绘图。([matching contract](https://github.com/Agents365-ai/drawio-skill/blob/6f33563adce24450003d1cb61111ebbcc5579f28/skills/drawio-skill/scripts/drawiodiff.py#L18-L31))
+
+**吸收:** PR-friendly summary 确实有价值,应保留为后续独立切片。
+**不吸收:** label matching;Archify Delta 必须继续 exact-ID、fail-closed。也不在本轮引入 git-ref parsing、Markdown asset hosting 或 CI comment publishing。
+
+### GitNexus:不要把 authored Delta 偷换成 code impact
+
+GitNexus 的 `impact`、`detect_changes` 和 process resources 建立在本地解析、knowledge graph、process trace 和 staleness checks 上。([tool contract](https://github.com/abhigyanpatwari/GitNexus/blob/cdbdf219dce797e51cdeb8cfa386e77ab2d35628/README.md#L136-L175)) Archify 的两份 authored architecture snapshots 没有这些事实来源。
+
+**吸收:** 对证据来源和 freshness 的显式区分。
+**不吸收:** blast radius、affected process、confidence、risk level 或 safe-to-merge 文案。
+
+## 两个真正的新候选
+
+| 候选 | 用户价值 | 稳定性成本 | 当前判断 |
+|---|---|---|---|
+| **A. Exact-ID Delta Review Navigator** | 很高:用户在一个成品里逐条检查、讲解和演示真实 change;不再靠眼睛在全图和表格间来回找。 | 中低:只消费 embedded compare receipt 和已生成 SVG;新增的是一个有限 viewer state machine。 | **现在做。** 它是明显可见的 delight,又不扩大事实边界。 |
+| **B. Deterministic CI/PR summary** | 中高:可把 counts 和 rows 放进 CI job summary 或 PR comment。 | 中:Markdown escaping、asset paths、base/head ref provenance、GitHub/CI host、private repo disclosure 和 publishing failure 都要独立定义。 | **后做。** CLI 已经有 `--json` 和 sidecar receipt,机器可消费入口不为空;先把人类审阅体验做好。 |
+
+B 不是坏想法,但现在做它会让核心能力先长出 CI/GitHub 边界,用户打开 Delta 后仍只能看静态 rows。A 的新增事实面为零,且能立即在现有示例、README 演示和真实 PR review 中被看见。
+
+## 冻结产品合同
+
+### 1. 唯一事实源
+
+Navigator 只读当前 document 内唯一的 `#archify-compare-receipt`,并要求:
+
+- JSON 可解析;
+- `schemaVersion === 1`、`command === "compare"`;
+- `completeness === "complete"`;
+- `changes.components / connections / boundaries` 都是数组;
+- 当前文档恰好有一个 Delta canvas 和对应 SVG;
+- 每个 change 能在 Delta SVG 中得到合同允许的 exact match。
+
+任一条件失败,Navigator 整体不可用并显示 `Review unavailable · compare identity mismatch`;Before / Delta / After、details、theme 和 preset 仍可用。不得部分播放、模糊匹配或跳过坏 row 后声称完整。
+
+### 2. 身份规则
+
+- component:receipt `id` ↔ `data-node-id`;
+- connection:receipt `id` ↔ `data-edge-id`;只把 path/line/polyline 与其 exact label/detail group 作为同一 change 的视觉集合;
+- boundary:receipt `key` ↔ renderer 新增的 `data-delta-boundary-key`;该 key 仍是 compare 已经验证唯一的 `(kind, label)`,不新增 schema ID;
+- moved component、rerouted connection 和 changed boundary 可以有 before phantom 与 head form;同一 exact identity 的全部合法 form 一起被选中;
+- 重复、缺失、错误 kind、错误 status 或 DOM/receipt classification 冲突全部 fail closed。
+
+永远不按 label、endpoint、geometry、邻近关系或数组位置猜实体。
+
+### 3. 顺序
+
+直接复用当前 `changeRows(receipt)` 的 codepoint-stable 顺序;不要创建“更聪明”的 risk、severity 或 topology-first 排序。总数必须等于三类 changes 的合计,并与 details summary 一致。
+
+格式化、object-key、entity-order、`wraps` / `sources` set-like reordering 已经不改变 Delta artifact;Navigator 不得破坏这一保证。([current deterministic tests](https://github.com/tt-a1i/archify/blob/4aeb07b379f09a8fc026df33e2402ad50ef9821e/archify/test/architecture-delta.test.mjs#L67-L75), [artifact stability tests](https://github.com/tt-a1i/archify/blob/4aeb07b379f09a8fc026df33e2402ad50ef9821e/archify/test/architecture-delta.test.mjs#L130-L177))
+
+### 4. UX
+
+保持一个 canvas,不增加第二张图或侧边工作台:
+
+- Details summary 上方或现有 proof tools 内加入一个 compact review strip;
+- native buttons:`Overview`、`Previous`、`Review/Pause/Replay`、`Next`;
+- 一个稳定状态文本:`03 / 11 · Relationship · publish-order · geometry`;
+- 每个 change row 变成 native button 或含一个全行 button,显示现有 symbol、kind、label、ID、classifications、fields;
+- 手动 row/Previous/Next 选择立即暂停播放,保持当前 exact change;
+- `Overview` 清除 selection,恢复完整 Delta;
+- Starting Review 是唯一可自动前进的入口,始终先切到 Delta view,从第一项开始,播放一次后停在最后一项;绝不自动开始或循环;
+- 用户切到 Before/After、聚焦任意 review control、页面 hidden、print 或出现新 intent 时立即暂停,绝不自行恢复。
+
+行按钮采用一个 roving tab stop,支持 ArrowUp/ArrowDown、Home/End 移动焦点,Enter/Space 选择;Previous/Next 激活后不移动按钮焦点。若提供自动前进,W3C Carousel pattern 要求 keyboard focus 停止 rotation,且只有用户再次触发 control 才可恢复。([WAI-ARIA APG Carousel](https://www.w3.org/WAI/ARIA/apg/patterns/carousel/))
+
+### 5. 视觉
+
+- 完整图、viewBox、node/edge/boundary geometry 和 paint order保持不变;
+- 当前 change 为 full emphasis,其他 changed entities 收敛到可读的 secondary opacity;unchanged context 继续保留;
+- selected state 同时使用 outline/pattern/symbol/文字状态,不只靠颜色;
+- moved/rerouted 的 from + to forms 同时可见,不制造“只有新位置”的假象;
+- 不复制 node/edge 作为新的可见拓扑;允许一个无 marker、无 pointer events 的静态 focus outline,但它必须来自 exact matched geometry,并在 clear/print 时删除;
+- manual selection 可以有一次不超过 160ms 的 opacity transition;Review 每步至少停留 1400ms;不移动 camera,不缩放,不平移,不闪烁。
+
+`prefers-reduced-motion: reduce` 下取消 transition 和自动 Review,只保留完整手动 Previous/Next/row selection。该 media feature 的语义正是减少或替换非必要动画。([MDN prefers-reduced-motion](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion))
+
+### 6. 状态边界
+
+Navigator 状态是 viewer-only:
+
+- 不写入 JSON IR、sidecar receipt、compare hashes、URL、history、localStorage 或 cookies;
+- 不改变 Before / Delta / After 的原始 SVG markup;
+- print 固定输出完整 Delta,忽略 active step;
+- 不加入 Share Card、PNG、WebM 或其他 export,本轮也不借机补 export menu;
+- 无新 dependency、server、GitHub API、telemetry 或 mobile product surface。
+
+### 7. 文案边界
+
+允许:`Authored change 3 of 11`、`Revision-pinned inputs`、`Changed fields`、`No authored architecture changes`。
+禁止:`impact`、`blast radius`、`affected`、`risk`、`safe`、`mergeable`、`verified PR`、`breaking`,除非未来存在独立、明确的代码事实合同。
+
+## 明确不做
+
+- 不做 CI action、PR bot、GitHub comment、status check 或 asset hosting;
+- 不接收 git refs,不自动选择 base;
+- 不做 label/endpoints fuzzy identity;
+- 不做 risk/severity scoring、affected-process 推断或测试建议;
+- 不做 diff editing、accept/reject、approval workflow;
+- 不做 infinite autoplay、ambient particles、GIF/WebM 导出;
+- 不复用普通 diagram 的 Story/Route/Camera state machine;Delta Navigator 拥有自己的小型、单一 owner;
+- 不做移动端产品;只保证现有桌面 proof 不产生页面横向溢出。
+
+## 自动化稳定门
+
+实施必须先写失败测试,再满足以下门:
+
+1. pure identity resolver 覆盖 component、connection、boundary、added、removed、changed、moved、rerouted 和 zero-change;
+2. missing / duplicate / conflicting DOM identity 统一 fail closed,且不会只跳过某一 row;
+3. row count、step count、summary count 与 embedded receipt 完全一致;
+4. stable order 在输入格式、object key、entity order、set-like order 改动后不变;
+5. Overview 不留下 `data-delta-review-*`、inline style、outline clone、timer 或 `aria-current`;
+6. Review 只运行一次,最后停止;replace/pause/hidden/print/reduced-motion 使旧 timer token 失效;
+7. manual activation、keyboard focus、view switch 都停止自动前进且不会 auto-resume;
+8. print 强制完整 Delta,禁止 toolbar、selection dimming 和 runtime overlay;
+9. forbidden claims audit 继续通过;
+10. current Delta artifact bytes仍然 deterministic;只有功能实现本身造成一次受控 golden 更新;
+11. `npm test`、`npm run test:webm`、installed ZIP package smoke、`unzip -t`、`git diff --check` 全绿;
+12. 不修改普通五 renderer 的 canonical exports、Route/Reach cards、WebM 或 Story behavior。
+
+## 内置浏览器验收
+
+在 `examples/checkout-platform-delta.html` 的桌面视口完成:
+
+1. 冷启动仍是 Delta overview,无选中 row、无 timer、无 console warning/error;
+2. 点击一个 component change:exact row 获得 `aria-current="step"`,只有相同 `data-node-id` 的合法 Delta forms 成为 current;
+3. 点击一个 connection change:path、对应 label/detail 同步突出,不命中同 endpoints 的另一条 edge;
+4. moved node 同时保留 move-from 和 moved form;rerouted edge 同时保留 old/new route;
+5. boundary row 只匹配同一个 exact boundary key;
+6. Previous/Next、row click、Arrow/Home/End、Enter/Space 行为一致;焦点始终可见;
+7. Review 从第一项开始、一次走完、停在最后;Pause 保留当前静态事实,Replay 只有用户点击后才重新开始;
+8. 播放期间聚焦 row、切 Before/After、隐藏页面或按 Pause 后不再前进;
+9. 浏览器模拟 reduced motion:Review 不自动运行,手动 navigation 完整可用;
+10. Overview 清除所有 runtime state,DOM/SVG fingerprint 回到激活前;
+11. Classic / Signal Flow / Blueprint × dark / light 都能区分 selected、other change、unchanged context;
+12. 1280×720 与 1440×900 无页面横向溢出,controls 不遮住图或 exact change list;
+13. `window.print()` / print preview 只呈现完整 Delta,没有 review chrome 或 selection residue;
+14. 动态篡改一个 ID 或制造 duplicate 后,Navigator 显示明确 unavailable,三视图和静态 change list 仍可读,绝不 fuzzy-match。
+
+## 成功判断
+
+成功不是“多了一个 Play 按钮”。成功是审阅者可以从 Overview 开始,用完全相同的 authored facts 逐项走完一份复杂 Delta;随时暂停、返回全图、切 Before/After,都不会丢失上下文或得到新的推断。实现前后 compare receipt、stable IDs、三视图和禁用风险结论的真相合同保持不变。
+
+完成这一刀之后,再单独评估 B:从 sidecar receipt 生成 deterministic Markdown/CI summary。那一轮必须独立冻结 git provenance、private path disclosure、asset publication、Markdown escaping 和 publishing failure,不能借本轮 Navigator 顺手带入。
diff --git a/examples/checkout-platform-delta.html b/examples/checkout-platform-delta.html
index eaed9335..65df4831 100644
--- a/examples/checkout-platform-delta.html
+++ b/examples/checkout-platform-delta.html
@@ -3953,17 +3953,19 @@
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}
+:root{color-scheme:dark;--d-add:#34d399;--d-remove:#fb7185;--d-change:#fbbf24;--d-move:#7dd3fc;--d-focus:#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}
+.proof-tools{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:16px 0 10px}.view-switch{display:inline-flex;padding:3px;border:1px solid var(--d-line);border-radius:8px;background:#0a141e}.view-switch button,.utility,.review-step{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)}.view-switch button:focus-visible,.utility:focus-visible,.review-step:focus-visible,.change-row:focus-visible{outline:2px solid var(--d-focus);outline-offset:2px}.utility:disabled,.review-step:disabled{cursor:not-allowed;opacity:.45}.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}
+.review-strip{display:grid;grid-template-columns:auto auto auto auto minmax(0,1fr);align-items:center;gap:5px;margin:0 0 10px;padding:7px 8px;border-block:1px solid var(--d-line);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.review-step{min-height:34px;border:1px solid var(--d-line);padding-inline:11px}.review-step[aria-pressed="true"]{border-color:var(--d-focus);color:var(--d-ink)}.review-status{min-width:0;padding-left:9px;color:var(--d-muted);font-size:10px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.review-status strong{color:var(--d-ink);font-weight:750}.review-status[data-state="unavailable"]{color:var(--d-remove)}
+.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}.canvas[data-delta-review-active]{--review-same-opacity:.14;--review-change-opacity:.28}.canvas[data-delta-review-active] [data-delta-state="same"]{opacity:var(--review-same-opacity)!important}.canvas[data-delta-review-active] [data-delta-state]:not([data-delta-state="same"]):not([data-delta-review-current]){opacity:var(--review-change-opacity)!important}.canvas[data-delta-review-active] [data-delta-review-current]{opacity:1!important;transition:opacity .16s ease-out}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}}
+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 8px 8px}.changes li{border-top:1px solid rgba(138,160,181,.16)}.change-row{display:grid;grid-template-columns:30px 90px minmax(140px,1fr) minmax(100px,.7fr) minmax(120px,.8fr) minmax(140px,1.2fr);gap:10px;width:100%;margin:0;padding:9px 7px;border:0;border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:11px;text-align:left;align-items:baseline;cursor:pointer}.change-row:hover{background:rgba(125,211,252,.06)}.change-row[aria-current="step"]{background:rgba(125,211,252,.1);box-shadow:inset 0 0 0 1px var(--d-focus)}.change-row:disabled{cursor:default}.token{font:800 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.changes code,.change-row>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;--d-focus:#006b8f}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}.canvas[data-delta-review-active] [data-delta-review-current]{transition:none!important}}@media print{body{min-width:0;background:#fff;color:#111}.proof-page{width:100%;padding:0}.proof-tools,.review-strip,details{display:none!important}.canvas{display:none!important}.canvas[data-view="delta"]{display:block!important;border:0}.canvas[data-delta-review-active]{--review-same-opacity:1;--review-change-opacity:1}.canvas[data-delta-review-active] [data-delta-review-current]{opacity:1!important;transition:none!important}.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>
+<nav class="review-strip" aria-label="Authored change review"><button class="review-step" id="review-overview" type="button" disabled>Overview</button><button class="review-step" id="review-previous" type="button" aria-label="Previous authored change" disabled>←</button><button class="review-step" id="review-play" type="button" aria-pressed="false">Review</button><button class="review-step" id="review-next" type="button" aria-label="Next authored change" disabled>→</button><div class="review-status" id="review-status" role="status" aria-live="polite">Overview · 11 authored changes</div></nav>
<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>
@@ -3990,11 +3992,11 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
<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="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" data-delta-boundary-key="region:Production region"/>
+ <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-state="changed" data-delta-boundary-state="changed" data-delta-boundary-key="region:Production region">Production region</text>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="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>
+ <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" data-delta-boundary-key="security-group:Checkout trust zone"/>
+ <text x="408" y="238" class="t-security" font-size="9" font-weight="600" data-delta-state="changed" data-delta-boundary-state="changed" data-delta-boundary-key="security-group:Checkout trust zone">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"/>
@@ -4181,32 +4183,32 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
<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>
+<rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" x="190" y="70" width="610" height="410" rx="12" class="c-region" stroke-width="1" data-delta-state="moved-from" data-delta-classifications="scope" data-delta-boundary-key="region:Production region"/>
+ <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-state="moved-from" data-delta-boundary-state="moved-from" data-delta-boundary-key="region:Production region">Production region</text>
+<rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="400" y="220" width="400" height="110" rx="8" class="c-security-group" stroke-width="1" data-delta-state="moved-from" data-delta-classifications="scope" data-delta-boundary-key="security-group:Checkout trust zone"/>
+ <text x="408" y="238" class="t-security" font-size="9" font-weight="600" data-delta-state="moved-from" data-delta-boundary-state="moved-from" data-delta-boundary-key="security-group:Checkout trust zone">Checkout trust zone</text>
<!-- 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="region" data-composition-frame-id="0" x="190" y="70" width="610" height="430" rx="12" class="c-region" stroke-width="1" data-delta-state="changed" data-delta-classifications="scope" data-delta-boundary-key="region:Production region"/>
+ <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-state="changed" data-delta-boundary-state="changed" data-delta-boundary-key="region:Production region">Production region</text>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="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>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="400" y="70" width="400" height="260" rx="8" class="c-security-group" stroke-width="1" data-delta-state="changed" data-delta-classifications="scope" data-delta-boundary-key="security-group:Checkout trust zone"/>
+ <text x="408" y="88" class="t-security" font-size="9" font-weight="600" data-delta-state="changed" data-delta-boundary-state="changed" data-delta-boundary-key="security-group:Checkout trust zone">Checkout trust zone</text>
<!-- 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">
+<path data-edge-from="orders" data-edge-to="payments" data-edge-label="authorize" data-edge-key="0" data-edge-id="authorize-payment" data-composition-points="770,280;850,280" d="M 770 280 L 850 280" class="a-security" stroke-width="1.5" marker-end="url(#arrowhead-security)" data-delta-state="removed" data-delta-classifications="geometry,topology"/>
+<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" 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>
-<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">
+<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" data-delta-classifications="geometry"/>
+<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" 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>
-<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">
+<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" data-delta-classifications="topology"/>
+<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>
@@ -4221,7 +4223,7 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
<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">
+<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" 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"/>
@@ -4234,7 +4236,7 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
<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">
+<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" 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"/>
@@ -4378,13 +4380,13 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
</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>
+<text class="delta-edge-marker" data-delta-state="removed" data-edge-id="authorize-payment" x="779" y="273" aria-hidden="true">−</text>
+<text class="delta-edge-marker" data-delta-state="moved-from" data-edge-id="publish-order" x="504" y="303" aria-hidden="true">↔</text>
+<text class="delta-edge-marker" data-delta-state="removed" data-edge-id="session-read" x="504" y="243" aria-hidden="true">−</text>
+<text class="delta-edge-marker" data-delta-state="added" data-edge-id="authorize-payment" x="779" y="273" aria-hidden="true">+</text>
+<text class="delta-edge-marker" data-delta-state="added" data-edge-id="fraud-check" x="504" y="243" aria-hidden="true">+</text>
+<text class="delta-edge-marker" data-delta-state="changed" data-edge-id="persist-order" x="569" y="273" aria-hidden="true">~</text>
+<text class="delta-edge-marker" data-delta-state="rerouted" data-edge-id="publish-order" x="504" y="303" aria-hidden="true">↔</text>
<!-- Legend -->
<g data-legend-bridge>
@@ -4440,11 +4442,11 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
<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="region" data-composition-frame-id="0" x="190" y="70" width="610" height="430" rx="12" class="c-region" stroke-width="1" data-delta-state="changed" data-delta-classifications="scope" data-delta-boundary-key="region:Production region"/>
+ <text x="198" y="88" class="t-cloud" font-size="9" font-weight="600" data-delta-state="changed" data-delta-boundary-state="changed" data-delta-boundary-key="region:Production region">Production region</text>
- <rect data-graph-role="structural-frame" data-composition-frame-kind="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>
+ <rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" x="400" y="70" width="400" height="260" rx="8" class="c-security-group" stroke-width="1" data-delta-state="changed" data-delta-classifications="scope" data-delta-boundary-key="security-group:Checkout trust zone"/>
+ <text x="408" y="88" class="t-security" font-size="9" font-weight="600" data-delta-state="changed" data-delta-boundary-state="changed" data-delta-boundary-key="security-group:Checkout trust zone">Checkout trust zone</text>
<!-- 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"/>
@@ -4611,17 +4613,17 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
</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>
+<details><summary>Exact authored changes · 11</summary><ul class="changes"><li data-change-status="added"><button class="change-row" type="button" data-change-index="0" data-change-key="component:fraud" data-change-kind="component" data-change-id="fraud" data-change-label="Fraud Gate" data-change-status="added" data-change-classifications="semantic" data-change-target-signature="g:added:semantic"><span class="token">+</span><span>Component</span><strong>Fraud Gate</strong><code>fraud</code><span>semantic</span><span>identity</span></button></li>
+<li data-change-status="added"><button class="change-row" type="button" data-change-index="1" data-change-key="relationship:fraud-check" data-change-kind="relationship" data-change-id="fraud-check" data-change-label="screen" data-change-status="added" data-change-classifications="topology" data-change-target-signature="g:added:topology|path:added:topology|text:added:"><span class="token">+</span><span>Relationship</span><strong>screen</strong><code>fraud-check</code><span>topology</span><span>identity</span></button></li>
+<li data-change-status="changed"><button class="change-row" type="button" data-change-index="2" data-change-key="boundary:region:Production region" data-change-kind="boundary" data-change-id="region:Production region" data-change-label="Production region" data-change-status="changed" data-change-classifications="scope" data-change-target-signature="rect:changed:scope|rect:moved-from:scope|text:changed:|text:moved-from:"><span class="token">~</span><span>Boundary</span><strong>Production region</strong><code>region:Production region</code><span>scope</span><span>/wraps</span></button></li>
+<li data-change-status="changed"><button class="change-row" type="button" data-change-index="3" data-change-key="boundary:security-group:Checkout trust zone" data-change-kind="boundary" data-change-id="security-group:Checkout trust zone" data-change-label="Checkout trust zone" data-change-status="changed" data-change-classifications="scope" data-change-target-signature="rect:changed:scope|rect:moved-from:scope|text:changed:|text:moved-from:"><span class="token">~</span><span>Boundary</span><strong>Checkout trust zone</strong><code>security-group:Checkout trust zone</code><span>scope</span><span>/wraps</span></button></li>
+<li data-change-status="changed"><button class="change-row" type="button" data-change-index="4" data-change-key="component:checkout" data-change-kind="component" data-change-id="checkout" data-change-label="Checkout API" data-change-status="changed" data-change-classifications="semantic" data-change-target-signature="g:changed:semantic"><span class="token">~</span><span>Component</span><strong>Checkout API</strong><code>checkout</code><span>semantic</span><span>/sublabel</span></button></li>
+<li data-change-status="changed"><button class="change-row" type="button" data-change-index="5" data-change-key="relationship:authorize-payment" data-change-kind="relationship" data-change-id="authorize-payment" data-change-label="authorize" data-change-status="changed" data-change-classifications="geometry, topology" data-change-target-signature="g:changed:geometry,topology|g:removed:geometry,topology|path:changed:geometry,topology|path:removed:geometry,topology|text:added:|text:removed:"><span class="token">~</span><span>Relationship</span><strong>authorize</strong><code>authorize-payment</code><span>geometry, topology</span><span>/from, /fromSide, /toSide, /via</span></button></li>
+<li data-change-status="changed"><button class="change-row" type="button" data-change-index="6" data-change-key="relationship:persist-order" data-change-kind="relationship" data-change-id="persist-order" data-change-label="SQL tx" data-change-status="changed" data-change-classifications="semantic" data-change-target-signature="g:changed:semantic|path:changed:semantic|text:changed:"><span class="token">~</span><span>Relationship</span><strong>SQL tx</strong><code>persist-order</code><span>semantic</span><span>/label</span></button></li>
+<li data-change-status="moved"><button class="change-row" type="button" data-change-index="7" data-change-key="component:queue" data-change-kind="component" data-change-id="queue" data-change-label="Order Events" data-change-status="moved" data-change-classifications="geometry" data-change-target-signature="g:moved-from:geometry|g:moved:geometry"><span class="token">↔</span><span>Component</span><strong>Order Events</strong><code>queue</code><span>geometry</span><span>/pos</span></button></li>
+<li data-change-status="removed"><button class="change-row" type="button" data-change-index="8" data-change-key="component:cache" data-change-kind="component" data-change-id="cache" data-change-label="Session Cache" data-change-status="removed" data-change-classifications="semantic" data-change-target-signature="g:removed:semantic"><span class="token">−</span><span>Component</span><strong>Session Cache</strong><code>cache</code><span>semantic</span><span>identity</span></button></li>
+<li data-change-status="removed"><button class="change-row" type="button" data-change-index="9" data-change-key="relationship:session-read" data-change-kind="relationship" data-change-id="session-read" data-change-label="session" data-change-status="removed" data-change-classifications="topology" data-change-target-signature="g:removed:topology|path:removed:topology|text:removed:"><span class="token">−</span><span>Relationship</span><strong>session</strong><code>session-read</code><span>topology</span><span>identity</span></button></li>
+<li data-change-status="rerouted"><button class="change-row" type="button" data-change-index="10" data-change-key="relationship:publish-order" data-change-kind="relationship" data-change-id="publish-order" data-change-label="accepted" data-change-status="rerouted" data-change-classifications="geometry" data-change-target-signature="g:moved-from:geometry|g:rerouted:geometry|path:moved-from:geometry|path:rerouted:geometry|text:moved-from:|text:rerouted:"><span class="token">↔</span><span>Relationship</span><strong>accepted</strong><code>publish-order</code><span>geometry</span><span>/labelDy</span></button></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,
@@ -4840,4 +4842,263 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
"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 file
+<script>(()=>{
+ const REVIEW_DWELL_MS = 1400;
+ const tabs = [...document.querySelectorAll('[role="tab"]')];
+ const views = [...document.querySelectorAll('[data-view]')];
+ const deltaCanvas = document.querySelector('[data-view="delta"]');
+ const rowButtons = [...document.querySelectorAll('.change-row')];
+ const overviewButton = document.querySelector('#review-overview');
+ const previousButton = document.querySelector('#review-previous');
+ const playButton = document.querySelector('#review-play');
+ const nextButton = document.querySelector('#review-next');
+ const status = document.querySelector('#review-status');
+ const receiptNode = document.querySelector('#archify-compare-receipt');
+ const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
+ let activeIndex = -1;
+ let playbackToken = 0;
+ let playbackTimer = 0;
+ let playing = false;
+ let reviewAvailable = false;
+ let reviewSources = [];
+
+ function show(id) {
+ tabs.forEach((tab) => tab.setAttribute('aria-selected', String(tab.dataset.target === id)));
+ views.forEach((view) => { view.hidden = view.dataset.view !== id; });
+ }
+
+ function stopPlayback() {
+ playbackToken += 1;
+ if (playbackTimer) window.clearTimeout(playbackTimer);
+ playbackTimer = 0;
+ playing = false;
+ playButton.setAttribute('aria-pressed', 'false');
+ playButton.textContent = activeIndex === rowButtons.length - 1 && rowButtons.length ? 'Replay' : 'Review';
+ status.setAttribute('aria-live', 'polite');
+ }
+
+ function failReview() {
+ stopPlayback();
+ reviewAvailable = false;
+ activeIndex = -1;
+ deltaCanvas?.removeAttribute('data-delta-review-active');
+ deltaCanvas?.querySelectorAll('[data-delta-review-current]').forEach((element) => element.removeAttribute('data-delta-review-current'));
+ rowButtons.forEach((row) => {
+ row.disabled = true;
+ row.tabIndex = -1;
+ row.removeAttribute('aria-current');
+ });
+ [overviewButton, previousButton, playButton, nextButton].forEach((button) => { button.disabled = true; });
+ status.dataset.state = 'unavailable';
+ status.textContent = 'Review unavailable · compare identity mismatch';
+ }
+
+ function receiptRows(receipt) {
+ const definitions = [
+ { collection: 'components', kind: 'component', id: 'id', statuses: ['added', 'changed', 'evidence-changed', 'removed', 'moved'] },
+ { collection: 'connections', kind: 'relationship', id: 'id', statuses: ['added', 'changed', 'removed', 'rerouted'] },
+ { collection: 'boundaries', kind: 'boundary', id: 'key', statuses: ['added', 'changed', 'removed', 'geometry-changed'] },
+ ];
+ const rows = [];
+ for (const definition of definitions) {
+ const changes = receipt.changes[definition.collection];
+ if (!Array.isArray(changes)) return null;
+ for (const change of changes) {
+ if (!change || typeof change !== 'object' || Array.isArray(change)) return null;
+ const id = change[definition.id];
+ if (typeof id !== 'string' || !id || !definition.statuses.includes(change.status)) return null;
+ if (!Array.isArray(change.classifications) || !change.classifications.length || change.classifications.some((value) => typeof value !== 'string')) return null;
+ if (new Set(change.classifications).size !== change.classifications.length) return null;
+ if (!Array.isArray(change.changedFields) || change.changedFields.some((value) => typeof value !== 'string')) return null;
+ rows.push({ ...change, kind: definition.kind, key: definition.kind + ':' + id, id });
+ }
+ }
+ return rows;
+ }
+
+ function exactTargets(row) {
+ const attribute = row.dataset.changeKind === 'component'
+ ? 'data-node-id'
+ : row.dataset.changeKind === 'relationship'
+ ? 'data-edge-id'
+ : 'data-delta-boundary-key';
+ return [...deltaCanvas.querySelectorAll('[' + attribute + ']')]
+ .filter((element) => element.getAttribute(attribute) === row.dataset.changeId);
+ }
+
+ function targetSignature(matches) {
+ return matches.map((element) => {
+ const tag = element.tagName.toLowerCase();
+ const state = element.dataset.deltaState || '';
+ const classifications = element.dataset.deltaClassifications || '';
+ return tag + ':' + state + ':' + classifications;
+ }).sort().join('|');
+ }
+
+ function targetsMatch(source, row, matches) {
+ if (!source || !matches.length || !row.dataset.changeTargetSignature) return false;
+ if (row.dataset.changeKind !== source.kind || row.dataset.changeId !== source.id || row.dataset.changeStatus !== source.status) return false;
+ if (row.dataset.changeClassifications !== source.classifications.join(', ')) return false;
+ return row.dataset.changeTargetSignature === targetSignature(matches);
+ }
+
+ function validateReview() {
+ try {
+ if (document.querySelectorAll('#archify-compare-receipt').length !== 1 || !receiptNode) return false;
+ if (!deltaCanvas || !['base', 'delta', 'head'].every((id) => document.querySelectorAll('[data-view="' + id + '"]').length === 1)) return false;
+ if (deltaCanvas.children.length !== 1 || deltaCanvas.firstElementChild?.tagName.toLowerCase() !== 'svg') return false;
+ const receipt = JSON.parse(receiptNode.textContent);
+ if (!receipt || receipt.schemaVersion !== 1 || receipt.command !== 'compare' || receipt.completeness !== 'complete' || !receipt.changes) return false;
+ const sources = receiptRows(receipt);
+ if (!sources || sources.length !== rowButtons.length) return false;
+ const sourceByKey = new Map(sources.map((source) => [source.key, source]));
+ if (sourceByKey.size !== sources.length) return false;
+ const seen = new Set();
+ const orderedSources = [];
+ for (let index = 0; index < rowButtons.length; index += 1) {
+ const row = rowButtons[index];
+ const source = sourceByKey.get(row.dataset.changeKey);
+ if (!source || seen.has(source.key) || row.dataset.changeIndex !== String(index)) return false;
+ const matches = exactTargets(row);
+ if (!targetsMatch(source, row, matches)) return false;
+ seen.add(source.key);
+ orderedSources.push(source);
+ }
+ if (seen.size !== sourceByKey.size) return false;
+ reviewSources = orderedSources;
+ return true;
+ } catch {
+ return false;
+ }
+ }
+
+ function updateControls() {
+ overviewButton.disabled = !reviewAvailable || activeIndex < 0;
+ previousButton.disabled = !reviewAvailable || activeIndex <= 0;
+ nextButton.disabled = !reviewAvailable || activeIndex < 0 || activeIndex >= rowButtons.length - 1;
+ }
+
+ function selectChange(index, fromPlayback = false) {
+ if (!reviewAvailable || index < 0 || index >= rowButtons.length) return false;
+ const row = rowButtons[index];
+ const matches = exactTargets(row);
+ if (!targetsMatch(reviewSources[index], row, matches)) { failReview(); return false; }
+ show('delta');
+ deltaCanvas.querySelectorAll('[data-delta-review-current]').forEach((element) => element.removeAttribute('data-delta-review-current'));
+ matches.forEach((element) => element.setAttribute('data-delta-review-current', 'true'));
+ deltaCanvas.setAttribute('data-delta-review-active', 'true');
+ rowButtons.forEach((button, rowIndex) => {
+ button.tabIndex = rowIndex === index ? 0 : -1;
+ if (rowIndex === index) button.setAttribute('aria-current', 'step');
+ else button.removeAttribute('aria-current');
+ });
+ activeIndex = index;
+ updateControls();
+ const kind = row.dataset.changeKind.charAt(0).toUpperCase() + row.dataset.changeKind.slice(1);
+ status.textContent = String(index + 1).padStart(2, '0') + ' / ' + String(rowButtons.length).padStart(2, '0') + ' · ' + kind + ' · ' + row.dataset.changeLabel + ' [' + row.dataset.changeId + '] · ' + row.dataset.changeClassifications;
+ if (fromPlayback) status.setAttribute('aria-live', 'off');
+ return true;
+ }
+
+ function overview() {
+ if (!reviewAvailable) { failReview(); return; }
+ stopPlayback();
+ activeIndex = -1;
+ deltaCanvas.removeAttribute('data-delta-review-active');
+ deltaCanvas.querySelectorAll('[data-delta-review-current]').forEach((element) => element.removeAttribute('data-delta-review-current'));
+ rowButtons.forEach((row, index) => {
+ row.tabIndex = index === 0 ? 0 : -1;
+ row.removeAttribute('aria-current');
+ });
+ show('delta');
+ status.removeAttribute('data-state');
+ status.textContent = 'Overview · ' + rowButtons.length + ' authored changes';
+ updateControls();
+ }
+
+ function schedulePlayback(token) {
+ if (!playing || token !== playbackToken || activeIndex >= rowButtons.length - 1) {
+ if (activeIndex >= rowButtons.length - 1) stopPlayback();
+ return;
+ }
+ playbackTimer = window.setTimeout(() => {
+ if (!playing || token !== playbackToken) return;
+ if (!selectChange(activeIndex + 1, true)) return;
+ schedulePlayback(token);
+ }, REVIEW_DWELL_MS);
+ }
+
+ function startReview() {
+ if (!reviewAvailable) return;
+ if (playing) { stopPlayback(); return; }
+ stopPlayback();
+ if (!selectChange(0, false)) return;
+ if (reducedMotion.matches || rowButtons.length < 2) return;
+ playing = true;
+ const token = ++playbackToken;
+ playButton.textContent = 'Pause';
+ playButton.setAttribute('aria-pressed', 'true');
+ status.setAttribute('aria-live', 'off');
+ schedulePlayback(token);
+ }
+
+ tabs.forEach((tab, index) => {
+ tab.addEventListener('click', () => { stopPlayback(); show(tab.dataset.target); });
+ tab.addEventListener('keydown', (event) => {
+ if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return;
+ event.preventDefault();
+ stopPlayback();
+ const 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);
+ });
+ });
+
+ rowButtons.forEach((row, index) => {
+ row.tabIndex = index === 0 ? 0 : -1;
+ row.addEventListener('click', () => { stopPlayback(); selectChange(index); });
+ row.addEventListener('keydown', (event) => {
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault();
+ stopPlayback();
+ selectChange(index);
+ return;
+ }
+ if (!['ArrowUp', 'ArrowDown', 'Home', 'End'].includes(event.key)) return;
+ event.preventDefault();
+ stopPlayback();
+ const next = event.key === 'Home' ? 0 : event.key === 'End' ? rowButtons.length - 1 : (index + (event.key === 'ArrowDown' ? 1 : -1) + rowButtons.length) % rowButtons.length;
+ rowButtons.forEach((button, rowIndex) => { button.tabIndex = rowIndex === next ? 0 : -1; });
+ rowButtons[next].focus();
+ });
+ });
+
+ overviewButton.addEventListener('click', overview);
+ previousButton.addEventListener('click', () => { stopPlayback(); selectChange(activeIndex - 1); });
+ nextButton.addEventListener('click', () => { stopPlayback(); selectChange(activeIndex + 1); });
+ playButton.addEventListener('click', startReview);
+ document.addEventListener('focusin', (event) => {
+ if (playing && event.target.closest('button')) stopPlayback();
+ });
+ document.addEventListener('visibilitychange', () => { if (document.hidden) stopPlayback(); });
+ window.addEventListener('beforeprint', overview);
+ reducedMotion.addEventListener('change', () => { if (reducedMotion.matches) stopPlayback(); });
+ document.addEventListener('keydown', (event) => {
+ if (event.key === 'Escape' && activeIndex >= 0) {
+ event.preventDefault();
+ overview();
+ playButton.focus();
+ }
+ });
+
+ 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]; });
+
+ reviewAvailable = validateReview();
+ if (!reviewAvailable) failReview();
+ else {
+ status.removeAttribute('data-state');
+ updateControls();
+ }
+})();</script></body></html>
\ No newline at end of file
diff --git a/examples/checkout-platform-delta.receipt.json b/examples/checkout-platform-delta.receipt.json
index 363c67b3..a4bcfec2 100644
--- a/examples/checkout-platform-delta.receipt.json
+++ b/examples/checkout-platform-delta.receipt.json
@@ -219,12 +219,12 @@
"Boundary identity is conservatively derived from kind + label."
],
"artifact": {
- "sha256": "405c40ca58c1cd309266fe6bf64820b050db32f139036f90676172a6906e0ac2",
- "bytes": 226757
+ "sha256": "baf418a494391fa02f1d0c30fc1b4341498830b84199d1e536a8948130f449ea",
+ "bytes": 246410
},
"validation": {
- "checksPassed": 23,
- "checkCount": 23,
+ "checksPassed": 26,
+ "checkCount": 26,
"baseComposition": "pass",
"headComposition": "pass"
}