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
docs(website): explain MCO runtime ownership with pinned source evidence
tt-a1i270e8e10949f
diff --git a/website/package.json b/website/package.jsonindex f3c6530f..0d3a6ee8 100644--- a/website/package.json+++ b/website/package.json@@ -12,7 +12,7 @@"preview": "astro preview","check": "astro check","test": "node --test test/*.test.mjs ../test/cloudflare-output.test.mjs",- "test:browser": "node --test --test-name-pattern=\"real Chrome\" ../test/site-language-continuity.test.mjs test/community-browser.test.mjs test/homepage-browser.test.mjs test/agent-diagrams-browser.test.mjs"+ "test:browser": "node --test --test-name-pattern=\"real Chrome\" ../test/site-language-continuity.test.mjs test/community-browser.test.mjs test/homepage-browser.test.mjs test/agent-diagrams-browser.test.mjs test/mco-source-case-browser.test.mjs"},"dependencies": {"@astrojs/react": "^6.0.6",diff --git a/website/src/components/Navigation.astro b/website/src/components/Navigation.astroindex 08f518fb..92d74674 100644--- a/website/src/components/Navigation.astro+++ b/website/src/components/Navigation.astro@@ -1,9 +1,10 @@---import Brand from './Brand';-interface Props { page: 'index' | 'gallery' | 'guide' | 'start' | 'community' | 'agent-diagrams' }+interface Props { page: 'index' | 'gallery' | 'guide' | 'start' | 'community' | 'agent-diagrams' | 'cases/mco-runtime' }const { page } = Astro.props;const home = page === 'index';const identities = {+ 'cases/mco-runtime': { en: '/ MCO case', zh: '/ MCO 案例', label: 'Archify home' },'agent-diagrams': { en: '/ agent diagrams', zh: '/ Agent 画图', label: 'Archify home' },gallery: { en: '/ proof lab', zh: '/ 验证作品集', label: 'Back to Archify home' },guide: { en: '/ guide', zh: '/ 场景指南', label: 'Archify home' },diff --git a/website/src/content/agent-diagrams.en.md b/website/src/content/agent-diagrams.en.mdindex e848eb11..9af9bf92 100644--- a/website/src/content/agent-diagrams.en.md+++ b/website/src/content/agent-diagrams.en.md@@ -66,6 +66,8 @@ Where an artifact includes verified source links, inspect them. A source link shFor an existing source-backed example, see the [MCO runtime architecture](https://archify.si/cases/mco-runtime.architecture.html) and its [typed source](https://github.com/tt-a1i/archify/blob/main/docs/cases/mco-runtime.architecture.json). The example describes its pinned revision, not the repository's future state.+[Follow the MCO source case: who decodes output and who writes files →](cases/mco-runtime.html)+<span id="review-and-share" class="section-anchor" aria-hidden="true"></span>## Revise, inspect, and sharediff --git a/website/src/content/agent-diagrams.zh.md b/website/src/content/agent-diagrams.zh.mdindex dbf4b9f3..9ff8870d 100644--- a/website/src/content/agent-diagrams.zh.md+++ b/website/src/content/agent-diagrams.zh.md@@ -66,6 +66,8 @@ Archify 根据源文件生成 HTML,并执行对应的渲染与校验。你可可参考现有的 [MCO 运行时架构示例](https://archify.si/cases/mco-runtime.architecture.html)及其[结构化源文件](https://github.com/tt-a1i/archify/blob/main/docs/cases/mco-runtime.architecture.json)。它解释的是所标明的提交版本,不代表仓库之后永远保持相同结构。+[对照 MCO 源码:谁解码输出,谁写入文件 →](cases/mco-runtime.html)+<span id="review-and-share" class="section-anchor" aria-hidden="true"></span>## 修改、检查和分享diff --git a/website/src/content/mco-source-case.en.md b/website/src/content/mco-source-case.en.mdnew file mode 100644index 00000000..1ff68c67--- /dev/null+++ b/website/src/content/mco-source-case.en.md@@ -0,0 +1,49 @@+# Who decodes provider output and who writes artifacts in MCO++The MCO runtime architecture example in Archify separates provider execution, answer decoding, and result artifacts. Reading its source reveals an important ownership detail: the invocation runtime calls an adapter’s decoder and writes streamed answer text; InvocationArtifactWriter prepares answer files and writes the final result and metadata. The decoder is not the filesystem owner.++This case explains the existing MCO runtime diagram, not a newly executed agent run. Open the published diagram: [MCO runtime diagram](cases/mco-runtime.architecture.html)++<span class="section-anchor" id="case-version-boundary"></span>++## Version boundary++The diagram’s typed source pins mco-org/mco to 9f1a1cf1afdc04d7b5406782b40dfec76d9bc798. The Archify source examined here is 04dc1916e1651086564f16076eab6d2f6ba1ae42. These are different repositories and different revisions. The findings below describe that MCO snapshot, not its current or future main branch. [Pinned diagram source](https://github.com/tt-a1i/archify/blob/04dc1916e1651086564f16076eab6d2f6ba1ae42/docs/cases/mco-runtime.architecture.json#L1-L15)++<span class="section-anchor" id="case-decoding"></span>++## Where provider output becomes answer text++In the inspected invocation path, invocation_runtime.py reads the provider’s stdout log and calls adapter.decode_transport(raw_output) when that method is available. It uses the returned deltas to obtain streamed answer text; when the provider reports SUCCEEDED, it attempts to take transport.final_answer. A decoding exception or a decoded transport status of failed can still make that invocation fail. Without a callable decoder, this path falls back to the raw output. [Runtime decoder handling](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L339-L409)++answer_transport.py defines the shared AnswerTransport structure: deltas, final_answer, status, and optional usage. Its decoder functions cover plain text, JSON text events, Codex events, Pi events, and ACP updates. These functions turn provider output into a consistent representation; their existence does not imply that every provider follows an identical event format. [Answer transport](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/answer_transport.py)++<span class="section-anchor" id="case-file-writes"></span>++## Where files are actually written++The invocation runtime constructs InvocationArtifactWriter, prepares its directory, and creates an answer path for each invocation. While output arrives, the runtime itself appends decoded deltas to that answer path and flushes the file. Saying that only InvocationArtifactWriter writes answer files would miss this direct write in the runtime. [Answer-file preparation](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L470-L477) · [Streamed writes](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L364-L390)++InvocationArtifactWriter owns the final report-writing functions. write_run assembles result.md and calls _write_run_metadata, which writes run.json. The metadata records invocation identifiers, providers, models, statuses, exit codes, errors, output paths, and usage only when included in the invocation result. In the inspected runtime, usage is included only when include_token_usage is enabled and the decoded transport has non-null usage. It is a structured record of results, not proof that an answer is correct or that providers agree. [Usage condition](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L303-L317) · [Report and metadata writer](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_artifacts.py#L31-L106)++<span class="section-anchor" id="case-persistence"></span>++## What persist_artifacts changes++For the inspected invocation runner, persist_artifacts selects a retained output directory or a TemporaryDirectory. The final write_run call is conditional on persist_artifacts. With persistence disabled, returned artifact paths are cleared, artifact_root is null, and the temporary directory is cleaned up. [Persistence selection](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L459-L477) · [Invocation cleanup](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L601-L630)++Persistence disabled does not mean zero disk writes. The runner still prepares temporary answer files. The multi-stage workflow also writes aggregate reports inside its selected root, which can be temporary, then clears exposed artifact paths and cleans up when persistence is disabled. The distinction is retained artifacts versus temporary working files. [Workflow root](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L747-L758) · [Aggregate write and cleanup](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L965-L993)++<span class="section-anchor" id="case-reading-the-arrow"></span>++## How to read the diagram’s arrow++The typed diagram connects Answer Transport to Invocation Artifacts. Read this as an architectural dataflow relationship: decoded answer content contributes to artifacts. It is not a literal function-call edge from a decoder to a file writer. The source-backed ownership description is more precise: decoding happens through the adapter interface, the invocation runtime coordinates it and appends streamed text, and the artifact writer produces report files. [Runtime decoder handling](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L339-L409) [Answer-file preparation](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L470-L477) · [Streamed writes](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L364-L390) [Usage condition](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L303-L317) · [Report and metadata writer](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_artifacts.py#L31-L106) [Authored diagram edge](https://github.com/tt-a1i/archify/blob/04dc1916e1651086564f16076eab6d2f6ba1ae42/docs/cases/mco-runtime.architecture.json#L228-L233)++This makes the example useful for a concrete repository review question: “Which code changes if decoded text is wrong, and which code changes if saved output is wrong?” Inspect decoder behavior for extraction errors, then inspect runtime writes, artifact serialization, and persistence settings for output-file problems. Those are starting points for investigation, not diagnoses of a reproduced defect.++<span class="section-anchor" id="case-limits"></span>++## What this case establishes++The existing Archify artifact makes a bounded runtime model inspectable alongside pinned source. It does not prove a production deployment, a literal chronological call stack, successful execution of a new agent task, tested exports, or a performance improvement. Its animated trace is a presentation of authored relationships, not a captured runtime trace. For installation and the general authoring workflow, use the agent guide rather than treating this case as a new setup tutorial: [Agent diagramming guide](agent-diagrams.html)diff --git a/website/src/content/mco-source-case.zh.md b/website/src/content/mco-source-case.zh.mdnew file mode 100644index 00000000..b8cfbaf5--- /dev/null+++ b/website/src/content/mco-source-case.zh.md@@ -0,0 +1,51 @@+# MCO 的模型输出由谁解码,结果文件由谁写入++Archify 的 MCO 运行时架构案例把 provider 执行、答案解码和结果文件分成了不同组件。沿着源码看,职责还可以拆得更细:调用运行时负责调用适配器的解码方法,并写入流式答案文本;InvocationArtifactWriter 准备答案文件,再写出最终结果和元数据。解码器本身不负责文件写入。++本文解释已有的 MCO 运行时架构图,不代表重新执行了一次 agent 任务。查看原图:[MCO 运行时架构图](cases/mco-runtime.architecture.html)++<span class="section-anchor" id="case-version-boundary"></span>++## 先确认两个版本++图表的结构化源文件将 mco-org/mco 固定在 9f1a1cf1afdc04d7b5406782b40dfec76d9bc798。本文查看的 Archify 版本是 04dc1916e1651086564f16076eab6d2f6ba1ae42。它们属于不同仓库,不能混作一个版本。下文描述的是这个 MCO 快照,不是对其当前或未来 main 分支的保证。 [固定版本的图表源文件](https://github.com/tt-a1i/archify/blob/04dc1916e1651086564f16076eab6d2f6ba1ae42/docs/cases/mco-runtime.architecture.json#L1-L15)++<span class="section-anchor" id="case-decoding"></span>++## provider 输出如何变成答案++在所查看的调用路径中,invocation_runtime.py 读取 provider 的 stdout 日志。如果适配器提供可调用的 decode_transport 方法,运行时会调用 adapter.decode_transport(raw_output),从返回的 deltas 提取流式文本;provider 报告 SUCCEEDED 后,再尝试取 transport.final_answer。此时如果解码抛出异常,或解码后的 transport.status 为 failed,这次调用仍会被判定失败。没有可调用的解码方法时,这条路径会退回原始输出。 [运行时解码处理](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L339-L409)++answer_transport.py 定义统一的 AnswerTransport 结构,包含 deltas、final_answer、status 和可选的 usage。文件中的解码函数分别处理纯文本、JSON 文本事件、Codex 事件、Pi 事件和 ACP 更新。它们把不同 provider 的输出转为统一表示,并不意味着所有 provider 使用相同的事件格式。 [答案传输结构](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/answer_transport.py)++<span class="section-anchor" id="case-file-writes"></span>++## 谁真正写文件++调用运行时创建 InvocationArtifactWriter,准备目录,并为每次调用创建答案文件路径。输出到来时,运行时会直接把解码后的文本增量追加到答案文件并刷新。因此,“只有 InvocationArtifactWriter 写答案文件”也不准确,流式追加发生在运行时里。 [答案文件准备](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L470-L477) · [流式写入](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L364-L390)++最终报告由 InvocationArtifactWriter 的报告写入方法负责。write_run 组装 result.md,并调用 _write_run_metadata 写出 run.json。元数据包含调用标识、provider、模型、状态、退出码、错误、输出路径,以及调用结果中已包含的 usage。在所查看的运行时中,只有启用 include_token_usage 且解码后的 transport.usage 非 null,usage 才会进入调用结果。这些字段记录结果,不证明答案正确,也不证明不同 provider 已达成共识。 [usage 纳入条件](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L303-L317) · [报告与元数据写入](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_artifacts.py#L31-L106)++<span class="section-anchor" id="case-persistence"></span>++## persist_artifacts 控制保留,不代表完全不落盘++在所查看的调用执行器中,persist_artifacts 决定使用保留目录还是 TemporaryDirectory。最终 write_run 调用受这个开关控制。关闭持久化时,返回结果里的 artifact_path 会清空,artifact_root 为 null,临时目录最后被清理。 [持久化目录选择](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L459-L477) · [调用清理](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L601-L630)++但关闭持久化不等于没有文件写入:执行器仍会准备临时答案文件。多阶段工作流也会在选定的根目录中写汇总报告;这个根目录可以是临时目录。关闭持久化时,工作流会清空对外返回的产物路径并执行清理。需要区分的是“保留产物”和“临时工作文件”。 [工作流目录](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L747-L758) · [汇总写入与清理](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L965-L993)++<span class="section-anchor" id="case-reading-the-arrow"></span>++## 图里的箭头应该怎么读++结构化源文件把 Answer Transport 连到 Invocation Artifacts。这条边表达的是架构层面的数据流:解码后的答案内容进入结果产物。它不是“解码器直接调用文件写入器”的逐函数调用关系。更准确的职责描述是:适配器接口提供解码,调用运行时组织执行并追加流式文本,产物写入器输出报告文件。 [运行时解码处理](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L339-L409) [答案文件准备](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L470-L477) · [流式写入](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L364-L390) [usage 纳入条件](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_runtime.py#L303-L317) · [报告与元数据写入](https://github.com/mco-org/mco/blob/9f1a1cf1afdc04d7b5406782b40dfec76d9bc798/runtime/invocation_artifacts.py#L31-L106) [图表定义的关系](https://github.com/tt-a1i/archify/blob/04dc1916e1651086564f16076eab6d2f6ba1ae42/docs/cases/mco-runtime.architecture.json#L228-L233)++这个案例适合回答一个具体的代码审查问题:“如果解析出来的文本不对,和保存出来的文件不对,分别应该先看哪里?”提取内容异常时,先查看解码行为;文件异常时,再看运行时写入、产物序列化和持久化设置。这些是排查入口,不是对某个已复现缺陷的诊断。++<span class="section-anchor" id="case-limits"></span>++## 这个案例能证明什么++已有的 Archify 产物把一个范围明确的运行时模型和固定版本的源码放在一起,方便读者逐项检查。它不证明生产部署、严格的时序调用栈、新 agent 任务执行成功、导出验收通过或性能提升。图中的动画轨迹展示的是作者定义的关系,不是采集到的运行时 trace。++安装和通用创作流程可直接查看已有指南,不必把这个案例当成新的安装教程:[Agent 画图指南](agent-diagrams.html)diff --git a/website/src/data/localize-html.mjs b/website/src/data/localize-html.mjsindex d4e14a28..6d35fe43 100644--- a/website/src/data/localize-html.mjs+++ b/website/src/data/localize-html.mjs@@ -31,7 +31,7 @@ export function localizeHtml(html, { lang, page, cloudflare, copy = {} }) {node.childNodes = [{ nodeName: '#text', value: lang === 'zh' ? 'EN' : '中文', parentNode: node }];} else if (node.tagName === 'a') {const href = get('href');- const match = href?.match(/^(?:(index|guide|start|gallery|community|agent-diagrams)\.html|(\.\/))([?#].*)?$/);+ const match = href?.match(/^(?:(index|guide|start|gallery|community|agent-diagrams|cases\/mco-runtime)\.html|(\.\/))([?#].*)?$/);if (match) set('href', localPagePath(match[1] || 'index', lang, cloudflare) + (match[3] || ''));else if (href?.startsWith('#')) set('href', localPagePath(page, lang, cloudflare) + href);}diff --git a/website/src/data/site-metadata.mjs b/website/src/data/site-metadata.mjsindex 13e3185d..bb57e6bb 100644--- a/website/src/data/site-metadata.mjs+++ b/website/src/data/site-metadata.mjs@@ -1,5 +1,9 @@import { canonicalUrl, canonicalOrigin } from './site-urls.mjs';const descriptions = {+ 'cases/mco-runtime': {+ en: ['Archify MCO Runtime Case — Source-backed Architecture', 'Follow pinned MCO source to distinguish provider-output decoding, streamed answer writes and retained artifacts. Read the existing Archify diagram with explicit evidence limits.'],+ zh: ['Archify MCO 运行时案例 — 对照源码阅读架构', '沿固定版本的 MCO 源码区分输出解码、流式答案写入与产物保留,结合已有 Archify 架构图理解职责、持久化条件与证据边界。'],+ },'agent-diagrams': {en: ['Archify Agent Diagramming Guide — Author, Review, Share', 'Create diagrams with Claude Code, Codex, Cursor and other coding agents. Learn bounded prompts, repository evidence, review checks and safe HTML sharing with Archify.'],zh: ['Archify Agent 画图指南 — 编写、检查与分享', '用 Claude Code、Codex、Cursor 等 Coding Agent 画图:从范围明确的提示词和仓库证据开始,检查事实、修改图表,再安全分享 Archify HTML 成品。'],@@ -32,7 +36,7 @@ export function pageMetadata(page, lang, version) {schema: { '@context': 'https://schema.org', '@graph': [{ '@type': 'WebSite', '@id': `${canonicalOrigin}/#website`, url: `${canonicalOrigin}/`, name: 'Archify', inLanguage: ['en', 'zh-Hans'] },{ '@type': 'SoftwareSourceCode', '@id': `${canonicalOrigin}/#source`, name: 'Archify', codeRepository: 'https://github.com/tt-a1i/archify', url: 'https://github.com/tt-a1i/archify', license: 'https://github.com/tt-a1i/archify/blob/main/LICENSE', version, programmingLanguage: 'JavaScript', description: descriptions.index[lang][1] },- ...(page === 'agent-diagrams' ? [{ '@type': 'TechArticle', '@id': `${canonical}#article`, url: canonical, headline: title, description, inLanguage: lang === 'zh' ? 'zh-Hans' : 'en', isPartOf: { '@id': `${canonicalOrigin}/#website` }, about: { '@id': `${canonicalOrigin}/#source` } }] : []),+ ...(['agent-diagrams', 'cases/mco-runtime'].includes(page) ? [{ '@type': 'TechArticle', '@id': `${canonical}#article`, url: canonical, headline: title, description, inLanguage: lang === 'zh' ? 'zh-Hans' : 'en', isPartOf: { '@id': `${canonicalOrigin}/#website` }, about: { '@id': `${canonicalOrigin}/#source` } }] : []),] },};}diff --git a/website/src/data/site-urls.mjs b/website/src/data/site-urls.mjsindex cb8bebc0..8328688c 100644--- a/website/src/data/site-urls.mjs+++ b/website/src/data/site-urls.mjs@@ -1,5 +1,5 @@export const canonicalOrigin = 'https://archify.si';-export const sitePages = ['index', 'guide', 'start', 'gallery', 'community', 'agent-diagrams'];+export const sitePages = ['index', 'guide', 'start', 'gallery', 'community', 'agent-diagrams', 'cases/mco-runtime'];export function canonicalPath(page, lang = 'en') {return page === 'index' ? (lang === 'zh' ? '/zh' : '/') : `${lang === 'zh' ? '/zh/' : '/'}${page}`;}diff --git a/website/src/layouts/SiteLayout.astro b/website/src/layouts/SiteLayout.astroindex 1dd8286c..ee4d290d 100644--- a/website/src/layouts/SiteLayout.astro+++ b/website/src/layouts/SiteLayout.astro@@ -9,8 +9,10 @@ import { productChannel } from '../data/product-facts';import { canonicalUrl } from '../data/site-urls.mjs';import { pageMetadata } from '../data/site-metadata.mjs';import { localizeHtml } from '../data/localize-html.mjs';-interface Props { head: string; css: string; page: 'index' | 'guide' | 'start' | 'gallery' | 'community' | 'agent-diagrams'; lang?: 'en' | 'zh' }+interface Props { head: string; css: string; page: 'index' | 'guide' | 'start' | 'gallery' | 'community' | 'agent-diagrams' | 'cases/mco-runtime'; lang?: 'en' | 'zh' }const { head, css, page, lang = 'en' } = Astro.props;+const pageDepth = page.split('/').length - 1 + (lang === 'zh' && page !== 'index' ? 1 : 0);+const rootBase = pageDepth ? '../'.repeat(pageDepth) : './';const cloudflare = Astro.site?.origin === 'https://archify.si';const metadata = pageMetadata(page, lang, version);const copy = page === 'index' ? indexCopyFor(productChannel) : page === 'guide' ? guideCopyFor(guide, productChannel) : {};@@ -23,7 +25,7 @@ const resourceHead = head.replace(/<meta\b[^>]*>/gi, '').replace(/<title>[\s\S]*<head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" />- <base href={lang === 'zh' && page !== 'index' ? '../' : './'} />+ <base href={rootBase} /><title>{metadata.title}</title><meta name="description" content={metadata.description} /><meta name="theme-color" content="#07080a" />diff --git a/website/src/pages/cases/mco-runtime.astro b/website/src/pages/cases/mco-runtime.astronew file mode 100644index 00000000..b6d48688--- /dev/null+++ b/website/src/pages/cases/mco-runtime.astro@@ -0,0 +1,30 @@+---+import SiteLayout from '../../layouts/SiteLayout.astro';+import Navigation from '../../components/Navigation.astro';+import { Content as English, getHeadings as englishHeadings } from '../../content/mco-source-case.en.md';+import { Content as Chinese, getHeadings as chineseHeadings } from '../../content/mco-source-case.zh.md';+import head from '../../data/agent-diagrams-head.html?raw';+import css from '../../styles/agent-diagrams.css?raw';+const { lang = 'en' } = Astro.props;+const Content = lang === 'zh' ? Chinese : English;+const sectionIds = ['case-version-boundary', 'case-decoding', 'case-file-writes', 'case-persistence', 'case-reading-the-arrow', 'case-limits'];+const headings = (lang === 'zh' ? chineseHeadings() : englishHeadings()).filter(heading => heading.depth === 2).map((heading, index) => ({ ...heading, slug: sectionIds[index] }));+---+<SiteLayout page="cases/mco-runtime" lang={lang} head={head} css={css}>+ <div class="grid-bg" aria-hidden="true"></div>+ <Navigation page="cases/mco-runtime" />+ <main class="agent-guide">+ <header class="article-meta">+ <p>{lang === 'zh' ? '源码案例 · MCO 运行时' : 'Source-backed case · MCO runtime'}</p>+ <p>{lang === 'zh' ? '源码核对:2026-10-16 · 复用已有图表,并非新执行的 Agent 任务。' : 'Source reviewed: 2026-10-16 · Existing diagram, not a newly executed agent task.'}</p>+ </header>+ <div class="article-grid">+ <nav class="article-toc" aria-label={lang === 'zh' ? '本页目录' : 'On this page'}>+ <p>{lang === 'zh' ? '本页目录' : 'On this page'}</p>+ <ol>{headings.map(heading => <li><a href={`#${heading.slug}`}>{heading.text}</a></li>)}</ol>+ </nav>+ <article class="article-body"><Content /></article>+ </div>+ </main>+ <footer class="article-footer"><a href="agent-diagrams.html">{lang === 'zh' ? '阅读 Agent 画图指南 →' : 'Read the agent diagramming guide →'}</a><a href="gallery.html">{lang === 'zh' ? '探索验证作品集 →' : 'Explore the Proof Lab →'}</a></footer>+</SiteLayout>diff --git a/website/src/pages/gallery.astro b/website/src/pages/gallery.astroindex a71fc9b3..70011908 100644--- a/website/src/pages/gallery.astro+++ b/website/src/pages/gallery.astro@@ -31,6 +31,10 @@ const { lang = 'en' } = Astro.props;</div></section>+ <aside class="agent-guide-link shell" aria-label={lang === 'zh' ? '源码案例' : 'Source-backed case'}>+ <a href="cases/mco-runtime.html" data-en="Read a source-backed case: decoding and file ownership in MCO →" data-zh="阅读源码案例:MCO 的解码与文件写入职责 →">Read a source-backed case: decoding and file ownership in MCO →</a>+ </aside>+<section class="controls" aria-label="Gallery controls"><div class="shell controls-inner"><div class="filter-group" role="group" aria-label="Filter diagrams by type">diff --git a/website/src/pages/zh/cases/mco-runtime.astro b/website/src/pages/zh/cases/mco-runtime.astronew file mode 100644index 00000000..a6b7e336--- /dev/null+++ b/website/src/pages/zh/cases/mco-runtime.astro@@ -0,0 +1,4 @@+---+import Page from "../../cases/mco-runtime.astro";+---+<Page lang="zh" />diff --git a/website/src/scripts/site-language.js b/website/src/scripts/site-language.jsindex 8bf0c89d..04681c37 100644--- a/website/src/scripts/site-language.js+++ b/website/src/scripts/site-language.js@@ -29,7 +29,7 @@function localizeLinks() {document.querySelectorAll('a[href]').forEach(function (link) {if (link.hasAttribute('data-language-switch')) return;- var match = link.getAttribute('href').match(/^(index|guide|start|gallery|community|agent-diagrams)\.html([?#].*)?$/);+ var match = link.getAttribute('href').match(/^(index|guide|start|gallery|community|agent-diagrams|cases\/mco-runtime)\.html([?#].*)?$/);if (match) link.setAttribute('href', pagePath(match[1], language) + (match[2] || ''));});}diff --git a/website/test/deployment-target.test.mjs b/website/test/deployment-target.test.mjsindex 9e73356a..6274c0d3 100644--- a/website/test/deployment-target.test.mjs+++ b/website/test/deployment-target.test.mjs@@ -20,7 +20,7 @@ test('built deployment uses host-compatible generated assets and canonical metadconst canonicalUrl = `https://archify.si/${page === 'index' ? (lang === 'zh' ? 'zh' : '') : `${lang === 'zh' ? 'zh/' : ''}${page}`}`;const bases = all.filter(node => node.tagName === 'base');assert.equal(bases.length, 1, file);- assert.equal(attr(bases[0], 'href'), lang === 'zh' && page !== 'index' ? '../' : './', file);+ assert.equal(attr(bases[0], 'href'), '../'.repeat(file.split('/').length - 1) || './', file);const documentUrl = cloudflare ? canonicalUrl : `https://tt-a1i.github.io/archify/${file}`;const baseUri = new URL(attr(bases[0], 'href'), documentUrl);const nav = all.find(node => node.tagName === 'nav' && attr(node, 'class') === 'site-nav');diff --git a/website/test/local-fonts.test.mjs b/website/test/local-fonts.test.mjsindex 2de15338..c6f23575 100644--- a/website/test/local-fonts.test.mjs+++ b/website/test/local-fonts.test.mjs@@ -40,7 +40,7 @@ test('local font declarations preserve the original families, weights and swap bassert.ok(manifest.fonts.some(font => font.file === face.file));}for (const page of pages) {- const head = fs.readFileSync(new URL(`../src/data/${page}-head.html`, import.meta.url), 'utf8');+ const head = fs.readFileSync(new URL(`../src/data/${page === 'cases/mco-runtime' ? 'agent-diagrams' : page}-head.html`, import.meta.url), 'utf8');assert.doesNotMatch(head, /fonts\.googleapis\.com|fonts\.gstatic\.com/);assert.equal((head.match(/href="fonts\/fonts.css"/g) || []).length, 1);}diff --git a/website/test/mco-source-case-browser.test.mjs b/website/test/mco-source-case-browser.test.mjsnew file mode 100644index 00000000..4bdf479f--- /dev/null+++ b/website/test/mco-source-case-browser.test.mjs@@ -0,0 +1,179 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import http from 'node:http';+import path from 'node:path';+import { fileURLToPath } from 'node:url';+import { execFileSync } from 'node:child_process';+import { ChromeVisualBrowser, findChrome } from '../../archify/bin/visual-check.mjs';++const website = fileURLToPath(new URL('../', import.meta.url));+const enabled = process.env.ARCHIFY_SITE_INTEGRATION === '1';+const root = path.resolve(process.env.ARCHIFY_SITE_ROOT || path.join(website, 'dist'));+const mount = process.env.ARCHIFY_SITE_BASE ?? '/archify';+const target = mount ? 'github' : 'cloudflare';+const output = path.join(website, '.browser-evidence', target);++test('real Chrome: MCO case stays readable and navigable in both languages, themes and narrow viewports', {+ skip: enabled ? false : 'Set ARCHIFY_SITE_INTEGRATION=1 and ARCHIFY_CHROME to run MCO case browser evidence.',+ timeout: 180000,+}, async () => {+ const chrome = findChrome();+ assert.ok(chrome, 'The requested agent guide gate requires usable Chrome.');+ const server = http.createServer((request, response) => {+ const url = new URL(request.url, 'http://127.0.0.1');+ if (mount && !url.pathname.startsWith(`${mount}/`)) return response.writeHead(404).end();+ let relative = url.pathname.slice(mount.length).replace(/^\/+/, '') || 'index.html';+ // Resolve actual static HTML routes, never an SPA fallback.+ if (!path.extname(relative) && fs.existsSync(path.join(root, `${relative}.html`))) relative += '.html';+ const file = path.resolve(root, relative);+ if (!file.startsWith(`${root}${path.sep}`)) return response.writeHead(404).end();+ try {+ const types = { '.html': 'text/html', '.js': 'text/javascript', '.css': 'text/css', '.svg': 'image/svg+xml', '.woff2': 'font/woff2' };+ response.setHeader('Content-Type', types[path.extname(file)] || 'application/octet-stream');+ response.end(fs.readFileSync(file));+ } catch { response.writeHead(404).end(); }+ });+ let browser;+ fs.mkdirSync(output, { recursive: true });+ const event = process.env.GITHUB_EVENT_PATH ? JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8')) : null;+ const manifest = {+ capturedAt: new Date().toISOString(), target,+ checkoutSha: execFileSync('git', ['rev-parse', 'HEAD'], { cwd: website, encoding: 'utf8' }).trim(),+ pullRequestHead: event?.pull_request?.head?.sha || null,+ runId: process.env.GITHUB_RUN_ID || null,+ screenshots: [], navigation: [],+ };+ const saveManifest = () => fs.writeFileSync(path.join(output, 'mco-case-manifest.json'), JSON.stringify(manifest, null, 2));+ try {+ await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));+ browser = new ChromeVisualBrowser(chrome);+ const session = await browser.sessionPromise;+ const evaluate = async expression => {+ const result = await browser.cdp.send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true }, session);+ assert.ok(!result.exceptionDetails, JSON.stringify(result.exceptionDetails));+ return result.result.value;+ };+ const settled = () => evaluate('new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))');+ const loadedAction = async action => {+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ loaded.catch(() => {});+ await action();+ await loaded;+ await evaluate('document.fonts.ready');+ };+ const assertSectionVisible = async () => {+ const position = await evaluate(`(async () => {+ // Let native smooth fragment navigation finish, without overriding it.+ const started = performance.now(); let last = scrollY, stable = 0;+ while (performance.now() - started < 2500) {+ await new Promise(resolve => requestAnimationFrame(resolve));+ stable = Math.abs(scrollY - last) < .5 ? stable + 1 : 0; last = scrollY;+ if (stable >= 5 && performance.now() - started > 200) break;+ }+ const anchor = document.getElementById(location.hash.slice(1));+ const boundary = anchor?.parentElement.tagName === 'P' ? anchor.parentElement : anchor;+ const heading = boundary?.nextElementSibling;+ const box = heading?.getBoundingClientRect();+ return { tag: heading?.tagName, top: box?.top, bottom: box?.bottom, navBottom: document.querySelector('.site-nav').getBoundingClientRect().bottom, height: innerHeight };+ })()`);+ assert.equal(position.tag, 'H2');+ assert.ok(position.top >= position.navBottom - 1 && position.bottom <= position.height, 'fragment target heading is visible below the fixed navigation');+ return position;+ };+ const urlFor = (page, lang) => `http://127.0.0.1:${server.address().port}${mount}/${lang === 'zh' ? 'zh/' : ''}${page}${mount ? '.html' : ''}`;+ const navigate = url => loadedAction(() => browser.cdp.send('Page.navigate', { url }, session));+ await browser.cdp.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-reduced-motion', value: 'reduce' }] }, session);+ for (const width of [1440, 390, 320]) for (const lang of ['en', 'zh']) {+ await browser.cdp.send('Emulation.setDeviceMetricsOverride', { width, height: 1000, deviceScaleFactor: 1, mobile: width < 768 }, session);+ await navigate(urlFor('cases/mco-runtime', lang));+ for (const theme of ['light', 'dark']) {+ await evaluate(`if (document.documentElement.dataset.theme !== ${JSON.stringify(theme)}) document.querySelector('[data-theme-toggle]').click()`);+ await settled();+ const reading = await evaluate(`(() => {+ const article = document.querySelector('.article-body');+ const failures = [];+ const walker = document.createTreeWalker(article, NodeFilter.SHOW_TEXT);+ while (walker.nextNode()) {+ const node = walker.currentNode;+ if (!node.textContent.trim()) continue;+ for (let parent = node.parentElement; parent && parent !== document.body; parent = parent.parentElement) {+ const style = getComputedStyle(parent);+ if (style.visibility !== 'visible' || style.display === 'none' || Number(style.opacity) === 0) failures.push({ text: node.textContent.slice(0, 100), reason: 'hidden text' });+ }+ const range = document.createRange(); range.selectNodeContents(node);+ const rects = [...range.getClientRects()].filter(rect => rect.width > 0 && rect.height > 0);+ if (!rects.length) failures.push({ text: node.textContent.slice(0, 100), reason: 'text has no rendered bounds' });+ for (const rect of rects) {+ if (rect.left < -1 || rect.right > innerWidth + 1) failures.push({ text: node.textContent.slice(0, 100), reason: 'outside viewport horizontally' });+ for (let parent = node.parentElement; parent && parent !== document.body; parent = parent.parentElement) {+ const style = getComputedStyle(parent), box = parent.getBoundingClientRect();+ if (['hidden', 'clip'].includes(style.overflowX) && (rect.left < box.left - 1 || rect.right > box.right + 1)) failures.push({ text: node.textContent.slice(0, 100), reason: 'horizontal clipping' });+ if (['hidden', 'clip'].includes(style.overflowY) && (rect.top < box.top - 1 || rect.bottom > box.bottom + 1)) failures.push({ text: node.textContent.slice(0, 100), reason: 'vertical clipping' });+ }+ }+ }+ return { lang: document.documentElement.lang, theme: document.documentElement.dataset.theme, width: innerWidth, pageWidth: document.documentElement.scrollWidth, failures };+ })()`);+ // Capture bounded viewport tiles so long mobile source explanations and limits are not+ // silently cropped or squeezed into an unreadable full-page thumbnail.+ for (const region of ['opening', 'file-ownership', 'persistence-limits']) {+ const bounds = await evaluate(`(() => {+ const article = document.querySelector('.article-body');+ const start = ${JSON.stringify(region)} === 'opening' ? article.querySelector('h1') : document.getElementById(${JSON.stringify(region === 'file-ownership' ? 'case-file-writes' : 'case-persistence')});+ const end = document.getElementById(${JSON.stringify(region === 'opening' ? 'case-version-boundary' : region === 'file-ownership' ? 'case-persistence' : 'case-limits')});+ return { top: start.getBoundingClientRect().top + scrollY, bottom: (${JSON.stringify(region)} === 'persistence-limits' ? article.getBoundingClientRect().bottom : end.getBoundingClientRect().top) + scrollY, nav: document.querySelector('.site-nav').getBoundingClientRect().bottom };+ })()`);+ const inset = bounds.nav + 20;+ const step = 1000 - inset - 40;+ const tiles = Math.max(1, Math.ceil((bounds.bottom - bounds.top) / step));+ assert.ok(tiles <= 12, `${region}: unexpectedly unbounded article region`);+ for (let tile = 0; tile < tiles; tile++) {+ await evaluate(`scrollTo({ top: ${Math.max(0, bounds.top - inset + tile * step)}, behavior: 'instant' })`);+ await settled();+ const receipt = await evaluate(`({ scrollY, viewport: { width: innerWidth, height: innerHeight }, lang: document.documentElement.lang, theme: document.documentElement.dataset.theme })`);+ const name = `mco-case-${lang}-${width}-${theme}-${region}-${tile + 1}.png`;+ const image = await browser.cdp.send('Page.captureScreenshot', { format: 'png' }, session);+ fs.writeFileSync(path.join(output, name), Buffer.from(image.data, 'base64'));+ manifest.screenshots.push({ file: name, width, height: 1000, lang, theme, region, tile: tile + 1, tiles, bounds, receipt, reading });+ saveManifest();+ }+ }+ assert.equal(reading.lang, lang === 'en' ? 'en' : 'zh-Hans');+ assert.equal(reading.theme, theme);+ assert.equal(reading.width, width);+ assert.ok(reading.pageWidth <= width + 1, 'no horizontal page overflow');+ assert.deepEqual(reading.failures, [], 'all article text remains visible and unclipped');+ }+ // Exercise real authored links, including section and locale continuity.+ await evaluate(`document.querySelector('.article-toc a[href$="#case-file-writes"]').click()`);+ await settled();+ assert.equal(await evaluate('location.hash'), '#case-file-writes');+ const tocPosition = await assertSectionVisible();+ await loadedAction(() => evaluate(`document.querySelector('[data-language-switch]').click()`));+ const other = lang === 'en' ? 'zh' : 'en';+ assert.equal(await evaluate('location.pathname'), new URL(urlFor('cases/mco-runtime', other)).pathname);+ assert.equal(await evaluate('document.documentElement.lang'), other === 'zh' ? 'zh-Hans' : 'en');+ assert.equal(await evaluate('location.hash'), '#case-file-writes');+ assert.equal(await evaluate('!!document.getElementById(location.hash.slice(1))'), true);+ const localePosition = await assertSectionVisible();+ await loadedAction(() => evaluate(`document.querySelector('.article-body a[href="cases/mco-runtime.architecture.html"]').click()`));+ assert.ok((await evaluate('location.pathname')).endsWith('/cases/mco-runtime.architecture.html'));+ assert.equal(await evaluate('!!document.querySelector("svg")'), true, 'existing linked artifact actually loads');+ const caseHref = `${lang === 'zh' ? 'zh/' : ''}cases/mco-runtime${mount ? '.html' : ''}`;+ await navigate(urlFor('gallery', lang));+ await loadedAction(() => evaluate(`document.querySelector('a[href="${caseHref}"]').click()`));+ assert.equal(await evaluate('location.pathname'), new URL(urlFor('cases/mco-runtime', lang)).pathname);+ await loadedAction(() => evaluate(`document.querySelector('.article-footer a').click()`));+ assert.equal(await evaluate('location.pathname'), new URL(urlFor('agent-diagrams', lang)).pathname);+ await loadedAction(() => evaluate(`document.querySelector('a[href="${caseHref}"]').click()`));+ assert.equal(await evaluate('location.pathname'), new URL(urlFor('cases/mco-runtime', lang)).pathname);+ manifest.navigation.push({ width, lang, result: 'passed', tocPosition, localePosition, paths: ['toc', 'language with fragment', 'existing artifact loads SVG', 'gallery to case', 'case to agent guide', 'agent guide to case'] });+ saveManifest();+ }+ } finally {+ saveManifest();+ if (browser) await browser.close();+ if (server.listening) await new Promise(resolve => server.close(resolve));+ }+});diff --git a/website/test/mco-source-case.test.mjs b/website/test/mco-source-case.test.mjsnew file mode 100644index 00000000..6926d65f--- /dev/null+++ b/website/test/mco-source-case.test.mjs@@ -0,0 +1,64 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import { parse } from 'parse5';+import { parseSitemap } from '../scripts/indexnow.mjs';+const cloudflare = process.env.ARCHIFY_SITE_TARGET === 'cloudflare';+const output = new URL(cloudflare ? '../dist-cloudflare/' : '../dist/', import.meta.url);+const origin = cloudflare ? 'https://archify.si/' : 'https://tt-a1i.github.io/archify/';+const nodes = node => [node, ...(node.childNodes || []).flatMap(nodes)];+const attr = (node, name) => node?.attrs?.find(item => item.name === name)?.value;+const text = node => node.nodeName === '#text' ? node.value : (node.childNodes || []).map(text).join('');+const read = file => nodes(parse(fs.readFileSync(new URL(file, output), 'utf8')));++test('MCO case exposes pinned source, honest limits, stable sections and nested routes without JavaScript', () => {+ for (const lang of ['en', 'zh']) {+ const prefix = lang === 'zh' ? 'zh/' : '';+ const route = `${prefix}cases/mco-runtime`;+ const all = read(`${route}.html`);+ const url = new URL(route + (cloudflare ? '' : '.html'), origin);+ const base = new URL(attr(all.find(node => node.tagName === 'base'), 'href'), url);+ assert.equal(base.href, origin, 'nested case resolves to the deployed site root');+ const article = all.find(node => node.tagName === 'article');+ assert.equal(nodes(article).filter(node => node.tagName === 'h1').length, 1);+ const visible = text(article);+ for (const value of ['9f1a1cf1afdc04d7b5406782b40dfec76d9bc798', '04dc1916e1651086564f16076eab6d2f6ba1ae42', 'include_token_usage', 'TemporaryDirectory']) assert.ok(visible.includes(value), value);+ assert.match(visible, lang === 'en' ? /does not mean zero disk writes/ : /不等于没有文件写入/);+ assert.match(visible, lang === 'en' ? /not a captured runtime trace/ : /不是采集到的运行时 trace/);+ assert.doesNotMatch(visible, /\[\d+\]|source ledger|workspace\/shared/);+ const sourceLinks = nodes(article).filter(node => node.tagName === 'a' && attr(node, 'href')?.startsWith('https://github.com/'));+ assert.ok(sourceLinks.length >= 12);+ for (const link of sourceLinks) assert.match(attr(link, 'href'), /\/blob\/(9f1a1cf1afdc04d7b5406782b40dfec76d9bc798|04dc1916e1651086564f16076eab6d2f6ba1ae42)\//);+ const schema = JSON.parse(text(all.find(node => attr(node, 'type') === 'application/ld+json')));+ assert.equal(schema['@graph'].find(item => item['@type'] === 'TechArticle').url, `https://archify.si/${route}`);+ const toc = all.find(node => attr(node, 'class') === 'article-toc');+ for (const link of nodes(toc).filter(node => node.tagName === 'a')) {+ const destination = new URL(attr(link, 'href'), base);+ assert.equal(destination.origin + destination.pathname, url.href);+ const targets = nodes(article).filter(node => attr(node, 'id') === destination.hash.slice(1));+ assert.equal(targets.length, 1);+ const target = targets[0].parentNode.tagName === 'p' ? targets[0].parentNode : targets[0];+ const siblings = target.parentNode.childNodes;+ const next = siblings.slice(siblings.indexOf(target) + 1).find(node => node.tagName);+ assert.equal(next.tagName, 'h2');+ assert.equal(text(next), text(link));+ }+ const artifact = nodes(article).find(node => attr(node, 'href') === 'cases/mco-runtime.architecture.html');+ assert.ok(artifact);+ assert.equal(new URL(attr(artifact, 'href'), base).href, origin + 'cases/mco-runtime.architecture.html');+ for (const entry of ['gallery', 'agent-diagrams']) {+ const dom = read(`${prefix}${entry}.html`);+ const link = dom.find(node => node.tagName === 'a' && attr(node, 'href') === route + (cloudflare ? '' : '.html'));+ assert.ok(link, `${lang}/${entry}: contextual case link`);+ }+ }+});++test('MCO case inventory includes both wrappers and preserves original artifact and typed source bytes', () => {+ const urls = parseSitemap(fs.readFileSync(new URL('sitemap.xml', output), 'utf8'));+ for (const prefix of ['', 'zh/']) assert.ok(urls.includes(`https://archify.si/${prefix}cases/mco-runtime`));+ for (const extension of ['html', 'json']) {+ const file = `cases/mco-runtime.architecture.${extension}`;+ assert.deepEqual(fs.readFileSync(new URL(file, output)), fs.readFileSync(new URL(`../../docs/${file}`, import.meta.url)), file);+ }+});diff --git a/website/test/navigation.test.mjs b/website/test/navigation.test.mjsindex e55ea899..607db485 100644--- a/website/test/navigation.test.mjs+++ b/website/test/navigation.test.mjs@@ -20,7 +20,7 @@ test('all built pages expose one shared top navigation and the correct current pconst dom = parse(fs.readFileSync(new URL(file, output), 'utf8'));const bases = nodes(dom).filter(node => node.tagName === 'base');assert.equal(bases.length, 1, file);- assert.equal(attr(bases[0], 'href'), lang === 'zh' && page !== 'index' ? '../' : './', file);+ assert.equal(attr(bases[0], 'href'), '../'.repeat(file.split('/').length - 1) || './', file);const baseUri = new URL(attr(bases[0], 'href'), new URL(cloudflare ? file.replace(/\.html$/, '').replace(/^index$/, '') : file, origin));const resolvedHref = node => new URL(attr(node, 'href'), baseUri).href;const nav = nodes(dom).find(node => node.tagName === 'nav' && hasClass(node, 'site-nav'));@@ -30,7 +30,7 @@ test('all built pages expose one shared top navigation and the correct current p...['guide', 'gallery', 'start', 'community'].map(hrefFor), 'https://github.com/tt-a1i/archify',], page);assert.deepEqual(links.filter(node => attr(node, 'aria-current') === 'page').map(resolvedHref),- ['index', 'agent-diagrams'].includes(page) ? [] : [hrefFor(page)], page);+ ['index', 'agent-diagrams', 'cases/mco-runtime'].includes(page) ? [] : [hrefFor(page)], page);const community = links.find(node => resolvedHref(node) === hrefFor('community'));if (page === 'index' || page === 'guide') {assert.equal(attr(community, 'data-i18n'), page === 'index' ? 'nav-community' : 'navCommunity', page);