Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
HTML agent-skillsai-agentsarchitecture-diagramclaude-codeclaude-skillscodexcoding-agentsdeepseek-harnessdeveloper-toolsdiagramsdiagrams-as-codedsh-pluginflowchartllmmermaidopencodesequence-diagramsoftware-architecturesystem-designvisualization
feat: add authored reachability exploration
tt-a1i95dd518d5b6b
diff --git a/.impeccable/design.json b/.impeccable/design.jsonindex ab2c89eb..49c05e90 100644--- a/.impeccable/design.json+++ b/.impeccable/design.json@@ -66,10 +66,18 @@{"name": "Semantic Passport","kind": "custom",- "description": "One focused node's compact metadata, relationships, and optional verified sources.",+ "description": "One focused node's compact metadata, authored reachability, relationships, and optional verified sources.","html": "<aside class=\"ds-passport\"><span>SEMANTIC PASSPORT</span><strong>Entry Surfaces</strong><small>frontend · entry</small></aside>","css": ".ds-passport { display: grid; gap: 0.4rem; width: 18rem; padding: 0.75rem; border: 1px solid #22d3ee; border-radius: 0.82rem; background: #0f172a; color: #fff; box-shadow: 0 18px 48px rgba(0,0,0,0.3); font-family: 'JetBrains Mono', ui-monospace, monospace; } .ds-passport span { color: #22d3ee; font-size: 0.5rem; font-weight: 800; letter-spacing: 0.14em; } .ds-passport small { color: #94a3b8; } .ds-passport:focus-within { outline: 2px solid #22d3ee; outline-offset: 2px; }"},+ {+ "name": "Authored Reachability",+ "kind": "custom",+ "refersTo": "authored-reachability",+ "description": "Two compact Semantic Passport actions that reveal the deterministic upstream or downstream closure of authored relationships without claiming runtime causality.",+ "html": "<div class=\"ds-reach\"><button aria-pressed=\"false\">Upstream <b>3</b></button><button aria-pressed=\"true\">Downstream <b>9</b></button><small>9 nodes · 9 links · max 6 hops</small></div>",+ "css": ".ds-reach { display: grid; grid-template-columns: 1fr 1fr; gap: 0.38rem; width: 18rem; font-family: 'JetBrains Mono', ui-monospace, monospace; } .ds-reach button { min-height: 2rem; border: 1px solid #334155; border-radius: 0.45rem; background: #0f172a; color: #cbd5e1; font: 700 0.65rem/1 'JetBrains Mono', ui-monospace, monospace; } .ds-reach button[aria-pressed=\"true\"] { border-color: #22d3ee; color: #22d3ee; background: rgba(34,211,238,0.08); } .ds-reach b { color: inherit; } .ds-reach small { grid-column: 1 / -1; color: #94a3b8; font-size: 0.6rem; } .ds-reach button:focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }"+ },{"name": "Verified Source Beacon","kind": "chip",@@ -87,6 +95,7 @@"A fixed semantic color vocabulary shared by nodes, edges, legends, focus, and evidence.","Mono-forward typography, small labels, and deliberate density for engineering review.","Viewer state stays outside canonical exports; proof remains portable and deterministic.",+ "Authored reachability is explicit, finite, shareable, and never presented as runtime impact.","State transitions are 140–200ms; authored story motion may be longer but finite and reader-controlled."],"rules": [@@ -100,6 +109,7 @@"dos": ["Do make the primary path legible before adding secondary relationships or detail.","Do derive every focus, route, story, source link, receipt, and count from authored or locally verified evidence.",+ "Do label upstream and downstream exploration as authored reachability, deduplicate relationship fragments, terminate cycles, and preserve deterministic DOM order.","Do keep ordinary artifacts source-free and make repository evidence explicitly opt-in.","Do use 140–200ms transitions for control state and honor prefers-reduced-motion.","Do preserve keyboard access, visible focus, semantic labels, dark/light parity, and non-color state cues.",@@ -109,6 +119,7 @@"Don't build generic Mermaid beautifiers that change themes without improving information architecture.","Don't turn Archify into WYSIWYG drawing suites whose editing chrome becomes the product.","Don't ship motion-first graph demos that imply relationships or activity not present in the authored source.",+ "Don't call authored graph reachability blast radius, breakage, dependency impact, or runtime causality.","Don't use dense dashboard shells, endless identical card grids, decorative glass, gradient text, and other AI-generated interface clichés.","Don't add vendor-icon catalogues or product-name matching that weaken Archify's portable semantic vocabulary.","Don't create another permanent panel when the Semantic Passport, Node Finder, or existing canvas can carry the capability.",diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f5a2b21b..09aaba3c 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+- **Authored Reachability.** A focused node's existing Semantic Passport now offers compact `Upstream` and `Downstream` actions that reveal the deterministic transitive closure of authored relationships, report matched nodes, links, and maximum hops, and round-trip through `#focus=<id>&reach=upstream|downstream` plus Copy link. The viewer deduplicates parallel SVG fragments by stable edge key, terminates cycles, preserves authored DOM order, supports keyboard and browser-history navigation, and remains legible across Classic, Signal Flow, Blueprint, dark, and light. SVG, raster, Share Card, WebM backgrounds, and print strip the temporary state. This is explicitly authored reachability—not blast radius, breakage, repository impact, or runtime causality—and adds no parser, crawler, schema, panel, permanent toolbar action, dependency, hosted runtime, storage, geometry change, or mobile product surface.- **Verified Source Beacons.** Evidence-backed Architecture nodes now show one quiet viewer-only `SRC n` marker derived exclusively from the already verified repository payload. The node remains the single focus target and opens the existing Semantic Passport; screen-reader labels disclose the count, focus/routes/stories/guided views keep one coherent node state, and Classic, Signal Flow, Blueprint, dark, and light reuse the same proof-green vocabulary. Ordinary artifacts remain unchanged, while SVG, raster, Share Card, and WebM backgrounds strip the marker and restore the canonical node label. No parser, crawler, inferred relationship, panel, toolbar control, schema expansion, dependency, hosted runtime, or mobile product surface was added.- **Revision-verified Repository Evidence Passport.** Architecture diagrams can opt into public GitHub source links by declaring a repository URL, a full commit SHA, and one to three repo-relative sources per component, then passing `--repo-root` to `render`, `deliver`, `preview`, or `validate`. Archify verifies the local origin, commit, blobs, and optional line ranges before publishing; verified links appear in Semantic Passport and Node Finder while staying outside the canonical SVG and every visual export. Plain diagrams remain the default, other diagram modes reject the option, and private or unpinned evidence is deliberately out of scope.diff --git a/DESIGN.md b/DESIGN.mdindex 6b02d6e3..768f0993 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -204,12 +204,16 @@ One focused node opens one compact proof surface containing stable ID, authoredAn evidence-backed node receives one viewer-only `SRC n` capsule in its upper-right corner. It inherits node state, adds no tab stop, and is stripped from every canonical visual export.+### Authored Reachability++Semantic Passport offers two native, count-bearing actions: `Upstream` follows authored incoming relationships and `Downstream` follows authored outgoing relationships. The canvas keeps the focused origin plus the complete reachable subgraph strong while unrelated topology recedes. Upstream uses Repository Violet, downstream uses Proof Green, and Blueprint removes glow. The receipt says nodes, links, and maximum hops; it never says blast radius or breakage.+## Do's and Don'ts### Do:- **Do** make the primary path legible before adding secondary relationships or detail.-- **Do** derive every focus, route, story, source link, receipt, and count from authored or locally verified evidence.+- **Do** derive every focus, reachability query, route, story, source link, receipt, and count from authored or locally verified evidence.- **Do** keep ordinary artifacts source-free and make repository evidence explicitly opt-in.- **Do** use 140–200ms transitions for control state and honor `prefers-reduced-motion`.- **Do** preserve keyboard access, visible focus, semantic labels, dark/light parity, and non-color state cues.@@ -223,4 +227,5 @@ An evidence-backed node receives one viewer-only `SRC n` capsule in its upper-ri- **Don't** use dense dashboard shells, endless identical card grids, decorative glass, gradient text, and other AI-generated interface clichés.- **Don't** add vendor-icon catalogues or product-name matching that weaken Archify's portable semantic vocabulary.- **Don't** create another permanent panel when the Semantic Passport, Node Finder, or existing canvas can carry the capability.+- **Don't** call graph reachability runtime impact, blast radius, or breakage without independent code-analysis evidence.- **Don't** change the README Hero as a side effect of artifact or viewer iteration.diff --git a/PRODUCT.md b/PRODUCT.mdindex bb1d56b3..73296649 100644--- a/PRODUCT.md+++ b/PRODUCT.md@@ -26,7 +26,7 @@ Precise, composed, vivid. Archify should feel like a confident technical instrum## Design Principles-1. Truth before spectacle: every focus, route, story, source link, and receipt must derive from authored or verified evidence.+1. Truth before spectacle: every focus, reachability query, route, story, source link, and receipt must derive from authored or verified evidence.2. One spatial narrative first: make the primary path legible before revealing secondary relationships and detail.3. Progressive disclosure over permanent chrome: keep the canvas dominant and reuse focused tools instead of adding panels.4. Motion has one bounded owner: static meaning must remain complete, motion must be finite and reader-controlled, and exports stay clean.diff --git a/README.md b/README.mdindex f5750418..5cb0dfab 100644--- a/README.md+++ b/README.md@@ -15,7 +15,7 @@Archify is an agent skill for Claude, Codex CLI, and opencode. Give it a system description or repository; get a polished diagram you can open, explore, present, and share.- **Open it and present** — five technical diagram types, three visual presets, dark/light themes, and optional finite motion-- **Every interaction stays grounded** — search nodes, optionally open revision-verified source, inspect relationships, trace authored routes, compare roles, and play guided stories without inventing topology+- **Every interaction stays grounded** — search nodes, optionally open revision-verified source, trace upstream/downstream authored reach and exact routes, compare roles, and play guided stories without inventing topology- **One file, ready to trust and share** — typed JSON IR and deterministic checks produce self-contained HTML plus PNG, SVG, WebM, and 1200×630 share cards@@ -51,7 +51,7 @@ The [Proof Lab](https://tt-a1i.github.io/archify/gallery.html) contains all 11 c[](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)-Archify read [`mco-org/mco`](https://github.com/mco-org/mco) at commit `9f1a1cf`, traced its CLI, policy, provider adapters, invocation runtime, and durable sessions, then produced this checked, interactive map. **[Open the live map ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [inspect the typed source](docs/cases/mco-runtime.architecture.json)+Archify read [`mco-org/mco`](https://github.com/mco-org/mco) at commit `9f1a1cf`, traced its CLI, policy, provider adapters, invocation runtime, and durable sessions, then produced this checked, interactive map. **[Open the live map ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [trace Command Router reach ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark#focus=router&reach=downstream) · [inspect the typed source](docs/cases/mco-runtime.architecture.json)## Preview@@ -149,7 +149,7 @@ Architecture examples: [`web-app`](examples/web-app.html) · [`Archify pipeline`- **Typed JSON IR** — every renderer-backed mode has a schema and reproducible source.- **Atomic validation before delivery** — schema, layout, HTML/SVG, route, and label-to-route clearance checks must all pass before a showcase artifact replaces the last known good output.- **Last-good live preview** — an optional desktop loop watches one JSON file, refreshes only after the latest candidate passes every gate, and keeps the previous verified diagram visible when a save is incomplete or invalid.-- **Truthful interaction** — focus, routes, role comparison, and stories reuse authored nodes and relationships instead of inventing topology.+- **Truthful interaction** — focus, upstream/downstream reach, exact routes, role comparison, and stories reuse authored nodes and relationships instead of inventing topology or claiming runtime impact.- **Source evidence, only when requested** — Evidence-backed Architecture nodes mark themselves `SRC n` and open Git-verified files and line ranges pinned to one public commit; ordinary artifacts stay source-free.- **Portable by default** — the result is one HTML file; exports remain full-diagram and free of temporary viewer state.@@ -200,6 +200,7 @@ Omit `animation` for a truly static diagram. `classic` remains the default visua|---|---|| Open the factual Diagram Guide | <kbd>?</kbd> || Find and focus a semantic node | <kbd>/</kbd> |+| Trace upstream/downstream authored reach | Focus a node → `Upstream` / `Downstream` || Probe a directed route and inspect its journey | <kbd>R</kbd> or `PATH` || Compare one or two semantic roles | <kbd>L</kbd> or `LENS` || Open the live overview radar | <kbd>M</kbd> or `MAP` |@@ -208,7 +209,7 @@ Omit `animation` for a truly static diagram. `classic` remains the default visua| Cycle visual style / toggle theme / open Export | <kbd>S</kbd> / <kbd>T</kbd> / <kbd>E</kbd> || Zoom or reset | <kbd>+</kbd> / <kbd>-</kbd> / <kbd>0</kbd> |-Stable links can restore `#focus=<id>`, `#relation=<id>`, `#route=<source>~<target>`, `#lens=<kind>~<kind>`, and `#view=<view-id>`. Reader-driven motion is finite, respects `prefers-reduced-motion`, and never enters canonical exports.+Stable links can restore `#focus=<id>`, `#focus=<id>&reach=upstream|downstream`, `#relation=<id>`, `#route=<source>~<target>`, `#lens=<kind>~<kind>`, and `#view=<view-id>`. Reader-driven motion is finite, respects `prefers-reduced-motion`, and never enters canonical exports.The complete generation and viewer contract lives in [`archify/SKILL.md`](archify/SKILL.md).@@ -231,7 +232,7 @@ The complete generation and viewer contract lives in [`archify/SKILL.md`](archif- [Roadmap](ROADMAP.md)- [Generated Proof Lab](https://tt-a1i.github.io/archify/gallery.html)-Archify 2.12 includes typed IR across all five modes, real-repository proof, verified live preview, optional finite motion, guided views, semantic search and relationship exploration, shareable deep links, 1200×630 diagram and route cards, browser-native WebM recording, and explicit `standard` / `showcase` quality profiles.+Archify 2.12 includes typed IR across all five modes, real-repository proof, verified live preview, authored reachability, optional finite motion, guided views, semantic search and relationship exploration, shareable deep links, 1200×630 diagram and route cards, browser-native WebM recording, and explicit `standard` / `showcase` quality profiles.Automatic Mermaid parsing, general-purpose auto-layout, hosted sharing, and WYSIWYG editing are intentionally outside the current scope.diff --git a/README_EN.md b/README_EN.mdindex f5750418..5cb0dfab 100644--- a/README_EN.md+++ b/README_EN.md@@ -15,7 +15,7 @@Archify is an agent skill for Claude, Codex CLI, and opencode. Give it a system description or repository; get a polished diagram you can open, explore, present, and share.- **Open it and present** — five technical diagram types, three visual presets, dark/light themes, and optional finite motion-- **Every interaction stays grounded** — search nodes, optionally open revision-verified source, inspect relationships, trace authored routes, compare roles, and play guided stories without inventing topology+- **Every interaction stays grounded** — search nodes, optionally open revision-verified source, trace upstream/downstream authored reach and exact routes, compare roles, and play guided stories without inventing topology- **One file, ready to trust and share** — typed JSON IR and deterministic checks produce self-contained HTML plus PNG, SVG, WebM, and 1200×630 share cards@@ -51,7 +51,7 @@ The [Proof Lab](https://tt-a1i.github.io/archify/gallery.html) contains all 11 c[](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)-Archify read [`mco-org/mco`](https://github.com/mco-org/mco) at commit `9f1a1cf`, traced its CLI, policy, provider adapters, invocation runtime, and durable sessions, then produced this checked, interactive map. **[Open the live map ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [inspect the typed source](docs/cases/mco-runtime.architecture.json)+Archify read [`mco-org/mco`](https://github.com/mco-org/mco) at commit `9f1a1cf`, traced its CLI, policy, provider adapters, invocation runtime, and durable sessions, then produced this checked, interactive map. **[Open the live map ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [trace Command Router reach ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark#focus=router&reach=downstream) · [inspect the typed source](docs/cases/mco-runtime.architecture.json)## Preview@@ -149,7 +149,7 @@ Architecture examples: [`web-app`](examples/web-app.html) · [`Archify pipeline`- **Typed JSON IR** — every renderer-backed mode has a schema and reproducible source.- **Atomic validation before delivery** — schema, layout, HTML/SVG, route, and label-to-route clearance checks must all pass before a showcase artifact replaces the last known good output.- **Last-good live preview** — an optional desktop loop watches one JSON file, refreshes only after the latest candidate passes every gate, and keeps the previous verified diagram visible when a save is incomplete or invalid.-- **Truthful interaction** — focus, routes, role comparison, and stories reuse authored nodes and relationships instead of inventing topology.+- **Truthful interaction** — focus, upstream/downstream reach, exact routes, role comparison, and stories reuse authored nodes and relationships instead of inventing topology or claiming runtime impact.- **Source evidence, only when requested** — Evidence-backed Architecture nodes mark themselves `SRC n` and open Git-verified files and line ranges pinned to one public commit; ordinary artifacts stay source-free.- **Portable by default** — the result is one HTML file; exports remain full-diagram and free of temporary viewer state.@@ -200,6 +200,7 @@ Omit `animation` for a truly static diagram. `classic` remains the default visua|---|---|| Open the factual Diagram Guide | <kbd>?</kbd> || Find and focus a semantic node | <kbd>/</kbd> |+| Trace upstream/downstream authored reach | Focus a node → `Upstream` / `Downstream` || Probe a directed route and inspect its journey | <kbd>R</kbd> or `PATH` || Compare one or two semantic roles | <kbd>L</kbd> or `LENS` || Open the live overview radar | <kbd>M</kbd> or `MAP` |@@ -208,7 +209,7 @@ Omit `animation` for a truly static diagram. `classic` remains the default visua| Cycle visual style / toggle theme / open Export | <kbd>S</kbd> / <kbd>T</kbd> / <kbd>E</kbd> || Zoom or reset | <kbd>+</kbd> / <kbd>-</kbd> / <kbd>0</kbd> |-Stable links can restore `#focus=<id>`, `#relation=<id>`, `#route=<source>~<target>`, `#lens=<kind>~<kind>`, and `#view=<view-id>`. Reader-driven motion is finite, respects `prefers-reduced-motion`, and never enters canonical exports.+Stable links can restore `#focus=<id>`, `#focus=<id>&reach=upstream|downstream`, `#relation=<id>`, `#route=<source>~<target>`, `#lens=<kind>~<kind>`, and `#view=<view-id>`. Reader-driven motion is finite, respects `prefers-reduced-motion`, and never enters canonical exports.The complete generation and viewer contract lives in [`archify/SKILL.md`](archify/SKILL.md).@@ -231,7 +232,7 @@ The complete generation and viewer contract lives in [`archify/SKILL.md`](archif- [Roadmap](ROADMAP.md)- [Generated Proof Lab](https://tt-a1i.github.io/archify/gallery.html)-Archify 2.12 includes typed IR across all five modes, real-repository proof, verified live preview, optional finite motion, guided views, semantic search and relationship exploration, shareable deep links, 1200×630 diagram and route cards, browser-native WebM recording, and explicit `standard` / `showcase` quality profiles.+Archify 2.12 includes typed IR across all five modes, real-repository proof, verified live preview, authored reachability, optional finite motion, guided views, semantic search and relationship exploration, shareable deep links, 1200×630 diagram and route cards, browser-native WebM recording, and explicit `standard` / `showcase` quality profiles.Automatic Mermaid parsing, general-purpose auto-layout, hosted sharing, and WYSIWYG editing are intentionally outside the current scope.diff --git a/README_ZH.md b/README_ZH.mdindex ca7b5dd9..d5d27a63 100644--- a/README_ZH.md+++ b/README_ZH.md@@ -11,7 +11,7 @@Archify 是适用于 Claude、Codex CLI 和 opencode 的 Agent Skill。给它一段系统描述或一个代码仓库,就能得到可打开、可探索、可演示、可分享的专业技术图。- **打开就是成品** —— 五种技术图、三套视觉预设、深浅主题,以及显式启用的有限动态-- **每次探索都有依据** —— 搜索节点、按需打开版本校验过的源码、检查关系、追踪作者路径、对比角色、播放故事,但不编造拓扑+- **每次探索都有依据** —— 搜索节点、按需打开版本校验过的源码、追踪作者定义的上下游可达范围与精确路径、对比角色、播放故事,但不编造拓扑- **一个文件即可放心交付** —— Typed JSON IR 和确定性校验生成独立 HTML,并支持 PNG、SVG、WebM 与 1200×630 分享卡片@@ -47,7 +47,7 @@ npx skills add tt-a1i/archify -g[](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)-Archify 读取 [`mco-org/mco`](https://github.com/mco-org/mco) 的 `9f1a1cf` 版本,追踪 CLI、执行策略、Provider Adapter、调用运行时和持久会话,最终生成这张校验通过、可交互的系统地图。**[打开可交互成品 ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [查看 Typed Source](docs/cases/mco-runtime.architecture.json)+Archify 读取 [`mco-org/mco`](https://github.com/mco-org/mco) 的 `9f1a1cf` 版本,追踪 CLI、执行策略、Provider Adapter、调用运行时和持久会话,最终生成这张校验通过、可交互的系统地图。**[打开可交互成品 ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark&present=1#view=dispatch-path)** · [查看 Command Router 下游 ↗](https://tt-a1i.github.io/archify/cases/mco-runtime.architecture.html?theme=dark#focus=router&reach=downstream) · [查看 Typed Source](docs/cases/mco-runtime.architecture.json)## 预览@@ -145,7 +145,7 @@ Architecture 示例:[`Web App`](examples/web-app.html) · [`Archify Pipeline`]- **Typed JSON IR** —— 每种 Renderer 模式都有 Schema 和可复现的源文件。- **原子交付前校验** —— Schema、布局、HTML/SVG、线路和标签到其他路径的净空检查必须全部通过,Showcase 成品才会替换上一份可信结果。- **保留最后好图的实时预览** —— 可选桌面循环只监听一个 JSON;只有最新候选通过全部门禁才刷新,半写入或无效保存时继续显示上一份验证成品。-- **交互不编造拓扑** —— 聚焦、路径、角色对比和故事都复用作者定义的节点与关系。+- **交互不编造拓扑** —— 聚焦、上下游可达范围、精确路径、角色对比和故事都复用作者定义的节点与关系,也不把图上可达误报成真实运行时影响。- **只在需要时附源码证据** —— 有证据的 Architecture 节点会显示 `SRC n`,并可打开由 Git 校验、固定到公开 commit 的文件与行号;普通成品不携带源码信息。- **结果默认便携** —— 一个 HTML 文件即可分享;导出永远是完整原图,不携带临时 Viewer 状态。@@ -196,6 +196,7 @@ node bin/archify.mjs deliver workflow examples/agent-tool-call.workflow.json /tm|---|---|| 打开事实型 Diagram Guide | <kbd>?</kbd> || 查找并聚焦语义节点 | <kbd>/</kbd> |+| 追踪作者定义的上游 / 下游可达范围 | 聚焦节点 → `Upstream` / `Downstream` || 探查有向路径并逐站检查 | <kbd>R</kbd> 或 `PATH` || 对比一种或两种语义角色 | <kbd>L</kbd> 或 `LENS` || 打开实时全局雷达 | <kbd>M</kbd> 或 `MAP` |@@ -204,7 +205,7 @@ node bin/archify.mjs deliver workflow examples/agent-tool-call.workflow.json /tm| 切换视觉风格 / 主题 / 打开 Export | <kbd>S</kbd> / <kbd>T</kbd> / <kbd>E</kbd> || 缩放或复位 | <kbd>+</kbd> / <kbd>-</kbd> / <kbd>0</kbd> |-稳定链接可以恢复 `#focus=<id>`、`#relation=<id>`、`#route=<source>~<target>`、`#lens=<kind>~<kind>` 和 `#view=<view-id>`。读者触发的动态有限运行、遵守 `prefers-reduced-motion`,并且不会进入标准导出。+稳定链接可以恢复 `#focus=<id>`、`#focus=<id>&reach=upstream|downstream`、`#relation=<id>`、`#route=<source>~<target>`、`#lens=<kind>~<kind>` 和 `#view=<view-id>`。读者触发的动态有限运行、遵守 `prefers-reduced-motion`,并且不会进入标准导出。完整生成与 Viewer 契约请查看 [`archify/SKILL.md`](archify/SKILL.md)。@@ -231,7 +232,7 @@ Claude.ai 中的上传入口:- [路线图](ROADMAP.md)- [自动生成的 Proof Lab](https://tt-a1i.github.io/archify/gallery.html)-Archify 2.12 已覆盖五种 Typed IR、真实仓库证明、验证后实时预览、可选有限动态、引导视图、语义搜索与关系探索、可分享深链、1200×630 整图与路径卡片、浏览器原生 WebM,以及显式 `standard` / `showcase` 质量档位。+Archify 2.12 已覆盖五种 Typed IR、真实仓库证明、验证后实时预览、作者可达性、可选有限动态、引导视图、语义搜索与关系探索、可分享深链、1200×630 整图与路径卡片、浏览器原生 WebM,以及显式 `standard` / `showcase` 质量档位。自动 Mermaid Parser、通用自动布局、托管分享服务和 WYSIWYG 编辑器目前都不在产品范围内。diff --git a/archify.zip b/archify.zipindex 1fc1006a..137464ba 100644Binary files a/archify.zip and b/archify.zip differdiff --git a/archify/SKILL.md b/archify/SKILL.mdindex be06b05f..513cd9e7 100644--- a/archify/SKILL.md+++ b/archify/SKILL.md@@ -130,6 +130,8 @@ Press <kbd>?</kbd> or use the question-mark control to open Diagram Guide. It muPress <kbd>/</kbd> or use the diagram's finder control to search any rendered node by label, responsibility sublabel, structural context, authored tag, semantic kind, or stable ID. Results report that same context plus relationship count; selecting one exits a guided view, resets the viewport, reveals the node on a contained mobile diagram, and enters the existing `#focus=<id>` one-hop view. While Route Probe is choosing an endpoint, the same control becomes a contextual route picker instead: source results include only nodes with a real authored outgoing route, destination results include only nodes reachable from the current source, and each destination previews its shortest directed hop count. Escape closes Finder while preserving the route question. Single-node focus opens Semantic Passport above Relationship Lens: it must show kind, sublabel, structural context, optional tag, and stable ID from renderer-owned SVG attributes, plus a dependency-free `Copy link` action for the existing focus URL. On narrow screens, keep the relationship list collapsed behind its exact count and place the compact Passport above or below the selected node; following a relationship collapses the next Passport again. Architecture context comes from authored boundary `wraps`; workflow context from lane/group/phase; sequence context from participant role; data-flow context from stage; lifecycle context from lane. Never infer scope from pixel proximity. Finder and Passport require no new input fields and must never be hand-authored as viewer markup in JSON IR.+Semantic Passport also exposes **Authored Reach** for its focused node. `Upstream` walks only incoming `data-edge-from` → `data-edge-to` relationships; `Downstream` walks only outgoing relationships. Use deterministic unweighted BFS in authored DOM edge order, deduplicate relationship fragments by stable edge key, assign minimum hop depth, terminate cycles, and report reachable node count, exact in-scope relationship count, and maximum hop depth. The result may be called upstream/downstream authored reachability, never blast radius, breakage, runtime causality, or repository impact. Keep the focused origin and every reachable authored node/relationship readable while unrelated topology recedes; do not move geometry, clone paths, or add motion. The two native buttons are keyboard-accessible, disabled honestly at zero reach, toggle off on repeated activation, and restore from `#focus=<id>&reach=upstream|downstream`; the existing Copy link includes the active direction. A new focus, clear, relation follow, route, lens, or story takeover removes the state deterministically. Classic, Signal Flow, Blueprint, dark, and light preserve the same semantics; Blueprint has no glow. Print and canonical SVG/raster/Share Card/WebM export remove all reach attributes. Add no schema, IR, renderer layout, parser, inferred edge, dependency, hosted runtime, permanent panel, toolbar control, or dedicated mobile surface.+Relationship Lens rows are the accessible target for exact-edge Relationship Preview. On one true fine-pointer entry or keyboard `focusin`, resolve exactly one stable `data-edge-key`, preserve authored source-to-target direction even for incoming rows, and clone only its path/line/polyline geometry into one marker-free, pointer-free, `aria-hidden` overlay with `pathLength="1"`. Play one 1.2-second pass and carry exactly one compact semantic token along the same geometry: security edge/endpoint evidence wins, then dashed/message-bus event evidence, database data evidence, waiting/success lifecycle state evidence, and otherwise a call cue. Use only compiled variants and renderer-owned stable kinds—never labels, product names, or geometry. Then remove the complete overlay while leaving the exact original edge plus source/target emphasis readable. A parked pointer or focus must not loop or restart from child bubbling; row re-entry or re-focus may replay. Narrow screens reuse the contained fallback and are not a dedicated product surface. Replacement, preview exit, Focus clear, Escape, stronger viewer ownership, page hiding, `animationend`, `animationcancel`, and a live switch to reduced motion must leave zero overlays. Classic, Signal Flow, and Blueprint may style the signal differently without changing timing or geometry; Blueprint has no glow. Never add replay controls, nested row actions, timers, schema/IR fields, renderer layout, dependencies, or motion to embed, print, canonical SVG, or raster export.Press <kbd>M</kbd> or use the `MAP` control to open Semantic Radar. It must derive a simplified, type-colored overview from each rendered node's stable ID, `data-node-kind`, and runtime `getBBox()`; never clone the canonical SVG or add radar fields to JSON IR. Its viewport rectangle follows desktop transform zoom/pan and contained mobile horizontal scroll. Radar node click/Enter/Space delegates to the same semantic focus and camera, while background drag/click and Arrow keys recenter the current view. The open radar docks only while the diagram intersects the window, chooses the opposite horizontal side from the focused node, and searches for a vertical slot that avoids the node and visible Passport when space permits. On contained mobile diagrams, report the actual visible width rather than claiming a zoom percentage. Escape closes the radar before clearing focus. Keep the radar out of embed, print, static HTML SVG counts, and canonical exports by constructing its small SVG at runtime.diff --git a/archify/assets/template.html b/archify/assets/template.htmlindex 5710ea01..bfae4118 100644--- a/archify/assets/template.html+++ b/archify/assets/template.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4242,6 +4343,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4641,6 +4754,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4732,6 +4846,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4778,6 +4897,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4798,7 +4918,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6098,6 +6218,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6111,6 +6237,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6124,6 +6252,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6731,6 +7031,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6827,6 +7128,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6858,6 +7160,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -6967,7 +7274,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7007,6 +7314,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7094,11 +7403,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7111,6 +7426,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7118,6 +7435,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/archify/test/authored-reachability.test.mjs b/archify/test/authored-reachability.test.mjsnew file mode 100644index 00000000..6aced775--- /dev/null+++ b/archify/test/authored-reachability.test.mjs@@ -0,0 +1,95 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import { execFileSync } from 'node:child_process';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import vm from 'node:vm';+import { fileURLToPath } from 'node:url';++const __dirname = path.dirname(fileURLToPath(import.meta.url));+const skillRoot = path.resolve(__dirname, '..');+const template = fs.readFileSync(path.join(skillRoot, 'assets/template.html'), 'utf8');+const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-authored-reach-'));++const CASES = {+ architecture: 'web-app.architecture.json',+ workflow: 'agent-tool-call.workflow.json',+ sequence: 'cache-miss-request.sequence.json',+ dataflow: 'product-analytics.dataflow.json',+ lifecycle: 'agent-run.lifecycle.json',+};++function render(mode, example) {+ const output = path.join(tmp, `${mode}.html`);+ execFileSync(process.execPath, [+ path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),+ path.join(skillRoot, 'examples', example),+ output,+ ]);+ return fs.readFileSync(output, 'utf8');+}++function canonicalSvg(html) {+ return html.match(/<svg\b[\s\S]*?<\/svg>/)?.[0] || '';+}++function reachabilityFunction() {+ const start = template.indexOf('function computeReachability(');+ const end = template.indexOf('\n function reachabilityFor(', start);+ assert.ok(start >= 0 && end > start, 'template exposes one extractable reachability function');+ return vm.runInNewContext(`(${template.slice(start, end)})`);+}++test('authored reachability is available in every typed artifact without entering canonical SVG', () => {+ for (const [mode, example] of Object.entries(CASES)) {+ const html = render(mode, example);+ assert.match(html, /id="focus-reach" hidden/);+ assert.match(html, /id="btn-reach-upstream"[^>]+aria-pressed="false"/);+ assert.match(html, /id="btn-reach-downstream"[^>]+aria-pressed="false"/);+ assert.match(html, /function computeReachability\(originId, direction, relationships\)/);+ assert.match(html, /svg\.setAttribute\('data-reach-active', direction\)/);+ assert.doesNotMatch(canonicalSvg(html), /data-reach-(?:active|match|origin|depth)/, mode);+ }+});++test('reachability uses stable breadth-first depth, supports cycles, and deduplicates edge fragments', () => {+ const compute = reachabilityFunction();+ const relationships = [+ { key: 'a-b', from: 'a', to: 'b' },+ { key: 'a-c', from: 'a', to: 'c' },+ { key: 'b-d', from: 'b', to: 'd' },+ { key: 'c-d', from: 'c', to: 'd' },+ { key: 'd-b', from: 'd', to: 'b' },+ { key: 'x-a', from: 'x', to: 'a' },+ { key: 'a-b', from: 'a', to: 'b' },+ ];++ const downstream = compute('a', 'downstream', relationships);+ assert.deepEqual(Array.from(downstream.nodeIds), ['a', 'b', 'c', 'd']);+ assert.deepEqual({ ...downstream.depths }, { a: 0, b: 1, c: 1, d: 2 });+ assert.deepEqual(Array.from(downstream.edgeKeys), ['a-b', 'a-c', 'b-d', 'c-d', 'd-b']);+ assert.equal(downstream.maxDepth, 2);++ const upstream = compute('d', 'upstream', relationships);+ assert.deepEqual(Array.from(upstream.nodeIds), ['d', 'b', 'c', 'a', 'x']);+ assert.deepEqual({ ...upstream.depths }, { d: 0, b: 1, c: 1, a: 2, x: 3 });+ assert.equal(upstream.maxDepth, 3);+ assert.equal(compute('a', 'sideways', relationships), null);+});++test('reachability stays explicit, deep-linkable, keyboard reachable, and export-clean', () => {+ assert.match(template, /Authored Reachability is a bounded graph query over the relationships/);+ assert.match(template, /direction !== 'upstream' && direction !== 'downstream'/);+ assert.match(template, /encodeURIComponent\(activeIds\[0\]\) \+ '&reach=' \+ direction/);+ assert.match(template, /applyReachability\(reach, \{ updateUrl: false, toggle: false, reveal: false \}\)/);+ assert.match(template, /upstreamBtn\.addEventListener\('click'/);+ assert.match(template, /downstreamBtn\.addEventListener\('click'/);+ assert.match(template, /clone\.removeAttribute\('data-reach-active'\)/);+ assert.match(template, /clone\.querySelectorAll\('\[data-reach-match\], \[data-reach-origin\], \[data-reach-depth\]'/);+ assert.match(template, /!clone\.hasAttribute\('data-reach-active'\)/);+ assert.match(template, /svg\[data-preset="blueprint"\]\[data-reach-active\]/);+ assert.match(template, /\.diagram-container svg\[data-reach-active\] \[data-node-id\]/);+});++process.on('exit', () => fs.rmSync(tmp, { recursive: true, force: true }));diff --git a/docs/assets/archify-live-proof.gif b/docs/assets/archify-live-proof.gifindex 7c31ff71..874fed83 100644Binary files a/docs/assets/archify-live-proof.gif and b/docs/assets/archify-live-proof.gif differdiff --git a/docs/assets/archify-live-proof.json b/docs/assets/archify-live-proof.jsonindex d12281ec..ff942c9e 100644--- a/docs/assets/archify-live-proof.json+++ b/docs/assets/archify-live-proof.json@@ -7,13 +7,13 @@"fps": 10,"frameCount": 54,"durationSeconds": 5.4,- "bytes": 1668403,- "sha256": "c55bda4ba0f16411870fea6283035d587555cfc840b1a82fe6f4b1132e898bdf",+ "bytes": 1561913,+ "sha256": "1eeb1ed82050b46900c5745b2c4b65a1d807c90702bc12b7d9577f57dc95c607","scenes": [{"id": "signal-flow","artifact": "docs/gallery/artifacts/agent-tool-call.workflow.html",- "artifactSha256": "a0c85d9d7a56aa8130d8f82ef1c4628b3301f924c6e7eb5432b3c3cbb7b54208",+ "artifactSha256": "28dfc2548c4deb616a6ca294118970848a238725eb523e5823553ab838322568","view": "happy-path","eyebrow": "WORKFLOW · SIGNAL FLOW","title": "Agent Tool Call",@@ -22,7 +22,7 @@{"id": "blueprint","artifact": "docs/gallery/artifacts/production-deployment.architecture.html",- "artifactSha256": "3e5b0bcf76f245fae1cb2625ff3ab804fececfb5f547ba8381b64c48372b1965",+ "artifactSha256": "5fddc4add98c66570dbe078632f45bdd8f3845b0413567696fe0ec55966bba03","view": "request-boundary","eyebrow": "ARCHITECTURE · BLUEPRINT","title": "Production Deployment",@@ -31,7 +31,7 @@{"id": "classic","artifact": "docs/gallery/artifacts/cache-miss.sequence.html",- "artifactSha256": "9511315ce2f30c98f8f8d623f7ae43921805a3e0fa0ebc2ccb1bb8f01b081cf4",+ "artifactSha256": "866273ba5df085d700a0fb60eca46d2f2bdef6baabbe40881934c1cd738084b2","view": "cache-fallback","eyebrow": "SEQUENCE · CLASSIC","title": "Cache Miss Request",diff --git a/docs/cases/mco-runtime.architecture.html b/docs/cases/mco-runtime.architecture.htmlindex 1ba8961e..65800f37 100644--- a/docs/cases/mco-runtime.architecture.html+++ b/docs/cases/mco-runtime.architecture.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4365,6 +4466,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4760,6 +4873,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4851,6 +4965,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4897,6 +5016,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4917,7 +5037,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6217,6 +6337,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6230,6 +6356,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6243,6 +6371,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6850,6 +7150,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6946,6 +7247,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6977,6 +7279,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7086,7 +7393,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7126,6 +7433,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7213,11 +7522,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7230,6 +7545,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7237,6 +7554,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery.html b/docs/gallery.htmlindex 023946e7..338f8b90 100644--- a/docs/gallery.html+++ b/docs/gallery.html@@ -324,7 +324,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 11E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="a0c85d9d7a56aa8130d8f82ef1c4628b3301f924c6e7eb5432b3c3cbb7b54208">a0c85d9d7a56</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="28dfc2548c4deb616a6ca294118970848a238725eb523e5823553ab838322568">28dfc2548c4d</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/agent-tool-call.workflow.html?present=1&play=1#view=happy-path" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -352,7 +352,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="3e5b0bcf76f245fae1cb2625ff3ab804fececfb5f547ba8381b64c48372b1965">3e5b0bcf76f2</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="5fddc4add98c66570dbe078632f45bdd8f3845b0413567696fe0ec55966bba03">5fddc4add98c</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/production-deployment.architecture.html?present=1&play=1#view=request-boundary" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -380,7 +380,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 12E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="9511315ce2f30c98f8f8d623f7ae43921805a3e0fa0ebc2ccb1bb8f01b081cf4">9511315ce2f3</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="866273ba5df085d700a0fb60eca46d2f2bdef6baabbe40881934c1cd738084b2">866273ba5df0</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/cache-miss.sequence.html?present=1&play=1#view=cache-fallback" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -408,7 +408,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="7de8dbf1ef4217b9969626f6e37436aa0d2a32eaecd521bbebe780f8566d2fbc">7de8dbf1ef42</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="82953127f8e08578f0c7ea95fdacc35b02724d7654c929ec497d5d04a16440aa">82953127f8e0</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/release-delivery.workflow.html?present=1&play=1#view=approval-to-production" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -436,7 +436,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 10E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="2be75c459e515344c6d5eebe05d57b3ea8d8121da5112fc6a6110cf70569f547">2be75c459e51</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="ed9e9ee06749fd6db186c8ba50fe15af8d44513a8d075a3a176dba1ab7943e5f">ed9e9ee06749</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/incident-response.workflow.html?present=1&play=1#view=mitigate-and-verify" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -464,7 +464,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="2af52c428001e1fa8e3e36e553f277f8a13a24a5984885821ed6e1fdf1e8527c">2af52c428001</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="3980da8686d93c82ef3b1e4e5182c8bdec69dfafea2fd6ed50ddb4597f14013e">3980da8686d9</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/product-analytics.dataflow.html?present=1&play=1#view=consent-boundary" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -492,7 +492,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 14E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="c3f62087c1d9fd9945982135b17703dba6694f36a687cf089ad4db36519787de">c3f62087c1d9</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="39af2a4cf178dd720b85b10d36f7346b66a7071d14fd433e23b5a442c180f547">39af2a4cf178</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/async-job-roundtrip.sequence.html?present=1&play=1#view=work-and-retry" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -520,7 +520,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="249e0601daf48fc982ca8aea9fcd6101f70b77219cf8127430db923d91cc9352">249e0601daf4</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="e992bd9969c629c76c3fc4ab52927d7e5fc52f550701daad3e3027a83e935121">e992bd9969c6</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/event-stream.dataflow.html?present=1&play=1#view=order-transit" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -548,7 +548,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 5E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="61e60dd71a87d4163ad748bc9b00964020d228eda58a2477d2aa6e703e79ef09">61e60dd71a87</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="59cc573056710b27b5502882cd8ff8fd0805c69481d74031dd090411275c52bd">59cc57305671</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/agent-run.lifecycle.html?present=1&play=1#view=main-lifecycle" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -576,7 +576,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 6E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="f8157bb810c1db38a6b4332fb729cb79536f052b7a292406eda5a33b178bb1a6">f8157bb810c1</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="544b85f7604643e37ec2b1722b471060bab7a7ad7a49c1b70e5f5f5f95492e5c">544b85f76046</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/deployment-release.lifecycle.html?present=1&play=1#view=rollback-outcomes" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -604,7 +604,7 @@<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div><div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div><div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 9E</span></div>- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="c5bb6ea2542526eef2c95276b9ebd87ca8412704bb2c1390b2b424fdea649bcc">c5bb6ea25425</span></div>+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="d076d42b4ce4f9d3ef60fecef030c9227c188fc084d0c510f0542d7a0a2ff423">d076d42b4ce4</span></div></div><div class="card-actions"><a class="card-link primary" href="gallery/artifacts/web-app.architecture.html?present=1&play=1#view=request-path" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>@@ -681,8 +681,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "trace","nodeCount": 12,"edgeCount": 11,- "artifactBytes": 567304,- "artifactSha256": "a0c85d9d7a56aa8130d8f82ef1c4628b3301f924c6e7eb5432b3c3cbb7b54208",+ "artifactBytes": 583130,+ "artifactSha256": "28dfc2548c4deb616a6ca294118970848a238725eb523e5823553ab838322568","sourceBytes": 6470,"sourceSha256": "a3afc6b30044eb256aa15c6195ddfbbcd1a14880d99967ed5605bc621ffb7e5f","checks": [@@ -778,8 +778,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "trace","nodeCount": 12,"edgeCount": 12,- "artifactBytes": 566460,- "artifactSha256": "3e5b0bcf76f245fae1cb2625ff3ab804fececfb5f547ba8381b64c48372b1965",+ "artifactBytes": 582286,+ "artifactSha256": "5fddc4add98c66570dbe078632f45bdd8f3845b0413567696fe0ec55966bba03","sourceBytes": 5308,"sourceSha256": "c3c4ddc8fd8910d8d2bcf2ba97434017d6fa347eb4ee436d2fb519dd0f27c814","checks": [@@ -875,8 +875,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "trace","nodeCount": 7,"edgeCount": 12,- "artifactBytes": 560951,- "artifactSha256": "9511315ce2f30c98f8f8d623f7ae43921805a3e0fa0ebc2ccb1bb8f01b081cf4",+ "artifactBytes": 576777,+ "artifactSha256": "866273ba5df085d700a0fb60eca46d2f2bdef6baabbe40881934c1cd738084b2","sourceBytes": 4442,"sourceSha256": "30098d81006a18813bab447da698edf74604a1463770f01dc056b0af8cb314ef","checks": [@@ -972,8 +972,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "trace","nodeCount": 10,"edgeCount": 10,- "artifactBytes": 563570,- "artifactSha256": "7de8dbf1ef4217b9969626f6e37436aa0d2a32eaecd521bbebe780f8566d2fbc",+ "artifactBytes": 579396,+ "artifactSha256": "82953127f8e08578f0c7ea95fdacc35b02724d7654c929ec497d5d04a16440aa","sourceBytes": 5256,"sourceSha256": "44aa56ac6ca807937dfe84a6404e8b07d6394a38ae2ac53248a1985337dfd671","checks": [@@ -1069,8 +1069,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "trace","nodeCount": 11,"edgeCount": 10,- "artifactBytes": 563428,- "artifactSha256": "2be75c459e515344c6d5eebe05d57b3ea8d8121da5112fc6a6110cf70569f547",+ "artifactBytes": 579254,+ "artifactSha256": "ed9e9ee06749fd6db186c8ba50fe15af8d44513a8d075a3a176dba1ab7943e5f","sourceBytes": 5471,"sourceSha256": "9beb8698b275679a2fc92d4b51288cd5b5fc2115696d06b9168f3d7fef253a72","checks": [@@ -1166,8 +1166,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "trace","nodeCount": 10,"edgeCount": 10,- "artifactBytes": 564961,- "artifactSha256": "2af52c428001e1fa8e3e36e553f277f8a13a24a5984885821ed6e1fdf1e8527c",+ "artifactBytes": 580787,+ "artifactSha256": "3980da8686d93c82ef3b1e4e5182c8bdec69dfafea2fd6ed50ddb4597f14013e","sourceBytes": 5719,"sourceSha256": "f71c89288f80255bdedcdc0057bcbc155d1d8b1b7476d024b35f4e27c730c974","checks": [@@ -1263,8 +1263,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "trace","nodeCount": 7,"edgeCount": 14,- "artifactBytes": 561736,- "artifactSha256": "c3f62087c1d9fd9945982135b17703dba6694f36a687cf089ad4db36519787de",+ "artifactBytes": 577562,+ "artifactSha256": "39af2a4cf178dd720b85b10d36f7346b66a7071d14fd433e23b5a442c180f547","sourceBytes": 4483,"sourceSha256": "1b53d7c4ce7b2d8f6f40b8f33a394abe1d37fc991272b534c1ccd0255920ab52","checks": [@@ -1360,8 +1360,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "trace","nodeCount": 12,"edgeCount": 12,- "artifactBytes": 568916,- "artifactSha256": "249e0601daf48fc982ca8aea9fcd6101f70b77219cf8127430db923d91cc9352",+ "artifactBytes": 584742,+ "artifactSha256": "e992bd9969c629c76c3fc4ab52927d7e5fc52f550701daad3e3027a83e935121","sourceBytes": 5543,"sourceSha256": "bbfedc2f1b73bf50932490f7f56d45d5f853e970d2fab26660a04947a783969c","checks": [@@ -1457,8 +1457,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "trace","nodeCount": 10,"edgeCount": 5,- "artifactBytes": 557906,- "artifactSha256": "61e60dd71a87d4163ad748bc9b00964020d228eda58a2477d2aa6e703e79ef09",+ "artifactBytes": 573732,+ "artifactSha256": "59cc573056710b27b5502882cd8ff8fd0805c69481d74031dd090411275c52bd","sourceBytes": 4353,"sourceSha256": "1d6b34282e014cb2730662b1993158ec67bc0ad2a40520cb441aaee1ad21e4c6","checks": [@@ -1554,8 +1554,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "trace","nodeCount": 11,"edgeCount": 6,- "artifactBytes": 559283,- "artifactSha256": "f8157bb810c1db38a6b4332fb729cb79536f052b7a292406eda5a33b178bb1a6",+ "artifactBytes": 575109,+ "artifactSha256": "544b85f7604643e37ec2b1722b471060bab7a7ad7a49c1b70e5f5f5f95492e5c","sourceBytes": 4394,"sourceSha256": "aa614f0c9a82f210e301e382f362dfbd7f290bda4d5501de3c99a6cd81b4c0a4","checks": [@@ -1651,8 +1651,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>"animation": "static","nodeCount": 10,"edgeCount": 9,- "artifactBytes": 558915,- "artifactSha256": "c5bb6ea2542526eef2c95276b9ebd87ca8412704bb2c1390b2b424fdea649bcc",+ "artifactBytes": 574741,+ "artifactSha256": "d076d42b4ce4f9d3ef60fecef030c9227c188fc084d0c510f0542d7a0a2ff423","sourceBytes": 3863,"sourceSha256": "01567b5e49cad5139baa071533a028d22f0e80fedfb49095e0d9330aee7f87db","checks": [diff --git a/docs/gallery/artifacts/agent-run.lifecycle.html b/docs/gallery/artifacts/agent-run.lifecycle.htmlindex cd7b0928..ed786452 100644--- a/docs/gallery/artifacts/agent-run.lifecycle.html+++ b/docs/gallery/artifacts/agent-run.lifecycle.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4297,6 +4398,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4692,6 +4805,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4783,6 +4897,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4829,6 +4948,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4849,7 +4969,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6149,6 +6269,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6162,6 +6288,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6175,6 +6303,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6782,6 +7082,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6878,6 +7179,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6909,6 +7211,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7018,7 +7325,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7058,6 +7365,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7145,11 +7454,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7162,6 +7477,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7169,6 +7486,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/artifacts/agent-tool-call.workflow.html b/docs/gallery/artifacts/agent-tool-call.workflow.htmlindex 3e02861b..6ba6f683 100644--- a/docs/gallery/artifacts/agent-tool-call.workflow.html+++ b/docs/gallery/artifacts/agent-tool-call.workflow.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4374,6 +4475,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4772,6 +4885,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4863,6 +4977,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4909,6 +5028,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4929,7 +5049,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6229,6 +6349,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6242,6 +6368,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6255,6 +6383,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6862,6 +7162,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6958,6 +7259,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6989,6 +7291,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7098,7 +7405,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7138,6 +7445,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7225,11 +7534,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7242,6 +7557,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7249,6 +7566,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/artifacts/async-job-roundtrip.sequence.html b/docs/gallery/artifacts/async-job-roundtrip.sequence.htmlindex a509220d..8683fe12 100644--- a/docs/gallery/artifacts/async-job-roundtrip.sequence.html+++ b/docs/gallery/artifacts/async-job-roundtrip.sequence.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4364,6 +4465,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4759,6 +4872,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4850,6 +4964,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4896,6 +5015,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4916,7 +5036,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6216,6 +6336,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6229,6 +6355,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6242,6 +6370,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6849,6 +7149,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6945,6 +7246,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6976,6 +7278,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7085,7 +7392,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7125,6 +7432,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7212,11 +7521,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7229,6 +7544,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7236,6 +7553,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/artifacts/cache-miss.sequence.html b/docs/gallery/artifacts/cache-miss.sequence.htmlindex 22440599..5923172b 100644--- a/docs/gallery/artifacts/cache-miss.sequence.html+++ b/docs/gallery/artifacts/cache-miss.sequence.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4348,6 +4449,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4743,6 +4856,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4834,6 +4948,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4880,6 +4999,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4900,7 +5020,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6200,6 +6320,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6213,6 +6339,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6226,6 +6354,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6833,6 +7133,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6929,6 +7230,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6960,6 +7262,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7069,7 +7376,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7109,6 +7416,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7196,11 +7505,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7213,6 +7528,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7220,6 +7537,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/artifacts/deployment-release.lifecycle.html b/docs/gallery/artifacts/deployment-release.lifecycle.htmlindex e8c2b331..c47424c6 100644--- a/docs/gallery/artifacts/deployment-release.lifecycle.html+++ b/docs/gallery/artifacts/deployment-release.lifecycle.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4311,6 +4412,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4706,6 +4819,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4797,6 +4911,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4843,6 +4962,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4863,7 +4983,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6163,6 +6283,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6176,6 +6302,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6189,6 +6317,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6796,6 +7096,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6892,6 +7193,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6923,6 +7225,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7032,7 +7339,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7072,6 +7379,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7159,11 +7468,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7176,6 +7491,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7183,6 +7500,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/artifacts/event-stream.dataflow.html b/docs/gallery/artifacts/event-stream.dataflow.htmlindex 9c5a52cc..ae964140 100644--- a/docs/gallery/artifacts/event-stream.dataflow.html+++ b/docs/gallery/artifacts/event-stream.dataflow.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4383,6 +4484,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4778,6 +4891,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4869,6 +4983,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4915,6 +5034,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4935,7 +5055,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6235,6 +6355,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6248,6 +6374,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6261,6 +6389,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6868,6 +7168,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6964,6 +7265,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6995,6 +7297,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7104,7 +7411,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7144,6 +7451,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7231,11 +7540,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7248,6 +7563,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7255,6 +7572,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/artifacts/incident-response.workflow.html b/docs/gallery/artifacts/incident-response.workflow.htmlindex 67b4e832..f57119c8 100644--- a/docs/gallery/artifacts/incident-response.workflow.html+++ b/docs/gallery/artifacts/incident-response.workflow.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4346,6 +4447,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4741,6 +4854,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4832,6 +4946,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4878,6 +4997,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4898,7 +5018,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6198,6 +6318,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6211,6 +6337,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6224,6 +6352,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6831,6 +7131,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6927,6 +7228,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6958,6 +7260,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7067,7 +7374,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7107,6 +7414,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7194,11 +7503,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7211,6 +7526,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7218,6 +7535,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/artifacts/product-analytics.dataflow.html b/docs/gallery/artifacts/product-analytics.dataflow.htmlindex b9ac8362..c0623dc6 100644--- a/docs/gallery/artifacts/product-analytics.dataflow.html+++ b/docs/gallery/artifacts/product-analytics.dataflow.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4344,6 +4445,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4739,6 +4852,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4830,6 +4944,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4876,6 +4995,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4896,7 +5016,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6196,6 +6316,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6209,6 +6335,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6222,6 +6350,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6829,6 +7129,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6925,6 +7226,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6956,6 +7258,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7065,7 +7372,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7105,6 +7412,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7192,11 +7501,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7209,6 +7524,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7216,6 +7533,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/artifacts/production-deployment.architecture.html b/docs/gallery/artifacts/production-deployment.architecture.htmlindex e991bba4..6f09fcd8 100644--- a/docs/gallery/artifacts/production-deployment.architecture.html+++ b/docs/gallery/artifacts/production-deployment.architecture.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4363,6 +4464,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4758,6 +4871,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4849,6 +4963,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4895,6 +5014,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4915,7 +5035,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6215,6 +6335,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6228,6 +6354,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6241,6 +6369,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6848,6 +7148,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6944,6 +7245,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6975,6 +7277,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7084,7 +7391,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7124,6 +7431,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7211,11 +7520,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7228,6 +7543,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7235,6 +7552,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/artifacts/release-delivery.workflow.html b/docs/gallery/artifacts/release-delivery.workflow.htmlindex 541b0955..961e031e 100644--- a/docs/gallery/artifacts/release-delivery.workflow.html+++ b/docs/gallery/artifacts/release-delivery.workflow.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4346,6 +4447,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4741,6 +4854,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4832,6 +4946,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4878,6 +4997,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4898,7 +5018,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6198,6 +6318,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6211,6 +6337,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6224,6 +6352,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6831,6 +7131,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6927,6 +7228,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6958,6 +7260,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7067,7 +7374,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7107,6 +7414,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7194,11 +7503,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7211,6 +7526,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7218,6 +7535,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/artifacts/web-app.architecture.html b/docs/gallery/artifacts/web-app.architecture.htmlindex ec7dc59c..586fea28 100644--- a/docs/gallery/artifacts/web-app.architecture.html+++ b/docs/gallery/artifacts/web-app.architecture.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4315,6 +4416,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4708,6 +4821,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4799,6 +4913,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4845,6 +4964,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4865,7 +4985,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6165,6 +6285,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6178,6 +6304,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6191,6 +6319,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6798,6 +7098,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6894,6 +7195,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6925,6 +7227,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7034,7 +7341,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7074,6 +7381,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7161,11 +7470,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7178,6 +7493,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7185,6 +7502,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/docs/gallery/manifest.json b/docs/gallery/manifest.jsonindex 82e4039e..d853e0e6 100644--- a/docs/gallery/manifest.json+++ b/docs/gallery/manifest.json@@ -26,8 +26,8 @@"animation": "trace","nodeCount": 12,"edgeCount": 11,- "artifactBytes": 567304,- "artifactSha256": "a0c85d9d7a56aa8130d8f82ef1c4628b3301f924c6e7eb5432b3c3cbb7b54208",+ "artifactBytes": 583130,+ "artifactSha256": "28dfc2548c4deb616a6ca294118970848a238725eb523e5823553ab838322568","sourceBytes": 6470,"sourceSha256": "a3afc6b30044eb256aa15c6195ddfbbcd1a14880d99967ed5605bc621ffb7e5f","checks": [@@ -123,8 +123,8 @@"animation": "trace","nodeCount": 12,"edgeCount": 12,- "artifactBytes": 566460,- "artifactSha256": "3e5b0bcf76f245fae1cb2625ff3ab804fececfb5f547ba8381b64c48372b1965",+ "artifactBytes": 582286,+ "artifactSha256": "5fddc4add98c66570dbe078632f45bdd8f3845b0413567696fe0ec55966bba03","sourceBytes": 5308,"sourceSha256": "c3c4ddc8fd8910d8d2bcf2ba97434017d6fa347eb4ee436d2fb519dd0f27c814","checks": [@@ -220,8 +220,8 @@"animation": "trace","nodeCount": 7,"edgeCount": 12,- "artifactBytes": 560951,- "artifactSha256": "9511315ce2f30c98f8f8d623f7ae43921805a3e0fa0ebc2ccb1bb8f01b081cf4",+ "artifactBytes": 576777,+ "artifactSha256": "866273ba5df085d700a0fb60eca46d2f2bdef6baabbe40881934c1cd738084b2","sourceBytes": 4442,"sourceSha256": "30098d81006a18813bab447da698edf74604a1463770f01dc056b0af8cb314ef","checks": [@@ -317,8 +317,8 @@"animation": "trace","nodeCount": 10,"edgeCount": 10,- "artifactBytes": 563570,- "artifactSha256": "7de8dbf1ef4217b9969626f6e37436aa0d2a32eaecd521bbebe780f8566d2fbc",+ "artifactBytes": 579396,+ "artifactSha256": "82953127f8e08578f0c7ea95fdacc35b02724d7654c929ec497d5d04a16440aa","sourceBytes": 5256,"sourceSha256": "44aa56ac6ca807937dfe84a6404e8b07d6394a38ae2ac53248a1985337dfd671","checks": [@@ -414,8 +414,8 @@"animation": "trace","nodeCount": 11,"edgeCount": 10,- "artifactBytes": 563428,- "artifactSha256": "2be75c459e515344c6d5eebe05d57b3ea8d8121da5112fc6a6110cf70569f547",+ "artifactBytes": 579254,+ "artifactSha256": "ed9e9ee06749fd6db186c8ba50fe15af8d44513a8d075a3a176dba1ab7943e5f","sourceBytes": 5471,"sourceSha256": "9beb8698b275679a2fc92d4b51288cd5b5fc2115696d06b9168f3d7fef253a72","checks": [@@ -511,8 +511,8 @@"animation": "trace","nodeCount": 10,"edgeCount": 10,- "artifactBytes": 564961,- "artifactSha256": "2af52c428001e1fa8e3e36e553f277f8a13a24a5984885821ed6e1fdf1e8527c",+ "artifactBytes": 580787,+ "artifactSha256": "3980da8686d93c82ef3b1e4e5182c8bdec69dfafea2fd6ed50ddb4597f14013e","sourceBytes": 5719,"sourceSha256": "f71c89288f80255bdedcdc0057bcbc155d1d8b1b7476d024b35f4e27c730c974","checks": [@@ -608,8 +608,8 @@"animation": "trace","nodeCount": 7,"edgeCount": 14,- "artifactBytes": 561736,- "artifactSha256": "c3f62087c1d9fd9945982135b17703dba6694f36a687cf089ad4db36519787de",+ "artifactBytes": 577562,+ "artifactSha256": "39af2a4cf178dd720b85b10d36f7346b66a7071d14fd433e23b5a442c180f547","sourceBytes": 4483,"sourceSha256": "1b53d7c4ce7b2d8f6f40b8f33a394abe1d37fc991272b534c1ccd0255920ab52","checks": [@@ -705,8 +705,8 @@"animation": "trace","nodeCount": 12,"edgeCount": 12,- "artifactBytes": 568916,- "artifactSha256": "249e0601daf48fc982ca8aea9fcd6101f70b77219cf8127430db923d91cc9352",+ "artifactBytes": 584742,+ "artifactSha256": "e992bd9969c629c76c3fc4ab52927d7e5fc52f550701daad3e3027a83e935121","sourceBytes": 5543,"sourceSha256": "bbfedc2f1b73bf50932490f7f56d45d5f853e970d2fab26660a04947a783969c","checks": [@@ -802,8 +802,8 @@"animation": "trace","nodeCount": 10,"edgeCount": 5,- "artifactBytes": 557906,- "artifactSha256": "61e60dd71a87d4163ad748bc9b00964020d228eda58a2477d2aa6e703e79ef09",+ "artifactBytes": 573732,+ "artifactSha256": "59cc573056710b27b5502882cd8ff8fd0805c69481d74031dd090411275c52bd","sourceBytes": 4353,"sourceSha256": "1d6b34282e014cb2730662b1993158ec67bc0ad2a40520cb441aaee1ad21e4c6","checks": [@@ -899,8 +899,8 @@"animation": "trace","nodeCount": 11,"edgeCount": 6,- "artifactBytes": 559283,- "artifactSha256": "f8157bb810c1db38a6b4332fb729cb79536f052b7a292406eda5a33b178bb1a6",+ "artifactBytes": 575109,+ "artifactSha256": "544b85f7604643e37ec2b1722b471060bab7a7ad7a49c1b70e5f5f5f95492e5c","sourceBytes": 4394,"sourceSha256": "aa614f0c9a82f210e301e382f362dfbd7f290bda4d5501de3c99a6cd81b4c0a4","checks": [@@ -996,8 +996,8 @@"animation": "static","nodeCount": 10,"edgeCount": 9,- "artifactBytes": 558915,- "artifactSha256": "c5bb6ea2542526eef2c95276b9ebd87ca8412704bb2c1390b2b424fdea649bcc",+ "artifactBytes": 574741,+ "artifactSha256": "d076d42b4ce4f9d3ef60fecef030c9227c188fc084d0c510f0542d7a0a2ff423","sourceBytes": 3863,"sourceSha256": "01567b5e49cad5139baa071533a028d22f0e80fedfb49095e0d9330aee7f87db","checks": [diff --git a/docs/research-authored-reachability-2026-07-23.md b/docs/research-authored-reachability-2026-07-23.mdnew file mode 100644index 00000000..902f91ff--- /dev/null+++ b/docs/research-authored-reachability-2026-07-23.md@@ -0,0 +1,48 @@+# Authored Reachability — competitor learning and product boundary++Date: 2026-07-23++## What the adjacent tools teach++- [GitNexus at `cdbdf21`](https://github.com/abhigyanpatwari/GitNexus/blob/cdbdf219dce797e51cdeb8cfa386e77ab2d35628/README.md#L145-L146) makes graph exploration useful by turning a selected symbol into upstream impact groups and a shortest directed path. The interaction is contextual rather than another permanent dashboard.+- [SocratiCode at `d95a52f`](https://github.com/giancarloerra/SocratiCode/blob/d95a52fba46ae2c3e302edd6d5e9a927daa71bf5/README.md#L918-L943) exposes a blast-radius overlay using breadth-first search through reverse-call edges, while explicitly documenting the limitations of static analysis.++The valuable pattern is not the phrase "blast radius." It is the fast answer to a reader's next question after selecting a node: what authored relationships lead here, and where can they lead next?++## Archify's bounded response++Archify adds **Authored Reachability** to the existing Semantic Passport:++- `Upstream` follows authored relationships toward the focused node.+- `Downstream` follows authored relationships away from the focused node.+- A deterministic, unweighted breadth-first traversal reports matched nodes, matched links, and maximum hops.+- Relationship fragments are deduplicated by their stable authored edge key; cycles terminate; DOM authored order breaks ties.+- Repeating the active action clears reachability but preserves node focus.+- `#focus=<id>&reach=upstream|downstream` makes the exact reading state shareable, and Copy link preserves it.+- Classic, Signal Flow, and Blueprint share the same semantic state; Blueprint deliberately has no glow.+- SVG, raster, Share Card, WebM backgrounds, and print remain canonical and free of viewer-only reachability state.++## Truth boundary++This capability describes only the directed relationships already authored into the artifact. It does **not** claim:++- runtime causality;+- breakage or change impact;+- call-graph completeness;+- confidence scoring;+- repository-wide dependency analysis.++Those claims require a separate evidence model and are deliberately outside this slice.++## Rejected scope++- no parser or crawler;+- no schema or JSON IR change;+- no new panel or permanent toolbar action;+- no weighted path algorithm;+- no dependency, hosted service, storage, or mobile product surface;+- no geometry mutation and no reachability state in canonical exports.++## Acceptance++The slice is acceptable only when traversal is stable through branches, cycles, and duplicate SVG fragments; URL history and Copy link round-trip the direction; all five renderers inherit it; Classic, Signal Flow, Blueprint, dark, and light remain legible; exports are clean; and the complete regression, package, and real-browser gates pass.diff --git a/examples/dataflow-product-analytics.html b/examples/dataflow-product-analytics.htmlindex b9ac8362..c0623dc6 100644--- a/examples/dataflow-product-analytics.html+++ b/examples/dataflow-product-analytics.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4344,6 +4445,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4739,6 +4852,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4830,6 +4944,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4876,6 +4995,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4896,7 +5016,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6196,6 +6316,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6209,6 +6335,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6222,6 +6350,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6829,6 +7129,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6925,6 +7226,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6956,6 +7258,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7065,7 +7372,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7105,6 +7412,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7192,11 +7501,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7209,6 +7524,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7216,6 +7533,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/examples/lifecycle-agent-run.html b/examples/lifecycle-agent-run.htmlindex cd7b0928..ed786452 100644--- a/examples/lifecycle-agent-run.html+++ b/examples/lifecycle-agent-run.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4297,6 +4398,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4692,6 +4805,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4783,6 +4897,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4829,6 +4948,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4849,7 +4969,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6149,6 +6269,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6162,6 +6288,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6175,6 +6303,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6782,6 +7082,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6878,6 +7179,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6909,6 +7211,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7018,7 +7325,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7058,6 +7365,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7145,11 +7454,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7162,6 +7477,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7169,6 +7486,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/examples/sequence-cache-miss-request.html b/examples/sequence-cache-miss-request.htmlindex 22440599..5923172b 100644--- a/examples/sequence-cache-miss-request.html+++ b/examples/sequence-cache-miss-request.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4348,6 +4449,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4743,6 +4856,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4834,6 +4948,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4880,6 +4999,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4900,7 +5020,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6200,6 +6320,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6213,6 +6339,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6226,6 +6354,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6833,6 +7133,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6929,6 +7230,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6960,6 +7262,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7069,7 +7376,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7109,6 +7416,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7196,11 +7505,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7213,6 +7528,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7220,6 +7537,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/examples/web-app-rendered.html b/examples/web-app-rendered.htmlindex ec7dc59c..586fea28 100644--- a/examples/web-app-rendered.html+++ b/examples/web-app-rendered.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4315,6 +4416,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4708,6 +4821,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4799,6 +4913,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4845,6 +4964,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4865,7 +4985,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6165,6 +6285,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6178,6 +6304,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6191,6 +6319,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6798,6 +7098,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6894,6 +7195,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6925,6 +7227,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7034,7 +7341,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7074,6 +7381,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7161,11 +7470,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7178,6 +7493,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7185,6 +7502,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/examples/web-app.html b/examples/web-app.htmlindex ec7dc59c..586fea28 100644--- a/examples/web-app.html+++ b/examples/web-app.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4315,6 +4416,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4708,6 +4821,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4799,6 +4913,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4845,6 +4964,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4865,7 +4985,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6165,6 +6285,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6178,6 +6304,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6191,6 +6319,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6798,6 +7098,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6894,6 +7195,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6925,6 +7227,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7034,7 +7341,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7074,6 +7381,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7161,11 +7470,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7178,6 +7493,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7185,6 +7502,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/examples/workflow-agent-tool-call-rendered.html b/examples/workflow-agent-tool-call-rendered.htmlindex 3e02861b..6ba6f683 100644--- a/examples/workflow-agent-tool-call-rendered.html+++ b/examples/workflow-agent-tool-call-rendered.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4374,6 +4475,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4772,6 +4885,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4863,6 +4977,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4909,6 +5028,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4929,7 +5049,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6229,6 +6349,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6242,6 +6368,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6255,6 +6383,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6862,6 +7162,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6958,6 +7259,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6989,6 +7291,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7098,7 +7405,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7138,6 +7445,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7225,11 +7534,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7242,6 +7557,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7249,6 +7566,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();diff --git a/experiments/mco-showcase/mco-runtime.html b/experiments/mco-showcase/mco-runtime.htmlindex a221b574..5da79ea7 100644--- a/experiments/mco-showcase/mco-runtime.html+++ b/experiments/mco-showcase/mco-runtime.html@@ -1508,6 +1508,75 @@color: var(--text-faint);font-size: 0.5625rem;}+ .semantic-passport-reach {+ display: grid;+ gap: 0.28rem;+ margin-top: 0.52rem;+ padding-top: 0.48rem;+ border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);+ }+ .semantic-passport-reach[hidden] { display: none; }+ .semantic-passport-reach-label {+ color: var(--text-faint);+ font-size: 0.5rem;+ font-weight: 800;+ letter-spacing: 0.1em;+ text-transform: uppercase;+ }+ .semantic-passport-reach-actions {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 0.25rem;+ }+ .semantic-passport-reach-actions button {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ min-width: 0;+ min-height: 2rem;+ padding: 0.32rem 0.42rem;+ border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);+ background: color-mix(in srgb, var(--panel) 70%, transparent);+ color: var(--text-muted);+ text-align: left;+ }+ .semantic-passport-reach-actions button:hover:not(:disabled),+ .semantic-passport-reach-actions button:focus-visible {+ border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));+ color: var(--text);+ }+ .semantic-passport-reach-actions button:focus-visible {+ outline: 2px solid var(--frontend-stroke);+ outline-offset: 1px;+ }+ .semantic-passport-reach-actions button:disabled {+ cursor: default;+ opacity: 0.5;+ }+ .semantic-passport-reach-actions button[aria-pressed="true"] {+ border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));+ background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);+ color: var(--text);+ }+ #btn-reach-upstream {+ --reach-color: var(--database-stroke);+ --reach-fill: var(--database-fill);+ }+ #btn-reach-downstream {+ --reach-color: var(--backend-stroke);+ --reach-fill: var(--backend-fill);+ }+ .semantic-passport-reach-actions strong {+ color: var(--reach-color, var(--frontend-stroke));+ font-size: 0.625rem;+ }+ .semantic-passport-reach-status {+ color: var(--text-faint);+ font-size: 0.525rem;+ line-height: 1.4;+ }+ .semantic-passport-reach-status[hidden] { display: none; }.relationship-lens-list {max-height: min(18rem, 46vh);overflow: auto;@@ -2598,6 +2667,8 @@.story-carrier-overlay { display: none !important; }.diagram-container svg[data-focus-active] [data-node-id],.diagram-container svg[data-focus-active] [data-edge-from],+ .diagram-container svg[data-reach-active] [data-node-id],+ .diagram-container svg[data-reach-active] [data-edge-from],.diagram-container svg[data-story-beat] [data-story-step],.diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],.diagram-container svg[data-route-active] [data-node-id],@@ -3143,6 +3214,8 @@the global zoom level. Reveal only their exact semantic matches. */svg[data-focus-active] [data-focus-match][data-detail],svg[data-focus-active] [data-focus-match] [data-detail],+ svg[data-reach-active] [data-reach-match][data-detail],+ svg[data-reach-active] [data-reach-match] [data-detail],svg[data-lens-active] [data-lens-match][data-detail],svg[data-lens-active] [data-lens-match] [data-detail],svg[data-legend-preview-active] [data-legend-preview-match][data-detail],@@ -3161,6 +3234,7 @@pointer-events: auto;}svg[data-focus-active] [data-focus-match] [data-detail-anchor],+ svg[data-reach-active] [data-reach-match] [data-detail-anchor],svg[data-lens-active] [data-lens-match] [data-detail-anchor],svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],@@ -3342,6 +3416,30 @@filter: drop-shadow(0 0 10px var(--frontend-stroke));}+ /* Authored Reachability is a bounded graph query over the relationships+ already present in the artifact. Upstream walks incoming edges;+ downstream walks outgoing edges. It never claims runtime causality and+ changes only viewer emphasis, not canonical geometry or export bytes. */+ svg[data-reach-active] [data-node-id],+ svg[data-reach-active] [data-edge-from] { opacity: 0.09; }+ svg[data-reach-active] [data-reach-match] { opacity: 1; }+ svg[data-reach-active="upstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--database-stroke));+ }+ svg[data-reach-active="downstream"] [data-reach-origin] {+ filter: drop-shadow(0 0 11px var(--backend-stroke));+ }+ svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));+ }+ svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {+ filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));+ }+ svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],+ svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {+ filter: none;+ }+/* Direct Relationship Explorer makes authored paths a real input surfacewithout changing their visible stroke or canonical SVG. A transparentruntime rail supplies forgiving pointer geometry; the exact authored@@ -3620,6 +3718,9 @@svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {filter: drop-shadow(0 0 3px var(--frontend-stroke));}+ svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {+ filter: none;+ }svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {@@ -4361,6 +4462,18 @@<div class="semantic-passport-evidence-links" id="focus-evidence-links"></div></div><span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>+ <div class="semantic-passport-reach" id="focus-reach" hidden>+ <span class="semantic-passport-reach-label">Authored reach</span>+ <div class="semantic-passport-reach-actions" role="group" aria-label="Trace authored reachability">+ <button id="btn-reach-upstream" type="button" aria-label="Trace upstream authored reachability" aria-pressed="false">+ <span>Upstream</span><strong id="focus-reach-upstream-count">0</strong>+ </button>+ <button id="btn-reach-downstream" type="button" aria-label="Trace downstream authored reachability" aria-pressed="false">+ <span>Downstream</span><strong id="focus-reach-downstream-count">0</strong>+ </button>+ </div>+ <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>+ </div></div><div class="relationship-lens-actions"><button id="btn-focus-copy" type="button" aria-label="Copy link to focused node">Copy link</button>@@ -4756,6 +4869,7 @@clone.style.removeProperty('transform');clone.removeAttribute('data-view-scale');clone.removeAttribute('data-focus-active');+ clone.removeAttribute('data-reach-active');clone.removeAttribute('data-lens-active');clone.removeAttribute('data-lens-flow-count');clone.removeAttribute('data-lens-flow-density');@@ -4847,6 +4961,11 @@el.removeAttribute('data-focus-match');el.removeAttribute('data-focus-selected');});+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {+ el.removeAttribute('data-reach-match');+ el.removeAttribute('data-reach-origin');+ el.removeAttribute('data-reach-depth');+ });Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {el.removeAttribute('data-lens-match');el.removeAttribute('data-lens-selected');@@ -4893,6 +5012,7 @@});var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&!clone.hasAttribute('data-focus-active') &&+ !clone.hasAttribute('data-reach-active') &&!clone.hasAttribute('data-lens-active') &&!clone.hasAttribute('data-lens-flow-count') &&!clone.hasAttribute('data-lens-flow-density') &&@@ -4913,7 +5033,7 @@!clone.hasAttribute('data-chapter-anchor') &&!clone.hasAttribute('data-chapter-preview') &&!clone.style.getPropertyValue('transform') &&- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;+ clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;var vb = svg.viewBox.baseVal;var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&@@ -6213,6 +6333,12 @@var repositoryLink = document.getElementById('focus-repository');var evidenceLinks = document.getElementById('focus-evidence-links');var summary = document.getElementById('focus-summary');+ var reachSection = document.getElementById('focus-reach');+ var reachStatus = document.getElementById('focus-reach-status');+ var upstreamBtn = document.getElementById('btn-reach-upstream');+ var downstreamBtn = document.getElementById('btn-reach-downstream');+ var upstreamCount = document.getElementById('focus-reach-upstream-count');+ var downstreamCount = document.getElementById('focus-reach-downstream-count');var relationshipList = document.getElementById('relationship-lens-list');var copyBtn = document.getElementById('btn-focus-copy');var relationsBtn = document.getElementById('btn-focus-relations');@@ -6226,6 +6352,8 @@var relationshipHitOverlay = null;var relationshipHitTargets = [];var directPreviewTimer = null;+ var reachabilityMode = null;+ var activeReachability = null;var svgNamespace = 'http://www.w3.org/2000/svg';var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;@@ -6239,6 +6367,178 @@function nodeLabel(node, fallback) {return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');}+ function reachabilityRelationships() {+ var seen = Object.create(null);+ var relationships = [];+ edges().forEach(function (edge) {+ var from = edge.getAttribute('data-edge-from');+ var to = edge.getAttribute('data-edge-to');+ var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));+ if (!from || !to || seen[key]) return;+ seen[key] = true;+ relationships.push({ key: key, from: from, to: to });+ });+ return relationships;+ }+ function computeReachability(originId, direction, relationships) {+ if (typeof originId !== 'string' || !originId ||+ (direction !== 'upstream' && direction !== 'downstream') ||+ !Array.isArray(relationships)) return null;+ var records = [];+ var seenKeys = Object.create(null);+ relationships.forEach(function (relationship, index) {+ if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||+ typeof relationship.to !== 'string' || !relationship.to) return;+ var key = typeof relationship.key === 'string' && relationship.key+ ? relationship.key : String(index);+ if (seenKeys[key]) return;+ seenKeys[key] = true;+ records.push({ key: key, from: relationship.from, to: relationship.to });+ });++ var depths = Object.create(null);+ var order = [];+ var queue = [originId];+ depths[originId] = 0;+ for (var cursor = 0; cursor < queue.length; cursor += 1) {+ var current = queue[cursor];+ records.forEach(function (relationship) {+ var next = null;+ if (direction === 'downstream' && relationship.from === current) next = relationship.to;+ else if (direction === 'upstream' && relationship.to === current) next = relationship.from;+ if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;+ depths[next] = depths[current] + 1;+ queue.push(next);+ });+ }+ queue.forEach(function (id) { order.push(id); });++ var edgeKeys = [];+ records.forEach(function (relationship) {+ if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&+ Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);+ });+ var maxDepth = order.reduce(function (maximum, id) {+ return Math.max(maximum, depths[id]);+ }, 0);+ return {+ direction: direction,+ originId: originId,+ nodeIds: order,+ edgeKeys: edgeKeys,+ depths: depths,+ maxDepth: maxDepth+ };+ }+ function reachabilityFor(id, direction) {+ return computeReachability(id, direction, reachabilityRelationships());+ }+ function resetReachabilityButtons() {+ upstreamBtn.setAttribute('aria-pressed', 'false');+ downstreamBtn.setAttribute('aria-pressed', 'false');+ }+ function clearReachability(options) {+ options = options || {};+ reachabilityMode = null;+ activeReachability = null;+ svg.removeAttribute('data-reach-active');+ chip.removeAttribute('data-reach-mode');+ nodes().forEach(function (node) {+ node.removeAttribute('data-reach-match');+ node.removeAttribute('data-reach-origin');+ node.removeAttribute('data-reach-depth');+ });+ edges().forEach(function (edge) {+ edge.removeAttribute('data-reach-match');+ edge.removeAttribute('data-reach-depth');+ });+ resetReachabilityButtons();+ reachStatus.textContent = '';+ reachStatus.hidden = true;+ if (options.updateUrl === true && activeIds.length === 1) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));+ } catch (_) {}+ }+ }+ function renderReachabilityControls(id) {+ var upstream = reachabilityFor(id, 'upstream');+ var downstream = reachabilityFor(id, 'downstream');+ var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;+ var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;+ upstreamCount.textContent = String(upstreamReach);+ downstreamCount.textContent = String(downstreamReach);+ upstreamBtn.disabled = upstreamReach === 0;+ downstreamBtn.disabled = downstreamReach === 0;+ upstreamBtn.setAttribute('aria-label', upstreamReach+ ? 'Trace ' + upstreamReach + ' upstream authored node' + (upstreamReach === 1 ? '' : 's')+ : 'No upstream authored nodes');+ downstreamBtn.setAttribute('aria-label', downstreamReach+ ? 'Trace ' + downstreamReach + ' downstream authored node' + (downstreamReach === 1 ? '' : 's')+ : 'No downstream authored nodes');+ reachSection.hidden = false;+ }+ function applyReachability(direction, options) {+ options = options || {};+ if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;+ if (reachabilityMode === direction && options.toggle !== false) {+ clearReachability({ updateUrl: options.updateUrl !== false });+ return true;+ }+ var result = reachabilityFor(activeIds[0], direction);+ if (!result || result.nodeIds.length <= 1) return false;+ if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {+ Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });+ }+ clearRelationshipPreview({ clearPin: true });+ clearReachability({ updateUrl: false });+ reachabilityMode = direction;+ activeReachability = result;+ var edgeKeySet = Object.create(null);+ result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });+ svg.setAttribute('data-reach-active', direction);+ chip.setAttribute('data-reach-mode', direction);+ nodes().forEach(function (node) {+ var id = node.getAttribute('data-node-id');+ if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;+ node.setAttribute('data-reach-match', '');+ node.setAttribute('data-reach-depth', String(result.depths[id]));+ if (id === result.originId) node.setAttribute('data-reach-origin', '');+ });+ edges().forEach(function (edge) {+ var key = edge.getAttribute('data-edge-key') || (+ edge.getAttribute('data-edge-from') + '\u0000' ++ edge.getAttribute('data-edge-to') + '\u0000' ++ (edge.getAttribute('data-edge-label') || '')+ );+ if (!edgeKeySet[key]) return;+ edge.setAttribute('data-reach-match', '');+ var fromDepth = result.depths[edge.getAttribute('data-edge-from')];+ var toDepth = result.depths[edge.getAttribute('data-edge-to')];+ edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));+ });+ resetReachabilityButtons();+ var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;+ activeButton.setAttribute('aria-pressed', 'true');+ var reachableCount = result.nodeIds.length - 1;+ var directionLabel = direction === 'upstream' ? 'Upstream' : 'Downstream';+ reachStatus.textContent = directionLabel + ' · ' + reachableCount + ' node' ++ (reachableCount === 1 ? '' : 's') + ' · ' + result.edgeKeys.length + ' link' ++ (result.edgeKeys.length === 1 ? '' : 's') + ' · max ' + result.maxDepth + ' hop' ++ (result.maxDepth === 1 ? '' : 's');+ reachStatus.hidden = false;+ if (options.updateUrl !== false) {+ try {+ history.replaceState(null, '', location.pathname + location.search + '#focus=' ++ encodeURIComponent(activeIds[0]) + '&reach=' + direction);+ } catch (_) {}+ }+ if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {+ Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });+ }+ requestLensPlacement();+ return true;+ }function setPassportValue(element, value) {var normalized = value == null ? '' : String(value).trim();element.textContent = normalized;@@ -6846,6 +7146,7 @@var counts = { out: 0, in: 0, loop: 0 };relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });summary.textContent = counts.out + ' outgoing · ' + counts.in + ' incoming' + (counts.loop ? ' · ' + counts.loop + ' loop' : '');+ renderReachabilityControls(id);relationshipList.textContent = '';if (!relationships.length) {var empty = document.createElement('p');@@ -6942,6 +7243,7 @@}function clear(options) {options = options || {};+ clearReachability({ updateUrl: false });if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {Archify.intentTrace.clear({ announce: false });}@@ -6973,6 +7275,11 @@repositoryLink.removeAttribute('href');repositoryLink.textContent = '';summary.textContent = '';+ reachSection.hidden = true;+ upstreamCount.textContent = '0';+ downstreamCount.textContent = '0';+ upstreamBtn.disabled = true;+ downstreamBtn.disabled = true;relationshipList.textContent = '';copyBtn.textContent = 'Copy link';copyBtn.setAttribute('aria-label', 'Copy link to focused node');@@ -7082,7 +7389,7 @@var relationId = record && record.id;var value = location.href.replace(/#.*$/, '') + (relationId? '#relation=' + encodeURIComponent(relationId)- : '#focus=' + encodeURIComponent(activeIds[0]));+ : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); }): Promise.resolve(fallbackCopy(value));@@ -7122,6 +7429,8 @@});clearBtn.addEventListener('click', function () { clear(); });copyBtn.addEventListener('click', copyFocusLink);+ upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });+ downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });relationsBtn.addEventListener('click', function () {var expanded = chip.getAttribute('data-relations-expanded') === 'true';if (expanded) chip.removeAttribute('data-relations-expanded');@@ -7209,11 +7518,17 @@var params = new URLSearchParams(location.hash.replace(/^#/, ''));var relation = params.get('relation');var initial = params.get('focus');+ var reach = params.get('reach');if (relation) {if (html.getAttribute('data-embed') === 'true' ||!inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });}- else if (initial) set(initial, { updateUrl: false, toggle: false });+ else if (initial) {+ if (set(initial, { updateUrl: false, toggle: false }) &&+ (reach === 'upstream' || reach === 'downstream')) {+ applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });+ }+ }else if (!params.get('view')) clear({ updateUrl: false });} catch (_) {}}@@ -7226,6 +7541,8 @@setMany: setMany,clear: clear,copyLink: copyFocusLink,+ reach: applyReachability,+ clearReach: clearReachability,inspectRelationship: inspectRelationship,inspectRelationshipById: inspectRelationshipById,reposition: requestLensPlacement,@@ -7233,6 +7550,15 @@var record = pinnedRelationshipRecord();return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;},+ reachability: function () {+ return activeReachability ? {+ direction: activeReachability.direction,+ originId: activeReachability.originId,+ nodeIds: activeReachability.nodeIds.slice(),+ edgeKeys: activeReachability.edgeKeys.slice(),+ maxDepth: activeReachability.maxDepth+ } : null;+ },active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }};})();