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(skill): add notification-only update awareness (#181)
Friend Ab36d79fdbc3a
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex b35b125d..8d912c16 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -85,6 +85,61 @@ jobs:exit 1fi+ published-update-manifest:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with:+ node-version: 22+ - name: Public notifier manifest must reference an existing stable Release+ env:+ GH_TOKEN: ${{ github.token }}+ run: |+ set -euo pipefail+ manifest_version="$(node --input-type=module -e 'import fs from "node:fs"; import { validateStableUpdateManifest } from "./archify/scripts/update-contract.mjs"; process.stdout.write(validateStableUpdateManifest(JSON.parse(fs.readFileSync("./docs/skill-updates/archify/stable.json", "utf8"))).version);')"+ latest_stable_tag="$(gh api "repos/${GITHUB_REPOSITORY}/releases/latest" --jq 'select(.draft == false and .prerelease == false) | .tag_name')"+ if [[ "$latest_stable_tag" != "v${manifest_version}" ]]; then+ echo "::error::stable.json v${manifest_version} must match the latest published stable Release ${latest_stable_tag:-'(missing)'}"+ exit 1+ fi+ release_asset_id="$(gh api "repos/${GITHUB_REPOSITORY}/releases/tags/v${manifest_version}" --jq 'select(.draft == false and .prerelease == false) | .assets[] | select(.name == "archify.zip") | .id')"+ if [[ -z "$release_asset_id" ]]; then+ echo "::error::v${manifest_version} must have a published stable GitHub Release with an archify.zip asset before stable.json is merged"+ exit 1+ fi+ published_archive="$RUNNER_TEMP/archify-v${manifest_version}.zip"+ gh api "repos/${GITHUB_REPOSITORY}/releases/assets/${release_asset_id}" \+ -H 'Accept: application/octet-stream' > "$published_archive"+ git fetch --force --no-tags --depth=1 origin \+ "refs/tags/v${manifest_version}:refs/tags/v${manifest_version}"+ tagged_archive="$RUNNER_TEMP/archify-tag-v${manifest_version}.zip"+ git show "v${manifest_version}:archify.zip" > "$tagged_archive"+ if ! cmp -s "$published_archive" "$tagged_archive"; then+ echo "::error::the published archify.zip asset must byte-match archify.zip committed at v${manifest_version}"+ exit 1+ fi+ node scripts/check-stable-update-manifest.mjs \+ --archive "$published_archive" \+ --tag "v${manifest_version}" \+ --source-ref "v${manifest_version}"+ if git cat-file -e "v${manifest_version}:scripts/stage-clean-skill.mjs" 2>/dev/null \+ && git cat-file -e "v${manifest_version}:scripts/write-deterministic-zip.mjs" 2>/dev/null; then+ tag_checkout="$RUNNER_TEMP/archify-tag-v${manifest_version}"+ rebuilt_archive="$RUNNER_TEMP/archify-rebuilt-v${manifest_version}.zip"+ git worktree add --detach "$tag_checkout" "v${manifest_version}"+ "$tag_checkout/scripts/build-zip.sh" "$rebuilt_archive"+ if ! cmp -s "$rebuilt_archive" "$tagged_archive"; then+ echo "::error::archify.zip committed at v${manifest_version} is not the deterministic build of that tag"+ exit 1+ fi+ elif [[ "$manifest_version" == "2.15.0" ]]; then+ echo "::notice::v2.15.0 predates the deterministic builder; its published asset is bound to the exact tagged archive blob"+ else+ echo "::error::v${manifest_version} is missing the deterministic archive builder"+ exit 1+ fi+package-smoke:name: package smoke (${{ matrix.os }})strategy:@@ -114,3 +169,44 @@ jobs:Expand-Archive -Path archify.zip -DestinationPath $packageRoot- name: Validate packaged skill without installing dependenciesrun: node scripts/package-smoke.mjs++ deploy-pages:+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'+ needs: [test, webm-artifact, zip-freshness, published-update-manifest, package-smoke]+ runs-on: ubuntu-latest+ concurrency:+ group: github-pages+ cancel-in-progress: false+ permissions:+ contents: read+ pages: write+ id-token: write+ environment:+ name: github-pages+ url: ${{ steps.deployment.outputs.page_url }}+ steps:+ - uses: actions/checkout@v4+ - name: Reject an obsolete deployment run+ id: deployment-head+ env:+ GH_TOKEN: ${{ github.token }}+ run: |+ current_main="$(gh api "repos/${GITHUB_REPOSITORY}/git/ref/heads/main" --jq '.object.sha')"+ if [[ "$current_main" == "$GITHUB_SHA" ]]; then+ echo 'current=true' >> "$GITHUB_OUTPUT"+ else+ echo 'current=false' >> "$GITHUB_OUTPUT"+ echo "::notice::Skipping obsolete Pages deployment for ${GITHUB_SHA}; main is ${current_main}"+ fi+ - name: Configure GitHub Pages+ if: steps.deployment-head.outputs.current == 'true'+ uses: actions/configure-pages@v5+ - name: Upload checked documentation+ if: steps.deployment-head.outputs.current == 'true'+ uses: actions/upload-pages-artifact@v4+ with:+ path: docs+ - name: Deploy checked documentation+ if: steps.deployment-head.outputs.current == 'true'+ id: deployment+ uses: actions/deploy-pages@v4diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 0590f2d7..007b81b0 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -49,13 +49,35 @@ jobs:shell: bashrun: |version="${GITHUB_REF_NAME#v}"- if [[ "$version" == *-* ]]; then+ channel="$(node --input-type=module -e 'import fs from "node:fs"; import { validateLocalRelease } from "./archify/scripts/update-contract.mjs"; const release = validateLocalRelease(JSON.parse(fs.readFileSync("./archify/skill-release.json", "utf8"))); if (release.version !== process.argv[1]) process.exit(1); process.stdout.write(release.channel);' "$version")"+ if [[ "$channel" == "development" ]]; thenecho "prerelease=true" >> "$GITHUB_OUTPUT"echo "make_latest=false" >> "$GITHUB_OUTPUT"elseecho "prerelease=false" >> "$GITHUB_OUTPUT"echo "make_latest=true" >> "$GITHUB_OUTPUT"fi+ - name: Stable release tag must be annotated+ if: steps.release-kind.outputs.prerelease == 'false'+ shell: bash+ run: |+ if [[ "$(git cat-file -t "refs/tags/${GITHUB_REF_NAME}" 2>/dev/null || true)" != "tag" ]]; then+ echo "::error::stable releases require an annotated tag: ${GITHUB_REF_NAME}"+ exit 1+ fi+ - name: Stable notifier manifest must remain on the previous release+ if: steps.release-kind.outputs.prerelease == 'false'+ run: |+ node --input-type=module -e '+ import fs from "node:fs";+ import { compareSemver, validateStableUpdateManifest } from "./archify/scripts/update-contract.mjs";+ const releasing = process.argv[1];+ const published = validateStableUpdateManifest(JSON.parse(fs.readFileSync("./docs/skill-updates/archify/stable.json", "utf8")));+ if (compareSemver(published.version, releasing) >= 0) {+ console.error(`::error::stable.json must remain below v${releasing} until its GitHub Release exists; publish the manifest in a follow-up commit`);+ process.exit(1);+ }+ ' "${GITHUB_REF_NAME#v}"- name: Build skill archiverun: scripts/build-zip.sh /tmp/archify-built.zip- name: Validate the exact release archive without installing dependencies@@ -74,3 +96,7 @@ jobs:generate_release_notes: trueprerelease: ${{ steps.release-kind.outputs.prerelease }}make_latest: ${{ steps.release-kind.outputs.make_latest }}+ - name: Record stable notifier publication follow-up+ if: steps.release-kind.outputs.prerelease == 'false'+ run: |+ echo 'After the repository Pages source is set to GitHub Actions, publish docs/skill-updates/archify/stable.json in a follow-up commit; the gated deploy job will verify this Release, its archify.zip digest, and the tagged Skill tree before exposure.' >> "$GITHUB_STEP_SUMMARY"diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4e8b166a..b0a5e870 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,8 +7,13 @@ All notable changes are documented here. Format loosely follows [Keep a ChangeloDevelopment identity: `v2.16.0-dev.0`### Added+- **Optional embedded Skill update awareness.** The packaged Skill can perform a cached, notification-only stable-release check with a fixed trusted manifest URL, strict identity and response bounds, SemVer downgrade protection, per-installed-version state, two-stage visible-notice acknowledgement, and a one-second fail-silent timeout. It never downloads, installs, executes, or overwrites an update; the user remains the sole update decision owner. Release identity, final ZIP contents, stable tag/tree/archive digests, and cross-platform packaged execution are gated in tests and release automation.- **Bounded Viewer localization.** All five renderers accept the optional `meta.locale` values `en` and `zh-CN`, localizing renderer-owned Viewer UI, accessibility copy, default legends, document titles, and language metadata without translating authored content. Omitted locale remains backward-compatible English, while unsupported authored languages retain their requested authored copy with an explicitly disclosed English Viewer fallback.+### Fixed+- Skill packaging now stages only tracked regular files through one symlink-safe path shared by the release ZIP and DeepSeek Harness bundle, while preserving legitimate nested runtime test directories and rejecting stale or dependency-bearing artifacts.+- Update checks use generation-fenced atomic cache snapshots, unconditional bounded requests without persistent server validators, and a Release-first publication gate that verifies the published archive digest and tagged Skill tree before a gated GitHub Pages deployment can expose a stable manifest.+## [2.15.0] — 2026-08-17### Addeddiff --git a/README.md b/README.mdindex 480afd4d..9edae19e 100644--- a/README.md+++ b/README.md@@ -115,6 +115,8 @@ npx skills use tt-a1i/archify@archify --agent codexThe [agent switcher](https://tt-a1i.github.io/archify/start.html?agent=cursor&type=architecture) covers `cursor`, `codex`, `claude-code`, and `opencode`. For Raven's manual ZIP install, extract [`archify.zip`](archify.zip) into `~/.raven/workspace/skills`; it yields `~/.raven/workspace/skills/archify`. Raven is not a switcher target.+Archify may GET the fixed stable manifest solely to show an optional reminder; it never downloads or installs updates. Successful checks wait about 72 hours (±20%); active use retries failures after 6, then 24 hours. The server sees normal HTTP metadata (IP and time), but receives no version, Agent, project data, prompts, account/device ID, or ETag. You decide whether and when to update. Set `ARCHIFY_UPDATE_CHECK_DISABLED=1` to disable networking and reminder-state writes.+### 2. Ask for one bounded view```text@@ -144,13 +146,9 @@ Continue with focused requests such as `add Redis`, `move auth to the left`, or| **Data Flow** | Pipelines, lineage, PII, consumers | Sources, transforms, stores, boundaries || **Lifecycle** | States, retries, waits, terminal outcomes | States, events, retry and cancellation paths |-For a production deployment review, Architecture can optionally enable the-`deployment-ownership` engineering profile. It fails closed when owners,-single-region placement, private database scope, or named boundary crossings-are missing. It is never enabled silently and validates authored facts—not live-infrastructure. See the [checked deployment proof](https://tt-a1i.github.io/archify/gallery.html#proof-deployment-ownership).+Architecture's optional `deployment-ownership` profile fails closed when authored owners, region placement, private database scope, or named crossings are missing; it is never implicit and does not inspect live infrastructure. See the [checked deployment proof](https://tt-a1i.github.io/archify/gallery.html#proof-deployment-ownership).-For design or PR review, Architecture Delta compares validated Before / Delta / After snapshots with a machine receipt. Select an exact authored change or play one finite Review—viewer-only, with no impact, risk, or merge-safety inference.+For design or PR review, Architecture Delta compares validated Before / Delta / After snapshots with a machine receipt. Select an authored change or play one finite, viewer-only Review; it infers no impact, risk, or merge safety.`node archify/bin/archify.mjs compare architecture base.json head.json architecture-delta.html --json`@@ -216,11 +214,11 @@ node bin/archify.mjs preview workflow examples/agent-tool-call.workflow.json /tmnode bin/archify.mjs deliver workflow examples/agent-tool-call.workflow.json /tmp/workflow.html --quality showcase --open --json```-`preview` is an explicit desktop authoring mode, not a default background service: it binds only to `127.0.0.1` on a random port, watches the one named JSON file, preserves the last verified output through failures, and stops with Ctrl-C. Add `--no-open` for tests or when you will open the printed local URL yourself. It adds no runtime to the generated HTML.+`preview` is an explicit loopback-only desktop mode: it watches one JSON file on a random `127.0.0.1` port, keeps the last verified output through failures, stops with Ctrl-C, and adds no generated-HTML runtime. Use `--no-open` for tests or manual URL opening.-Use `deliver --open` for a one-shot interactive local handoff. It is off by default, runs only after the verified artifact is committed, and never turns a successful delivery into a failure when the OS opener is unavailable; JSON stays on stdout and the absolute manual-open path goes to stderr.+`deliver --open` is an opt-in one-shot handoff after commit. Opener failure preserves success; JSON remains on stdout and the absolute fallback path goes to stderr.-On failure, `validate --json` and `deliver --json` still emit exactly one JSON object. Read `diagnostics[]` and change only the named subject using its `supportedFixes`; do not rewrite the whole diagram or exceed the Skill's two focused correction rounds. Deterministic diagnostics remain separate from visual review.+On failure, `validate --json` and `deliver --json` emit one JSON object. Apply only each `diagnostics[]` subject's `supportedFixes`, within the Skill's two correction rounds; visual review remains separate.Settings:diff --git a/README_EN.md b/README_EN.mdindex 480afd4d..9edae19e 100644--- a/README_EN.md+++ b/README_EN.md@@ -115,6 +115,8 @@ npx skills use tt-a1i/archify@archify --agent codexThe [agent switcher](https://tt-a1i.github.io/archify/start.html?agent=cursor&type=architecture) covers `cursor`, `codex`, `claude-code`, and `opencode`. For Raven's manual ZIP install, extract [`archify.zip`](archify.zip) into `~/.raven/workspace/skills`; it yields `~/.raven/workspace/skills/archify`. Raven is not a switcher target.+Archify may GET the fixed stable manifest solely to show an optional reminder; it never downloads or installs updates. Successful checks wait about 72 hours (±20%); active use retries failures after 6, then 24 hours. The server sees normal HTTP metadata (IP and time), but receives no version, Agent, project data, prompts, account/device ID, or ETag. You decide whether and when to update. Set `ARCHIFY_UPDATE_CHECK_DISABLED=1` to disable networking and reminder-state writes.+### 2. Ask for one bounded view```text@@ -144,13 +146,9 @@ Continue with focused requests such as `add Redis`, `move auth to the left`, or| **Data Flow** | Pipelines, lineage, PII, consumers | Sources, transforms, stores, boundaries || **Lifecycle** | States, retries, waits, terminal outcomes | States, events, retry and cancellation paths |-For a production deployment review, Architecture can optionally enable the-`deployment-ownership` engineering profile. It fails closed when owners,-single-region placement, private database scope, or named boundary crossings-are missing. It is never enabled silently and validates authored facts—not live-infrastructure. See the [checked deployment proof](https://tt-a1i.github.io/archify/gallery.html#proof-deployment-ownership).+Architecture's optional `deployment-ownership` profile fails closed when authored owners, region placement, private database scope, or named crossings are missing; it is never implicit and does not inspect live infrastructure. See the [checked deployment proof](https://tt-a1i.github.io/archify/gallery.html#proof-deployment-ownership).-For design or PR review, Architecture Delta compares validated Before / Delta / After snapshots with a machine receipt. Select an exact authored change or play one finite Review—viewer-only, with no impact, risk, or merge-safety inference.+For design or PR review, Architecture Delta compares validated Before / Delta / After snapshots with a machine receipt. Select an authored change or play one finite, viewer-only Review; it infers no impact, risk, or merge safety.`node archify/bin/archify.mjs compare architecture base.json head.json architecture-delta.html --json`@@ -216,11 +214,11 @@ node bin/archify.mjs preview workflow examples/agent-tool-call.workflow.json /tmnode bin/archify.mjs deliver workflow examples/agent-tool-call.workflow.json /tmp/workflow.html --quality showcase --open --json```-`preview` is an explicit desktop authoring mode, not a default background service: it binds only to `127.0.0.1` on a random port, watches the one named JSON file, preserves the last verified output through failures, and stops with Ctrl-C. Add `--no-open` for tests or when you will open the printed local URL yourself. It adds no runtime to the generated HTML.+`preview` is an explicit loopback-only desktop mode: it watches one JSON file on a random `127.0.0.1` port, keeps the last verified output through failures, stops with Ctrl-C, and adds no generated-HTML runtime. Use `--no-open` for tests or manual URL opening.-Use `deliver --open` for a one-shot interactive local handoff. It is off by default, runs only after the verified artifact is committed, and never turns a successful delivery into a failure when the OS opener is unavailable; JSON stays on stdout and the absolute manual-open path goes to stderr.+`deliver --open` is an opt-in one-shot handoff after commit. Opener failure preserves success; JSON remains on stdout and the absolute fallback path goes to stderr.-On failure, `validate --json` and `deliver --json` still emit exactly one JSON object. Read `diagnostics[]` and change only the named subject using its `supportedFixes`; do not rewrite the whole diagram or exceed the Skill's two focused correction rounds. Deterministic diagnostics remain separate from visual review.+On failure, `validate --json` and `deliver --json` emit one JSON object. Apply only each `diagnostics[]` subject's `supportedFixes`, within the Skill's two correction rounds; visual review remains separate.Settings:diff --git a/README_ZH.md b/README_ZH.mdindex 60924c89..53d39ec2 100644--- a/README_ZH.md+++ b/README_ZH.md@@ -107,9 +107,9 @@ npx -y skills add tt-a1i/archify --skill archify --agent cursor --global --copynpx skills use tt-a1i/archify@archify --agent codex```-DeepSeek Harness(社区集成、显式启用):运行 `dsh plugin --profile web add @tt-a1i/[email protected]`;参见[兼容范围、限制与安全说明](integrations/deepseek-harness/README.md)。+DeepSeek Harness(社区集成、显式启用):运行 `dsh plugin --profile web add @tt-a1i/[email protected]`;参见[兼容范围、限制与安全说明](integrations/deepseek-harness/README.md)。[Agent 切换器](https://tt-a1i.github.io/archify/start.html?agent=cursor&type=architecture)只为 `cursor`、`codex`、`claude-code` 和 `opencode` 生成命令。Raven 仅支持 ZIP 手动安装:将 [`archify.zip`](archify.zip) 解压到 `~/.raven/workspace/skills`,解压后会得到 `~/.raven/workspace/skills/archify`;Raven 不属于切换器目标。-[Agent 切换器](https://tt-a1i.github.io/archify/start.html?agent=cursor&type=architecture)只为 `cursor`、`codex`、`claude-code` 和 `opencode` 生成命令。Raven 仅支持 ZIP 手动安装:将 [`archify.zip`](archify.zip) 解压到 `~/.raven/workspace/skills`,解压后会得到 `~/.raven/workspace/skills/archify`;Raven 不属于切换器目标。+安装后的 Skill 包含一个低频、失败静默的发布检查,它最多只显示可选更新提醒,绝不会自行下载或安装更新。一次成功检查后,下次网络请求通常约在 72 小时(±20%)后发出;检查失败后,活跃使用可能在首次 6 小时、后续 24 小时退避到期时重试。请求只访问 `https://tt-a1i.github.io/archify/skill-updates/archify/stable.json`。服务端会自然获得 IP、请求时间和常规 HTTP 元数据;检查器不会发送本地版本、Agent、项目数据、用户输入、账户/设备标识,也不会保存或回传 ETag。是否更新以及何时更新始终由你决定。如需完全关闭检查(包括网络请求和提醒状态写入),请在 Agent 环境中设置 `ARCHIFY_UPDATE_CHECK_DISABLED=1`。### 2. 先画一个边界清楚的视图diff --git a/ROADMAP.md b/ROADMAP.mdindex 48b2b956..51cf4730 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -1,6 +1,9 @@# Archify Roadmap-The current development line is `v2.16.0-dev.0`. Across the current development line, the coordinate-stability work uses JSON IR plus typed renderers for architecture, workflow, sequence, data-flow, and lifecycle diagrams. Workflow diagrams also have phase/group/exception-lane structure, happy-path linting, trace animation, and route-crossing guards. The shared viewer adds deterministic semantic node IDs, optional author-controlled relationship IDs with durable `#relation=` links, a pre-click Intent Trace for exact one-hop traffic, a two-endpoint Route Probe with an inspectable Route Journey over deterministic shortest authored paths, searchable Node Finder navigation, read-only one-hop focus with a renderer-owned Semantic Passport and copyable focus link, upstream/downstream Authored Reachability, a runtime-built Semantic Radar for desktop viewport navigation, bounded typed guided views with a visible Named Chapter Rail, pre-commit Chapter Delta Preview, Shared Anchor Handoff, and path-aware Semantic Story Beats, a reader-controlled Live/Still Motion Governor, share-ready one-shot chapters with a title/route/step/state/progress cue, a viewport-filling Presentation Stage, Semantic Camera framing, pan/zoom, four reader-switchable visual presets with a direct Style Picker, optional authored brand marks, a contain-only 1200×630 Share Card, route-focused Route Share Card and authored-reach Reach Share Card variants, and browser-native WebM export. A generated Proof Lab publishes 11 live scenario artifacts with their exact sources, three named reader views, 99 artifact checks, and named composition receipts; its preview grid stays static while deliberate proof links play one named chapter once. The landing-page Live Proof Stage promotes three of those generated artifacts into the first bounded motion proof, and the README motion reel carries the same proof-first story onto GitHub without claiming SVG animation support. A question-first scenario guide maps concrete user needs to those 11 bounded recipes across the five modes, with one shared source for CLI and GitHub Pages and direct proof navigation. A unified CLI (`bin/archify.mjs`) wraps guide, render, preview, deliver, validate, check, visual-check, brands, and examples, with optional last-good desktop preview, verified post-commit open handoffs, and bounded viewport evidence. This file records the design decisions that led there, plus the ideas that were explicitly declined. The original v2.4 / v2.5 backlog (export-scale URL param, color-blind palette, gzip+base64 share links) was considered and dropped — see [Not planned](#not-planned) for the rationale on each.+The current development line is `v2.16.0-dev.0`; it contains the work under Changelog Unreleased and is not a stable release. [CHANGELOG.md](CHANGELOG.md) is the single owner for delivered feature history. This file owns architectural direction, retained rationale, and explicitly declined ideas.++<details>+<summary>Archived delivered-slice context (frozen; no longer maintained as a second changelog)</summary>The latest stability and viewer slice adds `archify visual-check` as a small evidence tool rather than an automatic visual verdict: it measures four desktop viewports, captures light/dark endpoint screenshots, writes a contact sheet, and leaves human review pending. The same slice gives wide diagrams a height-budgeted first screen, keeps near-aligned singly spread links straight without weakening obstacle or explicit-route behavior, preserves relationship-label semantics and explicit deployment-profile selection, follows the user's language for visible copy, and reduces toolbar/dock prominence while retaining 44px mobile targets. Classic remains the default in both themes. No schema expansion, general auto-layout engine, browser dependency in the installed package, hosted service, telemetry, or new mobile product surface was added.@@ -84,6 +87,8 @@ The previous viewer slice turned the counted two-kind Semantic Lens into a delibThis roadmap was rewritten on 2026-04-16 after three independent design reviews, and updated the same day after a visual-quality validation experiment conclusively failed (see `experiments/v3-mermaid-validation/RESULT.md`).+</details>+---## JSON IR for coordinate stabilitydiff --git a/archify.zip b/archify.zipindex b6dcc9c8..b3ba88ff 100644Binary files a/archify.zip and b/archify.zip differdiff --git a/archify/SKILL.md b/archify/SKILL.mdindex ae9251d2..0e3810c8 100644--- a/archify/SKILL.md+++ b/archify/SKILL.md@@ -34,6 +34,15 @@ Use this bounded path for ordinary generation. Do not read the optional Viewer RA non-zero exit can never be described as success. If validation fails, change only the diagnosed `subject`, verify `evidence`, choose from `supportedFixes`, and rerun. Continue focused correction while the objective error count reaches a new minimum. If two consecutive rounds do not improve that best count, stop and report the unresolved diagnostics truthfully.+## Update awareness++After the first candidate exists, run the packaged checker `scripts/check-update.mjs` once with Node and continue the requested workflow. If the command cannot run, continue without mentioning the check.++- For `silent`, continue without mentioning the update check.+- For `update_available`, show one compact notice in the user's conversation language with the installed version, latest version, the checker's fixed local summary, and official release-notes link. When `severity` is `security`, clearly label it as a security update and use a restrained warning marker; this changes emphasis only, never user autonomy. Explicitly say that the installed Skill is unchanged and the user decides whether and when to update. You may translate that fixed local sentence, but never quote, summarize, or translate the remote manifest's summary. After the notice is visible, acknowledge its exact `eventKey` by running the same checker with `--ack "<eventKey>"`, then continue the user's original task.++The notice is information, not permission. Keep the installed version unchanged; this v0.1 workflow never downloads, installs, or executes an update, and silence is never consent.+Do not read `renderers/shared/geometry.mjs`, renderer source, validator source, tests, or benchmarks before the first candidate. Inspect implementation only for an unsupported internal diagnostic or after two focused repairs fail.Lifecycle note: phase columns `0..4` occupy the main rail; event/outcome columns `0..2` align beneath later phases. A recoverable state uses `type: "failure"` plus a real transition back to the active state.diff --git a/archify/bin/archify.mjs b/archify/bin/archify.mjsindex 13a782f9..3bf02a7e 100755--- a/archify/bin/archify.mjs+++ b/archify/bin/archify.mjs@@ -704,15 +704,15 @@ function commandRender(args) {if (result.status !== 0) exitFrom(result);}-function reportDeliveryFailure({ json, stage, type, input, output, error, diagnostics = [], status = 1, checker }) {+function reportArtifactFailure({ command, json, stage, type, input, output, error, diagnostics = [], status = 1, checker }) {const receipt = {schemaVersion: 1,ok: false,- command: 'deliver',+ command,stage,type,input,- output,+ ...(output === undefined ? {} : { output }),error,diagnostics,...(checker ? { checker } : {}),@@ -722,21 +722,12 @@ function reportDeliveryFailure({ json, stage, type, input, output, error, diagnoprocess.exitCode = status;}-function reportValidateFailure({ json, stage, type, input, error, diagnostics = [], status = 1, checker }) {- const receipt = {- schemaVersion: 1,- ok: false,- command: 'validate',- stage,- type,- input,- error,- diagnostics,- ...(checker ? { checker } : {}),- };- if (json) console.log(JSON.stringify(receipt, null, 2));- else console.error(formatDiagnostics(error, diagnostics));- process.exitCode = status;+function reportDeliveryFailure(options) {+ reportArtifactFailure({ ...options, command: 'deliver' });+}++function reportValidateFailure(options) {+ reportArtifactFailure({ ...options, command: 'validate' });}function sourceEvidenceFromArtifact(artifact) {diff --git a/archify/bin/visual-check.mjs b/archify/bin/visual-check.mjsindex 1a483a90..64f48249 100644--- a/archify/bin/visual-check.mjs+++ b/archify/bin/visual-check.mjs@@ -4,18 +4,21 @@ import fs from 'node:fs';import os from 'node:os';import path from 'node:path';import { pathToFileURL } from 'node:url';-import { MIN_PROJECTED_NODE_TEXT_PX } from '../renderers/shared/desktop-readability.mjs';+import {+ DESKTOP_READABILITY_VIEWPORT,+ MIN_PROJECTED_NODE_TEXT_PX,+} from '../renderers/shared/desktop-readability.mjs';export const VISUAL_CHECK_VIEWPORTS = Object.freeze([- Object.freeze({ width: 1440, height: 900 }),+ DESKTOP_READABILITY_VIEWPORT,Object.freeze({ width: 1600, height: 1000 }),Object.freeze({ width: 1920, height: 1080 }),Object.freeze({ width: 2048, height: 1320 }),]);const CAPTURE_VIEWPORTS = Object.freeze([- Object.freeze({ width: 1440, height: 900 }),- Object.freeze({ width: 2048, height: 1320 }),+ VISUAL_CHECK_VIEWPORTS[0],+ VISUAL_CHECK_VIEWPORTS[VISUAL_CHECK_VIEWPORTS.length - 1],]);const THEMES = Object.freeze(['light', 'dark']);const EXIT = Object.freeze({ pass: 0, fail: 1, skipped: 2 });diff --git a/archify/delta/architecture-delta.mjs b/archify/delta/architecture-delta.mjsindex 6b63b4dd..0c49ae76 100644--- a/archify/delta/architecture-delta.mjs+++ b/archify/delta/architecture-delta.mjs@@ -716,7 +716,7 @@ rect[data-graph-role="structural-frame"][data-delta-state="added"]{stroke:var(--details{margin-top:12px;border:1px solid var(--d-line);border-radius:9px;background:#0a141e}summary{padding:13px 15px;cursor:pointer;font-weight:700}.changes{list-style:none;margin:0;padding:0 8px 8px}.changes li{border-top:1px solid rgba(138,160,181,.16)}.change-row{display:grid;grid-template-columns:30px 90px minmax(140px,1fr) minmax(100px,.7fr) minmax(120px,.8fr) minmax(140px,1.2fr);gap:10px;width:100%;margin:0;padding:9px 7px;border:0;border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:11px;text-align:left;align-items:baseline;cursor:pointer}.change-row:hover{background:rgba(125,211,252,.06)}.change-row[aria-current="step"]{background:rgba(125,211,252,.1);box-shadow:inset 0 0 0 1px var(--d-focus)}.change-row:disabled{cursor:default}.token{font:800 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.changes code,.change-row>span:last-child{color:var(--d-muted)}.proof-foot{display:flex;justify-content:space-between;gap:24px;margin-top:14px;color:var(--d-muted);font:650 10px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace}html[data-theme="dark"] body{background:#071019!important;background-image:none!important}html[data-theme="light"]{color-scheme:light;--d-ink:#10283c;--d-muted:#587187;--d-line:#c8d6e2;--d-focus:#006b8f}html[data-theme="light"] body{background:#eef3f7!important;background-image:none!important;color:var(--d-ink)}html[data-theme="light"] .metric,html[data-theme="light"] .view-switch,html[data-theme="light"] details{background:#fff}html[data-theme="light"] .canvas{background:#f8fbfd}html[data-theme="light"] .view-switch button[aria-selected="true"]{background:#dbeaf5;color:#10283c}html[data-theme="light"] .delta-node-marker circle{fill:#fff}html[data-preset="blueprint"] body{background-image:none!important}@media(max-width:760px){.proof-page{width:100%;padding:12px}.proof-head{grid-template-columns:1fr;gap:14px;align-items:start}.proof-head h1{font-size:32px}.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.metric{min-width:0}.proof-tools{align-items:stretch;flex-wrap:wrap;gap:8px}.view-switch{display:flex;flex:1 1 100%}.view-switch button{flex:1;padding-inline:8px}.legend{flex-wrap:wrap;gap:8px}.proof-tools>div:last-child{margin-left:auto}.review-strip{grid-template-columns:auto auto auto auto}.review-status{grid-column:1/-1;padding:4px 2px 0}.canvas{min-height:0;padding:6px;overflow:auto}.canvas svg{min-width:720px;max-height:none}.snapshot-frame{min-width:720px}.changes{overflow-x:auto}.change-row{min-width:820px}.proof-foot{flex-direction:column;gap:4px}}-@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}.canvas[data-delta-review-active] [data-delta-review-current]{transition:none!important}}@media print{body{min-width:0;background:#fff;color:#111}.proof-page{width:100%;padding:0}.proof-tools,.review-strip,details{display:none!important}.canvas{display:none!important}.canvas[data-view="delta"]{display:block!important;border:0}.canvas[data-delta-review-active]{--review-same-opacity:1;--review-change-opacity:1}.canvas[data-delta-review-active] [data-delta-review-current]{opacity:1!important;transition:none!important}.proof-foot{color:#444}}+@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}.canvas[data-delta-review-active] [data-delta-review-current]{transition:none!important}}@media print{body{min-width:0;background:#fff;color:#111}.proof-page{width:100%;padding:0}.proof-tools,.review-strip,details{display:none!important}.canvas{display:none!important}.canvas[data-view="delta"]{display:block!important;border:0}.canvas[data-view="delta"] [data-delta-state="same"]{opacity:1!important;transition:none!important}.canvas[data-delta-review-active]{--review-same-opacity:1;--review-change-opacity:1}.canvas[data-delta-review-active] [data-delta-review-current]{opacity:1!important;transition:none!important}.proof-foot{color:#444}}</style></head><body><main class="proof-page"><header class="proof-head"><div><p class="eyebrow">ARCHITECTURE DELTA · ${proof}</p><h1>See what changed<br>before you merge.</h1><p class="subtitle">${esc(receipt.base.title)} → ${esc(receipt.head.title)}</p></div><div class="metrics"><div class="metric add"><strong>${total(receipt.summary, 'added')}</strong><span>ADDED</span></div><div class="metric remove"><strong>${total(receipt.summary, 'removed')}</strong><span>REMOVED</span></div><div class="metric change"><strong>${changed}</strong><span>CHANGED</span></div></div></header><div class="proof-tools"><div class="view-switch" role="tablist" aria-label="Architecture snapshot"><button role="tab" data-target="base" aria-selected="false">Before</button><button role="tab" data-target="delta" aria-selected="true">Delta</button><button role="tab" data-target="head" aria-selected="false">After</button></div><div class="legend"><span class="add"><i></i>+ ADD</span><span class="remove"><i></i>− DEL</span><span class="change"><i></i>~ MOD</span><span class="move"><i></i>↔ MOVE</span></div><div><button class="utility" id="export-svg" type="button">Export SVG</button> <button class="utility" id="share-card" type="button">Share Card</button> <button class="utility" id="preset" type="button">Preset</button> <button class="utility" id="theme" type="button">Theme</button></div></div>diff --git a/archify/recipes/scenarios.mjs b/archify/recipes/scenarios.mjsindex 392df178..87fc19ae 100644--- a/archify/recipes/scenarios.mjs+++ b/archify/recipes/scenarios.mjs@@ -303,7 +303,9 @@ export function recommendScenario(query, options = {}) {export function formatScenarioList(lang = 'en') {const isZh = lang === 'zh';- const heading = isZh ? 'Archify 场景配方(11)' : 'Archify scenario recipes (11)';+ const heading = isZh+ ? `Archify 场景配方(${SCENARIO_RECIPES.length})`+ : `Archify scenario recipes (${SCENARIO_RECIPES.length})`;const intro = isZh? '先选择你要回答的问题,再选择图表类型。可运行:archify guide "你的场景"': 'Choose the question before the diagram type. Run: archify guide "your scenario"';diff --git a/archify/references/delivery-contract.md b/archify/references/delivery-contract.mdindex 655794b4..f111809d 100644--- a/archify/references/delivery-contract.md+++ b/archify/references/delivery-contract.md@@ -48,6 +48,8 @@ node bin/archify.mjs preview <type> <input>.json <output>.html --quality showcasPreview watches one explicit input on loopback, binds each stable digest to a private snapshot, and advances only after the existing verified delivery pipeline passes. Invalid, half-written, deleted, or superseded input leaves the previous verified revision on screen and on disk. Identical bytes do not rebuild or reload.+The preview runtime ships inside the zero-dependency Skill ZIP and must work without `node_modules`.+Never start it by default. Do not use it for CI, unattended agents, remote sharing, or mobile use. `--no-open` is only for a user who will open the printed local URL or for loop testing. Stop it with Ctrl-C before handoff. Server state, port, source path, diagnostics, error text, and reload tokens must never enter the generated artifact or any export.## Perceptual delivery gatediff --git a/archify/renderers/architecture/render-architecture.mjs b/archify/renderers/architecture/render-architecture.mjsindex 247c6042..59d5f196 100644--- a/archify/renderers/architecture/render-architecture.mjs+++ b/archify/renderers/architecture/render-architecture.mjs@@ -340,15 +340,6 @@ function validateArchitecture() {problems.push(resolvedBoundaryTitles.readabilityProblem);}const requiresNestedBoundaryMembership = arch.meta?.engineering_profile === 'deployment-ownership';- if (arch.schema_version !== 1) problems.push('Architecture files must set "schema_version": 1.');- if (arch.diagram_type !== 'architecture') problems.push('Architecture files must set "diagram_type": "architecture".');- if (!arch.meta?.title) problems.push('Architecture files must include meta.title.');- if (!Array.isArray(arch.components) || arch.components.length < 1) {- problems.push('Architecture diagrams need at least one component.');- }- if (arch.connections !== undefined && !Array.isArray(arch.connections)) problems.push('Architecture "connections" must be an array.');- if (arch.boundaries !== undefined && !Array.isArray(arch.boundaries)) problems.push('Architecture "boundaries" must be an array.');- if (arch.cards !== undefined && !Array.isArray(arch.cards)) problems.push('Architecture "cards" must be an array.');if (components.size !== asArray(arch.components).length) problems.push('Component ids must be unique.');if (grid) {validateGridPlacement(arch, grid, problems);@@ -1046,7 +1037,7 @@ function renderLegend() {}function renderSvg() {- return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(arch.meta, 'architecture diagram')}>+ return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(arch.meta)}>${svgAccessibleText(arch.meta, 'architecture')}${renderDefinitions()}diff --git a/archify/renderers/dataflow/render-dataflow.mjs b/archify/renderers/dataflow/render-dataflow.mjsindex 1a539eb0..7434f2bc 100644--- a/archify/renderers/dataflow/render-dataflow.mjs+++ b/archify/renderers/dataflow/render-dataflow.mjs@@ -117,17 +117,6 @@ for (const [index, node] of asArray(dataflow.nodes).entries()) {function validateDataflow() {const problems = [];- if (dataflow.schema_version !== 1) problems.push('Data-flow files must set "schema_version": 1.');- if (dataflow.diagram_type !== 'dataflow') problems.push('Data-flow files must set "diagram_type": "dataflow".');- if (!dataflow.meta?.title) problems.push('Data-flow files must include meta.title.');- if (!Array.isArray(dataflow.stages) || dataflow.stages.length < 2) {- problems.push('Data-flow diagrams need at least two stages.');- }- if (!Array.isArray(dataflow.nodes) || dataflow.nodes.length < 2) {- problems.push('Data-flow diagrams need at least two nodes.');- }- if (!Array.isArray(dataflow.flows)) problems.push('Data-flow diagrams must include a flows array.');- if (dataflow.cards !== undefined && !Array.isArray(dataflow.cards)) problems.push('Data-flow "cards" must be an array.');if (nodes.size !== asArray(dataflow.nodes).length) problems.push('Node ids must be unique.');const stageCount = asArray(dataflow.stages).length;@@ -447,7 +436,7 @@ function renderLegend() {}function renderSvg() {- return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(dataflow.meta, 'data-flow diagram')}>+ return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(dataflow.meta)}>${svgAccessibleText(dataflow.meta, 'dataflow')}${renderDefinitions()}diff --git a/archify/renderers/lifecycle/render-lifecycle.mjs b/archify/renderers/lifecycle/render-lifecycle.mjsindex 759af921..5b692d5c 100644--- a/archify/renderers/lifecycle/render-lifecycle.mjs+++ b/archify/renderers/lifecycle/render-lifecycle.mjs@@ -140,13 +140,6 @@ for (const [index, state] of asArray(lifecycle.states).entries()) {function validateLifecycle() {const problems = [];- if (lifecycle.schema_version !== 1) problems.push('Lifecycle files must set "schema_version": 1.');- if (lifecycle.diagram_type !== 'lifecycle') problems.push('Lifecycle files must set "diagram_type": "lifecycle".');- if (!lifecycle.meta?.title) problems.push('Lifecycle files must include meta.title.');- if (!Array.isArray(lifecycle.lanes) || lifecycle.lanes.length < 1) problems.push('Lifecycle diagrams need at least one lane.');- if (!Array.isArray(lifecycle.states) || lifecycle.states.length < 2) problems.push('Lifecycle diagrams need at least two states.');- if (!Array.isArray(lifecycle.transitions)) problems.push('Lifecycle diagrams must include a transitions array.');- if (lifecycle.cards !== undefined && !Array.isArray(lifecycle.cards)) problems.push('Lifecycle "cards" must be an array.');if (states.size !== asArray(lifecycle.states).length) problems.push('State ids must be unique.');// The three bands are fixed at y=112/264/436. Preserve the original@@ -532,7 +525,7 @@ function renderLifecycleRail() {}function renderSvg() {- return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(lifecycle.meta, 'lifecycle diagram')}>+ return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(lifecycle.meta)}>${svgAccessibleText(lifecycle.meta, 'lifecycle')}${renderDefinitions()}diff --git a/archify/renderers/sequence/render-sequence.mjs b/archify/renderers/sequence/render-sequence.mjsindex a86760ca..bfa4c01e 100644--- a/archify/renderers/sequence/render-sequence.mjs+++ b/archify/renderers/sequence/render-sequence.mjs@@ -134,20 +134,7 @@ function messagePath(message) {function validateSequence() {const problems = [];- if (sequence.schema_version !== 1) problems.push('Sequence files must set "schema_version": 1.');- if (sequence.diagram_type !== 'sequence') problems.push('Sequence files must set "diagram_type": "sequence".');- if (!sequence.meta?.title) problems.push('Sequence files must include meta.title.');- if (!Array.isArray(sequence.participants) || sequence.participants.length < 2) {- problems.push('Sequence diagrams need at least two participants.');- }if (participants.size !== asArray(sequence.participants).length) problems.push('Participant ids must be unique.');- if (!Array.isArray(sequence.messages) || sequence.messages.length < 1) {- problems.push('Sequence diagrams need at least one message.');- }- if (sequence.cards !== undefined && !Array.isArray(sequence.cards)) problems.push('Sequence "cards" must be an array.');- for (const arr of ['segments', 'activations']) {- if (sequence[arr] !== undefined && !Array.isArray(sequence[arr])) problems.push(`Sequence "${arr}" must be an array.`);- }if (layout.lifelineBottom - layout.lifelineTop < 120) {problems.push(`viewBox height ${viewBox[1]} leaves under 120px of timeline — set meta.viewBox[1] to at least ${layout.lifelineTop + 120 + 65}.`);@@ -427,7 +414,7 @@ function renderLegend() {function renderSvg() {const participantList = [...participants.values()];- return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(sequence.meta, 'sequence diagram')}>+ return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(sequence.meta)}>${svgAccessibleText(sequence.meta, 'sequence')}${renderDefinitions()}diff --git a/archify/renderers/shared/cli.mjs b/archify/renderers/shared/cli.mjsindex 6fa45e9c..32f66726 100644--- a/archify/renderers/shared/cli.mjs+++ b/archify/renderers/shared/cli.mjs@@ -26,8 +26,6 @@ export function loadDiagram({ rendererDir, diagramType, defaultExample, argv = pvalidateEngineeringProfile(diagramType, diagram);const sourceEvidence = verifyRepositoryEvidence(diagramType, diagram, process.env.ARCHIFY_REPO_ROOT);const template = fs.readFileSync(path.join(skillRoot, 'assets/template.html'), 'utf8');- // Optional chaining: in degraded mode (no ajv) malformed input must still- // reach the renderer's friendly layout checks instead of crashing here.const outputRequest = {requestedOutput: argv[3],authoredOutput: diagram.meta?.output,@@ -148,7 +146,7 @@ export function validateGuidedViews(diagramType, diagram) {}// Accessible name for the generated diagram SVG.-export function svgRootAttrs(meta, kind) {+export function svgRootAttrs(meta) {const animation = meta.animation === 'trace' ? ' data-animation="trace"' : '';const preset = ` data-preset="${esc(meta.visual_preset || 'classic')}"`;const engineeringProfile = meta.engineering_profilediff --git a/archify/renderers/shared/generated-validators.mjs b/archify/renderers/shared/generated-validators.mjsindex b8e9e73f..05741c9c 100644--- a/archify/renderers/shared/generated-validators.mjs+++ b/archify/renderers/shared/generated-validators.mjs@@ -1,5 +1,5 @@// Generated by scripts/generate-validators.mjs. Do not edit by hand.-"use strict";export const workflow = validate20;const schema31 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/workflow.schema.json","title":"Archify Workflow Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","lanes","nodes","edges"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"workflow"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"type":"string"},"animation":{"enum":["trace","none"]},"visual_preset":{"enum":["classic","signal-flow","blueprint","editorial"]},"quality_profile":{"enum":["standard","showcase"]},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"frontend":{"$ref":"common.schema.json#/$defs/legendEntry"},"backend":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"},"cloud":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"messagebus":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":700},{"type":"number","minimum":240}],"items":false,"minItems":2,"maxItems":2}}},"lanes":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"variant":{"enum":["normal","exception"]}}}},"phases":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","label","fromCol","toCol"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"fromCol":{"type":"integer","minimum":0,"maximum":5},"toCol":{"type":"integer","minimum":0,"maximum":5},"variant":{"enum":["default","emphasis","security","dashed"]}}}},"groups":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","label","lane","fromCol","toCol"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"lane":{"$ref":"common.schema.json#/$defs/id"},"fromCol":{"type":"integer","minimum":0,"maximum":5},"toCol":{"type":"integer","minimum":0,"maximum":5},"variant":{"enum":["default","emphasis","security","dashed"]}}}},"mainPath":{"type":"array","minItems":2,"items":{"$ref":"common.schema.json#/$defs/id"}},"nodes":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","lane","col","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"lane":{"$ref":"common.schema.json#/$defs/id"},"col":{"type":"integer","minimum":0,"maximum":5},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"width":{"type":"number","minimum":32},"height":{"type":"number","minimum":32},"yOffset":{"type":"number"}}}},"edges":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"role":{"enum":["main","branch","async","return","error"]},"fromSide":{"$ref":"#/$defs/side"},"toSide":{"$ref":"#/$defs/side"},"route":{"enum":["auto","straight","drop","outside-right","return-left","bottom-channel","up-channel"]},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"channelX":{"type":"number"},"channelY":{"type":"number"},"bias":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0.5}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}},"$defs":{"side":{"enum":["left","right","top","bottom"]}}};const schema33 = {"enum":["en","zh-CN"]};const schema37 = {"enum":["auto","all","hidden"]};const schema38 = {"type":"object","additionalProperties":false,"minProperties":1,"properties":{"label":{"type":"string","minLength":1,"maxLength":80},"visible":{"type":"boolean"}}};const schema35 = {"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_-]*$"};const schema52 = {"enum":["frontend","backend","database","cloud","security","messagebus","external"]};const schema53 = {"oneOf":[{"type":"string","minLength":1,"maxLength":2048,"anyOf":[{"maxLength":80,"pattern":"^[^\\r\\n]+$"},{"pattern":"^https?://"}]},{"type":"object","additionalProperties":false,"required":["url","sha256"],"properties":{"url":{"type":"string","minLength":8,"maxLength":2048,"pattern":"^https?://"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}]};const schema57 = {"enum":["default","emphasis","security","dashed"]};const schema58 = {"enum":["left","right","top","bottom"]};const schema60 = {"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2};const schema62 = {"type":"array","items":{"type":"object","additionalProperties":false,"required":["dot","title","items"],"properties":{"dot":{"enum":["cyan","emerald","violet","amber","rose","orange","slate"]},"title":{"type":"string","minLength":1},"items":{"type":"array","items":{"type":"string"}}}}};const func1 = Object.prototype.hasOwnProperty;const func3 = function ucs2length(str) {+"use strict";export const workflow = validate20;const schema31 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/workflow.schema.json","title":"Archify Workflow Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","lanes","nodes","edges"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"workflow"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"type":"string"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"frontend":{"$ref":"common.schema.json#/$defs/legendEntry"},"backend":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"},"cloud":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"messagebus":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":700},{"type":"number","minimum":240}],"items":false,"minItems":2,"maxItems":2}}},"lanes":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"variant":{"enum":["normal","exception"]}}}},"phases":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","label","fromCol","toCol"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"fromCol":{"type":"integer","minimum":0,"maximum":5},"toCol":{"type":"integer","minimum":0,"maximum":5},"variant":{"$ref":"common.schema.json#/$defs/variant"}}}},"groups":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","label","lane","fromCol","toCol"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"lane":{"$ref":"common.schema.json#/$defs/id"},"fromCol":{"type":"integer","minimum":0,"maximum":5},"toCol":{"type":"integer","minimum":0,"maximum":5},"variant":{"$ref":"common.schema.json#/$defs/variant"}}}},"mainPath":{"type":"array","minItems":2,"items":{"$ref":"common.schema.json#/$defs/id"}},"nodes":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","lane","col","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"lane":{"$ref":"common.schema.json#/$defs/id"},"col":{"type":"integer","minimum":0,"maximum":5},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"width":{"type":"number","minimum":32},"height":{"type":"number","minimum":32},"yOffset":{"type":"number"}}}},"edges":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"role":{"enum":["main","branch","async","return","error"]},"fromSide":{"$ref":"common.schema.json#/$defs/side"},"toSide":{"$ref":"common.schema.json#/$defs/side"},"route":{"enum":["auto","straight","drop","outside-right","return-left","bottom-channel","up-channel"]},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"channelX":{"type":"number"},"channelY":{"type":"number"},"bias":{"type":"number","minimum":0,"maximum":1},"width":{"$ref":"common.schema.json#/$defs/relationshipWidth"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};const schema33 = {"enum":["en","zh-CN"]};const schema34 = {"enum":["trace","none"]};const schema35 = {"enum":["classic","signal-flow","blueprint","editorial"]};const schema36 = {"enum":["standard","showcase"]};const schema40 = {"enum":["auto","all","hidden"]};const schema41 = {"type":"object","additionalProperties":false,"minProperties":1,"properties":{"label":{"type":"string","minLength":1,"maxLength":80},"visible":{"type":"boolean"}}};const schema38 = {"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_-]*$"};const schema50 = {"enum":["default","emphasis","security","dashed"]};const schema57 = {"enum":["frontend","backend","database","cloud","security","messagebus","external"]};const schema58 = {"oneOf":[{"type":"string","minLength":1,"maxLength":2048,"anyOf":[{"maxLength":80,"pattern":"^[^\\r\\n]+$"},{"pattern":"^https?://"}]},{"type":"object","additionalProperties":false,"required":["url","sha256"],"properties":{"url":{"type":"string","minLength":8,"maxLength":2048,"pattern":"^https?://"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}]};const schema63 = {"enum":["left","right","top","bottom"]};const schema65 = {"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2};const schema67 = {"type":"number","minimum":0.5};const schema68 = {"type":"array","items":{"type":"object","additionalProperties":false,"required":["dot","title","items"],"properties":{"dot":{"enum":["cyan","emerald","violet","amber","rose","orange","slate"]},"title":{"type":"string","minLength":1},"items":{"type":"array","items":{"type":"string"}}}}};const func1 = Object.prototype.hasOwnProperty;const func3 = function ucs2length(str) {const len = str.length;let length = 0;let pos = 0;@@ -10,4 +10,4 @@&& (str.charCodeAt(pos) & 0xfc00) === 0xdc00) pos += 1;}return length;-};const schema34 = {"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["id","label","focus"],"properties":{"id":{"$ref":"#/$defs/id"},"label":{"type":"string","minLength":1,"maxLength":48},"focus":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/id"}},"note":{"type":"string","maxLength":140}}}};const pattern4 = new RegExp("^[a-zA-Z][a-zA-Z0-9_-]*$", "u");function validate22(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate22.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern4.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};const pattern13 = new RegExp("^[^\\r\\n]+$", "u");const pattern14 = new RegExp("^https?://", "u");const pattern16 = new RegExp("^[a-f0-9]{64}$", "u");function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/workflow.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.lanes === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lanes"},message:"must have required property '"+"lanes"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.nodes === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "nodes"},message:"must have required property '"+"nodes"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.edges === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "edges"},message:"must have required property '"+"edges"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(func1.call(schema31.properties, key0))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("workflow" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "workflow"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key1 in data2){if(!(func1.call(schema31.properties.meta.properties, key1))){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!((data4 === "en") || (data4 === "zh-CN"))){const err13 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err14 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.output !== undefined){if(typeof data2.output !== "string"){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"#/properties/meta/properties/output/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err16 = {instancePath:instancePath+"/meta/animation",schemaPath:"#/properties/meta/properties/animation/enum",keyword:"enum",params:{allowedValues: schema31.properties.meta.properties.animation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err17 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"#/properties/meta/properties/visual_preset/enum",keyword:"enum",params:{allowedValues: schema31.properties.meta.properties.visual_preset.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err18 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"#/properties/meta/properties/quality_profile/enum",keyword:"enum",params:{allowedValues: schema31.properties.meta.properties.quality_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data2.views !== undefined){if(!(validate22(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data11 = data2.legend;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){for(const key2 in data11){if(!((key2 === "mode") || (key2 === "entries"))){const err19 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data11.mode !== undefined){let data12 = data11.mode;if(!(((data12 === "auto") || (data12 === "all")) || (data12 === "hidden"))){const err20 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema37.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data11.entries !== undefined){let data13 = data11.entries;if(data13 && typeof data13 == "object" && !Array.isArray(data13)){for(const key3 in data13){if(!(((((((key3 === "frontend") || (key3 === "backend")) || (key3 === "database")) || (key3 === "cloud")) || (key3 === "security")) || (key3 === "messagebus")) || (key3 === "external"))){const err21 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data13.frontend !== undefined){let data14 = data13.frontend;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){if(Object.keys(data14).length < 1){const err22 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}for(const key4 in data14){if(!((key4 === "label") || (key4 === "visible"))){const err23 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data14.label !== undefined){let data15 = data14.label;if(typeof data15 === "string"){if(func3(data15) > 80){const err24 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(func3(data15) < 1){const err25 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data14.visible !== undefined){if(typeof data14.visible !== "boolean"){const err27 = {instancePath:instancePath+"/meta/legend/entries/frontend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data13.backend !== undefined){let data17 = data13.backend;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){if(Object.keys(data17).length < 1){const err29 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}for(const key5 in data17){if(!((key5 === "label") || (key5 === "visible"))){const err30 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data17.label !== undefined){let data18 = data17.label;if(typeof data18 === "string"){if(func3(data18) > 80){const err31 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func3(data18) < 1){const err32 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data17.visible !== undefined){if(typeof data17.visible !== "boolean"){const err34 = {instancePath:instancePath+"/meta/legend/entries/backend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}}else {const err35 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data13.database !== undefined){let data20 = data13.database;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){if(Object.keys(data20).length < 1){const err36 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key6 in data20){if(!((key6 === "label") || (key6 === "visible"))){const err37 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data20.label !== undefined){let data21 = data20.label;if(typeof data21 === "string"){if(func3(data21) > 80){const err38 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(func3(data21) < 1){const err39 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data20.visible !== undefined){if(typeof data20.visible !== "boolean"){const err41 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data13.cloud !== undefined){let data23 = data13.cloud;if(data23 && typeof data23 == "object" && !Array.isArray(data23)){if(Object.keys(data23).length < 1){const err43 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}for(const key7 in data23){if(!((key7 === "label") || (key7 === "visible"))){const err44 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data23.label !== undefined){let data24 = data23.label;if(typeof data24 === "string"){if(func3(data24) > 80){const err45 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data24) < 1){const err46 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data23.visible !== undefined){if(typeof data23.visible !== "boolean"){const err48 = {instancePath:instancePath+"/meta/legend/entries/cloud/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data13.security !== undefined){let data26 = data13.security;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(Object.keys(data26).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key8 in data26){if(!((key8 === "label") || (key8 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data26.label !== undefined){let data27 = data26.label;if(typeof data27 === "string"){if(func3(data27) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data27) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data26.visible !== undefined){if(typeof data26.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data13.messagebus !== undefined){let data29 = data13.messagebus;if(data29 && typeof data29 == "object" && !Array.isArray(data29)){if(Object.keys(data29).length < 1){const err57 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}for(const key9 in data29){if(!((key9 === "label") || (key9 === "visible"))){const err58 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data29.label !== undefined){let data30 = data29.label;if(typeof data30 === "string"){if(func3(data30) > 80){const err59 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(func3(data30) < 1){const err60 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data29.visible !== undefined){if(typeof data29.visible !== "boolean"){const err62 = {instancePath:instancePath+"/meta/legend/entries/messagebus/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}}else {const err63 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data13.external !== undefined){let data32 = data13.external;if(data32 && typeof data32 == "object" && !Array.isArray(data32)){if(Object.keys(data32).length < 1){const err64 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key10 in data32){if(!((key10 === "label") || (key10 === "visible"))){const err65 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data32.label !== undefined){let data33 = data32.label;if(typeof data33 === "string"){if(func3(data33) > 80){const err66 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if(func3(data33) < 1){const err67 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data32.visible !== undefined){if(typeof data32.visible !== "boolean"){const err69 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}}else {const err70 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}}else {const err71 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}}else {const err72 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data2.viewBox !== undefined){let data35 = data2.viewBox;if(Array.isArray(data35)){if(data35.length > 2){const err73 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(data35.length < 2){const err74 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}const len0 = data35.length;if(len0 > 0){let data36 = data35[0];if((typeof data36 == "number") && (isFinite(data36))){if(data36 < 700 || isNaN(data36)){const err75 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 700},message:"must be >= 700"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}else {const err76 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}if(len0 > 1){let data37 = data35[1];if((typeof data37 == "number") && (isFinite(data37))){if(data37 < 240 || isNaN(data37)){const err77 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 240},message:"must be >= 240"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}else {const err78 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}const len1 = data35.length;if(!(len1 <= 2)){const err79 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}else {const err80 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}}else {const err81 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data.lanes !== undefined){let data38 = data.lanes;if(Array.isArray(data38)){if(data38.length < 1){const err82 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}const len2 = data38.length;for(let i0=0; i0<len2; i0++){let data39 = data38[i0];if(data39 && typeof data39 == "object" && !Array.isArray(data39)){if(data39.id === undefined){const err83 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}if(data39.label === undefined){const err84 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}for(const key11 in data39){if(!(((key11 === "id") || (key11 === "label")) || (key11 === "variant"))){const err85 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}if(data39.id !== undefined){let data40 = data39.id;if(typeof data40 === "string"){if(!pattern4.test(data40)){const err86 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}else {const err87 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}if(data39.label !== undefined){let data41 = data39.label;if(typeof data41 === "string"){if(func3(data41) < 1){const err88 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}else {const err89 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}if(data39.variant !== undefined){let data42 = data39.variant;if(!((data42 === "normal") || (data42 === "exception"))){const err90 = {instancePath:instancePath+"/lanes/" + i0+"/variant",schemaPath:"#/properties/lanes/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema31.properties.lanes.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}}else {const err91 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}}else {const err92 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(data.phases !== undefined){let data43 = data.phases;if(Array.isArray(data43)){const len3 = data43.length;for(let i1=0; i1<len3; i1++){let data44 = data43[i1];if(data44 && typeof data44 == "object" && !Array.isArray(data44)){if(data44.id === undefined){const err93 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}if(data44.label === undefined){const err94 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}if(data44.fromCol === undefined){const err95 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "fromCol"},message:"must have required property '"+"fromCol"+"'"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}if(data44.toCol === undefined){const err96 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "toCol"},message:"must have required property '"+"toCol"+"'"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}for(const key12 in data44){if(!(((((key12 === "id") || (key12 === "label")) || (key12 === "fromCol")) || (key12 === "toCol")) || (key12 === "variant"))){const err97 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}if(data44.id !== undefined){let data45 = data44.id;if(typeof data45 === "string"){if(!pattern4.test(data45)){const err98 = {instancePath:instancePath+"/phases/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}else {const err99 = {instancePath:instancePath+"/phases/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data44.label !== undefined){let data46 = data44.label;if(typeof data46 === "string"){if(func3(data46) < 1){const err100 = {instancePath:instancePath+"/phases/" + i1+"/label",schemaPath:"#/properties/phases/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}else {const err101 = {instancePath:instancePath+"/phases/" + i1+"/label",schemaPath:"#/properties/phases/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}if(data44.fromCol !== undefined){let data47 = data44.fromCol;if(!(((typeof data47 == "number") && (!(data47 % 1) && !isNaN(data47))) && (isFinite(data47)))){const err102 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}if((typeof data47 == "number") && (isFinite(data47))){if(data47 > 5 || isNaN(data47)){const err103 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}if(data47 < 0 || isNaN(data47)){const err104 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}}if(data44.toCol !== undefined){let data48 = data44.toCol;if(!(((typeof data48 == "number") && (!(data48 % 1) && !isNaN(data48))) && (isFinite(data48)))){const err105 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}if((typeof data48 == "number") && (isFinite(data48))){if(data48 > 5 || isNaN(data48)){const err106 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}if(data48 < 0 || isNaN(data48)){const err107 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}}if(data44.variant !== undefined){let data49 = data44.variant;if(!((((data49 === "default") || (data49 === "emphasis")) || (data49 === "security")) || (data49 === "dashed"))){const err108 = {instancePath:instancePath+"/phases/" + i1+"/variant",schemaPath:"#/properties/phases/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema31.properties.phases.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}}else {const err109 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}}else {const err110 = {instancePath:instancePath+"/phases",schemaPath:"#/properties/phases/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data.groups !== undefined){let data50 = data.groups;if(Array.isArray(data50)){const len4 = data50.length;for(let i2=0; i2<len4; i2++){let data51 = data50[i2];if(data51 && typeof data51 == "object" && !Array.isArray(data51)){if(data51.id === undefined){const err111 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(data51.label === undefined){const err112 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}if(data51.lane === undefined){const err113 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}if(data51.fromCol === undefined){const err114 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "fromCol"},message:"must have required property '"+"fromCol"+"'"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(data51.toCol === undefined){const err115 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "toCol"},message:"must have required property '"+"toCol"+"'"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}for(const key13 in data51){if(!((((((key13 === "id") || (key13 === "label")) || (key13 === "lane")) || (key13 === "fromCol")) || (key13 === "toCol")) || (key13 === "variant"))){const err116 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data51.id !== undefined){let data52 = data51.id;if(typeof data52 === "string"){if(!pattern4.test(data52)){const err117 = {instancePath:instancePath+"/groups/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}else {const err118 = {instancePath:instancePath+"/groups/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data51.label !== undefined){let data53 = data51.label;if(typeof data53 === "string"){if(func3(data53) < 1){const err119 = {instancePath:instancePath+"/groups/" + i2+"/label",schemaPath:"#/properties/groups/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+"/groups/" + i2+"/label",schemaPath:"#/properties/groups/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data51.lane !== undefined){let data54 = data51.lane;if(typeof data54 === "string"){if(!pattern4.test(data54)){const err121 = {instancePath:instancePath+"/groups/" + i2+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}else {const err122 = {instancePath:instancePath+"/groups/" + i2+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}if(data51.fromCol !== undefined){let data55 = data51.fromCol;if(!(((typeof data55 == "number") && (!(data55 % 1) && !isNaN(data55))) && (isFinite(data55)))){const err123 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}if((typeof data55 == "number") && (isFinite(data55))){if(data55 > 5 || isNaN(data55)){const err124 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}if(data55 < 0 || isNaN(data55)){const err125 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}}if(data51.toCol !== undefined){let data56 = data51.toCol;if(!(((typeof data56 == "number") && (!(data56 % 1) && !isNaN(data56))) && (isFinite(data56)))){const err126 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}if((typeof data56 == "number") && (isFinite(data56))){if(data56 > 5 || isNaN(data56)){const err127 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}if(data56 < 0 || isNaN(data56)){const err128 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}}if(data51.variant !== undefined){let data57 = data51.variant;if(!((((data57 === "default") || (data57 === "emphasis")) || (data57 === "security")) || (data57 === "dashed"))){const err129 = {instancePath:instancePath+"/groups/" + i2+"/variant",schemaPath:"#/properties/groups/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema31.properties.groups.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}}else {const err130 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}}}else {const err131 = {instancePath:instancePath+"/groups",schemaPath:"#/properties/groups/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}if(data.mainPath !== undefined){let data58 = data.mainPath;if(Array.isArray(data58)){if(data58.length < 2){const err132 = {instancePath:instancePath+"/mainPath",schemaPath:"#/properties/mainPath/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}const len5 = data58.length;for(let i3=0; i3<len5; i3++){let data59 = data58[i3];if(typeof data59 === "string"){if(!pattern4.test(data59)){const err133 = {instancePath:instancePath+"/mainPath/" + i3,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}else {const err134 = {instancePath:instancePath+"/mainPath/" + i3,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}}else {const err135 = {instancePath:instancePath+"/mainPath",schemaPath:"#/properties/mainPath/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}if(data.nodes !== undefined){let data60 = data.nodes;if(Array.isArray(data60)){if(data60.length < 1){const err136 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}const len6 = data60.length;for(let i4=0; i4<len6; i4++){let data61 = data60[i4];if(data61 && typeof data61 == "object" && !Array.isArray(data61)){if(data61.id === undefined){const err137 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}if(data61.lane === undefined){const err138 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}if(data61.col === undefined){const err139 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "col"},message:"must have required property '"+"col"+"'"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}if(data61.type === undefined){const err140 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}if(data61.label === undefined){const err141 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}for(const key14 in data61){if(!(func1.call(schema31.properties.nodes.items.properties, key14))){const err142 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}}if(data61.id !== undefined){let data62 = data61.id;if(typeof data62 === "string"){if(!pattern4.test(data62)){const err143 = {instancePath:instancePath+"/nodes/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}else {const err144 = {instancePath:instancePath+"/nodes/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data61.lane !== undefined){let data63 = data61.lane;if(typeof data63 === "string"){if(!pattern4.test(data63)){const err145 = {instancePath:instancePath+"/nodes/" + i4+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}else {const err146 = {instancePath:instancePath+"/nodes/" + i4+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}if(data61.col !== undefined){let data64 = data61.col;if(!(((typeof data64 == "number") && (!(data64 % 1) && !isNaN(data64))) && (isFinite(data64)))){const err147 = {instancePath:instancePath+"/nodes/" + i4+"/col",schemaPath:"#/properties/nodes/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}if((typeof data64 == "number") && (isFinite(data64))){if(data64 > 5 || isNaN(data64)){const err148 = {instancePath:instancePath+"/nodes/" + i4+"/col",schemaPath:"#/properties/nodes/items/properties/col/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}if(data64 < 0 || isNaN(data64)){const err149 = {instancePath:instancePath+"/nodes/" + i4+"/col",schemaPath:"#/properties/nodes/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}}if(data61.type !== undefined){let data65 = data61.type;if(!(((((((data65 === "frontend") || (data65 === "backend")) || (data65 === "database")) || (data65 === "cloud")) || (data65 === "security")) || (data65 === "messagebus")) || (data65 === "external"))){const err150 = {instancePath:instancePath+"/nodes/" + i4+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema52.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}if(data61.label !== undefined){let data66 = data61.label;if(typeof data66 === "string"){if(func3(data66) < 1){const err151 = {instancePath:instancePath+"/nodes/" + i4+"/label",schemaPath:"#/properties/nodes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}else {const err152 = {instancePath:instancePath+"/nodes/" + i4+"/label",schemaPath:"#/properties/nodes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}if(data61.sublabel !== undefined){if(typeof data61.sublabel !== "string"){const err153 = {instancePath:instancePath+"/nodes/" + i4+"/sublabel",schemaPath:"#/properties/nodes/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}if(data61.tag !== undefined){if(typeof data61.tag !== "string"){const err154 = {instancePath:instancePath+"/nodes/" + i4+"/tag",schemaPath:"#/properties/nodes/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}if(data61.brand !== undefined){let data69 = data61.brand;const _errs161 = errors;let valid44 = false;let passing0 = null;const _errs162 = errors;const _errs164 = errors;let valid45 = false;const _errs165 = errors;if(typeof data69 === "string"){if(func3(data69) > 80){const err155 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}if(!pattern13.test(data69)){const err156 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}var _valid1 = _errs165 === errors;valid45 = valid45 || _valid1;const _errs166 = errors;if(typeof data69 === "string"){if(!pattern14.test(data69)){const err157 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}var _valid1 = _errs166 === errors;valid45 = valid45 || _valid1;if(!valid45){const err158 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}else {errors = _errs164;if(vErrors !== null){if(_errs164){vErrors.length = _errs164;}else {vErrors = null;}}}if(typeof data69 === "string"){if(func3(data69) > 2048){const err159 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}if(func3(data69) < 1){const err160 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}else {const err161 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}var _valid0 = _errs162 === errors;if(_valid0){valid44 = true;passing0 = 0;}const _errs167 = errors;if(data69 && typeof data69 == "object" && !Array.isArray(data69)){if(data69.url === undefined){const err162 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}if(data69.sha256 === undefined){const err163 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}for(const key15 in data69){if(!((key15 === "url") || (key15 === "sha256"))){const err164 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}if(data69.url !== undefined){let data70 = data69.url;if(typeof data70 === "string"){if(func3(data70) > 2048){const err165 = {instancePath:instancePath+"/nodes/" + i4+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}if(func3(data70) < 8){const err166 = {instancePath:instancePath+"/nodes/" + i4+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}if(!pattern14.test(data70)){const err167 = {instancePath:instancePath+"/nodes/" + i4+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}else {const err168 = {instancePath:instancePath+"/nodes/" + i4+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}if(data69.sha256 !== undefined){let data71 = data69.sha256;if(typeof data71 === "string"){if(!pattern16.test(data71)){const err169 = {instancePath:instancePath+"/nodes/" + i4+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}else {const err170 = {instancePath:instancePath+"/nodes/" + i4+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}}else {const err171 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}var _valid0 = _errs167 === errors;if(_valid0 && valid44){valid44 = false;passing0 = [passing0, 1];}else {if(_valid0){valid44 = true;passing0 = 1;}}if(!valid44){const err172 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}else {errors = _errs161;if(vErrors !== null){if(_errs161){vErrors.length = _errs161;}else {vErrors = null;}}}}if(data61.width !== undefined){let data72 = data61.width;if((typeof data72 == "number") && (isFinite(data72))){if(data72 < 32 || isNaN(data72)){const err173 = {instancePath:instancePath+"/nodes/" + i4+"/width",schemaPath:"#/properties/nodes/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 32},message:"must be >= 32"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}else {const err174 = {instancePath:instancePath+"/nodes/" + i4+"/width",schemaPath:"#/properties/nodes/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}if(data61.height !== undefined){let data73 = data61.height;if((typeof data73 == "number") && (isFinite(data73))){if(data73 < 32 || isNaN(data73)){const err175 = {instancePath:instancePath+"/nodes/" + i4+"/height",schemaPath:"#/properties/nodes/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 32},message:"must be >= 32"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}}else {const err176 = {instancePath:instancePath+"/nodes/" + i4+"/height",schemaPath:"#/properties/nodes/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}if(data61.yOffset !== undefined){let data74 = data61.yOffset;if(!((typeof data74 == "number") && (isFinite(data74)))){const err177 = {instancePath:instancePath+"/nodes/" + i4+"/yOffset",schemaPath:"#/properties/nodes/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}}else {const err178 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}}else {const err179 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(data.edges !== undefined){let data75 = data.edges;if(Array.isArray(data75)){const len7 = data75.length;for(let i5=0; i5<len7; i5++){let data76 = data75[i5];if(data76 && typeof data76 == "object" && !Array.isArray(data76)){if(data76.from === undefined){const err180 = {instancePath:instancePath+"/edges/" + i5,schemaPath:"#/properties/edges/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}if(data76.to === undefined){const err181 = {instancePath:instancePath+"/edges/" + i5,schemaPath:"#/properties/edges/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}for(const key16 in data76){if(!(func1.call(schema31.properties.edges.items.properties, key16))){const err182 = {instancePath:instancePath+"/edges/" + i5,schemaPath:"#/properties/edges/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data76.id !== undefined){let data77 = data76.id;if(typeof data77 === "string"){if(!pattern4.test(data77)){const err183 = {instancePath:instancePath+"/edges/" + i5+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}else {const err184 = {instancePath:instancePath+"/edges/" + i5+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}if(data76.from !== undefined){let data78 = data76.from;if(typeof data78 === "string"){if(!pattern4.test(data78)){const err185 = {instancePath:instancePath+"/edges/" + i5+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}else {const err186 = {instancePath:instancePath+"/edges/" + i5+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}if(data76.to !== undefined){let data79 = data76.to;if(typeof data79 === "string"){if(!pattern4.test(data79)){const err187 = {instancePath:instancePath+"/edges/" + i5+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}else {const err188 = {instancePath:instancePath+"/edges/" + i5+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}if(data76.label !== undefined){if(typeof data76.label !== "string"){const err189 = {instancePath:instancePath+"/edges/" + i5+"/label",schemaPath:"#/properties/edges/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}if(data76.variant !== undefined){let data81 = data76.variant;if(!((((data81 === "default") || (data81 === "emphasis")) || (data81 === "security")) || (data81 === "dashed"))){const err190 = {instancePath:instancePath+"/edges/" + i5+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema57.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}if(data76.role !== undefined){let data82 = data76.role;if(!(((((data82 === "main") || (data82 === "branch")) || (data82 === "async")) || (data82 === "return")) || (data82 === "error"))){const err191 = {instancePath:instancePath+"/edges/" + i5+"/role",schemaPath:"#/properties/edges/items/properties/role/enum",keyword:"enum",params:{allowedValues: schema31.properties.edges.items.properties.role.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}if(data76.fromSide !== undefined){let data83 = data76.fromSide;if(!((((data83 === "left") || (data83 === "right")) || (data83 === "top")) || (data83 === "bottom"))){const err192 = {instancePath:instancePath+"/edges/" + i5+"/fromSide",schemaPath:"#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema58.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}if(data76.toSide !== undefined){let data84 = data76.toSide;if(!((((data84 === "left") || (data84 === "right")) || (data84 === "top")) || (data84 === "bottom"))){const err193 = {instancePath:instancePath+"/edges/" + i5+"/toSide",schemaPath:"#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema58.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}if(data76.route !== undefined){let data85 = data76.route;if(!(((((((data85 === "auto") || (data85 === "straight")) || (data85 === "drop")) || (data85 === "outside-right")) || (data85 === "return-left")) || (data85 === "bottom-channel")) || (data85 === "up-channel"))){const err194 = {instancePath:instancePath+"/edges/" + i5+"/route",schemaPath:"#/properties/edges/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema31.properties.edges.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}if(data76.via !== undefined){let data86 = data76.via;if(Array.isArray(data86)){const len8 = data86.length;for(let i6=0; i6<len8; i6++){let data87 = data86[i6];if(Array.isArray(data87)){if(data87.length > 2){const err195 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}if(data87.length < 2){const err196 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}const len9 = data87.length;if(len9 > 0){let data88 = data87[0];if(!((typeof data88 == "number") && (isFinite(data88)))){const err197 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}}if(len9 > 1){let data89 = data87[1];if(!((typeof data89 == "number") && (isFinite(data89)))){const err198 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}}const len10 = data87.length;if(!(len10 <= 2)){const err199 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}else {const err200 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}}else {const err201 = {instancePath:instancePath+"/edges/" + i5+"/via",schemaPath:"#/properties/edges/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}if(data76.labelAt !== undefined){let data90 = data76.labelAt;if(Array.isArray(data90)){if(data90.length > 2){const err202 = {instancePath:instancePath+"/edges/" + i5+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}if(data90.length < 2){const err203 = {instancePath:instancePath+"/edges/" + i5+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}const len11 = data90.length;if(len11 > 0){let data91 = data90[0];if(!((typeof data91 == "number") && (isFinite(data91)))){const err204 = {instancePath:instancePath+"/edges/" + i5+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}}if(len11 > 1){let data92 = data90[1];if(!((typeof data92 == "number") && (isFinite(data92)))){const err205 = {instancePath:instancePath+"/edges/" + i5+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}}const len12 = data90.length;if(!(len12 <= 2)){const err206 = {instancePath:instancePath+"/edges/" + i5+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}}else {const err207 = {instancePath:instancePath+"/edges/" + i5+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}if(data76.labelDx !== undefined){let data93 = data76.labelDx;if(!((typeof data93 == "number") && (isFinite(data93)))){const err208 = {instancePath:instancePath+"/edges/" + i5+"/labelDx",schemaPath:"#/properties/edges/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}if(data76.labelDy !== undefined){let data94 = data76.labelDy;if(!((typeof data94 == "number") && (isFinite(data94)))){const err209 = {instancePath:instancePath+"/edges/" + i5+"/labelDy",schemaPath:"#/properties/edges/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}}if(data76.labelSegment !== undefined){let data95 = data76.labelSegment;if(!(((typeof data95 == "number") && (!(data95 % 1) && !isNaN(data95))) && (isFinite(data95)))){const err210 = {instancePath:instancePath+"/edges/" + i5+"/labelSegment",schemaPath:"#/properties/edges/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}if((typeof data95 == "number") && (isFinite(data95))){if(data95 < 0 || isNaN(data95)){const err211 = {instancePath:instancePath+"/edges/" + i5+"/labelSegment",schemaPath:"#/properties/edges/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}}}if(data76.channelX !== undefined){let data96 = data76.channelX;if(!((typeof data96 == "number") && (isFinite(data96)))){const err212 = {instancePath:instancePath+"/edges/" + i5+"/channelX",schemaPath:"#/properties/edges/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}}if(data76.channelY !== undefined){let data97 = data76.channelY;if(!((typeof data97 == "number") && (isFinite(data97)))){const err213 = {instancePath:instancePath+"/edges/" + i5+"/channelY",schemaPath:"#/properties/edges/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}}if(data76.bias !== undefined){let data98 = data76.bias;if((typeof data98 == "number") && (isFinite(data98))){if(data98 > 1 || isNaN(data98)){const err214 = {instancePath:instancePath+"/edges/" + i5+"/bias",schemaPath:"#/properties/edges/items/properties/bias/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1},message:"must be <= 1"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}if(data98 < 0 || isNaN(data98)){const err215 = {instancePath:instancePath+"/edges/" + i5+"/bias",schemaPath:"#/properties/edges/items/properties/bias/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}}else {const err216 = {instancePath:instancePath+"/edges/" + i5+"/bias",schemaPath:"#/properties/edges/items/properties/bias/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err216];}else {vErrors.push(err216);}errors++;}}if(data76.width !== undefined){let data99 = data76.width;if((typeof data99 == "number") && (isFinite(data99))){if(data99 < 0.5 || isNaN(data99)){const err217 = {instancePath:instancePath+"/edges/" + i5+"/width",schemaPath:"#/properties/edges/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err217];}else {vErrors.push(err217);}errors++;}}else {const err218 = {instancePath:instancePath+"/edges/" + i5+"/width",schemaPath:"#/properties/edges/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err218];}else {vErrors.push(err218);}errors++;}}}else {const err219 = {instancePath:instancePath+"/edges/" + i5,schemaPath:"#/properties/edges/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err219];}else {vErrors.push(err219);}errors++;}}}else {const err220 = {instancePath:instancePath+"/edges",schemaPath:"#/properties/edges/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err220];}else {vErrors.push(err220);}errors++;}}if(data.cards !== undefined){let data100 = data.cards;if(Array.isArray(data100)){const len13 = data100.length;for(let i7=0; i7<len13; i7++){let data101 = data100[i7];if(data101 && typeof data101 == "object" && !Array.isArray(data101)){if(data101.dot === undefined){const err221 = {instancePath:instancePath+"/cards/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err221];}else {vErrors.push(err221);}errors++;}if(data101.title === undefined){const err222 = {instancePath:instancePath+"/cards/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err222];}else {vErrors.push(err222);}errors++;}if(data101.items === undefined){const err223 = {instancePath:instancePath+"/cards/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err223];}else {vErrors.push(err223);}errors++;}for(const key17 in data101){if(!(((key17 === "dot") || (key17 === "title")) || (key17 === "items"))){const err224 = {instancePath:instancePath+"/cards/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key17},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err224];}else {vErrors.push(err224);}errors++;}}if(data101.dot !== undefined){let data102 = data101.dot;if(!(((((((data102 === "cyan") || (data102 === "emerald")) || (data102 === "violet")) || (data102 === "amber")) || (data102 === "rose")) || (data102 === "orange")) || (data102 === "slate"))){const err225 = {instancePath:instancePath+"/cards/" + i7+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema62.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err225];}else {vErrors.push(err225);}errors++;}}if(data101.title !== undefined){let data103 = data101.title;if(typeof data103 === "string"){if(func3(data103) < 1){const err226 = {instancePath:instancePath+"/cards/" + i7+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err226];}else {vErrors.push(err226);}errors++;}}else {const err227 = {instancePath:instancePath+"/cards/" + i7+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err227];}else {vErrors.push(err227);}errors++;}}if(data101.items !== undefined){let data104 = data101.items;if(Array.isArray(data104)){const len14 = data104.length;for(let i8=0; i8<len14; i8++){if(typeof data104[i8] !== "string"){const err228 = {instancePath:instancePath+"/cards/" + i7+"/items/" + i8,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err228];}else {vErrors.push(err228);}errors++;}}}else {const err229 = {instancePath:instancePath+"/cards/" + i7+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err229];}else {vErrors.push(err229);}errors++;}}}else {const err230 = {instancePath:instancePath+"/cards/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err230];}else {vErrors.push(err230);}errors++;}}}else {const err231 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err231];}else {vErrors.push(err231);}errors++;}}}else {const err232 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err232];}else {vErrors.push(err232);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};export const sequence = validate24;const schema63 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/sequence.schema.json","title":"Archify Sequence Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","participants","messages"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"sequence"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"type":"string"},"animation":{"enum":["trace","none"]},"visual_preset":{"enum":["classic","signal-flow","blueprint","editorial"]},"quality_profile":{"enum":["standard","showcase"]},"column_fit":{"description":"Horizontal participant layout. Omit this field or use fixed for the stable 86px boxes and 108px gap. Use spread when a wide viewBox would leave unused horizontal space or meaningful participant labels do not fit the fixed boxes; spread derives wider boxes and gaps from the viewBox without changing participant order or message semantics.","enum":["fixed","spread"]},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"default":{"$ref":"common.schema.json#/$defs/legendEntry"},"emphasis":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"dashed":{"$ref":"common.schema.json#/$defs/legendEntry"},"return":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":480},{"type":"number","minimum":480}],"items":false,"minItems":2,"maxItems":2}}},"participants":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"}}}},"segments":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to","label"],"properties":{"from":{"type":"number"},"to":{"type":"number"},"label":{"type":"string","minLength":1}}}},"messages":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["from","to","y","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"y":{"type":"number","minimum":160},"label":{"type":"string","minLength":1},"variant":{"enum":["default","emphasis","security","dashed","return"]},"note":{"type":"string"}}}},"activations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["participant","from","to"],"properties":{"participant":{"$ref":"common.schema.json#/$defs/id"},"from":{"type":"number"},"to":{"type":"number"},"type":{"$ref":"common.schema.json#/$defs/componentType"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};function validate25(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate25.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern4.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate25.errors = vErrors;return errors === 0;}validate25.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate24(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/sequence.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate24.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.participants === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "participants"},message:"must have required property '"+"participants"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.messages === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "messages"},message:"must have required property '"+"messages"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!((((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "participants")) || (key0 === "segments")) || (key0 === "messages")) || (key0 === "activations")) || (key0 === "cards"))){const err5 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err6 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.diagram_type !== undefined){if("sequence" !== data.diagram_type){const err7 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "sequence"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err8 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}for(const key1 in data2){if(!(func1.call(schema63.properties.meta.properties, key1))){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err10 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!((data4 === "en") || (data4 === "zh-CN"))){const err12 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err13 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.output !== undefined){if(typeof data2.output !== "string"){const err14 = {instancePath:instancePath+"/meta/output",schemaPath:"#/properties/meta/properties/output/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err15 = {instancePath:instancePath+"/meta/animation",schemaPath:"#/properties/meta/properties/animation/enum",keyword:"enum",params:{allowedValues: schema63.properties.meta.properties.animation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err16 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"#/properties/meta/properties/visual_preset/enum",keyword:"enum",params:{allowedValues: schema63.properties.meta.properties.visual_preset.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err17 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"#/properties/meta/properties/quality_profile/enum",keyword:"enum",params:{allowedValues: schema63.properties.meta.properties.quality_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data2.column_fit !== undefined){let data10 = data2.column_fit;if(!((data10 === "fixed") || (data10 === "spread"))){const err18 = {instancePath:instancePath+"/meta/column_fit",schemaPath:"#/properties/meta/properties/column_fit/enum",keyword:"enum",params:{allowedValues: schema63.properties.meta.properties.column_fit.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data2.views !== undefined){if(!(validate25(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate25.errors : vErrors.concat(validate25.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data12 = data2.legend;if(data12 && typeof data12 == "object" && !Array.isArray(data12)){for(const key2 in data12){if(!((key2 === "mode") || (key2 === "entries"))){const err19 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data12.mode !== undefined){let data13 = data12.mode;if(!(((data13 === "auto") || (data13 === "all")) || (data13 === "hidden"))){const err20 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema37.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data12.entries !== undefined){let data14 = data12.entries;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){for(const key3 in data14){if(!(((((key3 === "default") || (key3 === "emphasis")) || (key3 === "security")) || (key3 === "dashed")) || (key3 === "return"))){const err21 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data14.default !== undefined){let data15 = data14.default;if(data15 && typeof data15 == "object" && !Array.isArray(data15)){if(Object.keys(data15).length < 1){const err22 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}for(const key4 in data15){if(!((key4 === "label") || (key4 === "visible"))){const err23 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data15.label !== undefined){let data16 = data15.label;if(typeof data16 === "string"){if(func3(data16) > 80){const err24 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(func3(data16) < 1){const err25 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data15.visible !== undefined){if(typeof data15.visible !== "boolean"){const err27 = {instancePath:instancePath+"/meta/legend/entries/default/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data14.emphasis !== undefined){let data18 = data14.emphasis;if(data18 && typeof data18 == "object" && !Array.isArray(data18)){if(Object.keys(data18).length < 1){const err29 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}for(const key5 in data18){if(!((key5 === "label") || (key5 === "visible"))){const err30 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data18.label !== undefined){let data19 = data18.label;if(typeof data19 === "string"){if(func3(data19) > 80){const err31 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func3(data19) < 1){const err32 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data18.visible !== undefined){if(typeof data18.visible !== "boolean"){const err34 = {instancePath:instancePath+"/meta/legend/entries/emphasis/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}}else {const err35 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data14.security !== undefined){let data21 = data14.security;if(data21 && typeof data21 == "object" && !Array.isArray(data21)){if(Object.keys(data21).length < 1){const err36 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key6 in data21){if(!((key6 === "label") || (key6 === "visible"))){const err37 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data21.label !== undefined){let data22 = data21.label;if(typeof data22 === "string"){if(func3(data22) > 80){const err38 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(func3(data22) < 1){const err39 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data21.visible !== undefined){if(typeof data21.visible !== "boolean"){const err41 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data14.dashed !== undefined){let data24 = data14.dashed;if(data24 && typeof data24 == "object" && !Array.isArray(data24)){if(Object.keys(data24).length < 1){const err43 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}for(const key7 in data24){if(!((key7 === "label") || (key7 === "visible"))){const err44 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data24.label !== undefined){let data25 = data24.label;if(typeof data25 === "string"){if(func3(data25) > 80){const err45 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data25) < 1){const err46 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data24.visible !== undefined){if(typeof data24.visible !== "boolean"){const err48 = {instancePath:instancePath+"/meta/legend/entries/dashed/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data14.return !== undefined){let data27 = data14.return;if(data27 && typeof data27 == "object" && !Array.isArray(data27)){if(Object.keys(data27).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key8 in data27){if(!((key8 === "label") || (key8 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data27.label !== undefined){let data28 = data27.label;if(typeof data28 === "string"){if(func3(data28) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data28) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data27.visible !== undefined){if(typeof data27.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/return/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}}else {const err57 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}}else {const err58 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data2.viewBox !== undefined){let data30 = data2.viewBox;if(Array.isArray(data30)){if(data30.length > 2){const err59 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(data30.length < 2){const err60 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}const len0 = data30.length;if(len0 > 0){let data31 = data30[0];if((typeof data31 == "number") && (isFinite(data31))){if(data31 < 480 || isNaN(data31)){const err61 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 480},message:"must be >= 480"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}else {const err62 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(len0 > 1){let data32 = data30[1];if((typeof data32 == "number") && (isFinite(data32))){if(data32 < 480 || isNaN(data32)){const err63 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 480},message:"must be >= 480"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}else {const err64 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}const len1 = data30.length;if(!(len1 <= 2)){const err65 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}else {const err66 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}}else {const err67 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}if(data.participants !== undefined){let data33 = data.participants;if(Array.isArray(data33)){if(data33.length < 2){const err68 = {instancePath:instancePath+"/participants",schemaPath:"#/properties/participants/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}const len2 = data33.length;for(let i0=0; i0<len2; i0++){let data34 = data33[i0];if(data34 && typeof data34 == "object" && !Array.isArray(data34)){if(data34.id === undefined){const err69 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}if(data34.type === undefined){const err70 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}if(data34.label === undefined){const err71 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}for(const key9 in data34){if(!(((((key9 === "id") || (key9 === "type")) || (key9 === "label")) || (key9 === "sublabel")) || (key9 === "brand"))){const err72 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data34.id !== undefined){let data35 = data34.id;if(typeof data35 === "string"){if(!pattern4.test(data35)){const err73 = {instancePath:instancePath+"/participants/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}else {const err74 = {instancePath:instancePath+"/participants/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}if(data34.type !== undefined){let data36 = data34.type;if(!(((((((data36 === "frontend") || (data36 === "backend")) || (data36 === "database")) || (data36 === "cloud")) || (data36 === "security")) || (data36 === "messagebus")) || (data36 === "external"))){const err75 = {instancePath:instancePath+"/participants/" + i0+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema52.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data34.label !== undefined){let data37 = data34.label;if(typeof data37 === "string"){if(func3(data37) < 1){const err76 = {instancePath:instancePath+"/participants/" + i0+"/label",schemaPath:"#/properties/participants/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}else {const err77 = {instancePath:instancePath+"/participants/" + i0+"/label",schemaPath:"#/properties/participants/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}if(data34.sublabel !== undefined){if(typeof data34.sublabel !== "string"){const err78 = {instancePath:instancePath+"/participants/" + i0+"/sublabel",schemaPath:"#/properties/participants/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}if(data34.brand !== undefined){let data39 = data34.brand;const _errs90 = errors;let valid23 = false;let passing0 = null;const _errs91 = errors;const _errs93 = errors;let valid24 = false;const _errs94 = errors;if(typeof data39 === "string"){if(func3(data39) > 80){const err79 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}if(!pattern13.test(data39)){const err80 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}var _valid1 = _errs94 === errors;valid24 = valid24 || _valid1;const _errs95 = errors;if(typeof data39 === "string"){if(!pattern14.test(data39)){const err81 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}var _valid1 = _errs95 === errors;valid24 = valid24 || _valid1;if(!valid24){const err82 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}else {errors = _errs93;if(vErrors !== null){if(_errs93){vErrors.length = _errs93;}else {vErrors = null;}}}if(typeof data39 === "string"){if(func3(data39) > 2048){const err83 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}if(func3(data39) < 1){const err84 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}else {const err85 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}var _valid0 = _errs91 === errors;if(_valid0){valid23 = true;passing0 = 0;}const _errs96 = errors;if(data39 && typeof data39 == "object" && !Array.isArray(data39)){if(data39.url === undefined){const err86 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}if(data39.sha256 === undefined){const err87 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}for(const key10 in data39){if(!((key10 === "url") || (key10 === "sha256"))){const err88 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data39.url !== undefined){let data40 = data39.url;if(typeof data40 === "string"){if(func3(data40) > 2048){const err89 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}if(func3(data40) < 8){const err90 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}if(!pattern14.test(data40)){const err91 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}else {const err92 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(data39.sha256 !== undefined){let data41 = data39.sha256;if(typeof data41 === "string"){if(!pattern16.test(data41)){const err93 = {instancePath:instancePath+"/participants/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}else {const err94 = {instancePath:instancePath+"/participants/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}}else {const err95 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}var _valid0 = _errs96 === errors;if(_valid0 && valid23){valid23 = false;passing0 = [passing0, 1];}else {if(_valid0){valid23 = true;passing0 = 1;}}if(!valid23){const err96 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}else {errors = _errs90;if(vErrors !== null){if(_errs90){vErrors.length = _errs90;}else {vErrors = null;}}}}}else {const err97 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/participants",schemaPath:"#/properties/participants/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}if(data.segments !== undefined){let data42 = data.segments;if(Array.isArray(data42)){const len3 = data42.length;for(let i1=0; i1<len3; i1++){let data43 = data42[i1];if(data43 && typeof data43 == "object" && !Array.isArray(data43)){if(data43.from === undefined){const err99 = {instancePath:instancePath+"/segments/" + i1,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}if(data43.to === undefined){const err100 = {instancePath:instancePath+"/segments/" + i1,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}if(data43.label === undefined){const err101 = {instancePath:instancePath+"/segments/" + i1,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}for(const key11 in data43){if(!(((key11 === "from") || (key11 === "to")) || (key11 === "label"))){const err102 = {instancePath:instancePath+"/segments/" + i1,schemaPath:"#/properties/segments/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(data43.from !== undefined){let data44 = data43.from;if(!((typeof data44 == "number") && (isFinite(data44)))){const err103 = {instancePath:instancePath+"/segments/" + i1+"/from",schemaPath:"#/properties/segments/items/properties/from/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}if(data43.to !== undefined){let data45 = data43.to;if(!((typeof data45 == "number") && (isFinite(data45)))){const err104 = {instancePath:instancePath+"/segments/" + i1+"/to",schemaPath:"#/properties/segments/items/properties/to/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}if(data43.label !== undefined){let data46 = data43.label;if(typeof data46 === "string"){if(func3(data46) < 1){const err105 = {instancePath:instancePath+"/segments/" + i1+"/label",schemaPath:"#/properties/segments/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}else {const err106 = {instancePath:instancePath+"/segments/" + i1+"/label",schemaPath:"#/properties/segments/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}}else {const err107 = {instancePath:instancePath+"/segments/" + i1,schemaPath:"#/properties/segments/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}}else {const err108 = {instancePath:instancePath+"/segments",schemaPath:"#/properties/segments/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}if(data.messages !== undefined){let data47 = data.messages;if(Array.isArray(data47)){if(data47.length < 1){const err109 = {instancePath:instancePath+"/messages",schemaPath:"#/properties/messages/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}const len4 = data47.length;for(let i2=0; i2<len4; i2++){let data48 = data47[i2];if(data48 && typeof data48 == "object" && !Array.isArray(data48)){if(data48.from === undefined){const err110 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}if(data48.to === undefined){const err111 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(data48.y === undefined){const err112 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "y"},message:"must have required property '"+"y"+"'"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}if(data48.label === undefined){const err113 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}for(const key12 in data48){if(!(((((((key12 === "id") || (key12 === "from")) || (key12 === "to")) || (key12 === "y")) || (key12 === "label")) || (key12 === "variant")) || (key12 === "note"))){const err114 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}if(data48.id !== undefined){let data49 = data48.id;if(typeof data49 === "string"){if(!pattern4.test(data49)){const err115 = {instancePath:instancePath+"/messages/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}else {const err116 = {instancePath:instancePath+"/messages/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data48.from !== undefined){let data50 = data48.from;if(typeof data50 === "string"){if(!pattern4.test(data50)){const err117 = {instancePath:instancePath+"/messages/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}else {const err118 = {instancePath:instancePath+"/messages/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data48.to !== undefined){let data51 = data48.to;if(typeof data51 === "string"){if(!pattern4.test(data51)){const err119 = {instancePath:instancePath+"/messages/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+"/messages/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data48.y !== undefined){let data52 = data48.y;if((typeof data52 == "number") && (isFinite(data52))){if(data52 < 160 || isNaN(data52)){const err121 = {instancePath:instancePath+"/messages/" + i2+"/y",schemaPath:"#/properties/messages/items/properties/y/minimum",keyword:"minimum",params:{comparison: ">=", limit: 160},message:"must be >= 160"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}else {const err122 = {instancePath:instancePath+"/messages/" + i2+"/y",schemaPath:"#/properties/messages/items/properties/y/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}if(data48.label !== undefined){let data53 = data48.label;if(typeof data53 === "string"){if(func3(data53) < 1){const err123 = {instancePath:instancePath+"/messages/" + i2+"/label",schemaPath:"#/properties/messages/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}else {const err124 = {instancePath:instancePath+"/messages/" + i2+"/label",schemaPath:"#/properties/messages/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}if(data48.variant !== undefined){let data54 = data48.variant;if(!(((((data54 === "default") || (data54 === "emphasis")) || (data54 === "security")) || (data54 === "dashed")) || (data54 === "return"))){const err125 = {instancePath:instancePath+"/messages/" + i2+"/variant",schemaPath:"#/properties/messages/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema63.properties.messages.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}if(data48.note !== undefined){if(typeof data48.note !== "string"){const err126 = {instancePath:instancePath+"/messages/" + i2+"/note",schemaPath:"#/properties/messages/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}}else {const err127 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}}else {const err128 = {instancePath:instancePath+"/messages",schemaPath:"#/properties/messages/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}if(data.activations !== undefined){let data56 = data.activations;if(Array.isArray(data56)){const len5 = data56.length;for(let i3=0; i3<len5; i3++){let data57 = data56[i3];if(data57 && typeof data57 == "object" && !Array.isArray(data57)){if(data57.participant === undefined){const err129 = {instancePath:instancePath+"/activations/" + i3,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "participant"},message:"must have required property '"+"participant"+"'"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if(data57.from === undefined){const err130 = {instancePath:instancePath+"/activations/" + i3,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}if(data57.to === undefined){const err131 = {instancePath:instancePath+"/activations/" + i3,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}for(const key13 in data57){if(!((((key13 === "participant") || (key13 === "from")) || (key13 === "to")) || (key13 === "type"))){const err132 = {instancePath:instancePath+"/activations/" + i3,schemaPath:"#/properties/activations/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}if(data57.participant !== undefined){let data58 = data57.participant;if(typeof data58 === "string"){if(!pattern4.test(data58)){const err133 = {instancePath:instancePath+"/activations/" + i3+"/participant",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}else {const err134 = {instancePath:instancePath+"/activations/" + i3+"/participant",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}if(data57.from !== undefined){let data59 = data57.from;if(!((typeof data59 == "number") && (isFinite(data59)))){const err135 = {instancePath:instancePath+"/activations/" + i3+"/from",schemaPath:"#/properties/activations/items/properties/from/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}if(data57.to !== undefined){let data60 = data57.to;if(!((typeof data60 == "number") && (isFinite(data60)))){const err136 = {instancePath:instancePath+"/activations/" + i3+"/to",schemaPath:"#/properties/activations/items/properties/to/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}if(data57.type !== undefined){let data61 = data57.type;if(!(((((((data61 === "frontend") || (data61 === "backend")) || (data61 === "database")) || (data61 === "cloud")) || (data61 === "security")) || (data61 === "messagebus")) || (data61 === "external"))){const err137 = {instancePath:instancePath+"/activations/" + i3+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema52.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}}else {const err138 = {instancePath:instancePath+"/activations/" + i3,schemaPath:"#/properties/activations/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}}else {const err139 = {instancePath:instancePath+"/activations",schemaPath:"#/properties/activations/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data.cards !== undefined){let data62 = data.cards;if(Array.isArray(data62)){const len6 = data62.length;for(let i4=0; i4<len6; i4++){let data63 = data62[i4];if(data63 && typeof data63 == "object" && !Array.isArray(data63)){if(data63.dot === undefined){const err140 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}if(data63.title === undefined){const err141 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}if(data63.items === undefined){const err142 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}for(const key14 in data63){if(!(((key14 === "dot") || (key14 === "title")) || (key14 === "items"))){const err143 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}if(data63.dot !== undefined){let data64 = data63.dot;if(!(((((((data64 === "cyan") || (data64 === "emerald")) || (data64 === "violet")) || (data64 === "amber")) || (data64 === "rose")) || (data64 === "orange")) || (data64 === "slate"))){const err144 = {instancePath:instancePath+"/cards/" + i4+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema62.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data63.title !== undefined){let data65 = data63.title;if(typeof data65 === "string"){if(func3(data65) < 1){const err145 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}else {const err146 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}if(data63.items !== undefined){let data66 = data63.items;if(Array.isArray(data66)){const len7 = data66.length;for(let i5=0; i5<len7; i5++){if(typeof data66[i5] !== "string"){const err147 = {instancePath:instancePath+"/cards/" + i4+"/items/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}}else {const err148 = {instancePath:instancePath+"/cards/" + i4+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}}else {const err149 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}}else {const err150 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}}else {const err151 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}validate24.errors = vErrors;return errors === 0;}validate24.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};export const dataflow = validate27;const schema83 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/dataflow.schema.json","title":"Archify Data Flow Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","stages","nodes","flows"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"dataflow"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"type":"string"},"animation":{"enum":["trace","none"]},"visual_preset":{"enum":["classic","signal-flow","blueprint","editorial"]},"quality_profile":{"enum":["standard","showcase"]},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"default":{"$ref":"common.schema.json#/$defs/legendEntry"},"emphasis":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"dashed":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":360},{"type":"number","minimum":360}],"items":false,"minItems":2,"maxItems":2}}},"stages":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["label"],"properties":{"label":{"type":"string","minLength":1}}}},"nodes":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label","stage","row"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"stage":{"type":"integer","minimum":0},"row":{"type":"integer","minimum":0},"width":{"type":"number","minimum":48},"height":{"type":"number","minimum":36},"yOffset":{"type":"number"}}}},"flows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"classification":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"route":{"enum":["auto","straight","vertical-channel","bottom-channel","top-channel"]},"fromSide":{"enum":["left","right","top","bottom"]},"toSide":{"enum":["left","right","top","bottom"]},"channelX":{"type":"number"},"channelY":{"type":"number"},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"width":{"type":"number","minimum":0.5}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};function validate28(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate28.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern4.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate28.errors = vErrors;return errors === 0;}validate28.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate27(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/dataflow.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate27.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.stages === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "stages"},message:"must have required property '"+"stages"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.nodes === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "nodes"},message:"must have required property '"+"nodes"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.flows === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "flows"},message:"must have required property '"+"flows"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "stages")) || (key0 === "nodes")) || (key0 === "flows")) || (key0 === "cards"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("dataflow" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "dataflow"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key1 in data2){if(!(func1.call(schema83.properties.meta.properties, key1))){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!((data4 === "en") || (data4 === "zh-CN"))){const err13 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err14 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.output !== undefined){if(typeof data2.output !== "string"){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"#/properties/meta/properties/output/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err16 = {instancePath:instancePath+"/meta/animation",schemaPath:"#/properties/meta/properties/animation/enum",keyword:"enum",params:{allowedValues: schema83.properties.meta.properties.animation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err17 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"#/properties/meta/properties/visual_preset/enum",keyword:"enum",params:{allowedValues: schema83.properties.meta.properties.visual_preset.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err18 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"#/properties/meta/properties/quality_profile/enum",keyword:"enum",params:{allowedValues: schema83.properties.meta.properties.quality_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data2.views !== undefined){if(!(validate28(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate28.errors : vErrors.concat(validate28.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data11 = data2.legend;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){for(const key2 in data11){if(!((key2 === "mode") || (key2 === "entries"))){const err19 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data11.mode !== undefined){let data12 = data11.mode;if(!(((data12 === "auto") || (data12 === "all")) || (data12 === "hidden"))){const err20 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema37.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data11.entries !== undefined){let data13 = data11.entries;if(data13 && typeof data13 == "object" && !Array.isArray(data13)){for(const key3 in data13){if(!(((((key3 === "default") || (key3 === "emphasis")) || (key3 === "security")) || (key3 === "dashed")) || (key3 === "database"))){const err21 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data13.default !== undefined){let data14 = data13.default;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){if(Object.keys(data14).length < 1){const err22 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}for(const key4 in data14){if(!((key4 === "label") || (key4 === "visible"))){const err23 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data14.label !== undefined){let data15 = data14.label;if(typeof data15 === "string"){if(func3(data15) > 80){const err24 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(func3(data15) < 1){const err25 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data14.visible !== undefined){if(typeof data14.visible !== "boolean"){const err27 = {instancePath:instancePath+"/meta/legend/entries/default/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data13.emphasis !== undefined){let data17 = data13.emphasis;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){if(Object.keys(data17).length < 1){const err29 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}for(const key5 in data17){if(!((key5 === "label") || (key5 === "visible"))){const err30 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data17.label !== undefined){let data18 = data17.label;if(typeof data18 === "string"){if(func3(data18) > 80){const err31 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func3(data18) < 1){const err32 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data17.visible !== undefined){if(typeof data17.visible !== "boolean"){const err34 = {instancePath:instancePath+"/meta/legend/entries/emphasis/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}}else {const err35 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data13.security !== undefined){let data20 = data13.security;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){if(Object.keys(data20).length < 1){const err36 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key6 in data20){if(!((key6 === "label") || (key6 === "visible"))){const err37 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data20.label !== undefined){let data21 = data20.label;if(typeof data21 === "string"){if(func3(data21) > 80){const err38 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(func3(data21) < 1){const err39 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data20.visible !== undefined){if(typeof data20.visible !== "boolean"){const err41 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data13.dashed !== undefined){let data23 = data13.dashed;if(data23 && typeof data23 == "object" && !Array.isArray(data23)){if(Object.keys(data23).length < 1){const err43 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}for(const key7 in data23){if(!((key7 === "label") || (key7 === "visible"))){const err44 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data23.label !== undefined){let data24 = data23.label;if(typeof data24 === "string"){if(func3(data24) > 80){const err45 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data24) < 1){const err46 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data23.visible !== undefined){if(typeof data23.visible !== "boolean"){const err48 = {instancePath:instancePath+"/meta/legend/entries/dashed/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data13.database !== undefined){let data26 = data13.database;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(Object.keys(data26).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key8 in data26){if(!((key8 === "label") || (key8 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data26.label !== undefined){let data27 = data26.label;if(typeof data27 === "string"){if(func3(data27) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data27) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data26.visible !== undefined){if(typeof data26.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}}else {const err57 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}}else {const err58 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data2.viewBox !== undefined){let data29 = data2.viewBox;if(Array.isArray(data29)){if(data29.length > 2){const err59 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(data29.length < 2){const err60 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}const len0 = data29.length;if(len0 > 0){let data30 = data29[0];if((typeof data30 == "number") && (isFinite(data30))){if(data30 < 360 || isNaN(data30)){const err61 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 360},message:"must be >= 360"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}else {const err62 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(len0 > 1){let data31 = data29[1];if((typeof data31 == "number") && (isFinite(data31))){if(data31 < 360 || isNaN(data31)){const err63 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 360},message:"must be >= 360"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}else {const err64 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}const len1 = data29.length;if(!(len1 <= 2)){const err65 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}else {const err66 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}}else {const err67 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}if(data.stages !== undefined){let data32 = data.stages;if(Array.isArray(data32)){if(data32.length > 5){const err68 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}if(data32.length < 2){const err69 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}const len2 = data32.length;for(let i0=0; i0<len2; i0++){let data33 = data32[i0];if(data33 && typeof data33 == "object" && !Array.isArray(data33)){if(data33.label === undefined){const err70 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}for(const key9 in data33){if(!(key9 === "label")){const err71 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data33.label !== undefined){let data34 = data33.label;if(typeof data34 === "string"){if(func3(data34) < 1){const err72 = {instancePath:instancePath+"/stages/" + i0+"/label",schemaPath:"#/properties/stages/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}else {const err73 = {instancePath:instancePath+"/stages/" + i0+"/label",schemaPath:"#/properties/stages/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}}else {const err74 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}}else {const err75 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data.nodes !== undefined){let data35 = data.nodes;if(Array.isArray(data35)){if(data35.length < 2){const err76 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}const len3 = data35.length;for(let i1=0; i1<len3; i1++){let data36 = data35[i1];if(data36 && typeof data36 == "object" && !Array.isArray(data36)){if(data36.id === undefined){const err77 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}if(data36.type === undefined){const err78 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}if(data36.label === undefined){const err79 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}if(data36.stage === undefined){const err80 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "stage"},message:"must have required property '"+"stage"+"'"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}if(data36.row === undefined){const err81 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "row"},message:"must have required property '"+"row"+"'"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}for(const key10 in data36){if(!(func1.call(schema83.properties.nodes.items.properties, key10))){const err82 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}if(data36.id !== undefined){let data37 = data36.id;if(typeof data37 === "string"){if(!pattern4.test(data37)){const err83 = {instancePath:instancePath+"/nodes/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}else {const err84 = {instancePath:instancePath+"/nodes/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}if(data36.type !== undefined){let data38 = data36.type;if(!(((((((data38 === "frontend") || (data38 === "backend")) || (data38 === "database")) || (data38 === "cloud")) || (data38 === "security")) || (data38 === "messagebus")) || (data38 === "external"))){const err85 = {instancePath:instancePath+"/nodes/" + i1+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema52.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}if(data36.label !== undefined){let data39 = data36.label;if(typeof data39 === "string"){if(func3(data39) < 1){const err86 = {instancePath:instancePath+"/nodes/" + i1+"/label",schemaPath:"#/properties/nodes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}else {const err87 = {instancePath:instancePath+"/nodes/" + i1+"/label",schemaPath:"#/properties/nodes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}if(data36.sublabel !== undefined){if(typeof data36.sublabel !== "string"){const err88 = {instancePath:instancePath+"/nodes/" + i1+"/sublabel",schemaPath:"#/properties/nodes/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data36.tag !== undefined){if(typeof data36.tag !== "string"){const err89 = {instancePath:instancePath+"/nodes/" + i1+"/tag",schemaPath:"#/properties/nodes/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}if(data36.brand !== undefined){let data42 = data36.brand;const _errs98 = errors;let valid26 = false;let passing0 = null;const _errs99 = errors;const _errs101 = errors;let valid27 = false;const _errs102 = errors;if(typeof data42 === "string"){if(func3(data42) > 80){const err90 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}if(!pattern13.test(data42)){const err91 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}var _valid1 = _errs102 === errors;valid27 = valid27 || _valid1;const _errs103 = errors;if(typeof data42 === "string"){if(!pattern14.test(data42)){const err92 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}var _valid1 = _errs103 === errors;valid27 = valid27 || _valid1;if(!valid27){const err93 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}else {errors = _errs101;if(vErrors !== null){if(_errs101){vErrors.length = _errs101;}else {vErrors = null;}}}if(typeof data42 === "string"){if(func3(data42) > 2048){const err94 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}if(func3(data42) < 1){const err95 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}else {const err96 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}var _valid0 = _errs99 === errors;if(_valid0){valid26 = true;passing0 = 0;}const _errs104 = errors;if(data42 && typeof data42 == "object" && !Array.isArray(data42)){if(data42.url === undefined){const err97 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}if(data42.sha256 === undefined){const err98 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}for(const key11 in data42){if(!((key11 === "url") || (key11 === "sha256"))){const err99 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data42.url !== undefined){let data43 = data42.url;if(typeof data43 === "string"){if(func3(data43) > 2048){const err100 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}if(func3(data43) < 8){const err101 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}if(!pattern14.test(data43)){const err102 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}else {const err103 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}if(data42.sha256 !== undefined){let data44 = data42.sha256;if(typeof data44 === "string"){if(!pattern16.test(data44)){const err104 = {instancePath:instancePath+"/nodes/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}else {const err105 = {instancePath:instancePath+"/nodes/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}}else {const err106 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}var _valid0 = _errs104 === errors;if(_valid0 && valid26){valid26 = false;passing0 = [passing0, 1];}else {if(_valid0){valid26 = true;passing0 = 1;}}if(!valid26){const err107 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}else {errors = _errs98;if(vErrors !== null){if(_errs98){vErrors.length = _errs98;}else {vErrors = null;}}}}if(data36.stage !== undefined){let data45 = data36.stage;if(!(((typeof data45 == "number") && (!(data45 % 1) && !isNaN(data45))) && (isFinite(data45)))){const err108 = {instancePath:instancePath+"/nodes/" + i1+"/stage",schemaPath:"#/properties/nodes/items/properties/stage/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}if((typeof data45 == "number") && (isFinite(data45))){if(data45 < 0 || isNaN(data45)){const err109 = {instancePath:instancePath+"/nodes/" + i1+"/stage",schemaPath:"#/properties/nodes/items/properties/stage/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}}if(data36.row !== undefined){let data46 = data36.row;if(!(((typeof data46 == "number") && (!(data46 % 1) && !isNaN(data46))) && (isFinite(data46)))){const err110 = {instancePath:instancePath+"/nodes/" + i1+"/row",schemaPath:"#/properties/nodes/items/properties/row/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}if((typeof data46 == "number") && (isFinite(data46))){if(data46 < 0 || isNaN(data46)){const err111 = {instancePath:instancePath+"/nodes/" + i1+"/row",schemaPath:"#/properties/nodes/items/properties/row/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}}if(data36.width !== undefined){let data47 = data36.width;if((typeof data47 == "number") && (isFinite(data47))){if(data47 < 48 || isNaN(data47)){const err112 = {instancePath:instancePath+"/nodes/" + i1+"/width",schemaPath:"#/properties/nodes/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 48},message:"must be >= 48"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}else {const err113 = {instancePath:instancePath+"/nodes/" + i1+"/width",schemaPath:"#/properties/nodes/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data36.height !== undefined){let data48 = data36.height;if((typeof data48 == "number") && (isFinite(data48))){if(data48 < 36 || isNaN(data48)){const err114 = {instancePath:instancePath+"/nodes/" + i1+"/height",schemaPath:"#/properties/nodes/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 36},message:"must be >= 36"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}else {const err115 = {instancePath:instancePath+"/nodes/" + i1+"/height",schemaPath:"#/properties/nodes/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}if(data36.yOffset !== undefined){let data49 = data36.yOffset;if(!((typeof data49 == "number") && (isFinite(data49)))){const err116 = {instancePath:instancePath+"/nodes/" + i1+"/yOffset",schemaPath:"#/properties/nodes/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}}else {const err117 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}}else {const err118 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data.flows !== undefined){let data50 = data.flows;if(Array.isArray(data50)){const len4 = data50.length;for(let i2=0; i2<len4; i2++){let data51 = data50[i2];if(data51 && typeof data51 == "object" && !Array.isArray(data51)){if(data51.from === undefined){const err119 = {instancePath:instancePath+"/flows/" + i2,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}if(data51.to === undefined){const err120 = {instancePath:instancePath+"/flows/" + i2,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}if(data51.label === undefined){const err121 = {instancePath:instancePath+"/flows/" + i2,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}for(const key12 in data51){if(!(func1.call(schema83.properties.flows.items.properties, key12))){const err122 = {instancePath:instancePath+"/flows/" + i2,schemaPath:"#/properties/flows/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}if(data51.id !== undefined){let data52 = data51.id;if(typeof data52 === "string"){if(!pattern4.test(data52)){const err123 = {instancePath:instancePath+"/flows/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}else {const err124 = {instancePath:instancePath+"/flows/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}if(data51.from !== undefined){let data53 = data51.from;if(typeof data53 === "string"){if(!pattern4.test(data53)){const err125 = {instancePath:instancePath+"/flows/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}else {const err126 = {instancePath:instancePath+"/flows/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}if(data51.to !== undefined){let data54 = data51.to;if(typeof data54 === "string"){if(!pattern4.test(data54)){const err127 = {instancePath:instancePath+"/flows/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}else {const err128 = {instancePath:instancePath+"/flows/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}if(data51.label !== undefined){let data55 = data51.label;if(typeof data55 === "string"){if(func3(data55) < 1){const err129 = {instancePath:instancePath+"/flows/" + i2+"/label",schemaPath:"#/properties/flows/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}else {const err130 = {instancePath:instancePath+"/flows/" + i2+"/label",schemaPath:"#/properties/flows/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}}if(data51.classification !== undefined){if(typeof data51.classification !== "string"){const err131 = {instancePath:instancePath+"/flows/" + i2+"/classification",schemaPath:"#/properties/flows/items/properties/classification/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}if(data51.variant !== undefined){let data57 = data51.variant;if(!((((data57 === "default") || (data57 === "emphasis")) || (data57 === "security")) || (data57 === "dashed"))){const err132 = {instancePath:instancePath+"/flows/" + i2+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema57.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}if(data51.route !== undefined){let data58 = data51.route;if(!(((((data58 === "auto") || (data58 === "straight")) || (data58 === "vertical-channel")) || (data58 === "bottom-channel")) || (data58 === "top-channel"))){const err133 = {instancePath:instancePath+"/flows/" + i2+"/route",schemaPath:"#/properties/flows/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema83.properties.flows.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}if(data51.fromSide !== undefined){let data59 = data51.fromSide;if(!((((data59 === "left") || (data59 === "right")) || (data59 === "top")) || (data59 === "bottom"))){const err134 = {instancePath:instancePath+"/flows/" + i2+"/fromSide",schemaPath:"#/properties/flows/items/properties/fromSide/enum",keyword:"enum",params:{allowedValues: schema83.properties.flows.items.properties.fromSide.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}if(data51.toSide !== undefined){let data60 = data51.toSide;if(!((((data60 === "left") || (data60 === "right")) || (data60 === "top")) || (data60 === "bottom"))){const err135 = {instancePath:instancePath+"/flows/" + i2+"/toSide",schemaPath:"#/properties/flows/items/properties/toSide/enum",keyword:"enum",params:{allowedValues: schema83.properties.flows.items.properties.toSide.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}if(data51.channelX !== undefined){let data61 = data51.channelX;if(!((typeof data61 == "number") && (isFinite(data61)))){const err136 = {instancePath:instancePath+"/flows/" + i2+"/channelX",schemaPath:"#/properties/flows/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}if(data51.channelY !== undefined){let data62 = data51.channelY;if(!((typeof data62 == "number") && (isFinite(data62)))){const err137 = {instancePath:instancePath+"/flows/" + i2+"/channelY",schemaPath:"#/properties/flows/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}if(data51.labelAt !== undefined){let data63 = data51.labelAt;if(Array.isArray(data63)){if(data63.length > 2){const err138 = {instancePath:instancePath+"/flows/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}if(data63.length < 2){const err139 = {instancePath:instancePath+"/flows/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}const len5 = data63.length;if(len5 > 0){let data64 = data63[0];if(!((typeof data64 == "number") && (isFinite(data64)))){const err140 = {instancePath:instancePath+"/flows/" + i2+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}if(len5 > 1){let data65 = data63[1];if(!((typeof data65 == "number") && (isFinite(data65)))){const err141 = {instancePath:instancePath+"/flows/" + i2+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}const len6 = data63.length;if(!(len6 <= 2)){const err142 = {instancePath:instancePath+"/flows/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}}else {const err143 = {instancePath:instancePath+"/flows/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}if(data51.labelDx !== undefined){let data66 = data51.labelDx;if(!((typeof data66 == "number") && (isFinite(data66)))){const err144 = {instancePath:instancePath+"/flows/" + i2+"/labelDx",schemaPath:"#/properties/flows/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data51.labelDy !== undefined){let data67 = data51.labelDy;if(!((typeof data67 == "number") && (isFinite(data67)))){const err145 = {instancePath:instancePath+"/flows/" + i2+"/labelDy",schemaPath:"#/properties/flows/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}if(data51.labelSegment !== undefined){let data68 = data51.labelSegment;if(!(((typeof data68 == "number") && (!(data68 % 1) && !isNaN(data68))) && (isFinite(data68)))){const err146 = {instancePath:instancePath+"/flows/" + i2+"/labelSegment",schemaPath:"#/properties/flows/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}if((typeof data68 == "number") && (isFinite(data68))){if(data68 < 0 || isNaN(data68)){const err147 = {instancePath:instancePath+"/flows/" + i2+"/labelSegment",schemaPath:"#/properties/flows/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}}if(data51.via !== undefined){let data69 = data51.via;if(Array.isArray(data69)){const len7 = data69.length;for(let i3=0; i3<len7; i3++){let data70 = data69[i3];if(Array.isArray(data70)){if(data70.length > 2){const err148 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}if(data70.length < 2){const err149 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}const len8 = data70.length;if(len8 > 0){let data71 = data70[0];if(!((typeof data71 == "number") && (isFinite(data71)))){const err150 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}if(len8 > 1){let data72 = data70[1];if(!((typeof data72 == "number") && (isFinite(data72)))){const err151 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}const len9 = data70.length;if(!(len9 <= 2)){const err152 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}else {const err153 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}}else {const err154 = {instancePath:instancePath+"/flows/" + i2+"/via",schemaPath:"#/properties/flows/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}if(data51.width !== undefined){let data73 = data51.width;if((typeof data73 == "number") && (isFinite(data73))){if(data73 < 0.5 || isNaN(data73)){const err155 = {instancePath:instancePath+"/flows/" + i2+"/width",schemaPath:"#/properties/flows/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}else {const err156 = {instancePath:instancePath+"/flows/" + i2+"/width",schemaPath:"#/properties/flows/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}}else {const err157 = {instancePath:instancePath+"/flows/" + i2,schemaPath:"#/properties/flows/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}}else {const err158 = {instancePath:instancePath+"/flows",schemaPath:"#/properties/flows/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}if(data.cards !== undefined){let data74 = data.cards;if(Array.isArray(data74)){const len10 = data74.length;for(let i4=0; i4<len10; i4++){let data75 = data74[i4];if(data75 && typeof data75 == "object" && !Array.isArray(data75)){if(data75.dot === undefined){const err159 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}if(data75.title === undefined){const err160 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}if(data75.items === undefined){const err161 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}for(const key13 in data75){if(!(((key13 === "dot") || (key13 === "title")) || (key13 === "items"))){const err162 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}if(data75.dot !== undefined){let data76 = data75.dot;if(!(((((((data76 === "cyan") || (data76 === "emerald")) || (data76 === "violet")) || (data76 === "amber")) || (data76 === "rose")) || (data76 === "orange")) || (data76 === "slate"))){const err163 = {instancePath:instancePath+"/cards/" + i4+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema62.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}if(data75.title !== undefined){let data77 = data75.title;if(typeof data77 === "string"){if(func3(data77) < 1){const err164 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}else {const err165 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data75.items !== undefined){let data78 = data75.items;if(Array.isArray(data78)){const len11 = data78.length;for(let i5=0; i5<len11; i5++){if(typeof data78[i5] !== "string"){const err166 = {instancePath:instancePath+"/cards/" + i4+"/items/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}}else {const err167 = {instancePath:instancePath+"/cards/" + i4+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}}else {const err168 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}}else {const err169 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}}else {const err170 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}validate27.errors = vErrors;return errors === 0;}validate27.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};export const lifecycle = validate30;const schema104 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/lifecycle.schema.json","title":"Archify Lifecycle Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","lanes","states","transitions"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"lifecycle"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"type":"string"},"animation":{"enum":["trace","none"]},"visual_preset":{"enum":["classic","signal-flow","blueprint","editorial"]},"quality_profile":{"enum":["standard","showcase"]},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"start":{"$ref":"common.schema.json#/$defs/legendEntry"},"active":{"$ref":"common.schema.json#/$defs/legendEntry"},"waiting":{"$ref":"common.schema.json#/$defs/legendEntry"},"decision":{"$ref":"common.schema.json#/$defs/legendEntry"},"success":{"$ref":"common.schema.json#/$defs/legendEntry"},"failure":{"$ref":"common.schema.json#/$defs/legendEntry"},"neutral":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":420},{"type":"number","minimum":566}],"items":false,"minItems":2,"maxItems":2}}},"lanes":{"type":"array","minItems":1,"maxItems":4,"items":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1}}}},"states":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label","lane","col"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"enum":["start","active","waiting","decision","success","failure","neutral","external"]},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"step":{"type":"string"},"lane":{"$ref":"common.schema.json#/$defs/id"},"col":{"type":"integer","minimum":0,"maximum":4},"width":{"type":"number","minimum":48},"height":{"type":"number","minimum":36},"yOffset":{"type":"number"}}}},"transitions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"note":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"route":{"enum":["auto","straight","drop","bottom-channel","top-channel","right-channel","left-channel"]},"fromSide":{"enum":["left","right","top","bottom"]},"toSide":{"enum":["left","right","top","bottom"]},"channelX":{"type":"number"},"channelY":{"type":"number"},"cornerRadius":{"type":"number","minimum":0},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"width":{"type":"number","minimum":0.5}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};function validate31(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate31.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern4.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate31.errors = vErrors;return errors === 0;}validate31.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate30(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/lifecycle.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate30.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.lanes === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lanes"},message:"must have required property '"+"lanes"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.states === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "states"},message:"must have required property '"+"states"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.transitions === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "transitions"},message:"must have required property '"+"transitions"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "lanes")) || (key0 === "states")) || (key0 === "transitions")) || (key0 === "cards"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("lifecycle" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "lifecycle"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key1 in data2){if(!(func1.call(schema104.properties.meta.properties, key1))){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!((data4 === "en") || (data4 === "zh-CN"))){const err13 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err14 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.output !== undefined){if(typeof data2.output !== "string"){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"#/properties/meta/properties/output/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err16 = {instancePath:instancePath+"/meta/animation",schemaPath:"#/properties/meta/properties/animation/enum",keyword:"enum",params:{allowedValues: schema104.properties.meta.properties.animation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err17 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"#/properties/meta/properties/visual_preset/enum",keyword:"enum",params:{allowedValues: schema104.properties.meta.properties.visual_preset.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err18 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"#/properties/meta/properties/quality_profile/enum",keyword:"enum",params:{allowedValues: schema104.properties.meta.properties.quality_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data2.views !== undefined){if(!(validate31(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data11 = data2.legend;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){for(const key2 in data11){if(!((key2 === "mode") || (key2 === "entries"))){const err19 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data11.mode !== undefined){let data12 = data11.mode;if(!(((data12 === "auto") || (data12 === "all")) || (data12 === "hidden"))){const err20 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema37.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data11.entries !== undefined){let data13 = data11.entries;if(data13 && typeof data13 == "object" && !Array.isArray(data13)){for(const key3 in data13){if(!((((((((key3 === "start") || (key3 === "active")) || (key3 === "waiting")) || (key3 === "decision")) || (key3 === "success")) || (key3 === "failure")) || (key3 === "neutral")) || (key3 === "external"))){const err21 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data13.start !== undefined){let data14 = data13.start;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){if(Object.keys(data14).length < 1){const err22 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}for(const key4 in data14){if(!((key4 === "label") || (key4 === "visible"))){const err23 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data14.label !== undefined){let data15 = data14.label;if(typeof data15 === "string"){if(func3(data15) > 80){const err24 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(func3(data15) < 1){const err25 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data14.visible !== undefined){if(typeof data14.visible !== "boolean"){const err27 = {instancePath:instancePath+"/meta/legend/entries/start/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data13.active !== undefined){let data17 = data13.active;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){if(Object.keys(data17).length < 1){const err29 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}for(const key5 in data17){if(!((key5 === "label") || (key5 === "visible"))){const err30 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data17.label !== undefined){let data18 = data17.label;if(typeof data18 === "string"){if(func3(data18) > 80){const err31 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func3(data18) < 1){const err32 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data17.visible !== undefined){if(typeof data17.visible !== "boolean"){const err34 = {instancePath:instancePath+"/meta/legend/entries/active/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}}else {const err35 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data13.waiting !== undefined){let data20 = data13.waiting;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){if(Object.keys(data20).length < 1){const err36 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key6 in data20){if(!((key6 === "label") || (key6 === "visible"))){const err37 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data20.label !== undefined){let data21 = data20.label;if(typeof data21 === "string"){if(func3(data21) > 80){const err38 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(func3(data21) < 1){const err39 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data20.visible !== undefined){if(typeof data20.visible !== "boolean"){const err41 = {instancePath:instancePath+"/meta/legend/entries/waiting/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data13.decision !== undefined){let data23 = data13.decision;if(data23 && typeof data23 == "object" && !Array.isArray(data23)){if(Object.keys(data23).length < 1){const err43 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}for(const key7 in data23){if(!((key7 === "label") || (key7 === "visible"))){const err44 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data23.label !== undefined){let data24 = data23.label;if(typeof data24 === "string"){if(func3(data24) > 80){const err45 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data24) < 1){const err46 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data23.visible !== undefined){if(typeof data23.visible !== "boolean"){const err48 = {instancePath:instancePath+"/meta/legend/entries/decision/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data13.success !== undefined){let data26 = data13.success;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(Object.keys(data26).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key8 in data26){if(!((key8 === "label") || (key8 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data26.label !== undefined){let data27 = data26.label;if(typeof data27 === "string"){if(func3(data27) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data27) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data26.visible !== undefined){if(typeof data26.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/success/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data13.failure !== undefined){let data29 = data13.failure;if(data29 && typeof data29 == "object" && !Array.isArray(data29)){if(Object.keys(data29).length < 1){const err57 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}for(const key9 in data29){if(!((key9 === "label") || (key9 === "visible"))){const err58 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data29.label !== undefined){let data30 = data29.label;if(typeof data30 === "string"){if(func3(data30) > 80){const err59 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(func3(data30) < 1){const err60 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data29.visible !== undefined){if(typeof data29.visible !== "boolean"){const err62 = {instancePath:instancePath+"/meta/legend/entries/failure/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}}else {const err63 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data13.neutral !== undefined){let data32 = data13.neutral;if(data32 && typeof data32 == "object" && !Array.isArray(data32)){if(Object.keys(data32).length < 1){const err64 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key10 in data32){if(!((key10 === "label") || (key10 === "visible"))){const err65 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data32.label !== undefined){let data33 = data32.label;if(typeof data33 === "string"){if(func3(data33) > 80){const err66 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if(func3(data33) < 1){const err67 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data32.visible !== undefined){if(typeof data32.visible !== "boolean"){const err69 = {instancePath:instancePath+"/meta/legend/entries/neutral/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}}else {const err70 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data13.external !== undefined){let data35 = data13.external;if(data35 && typeof data35 == "object" && !Array.isArray(data35)){if(Object.keys(data35).length < 1){const err71 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}for(const key11 in data35){if(!((key11 === "label") || (key11 === "visible"))){const err72 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data35.label !== undefined){let data36 = data35.label;if(typeof data36 === "string"){if(func3(data36) > 80){const err73 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(func3(data36) < 1){const err74 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}else {const err75 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data35.visible !== undefined){if(typeof data35.visible !== "boolean"){const err76 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}}else {const err78 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}}else {const err79 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}if(data2.viewBox !== undefined){let data38 = data2.viewBox;if(Array.isArray(data38)){if(data38.length > 2){const err80 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}if(data38.length < 2){const err81 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}const len0 = data38.length;if(len0 > 0){let data39 = data38[0];if((typeof data39 == "number") && (isFinite(data39))){if(data39 < 420 || isNaN(data39)){const err82 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 420},message:"must be >= 420"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}else {const err83 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}if(len0 > 1){let data40 = data38[1];if((typeof data40 == "number") && (isFinite(data40))){if(data40 < 566 || isNaN(data40)){const err84 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 566},message:"must be >= 566"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}else {const err85 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}const len1 = data38.length;if(!(len1 <= 2)){const err86 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}else {const err87 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}}else {const err88 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data.lanes !== undefined){let data41 = data.lanes;if(Array.isArray(data41)){if(data41.length > 4){const err89 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/maxItems",keyword:"maxItems",params:{limit: 4},message:"must NOT have more than 4 items"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}if(data41.length < 1){const err90 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}const len2 = data41.length;for(let i0=0; i0<len2; i0++){let data42 = data41[i0];if(data42 && typeof data42 == "object" && !Array.isArray(data42)){if(data42.id === undefined){const err91 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}if(data42.label === undefined){const err92 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}for(const key12 in data42){if(!((key12 === "id") || (key12 === "label"))){const err93 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(data42.id !== undefined){let data43 = data42.id;if(typeof data43 === "string"){if(!pattern4.test(data43)){const err94 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}else {const err95 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data42.label !== undefined){let data44 = data42.label;if(typeof data44 === "string"){if(func3(data44) < 1){const err96 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}else {const err97 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data.states !== undefined){let data45 = data.states;if(Array.isArray(data45)){if(data45.length < 2){const err100 = {instancePath:instancePath+"/states",schemaPath:"#/properties/states/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}const len3 = data45.length;for(let i1=0; i1<len3; i1++){let data46 = data45[i1];if(data46 && typeof data46 == "object" && !Array.isArray(data46)){if(data46.id === undefined){const err101 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}if(data46.type === undefined){const err102 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}if(data46.label === undefined){const err103 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}if(data46.lane === undefined){const err104 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}if(data46.col === undefined){const err105 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "col"},message:"must have required property '"+"col"+"'"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}for(const key13 in data46){if(!(func1.call(schema104.properties.states.items.properties, key13))){const err106 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}if(data46.id !== undefined){let data47 = data46.id;if(typeof data47 === "string"){if(!pattern4.test(data47)){const err107 = {instancePath:instancePath+"/states/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}else {const err108 = {instancePath:instancePath+"/states/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}if(data46.type !== undefined){let data48 = data46.type;if(!((((((((data48 === "start") || (data48 === "active")) || (data48 === "waiting")) || (data48 === "decision")) || (data48 === "success")) || (data48 === "failure")) || (data48 === "neutral")) || (data48 === "external"))){const err109 = {instancePath:instancePath+"/states/" + i1+"/type",schemaPath:"#/properties/states/items/properties/type/enum",keyword:"enum",params:{allowedValues: schema104.properties.states.items.properties.type.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}if(data46.label !== undefined){let data49 = data46.label;if(typeof data49 === "string"){if(func3(data49) < 1){const err110 = {instancePath:instancePath+"/states/" + i1+"/label",schemaPath:"#/properties/states/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}else {const err111 = {instancePath:instancePath+"/states/" + i1+"/label",schemaPath:"#/properties/states/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}if(data46.sublabel !== undefined){if(typeof data46.sublabel !== "string"){const err112 = {instancePath:instancePath+"/states/" + i1+"/sublabel",schemaPath:"#/properties/states/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}if(data46.tag !== undefined){if(typeof data46.tag !== "string"){const err113 = {instancePath:instancePath+"/states/" + i1+"/tag",schemaPath:"#/properties/states/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data46.brand !== undefined){let data52 = data46.brand;const _errs124 = errors;let valid32 = false;let passing0 = null;const _errs125 = errors;const _errs127 = errors;let valid33 = false;const _errs128 = errors;if(typeof data52 === "string"){if(func3(data52) > 80){const err114 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(!pattern13.test(data52)){const err115 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}var _valid1 = _errs128 === errors;valid33 = valid33 || _valid1;const _errs129 = errors;if(typeof data52 === "string"){if(!pattern14.test(data52)){const err116 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}var _valid1 = _errs129 === errors;valid33 = valid33 || _valid1;if(!valid33){const err117 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}else {errors = _errs127;if(vErrors !== null){if(_errs127){vErrors.length = _errs127;}else {vErrors = null;}}}if(typeof data52 === "string"){if(func3(data52) > 2048){const err118 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}if(func3(data52) < 1){const err119 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}var _valid0 = _errs125 === errors;if(_valid0){valid32 = true;passing0 = 0;}const _errs130 = errors;if(data52 && typeof data52 == "object" && !Array.isArray(data52)){if(data52.url === undefined){const err121 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}if(data52.sha256 === undefined){const err122 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}for(const key14 in data52){if(!((key14 === "url") || (key14 === "sha256"))){const err123 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}if(data52.url !== undefined){let data53 = data52.url;if(typeof data53 === "string"){if(func3(data53) > 2048){const err124 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}if(func3(data53) < 8){const err125 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}if(!pattern14.test(data53)){const err126 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}else {const err127 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}if(data52.sha256 !== undefined){let data54 = data52.sha256;if(typeof data54 === "string"){if(!pattern16.test(data54)){const err128 = {instancePath:instancePath+"/states/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}else {const err129 = {instancePath:instancePath+"/states/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}}else {const err130 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}var _valid0 = _errs130 === errors;if(_valid0 && valid32){valid32 = false;passing0 = [passing0, 1];}else {if(_valid0){valid32 = true;passing0 = 1;}}if(!valid32){const err131 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}else {errors = _errs124;if(vErrors !== null){if(_errs124){vErrors.length = _errs124;}else {vErrors = null;}}}}if(data46.step !== undefined){if(typeof data46.step !== "string"){const err132 = {instancePath:instancePath+"/states/" + i1+"/step",schemaPath:"#/properties/states/items/properties/step/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}if(data46.lane !== undefined){let data56 = data46.lane;if(typeof data56 === "string"){if(!pattern4.test(data56)){const err133 = {instancePath:instancePath+"/states/" + i1+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}else {const err134 = {instancePath:instancePath+"/states/" + i1+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}if(data46.col !== undefined){let data57 = data46.col;if(!(((typeof data57 == "number") && (!(data57 % 1) && !isNaN(data57))) && (isFinite(data57)))){const err135 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}if((typeof data57 == "number") && (isFinite(data57))){if(data57 > 4 || isNaN(data57)){const err136 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/maximum",keyword:"maximum",params:{comparison: "<=", limit: 4},message:"must be <= 4"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}if(data57 < 0 || isNaN(data57)){const err137 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}}if(data46.width !== undefined){let data58 = data46.width;if((typeof data58 == "number") && (isFinite(data58))){if(data58 < 48 || isNaN(data58)){const err138 = {instancePath:instancePath+"/states/" + i1+"/width",schemaPath:"#/properties/states/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 48},message:"must be >= 48"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}else {const err139 = {instancePath:instancePath+"/states/" + i1+"/width",schemaPath:"#/properties/states/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data46.height !== undefined){let data59 = data46.height;if((typeof data59 == "number") && (isFinite(data59))){if(data59 < 36 || isNaN(data59)){const err140 = {instancePath:instancePath+"/states/" + i1+"/height",schemaPath:"#/properties/states/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 36},message:"must be >= 36"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}else {const err141 = {instancePath:instancePath+"/states/" + i1+"/height",schemaPath:"#/properties/states/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}if(data46.yOffset !== undefined){let data60 = data46.yOffset;if(!((typeof data60 == "number") && (isFinite(data60)))){const err142 = {instancePath:instancePath+"/states/" + i1+"/yOffset",schemaPath:"#/properties/states/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}}}else {const err143 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}}else {const err144 = {instancePath:instancePath+"/states",schemaPath:"#/properties/states/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data.transitions !== undefined){let data61 = data.transitions;if(Array.isArray(data61)){const len4 = data61.length;for(let i2=0; i2<len4; i2++){let data62 = data61[i2];if(data62 && typeof data62 == "object" && !Array.isArray(data62)){if(data62.from === undefined){const err145 = {instancePath:instancePath+"/transitions/" + i2,schemaPath:"#/properties/transitions/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}if(data62.to === undefined){const err146 = {instancePath:instancePath+"/transitions/" + i2,schemaPath:"#/properties/transitions/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}for(const key15 in data62){if(!(func1.call(schema104.properties.transitions.items.properties, key15))){const err147 = {instancePath:instancePath+"/transitions/" + i2,schemaPath:"#/properties/transitions/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}if(data62.id !== undefined){let data63 = data62.id;if(typeof data63 === "string"){if(!pattern4.test(data63)){const err148 = {instancePath:instancePath+"/transitions/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}else {const err149 = {instancePath:instancePath+"/transitions/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}if(data62.from !== undefined){let data64 = data62.from;if(typeof data64 === "string"){if(!pattern4.test(data64)){const err150 = {instancePath:instancePath+"/transitions/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}else {const err151 = {instancePath:instancePath+"/transitions/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}if(data62.to !== undefined){let data65 = data62.to;if(typeof data65 === "string"){if(!pattern4.test(data65)){const err152 = {instancePath:instancePath+"/transitions/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}else {const err153 = {instancePath:instancePath+"/transitions/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}if(data62.label !== undefined){if(typeof data62.label !== "string"){const err154 = {instancePath:instancePath+"/transitions/" + i2+"/label",schemaPath:"#/properties/transitions/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}if(data62.note !== undefined){if(typeof data62.note !== "string"){const err155 = {instancePath:instancePath+"/transitions/" + i2+"/note",schemaPath:"#/properties/transitions/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}if(data62.variant !== undefined){let data68 = data62.variant;if(!((((data68 === "default") || (data68 === "emphasis")) || (data68 === "security")) || (data68 === "dashed"))){const err156 = {instancePath:instancePath+"/transitions/" + i2+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema57.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}if(data62.route !== undefined){let data69 = data62.route;if(!(((((((data69 === "auto") || (data69 === "straight")) || (data69 === "drop")) || (data69 === "bottom-channel")) || (data69 === "top-channel")) || (data69 === "right-channel")) || (data69 === "left-channel"))){const err157 = {instancePath:instancePath+"/transitions/" + i2+"/route",schemaPath:"#/properties/transitions/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema104.properties.transitions.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}if(data62.fromSide !== undefined){let data70 = data62.fromSide;if(!((((data70 === "left") || (data70 === "right")) || (data70 === "top")) || (data70 === "bottom"))){const err158 = {instancePath:instancePath+"/transitions/" + i2+"/fromSide",schemaPath:"#/properties/transitions/items/properties/fromSide/enum",keyword:"enum",params:{allowedValues: schema104.properties.transitions.items.properties.fromSide.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}if(data62.toSide !== undefined){let data71 = data62.toSide;if(!((((data71 === "left") || (data71 === "right")) || (data71 === "top")) || (data71 === "bottom"))){const err159 = {instancePath:instancePath+"/transitions/" + i2+"/toSide",schemaPath:"#/properties/transitions/items/properties/toSide/enum",keyword:"enum",params:{allowedValues: schema104.properties.transitions.items.properties.toSide.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}if(data62.channelX !== undefined){let data72 = data62.channelX;if(!((typeof data72 == "number") && (isFinite(data72)))){const err160 = {instancePath:instancePath+"/transitions/" + i2+"/channelX",schemaPath:"#/properties/transitions/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}if(data62.channelY !== undefined){let data73 = data62.channelY;if(!((typeof data73 == "number") && (isFinite(data73)))){const err161 = {instancePath:instancePath+"/transitions/" + i2+"/channelY",schemaPath:"#/properties/transitions/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}}if(data62.cornerRadius !== undefined){let data74 = data62.cornerRadius;if((typeof data74 == "number") && (isFinite(data74))){if(data74 < 0 || isNaN(data74)){const err162 = {instancePath:instancePath+"/transitions/" + i2+"/cornerRadius",schemaPath:"#/properties/transitions/items/properties/cornerRadius/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}else {const err163 = {instancePath:instancePath+"/transitions/" + i2+"/cornerRadius",schemaPath:"#/properties/transitions/items/properties/cornerRadius/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}if(data62.labelAt !== undefined){let data75 = data62.labelAt;if(Array.isArray(data75)){if(data75.length > 2){const err164 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}if(data75.length < 2){const err165 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}const len5 = data75.length;if(len5 > 0){let data76 = data75[0];if(!((typeof data76 == "number") && (isFinite(data76)))){const err166 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}if(len5 > 1){let data77 = data75[1];if(!((typeof data77 == "number") && (isFinite(data77)))){const err167 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}const len6 = data75.length;if(!(len6 <= 2)){const err168 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}else {const err169 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}if(data62.labelDx !== undefined){let data78 = data62.labelDx;if(!((typeof data78 == "number") && (isFinite(data78)))){const err170 = {instancePath:instancePath+"/transitions/" + i2+"/labelDx",schemaPath:"#/properties/transitions/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}if(data62.labelDy !== undefined){let data79 = data62.labelDy;if(!((typeof data79 == "number") && (isFinite(data79)))){const err171 = {instancePath:instancePath+"/transitions/" + i2+"/labelDy",schemaPath:"#/properties/transitions/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}if(data62.labelSegment !== undefined){let data80 = data62.labelSegment;if(!(((typeof data80 == "number") && (!(data80 % 1) && !isNaN(data80))) && (isFinite(data80)))){const err172 = {instancePath:instancePath+"/transitions/" + i2+"/labelSegment",schemaPath:"#/properties/transitions/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}if((typeof data80 == "number") && (isFinite(data80))){if(data80 < 0 || isNaN(data80)){const err173 = {instancePath:instancePath+"/transitions/" + i2+"/labelSegment",schemaPath:"#/properties/transitions/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}}if(data62.via !== undefined){let data81 = data62.via;if(Array.isArray(data81)){const len7 = data81.length;for(let i3=0; i3<len7; i3++){let data82 = data81[i3];if(Array.isArray(data82)){if(data82.length > 2){const err174 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}if(data82.length < 2){const err175 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}const len8 = data82.length;if(len8 > 0){let data83 = data82[0];if(!((typeof data83 == "number") && (isFinite(data83)))){const err176 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}if(len8 > 1){let data84 = data82[1];if(!((typeof data84 == "number") && (isFinite(data84)))){const err177 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}const len9 = data82.length;if(!(len9 <= 2)){const err178 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}else {const err179 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}}else {const err180 = {instancePath:instancePath+"/transitions/" + i2+"/via",schemaPath:"#/properties/transitions/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(data62.width !== undefined){let data85 = data62.width;if((typeof data85 == "number") && (isFinite(data85))){if(data85 < 0.5 || isNaN(data85)){const err181 = {instancePath:instancePath+"/transitions/" + i2+"/width",schemaPath:"#/properties/transitions/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}else {const err182 = {instancePath:instancePath+"/transitions/" + i2+"/width",schemaPath:"#/properties/transitions/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}}else {const err183 = {instancePath:instancePath+"/transitions/" + i2,schemaPath:"#/properties/transitions/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}}else {const err184 = {instancePath:instancePath+"/transitions",schemaPath:"#/properties/transitions/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}if(data.cards !== undefined){let data86 = data.cards;if(Array.isArray(data86)){const len10 = data86.length;for(let i4=0; i4<len10; i4++){let data87 = data86[i4];if(data87 && typeof data87 == "object" && !Array.isArray(data87)){if(data87.dot === undefined){const err185 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}if(data87.title === undefined){const err186 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}if(data87.items === undefined){const err187 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}for(const key16 in data87){if(!(((key16 === "dot") || (key16 === "title")) || (key16 === "items"))){const err188 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}if(data87.dot !== undefined){let data88 = data87.dot;if(!(((((((data88 === "cyan") || (data88 === "emerald")) || (data88 === "violet")) || (data88 === "amber")) || (data88 === "rose")) || (data88 === "orange")) || (data88 === "slate"))){const err189 = {instancePath:instancePath+"/cards/" + i4+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema62.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}if(data87.title !== undefined){let data89 = data87.title;if(typeof data89 === "string"){if(func3(data89) < 1){const err190 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}else {const err191 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}if(data87.items !== undefined){let data90 = data87.items;if(Array.isArray(data90)){const len11 = data90.length;for(let i5=0; i5<len11; i5++){if(typeof data90[i5] !== "string"){const err192 = {instancePath:instancePath+"/cards/" + i4+"/items/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}}else {const err193 = {instancePath:instancePath+"/cards/" + i4+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}}else {const err194 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}}else {const err195 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}}else {const err196 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}validate30.errors = vErrors;return errors === 0;}validate30.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};export const architecture = validate33;const schema129 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/architecture.schema.json","title":"Archify Architecture Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","components"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"architecture"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"type":"string"},"animation":{"enum":["trace","none"]},"visual_preset":{"enum":["classic","signal-flow","blueprint","editorial"]},"quality_profile":{"enum":["standard","showcase"]},"engineering_profile":{"enum":["deployment-ownership"]},"repository":{"type":"object","additionalProperties":false,"required":["url","revision"],"properties":{"url":{"type":"string","pattern":"^https://github\\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+(?:\\.git)?/?$"},"revision":{"type":"string","pattern":"^[a-fA-F0-9]{40}$"}}},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"frontend":{"$ref":"common.schema.json#/$defs/legendEntry"},"backend":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"},"cloud":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"messagebus":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":320},{"type":"number","minimum":240}],"items":false,"minItems":2,"maxItems":2}}},"layout":{"type":"object","additionalProperties":false,"required":["mode"],"properties":{"mode":{"enum":["grid"]},"origin":{"$ref":"common.schema.json#/$defs/point"},"cols":{"type":"integer","minimum":1,"maximum":12},"gapX":{"type":"number","minimum":0},"gapY":{"type":"number","minimum":0},"cellW":{"type":"number","minimum":40},"cellH":{"type":"number","minimum":24}}},"components":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","additionalProperties":false,"required":["path"],"properties":{"path":{"type":"string","minLength":1,"maxLength":240},"line":{"type":"integer","minimum":1},"end_line":{"type":"integer","minimum":1},"label":{"type":"string","minLength":1,"maxLength":48}}}},"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0},"pos":{"$ref":"common.schema.json#/$defs/point"},"size":{"type":"array","prefixItems":[{"type":"number","exclusiveMinimum":0},{"type":"number","exclusiveMinimum":0}],"items":false,"minItems":2,"maxItems":2}}}},"boundaries":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","label","wraps"],"properties":{"kind":{"enum":["region","security-group"]},"label":{"type":"string","minLength":1},"wraps":{"type":"array","minItems":1,"items":{"$ref":"common.schema.json#/$defs/id"}},"pad":{"type":"number","minimum":0}}}},"connections":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"fromSide":{"enum":["left","right","top","bottom"]},"toSide":{"enum":["left","right","top","bottom"]},"route":{"enum":["auto","straight","orthogonal-h","orthogonal-v"]},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"width":{"type":"number","minimum":0.5}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};const pattern53 = new RegExp("^https://github\\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+(?:\\.git)?/?$", "u");const pattern54 = new RegExp("^[a-fA-F0-9]{40}$", "u");function validate34(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate34.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern4.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate34.errors = vErrors;return errors === 0;}validate34.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate33(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/architecture.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate33.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.components === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "components"},message:"must have required property '"+"components"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!((((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "layout")) || (key0 === "components")) || (key0 === "boundaries")) || (key0 === "connections")) || (key0 === "cards"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err5 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.diagram_type !== undefined){if("architecture" !== data.diagram_type){const err6 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "architecture"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err7 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}for(const key1 in data2){if(!(func1.call(schema129.properties.meta.properties, key1))){const err8 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err9 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!((data4 === "en") || (data4 === "zh-CN"))){const err11 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err12 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.output !== undefined){if(typeof data2.output !== "string"){const err13 = {instancePath:instancePath+"/meta/output",schemaPath:"#/properties/meta/properties/output/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err14 = {instancePath:instancePath+"/meta/animation",schemaPath:"#/properties/meta/properties/animation/enum",keyword:"enum",params:{allowedValues: schema129.properties.meta.properties.animation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err15 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"#/properties/meta/properties/visual_preset/enum",keyword:"enum",params:{allowedValues: schema129.properties.meta.properties.visual_preset.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err16 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"#/properties/meta/properties/quality_profile/enum",keyword:"enum",params:{allowedValues: schema129.properties.meta.properties.quality_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data2.engineering_profile !== undefined){if(!(data2.engineering_profile === "deployment-ownership")){const err17 = {instancePath:instancePath+"/meta/engineering_profile",schemaPath:"#/properties/meta/properties/engineering_profile/enum",keyword:"enum",params:{allowedValues: schema129.properties.meta.properties.engineering_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data2.repository !== undefined){let data11 = data2.repository;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){if(data11.url === undefined){const err18 = {instancePath:instancePath+"/meta/repository",schemaPath:"#/properties/meta/properties/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(data11.revision === undefined){const err19 = {instancePath:instancePath+"/meta/repository",schemaPath:"#/properties/meta/properties/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}for(const key2 in data11){if(!((key2 === "url") || (key2 === "revision"))){const err20 = {instancePath:instancePath+"/meta/repository",schemaPath:"#/properties/meta/properties/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data11.url !== undefined){let data12 = data11.url;if(typeof data12 === "string"){if(!pattern53.test(data12)){const err21 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"#/properties/meta/properties/repository/properties/url/pattern",keyword:"pattern",params:{pattern: "^https://github\\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+(?:\\.git)?/?$"},message:"must match pattern \""+"^https://github\\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+(?:\\.git)?/?$"+"\""};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"#/properties/meta/properties/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data11.revision !== undefined){let data13 = data11.revision;if(typeof data13 === "string"){if(!pattern54.test(data13)){const err23 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"#/properties/meta/properties/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"#/properties/meta/properties/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}else {const err25 = {instancePath:instancePath+"/meta/repository",schemaPath:"#/properties/meta/properties/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data2.views !== undefined){if(!(validate34(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data15 = data2.legend;if(data15 && typeof data15 == "object" && !Array.isArray(data15)){for(const key3 in data15){if(!((key3 === "mode") || (key3 === "entries"))){const err26 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data15.mode !== undefined){let data16 = data15.mode;if(!(((data16 === "auto") || (data16 === "all")) || (data16 === "hidden"))){const err27 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema37.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data15.entries !== undefined){let data17 = data15.entries;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){for(const key4 in data17){if(!(((((((key4 === "frontend") || (key4 === "backend")) || (key4 === "database")) || (key4 === "cloud")) || (key4 === "security")) || (key4 === "messagebus")) || (key4 === "external"))){const err28 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data17.frontend !== undefined){let data18 = data17.frontend;if(data18 && typeof data18 == "object" && !Array.isArray(data18)){if(Object.keys(data18).length < 1){const err29 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}for(const key5 in data18){if(!((key5 === "label") || (key5 === "visible"))){const err30 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data18.label !== undefined){let data19 = data18.label;if(typeof data19 === "string"){if(func3(data19) > 80){const err31 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func3(data19) < 1){const err32 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data18.visible !== undefined){if(typeof data18.visible !== "boolean"){const err34 = {instancePath:instancePath+"/meta/legend/entries/frontend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}}else {const err35 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data17.backend !== undefined){let data21 = data17.backend;if(data21 && typeof data21 == "object" && !Array.isArray(data21)){if(Object.keys(data21).length < 1){const err36 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key6 in data21){if(!((key6 === "label") || (key6 === "visible"))){const err37 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data21.label !== undefined){let data22 = data21.label;if(typeof data22 === "string"){if(func3(data22) > 80){const err38 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(func3(data22) < 1){const err39 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data21.visible !== undefined){if(typeof data21.visible !== "boolean"){const err41 = {instancePath:instancePath+"/meta/legend/entries/backend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data17.database !== undefined){let data24 = data17.database;if(data24 && typeof data24 == "object" && !Array.isArray(data24)){if(Object.keys(data24).length < 1){const err43 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}for(const key7 in data24){if(!((key7 === "label") || (key7 === "visible"))){const err44 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data24.label !== undefined){let data25 = data24.label;if(typeof data25 === "string"){if(func3(data25) > 80){const err45 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data25) < 1){const err46 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data24.visible !== undefined){if(typeof data24.visible !== "boolean"){const err48 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data17.cloud !== undefined){let data27 = data17.cloud;if(data27 && typeof data27 == "object" && !Array.isArray(data27)){if(Object.keys(data27).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key8 in data27){if(!((key8 === "label") || (key8 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data27.label !== undefined){let data28 = data27.label;if(typeof data28 === "string"){if(func3(data28) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data28) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data27.visible !== undefined){if(typeof data27.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/cloud/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data17.security !== undefined){let data30 = data17.security;if(data30 && typeof data30 == "object" && !Array.isArray(data30)){if(Object.keys(data30).length < 1){const err57 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}for(const key9 in data30){if(!((key9 === "label") || (key9 === "visible"))){const err58 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data30.label !== undefined){let data31 = data30.label;if(typeof data31 === "string"){if(func3(data31) > 80){const err59 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(func3(data31) < 1){const err60 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data30.visible !== undefined){if(typeof data30.visible !== "boolean"){const err62 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}}else {const err63 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data17.messagebus !== undefined){let data33 = data17.messagebus;if(data33 && typeof data33 == "object" && !Array.isArray(data33)){if(Object.keys(data33).length < 1){const err64 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key10 in data33){if(!((key10 === "label") || (key10 === "visible"))){const err65 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data33.label !== undefined){let data34 = data33.label;if(typeof data34 === "string"){if(func3(data34) > 80){const err66 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if(func3(data34) < 1){const err67 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data33.visible !== undefined){if(typeof data33.visible !== "boolean"){const err69 = {instancePath:instancePath+"/meta/legend/entries/messagebus/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}}else {const err70 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data17.external !== undefined){let data36 = data17.external;if(data36 && typeof data36 == "object" && !Array.isArray(data36)){if(Object.keys(data36).length < 1){const err71 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}for(const key11 in data36){if(!((key11 === "label") || (key11 === "visible"))){const err72 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data36.label !== undefined){let data37 = data36.label;if(typeof data37 === "string"){if(func3(data37) > 80){const err73 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(func3(data37) < 1){const err74 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}else {const err75 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data36.visible !== undefined){if(typeof data36.visible !== "boolean"){const err76 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}}else {const err78 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}}else {const err79 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}if(data2.viewBox !== undefined){let data39 = data2.viewBox;if(Array.isArray(data39)){if(data39.length > 2){const err80 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}if(data39.length < 2){const err81 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}const len0 = data39.length;if(len0 > 0){let data40 = data39[0];if((typeof data40 == "number") && (isFinite(data40))){if(data40 < 320 || isNaN(data40)){const err82 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 320},message:"must be >= 320"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}else {const err83 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}if(len0 > 1){let data41 = data39[1];if((typeof data41 == "number") && (isFinite(data41))){if(data41 < 240 || isNaN(data41)){const err84 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 240},message:"must be >= 240"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}else {const err85 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}const len1 = data39.length;if(!(len1 <= 2)){const err86 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}else {const err87 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}}else {const err88 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data.layout !== undefined){let data42 = data.layout;if(data42 && typeof data42 == "object" && !Array.isArray(data42)){if(data42.mode === undefined){const err89 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/required",keyword:"required",params:{missingProperty: "mode"},message:"must have required property '"+"mode"+"'"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}for(const key12 in data42){if(!(((((((key12 === "mode") || (key12 === "origin")) || (key12 === "cols")) || (key12 === "gapX")) || (key12 === "gapY")) || (key12 === "cellW")) || (key12 === "cellH"))){const err90 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}if(data42.mode !== undefined){if(!(data42.mode === "grid")){const err91 = {instancePath:instancePath+"/layout/mode",schemaPath:"#/properties/layout/properties/mode/enum",keyword:"enum",params:{allowedValues: schema129.properties.layout.properties.mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}if(data42.origin !== undefined){let data44 = data42.origin;if(Array.isArray(data44)){if(data44.length > 2){const err92 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}if(data44.length < 2){const err93 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}const len2 = data44.length;if(len2 > 0){let data45 = data44[0];if(!((typeof data45 == "number") && (isFinite(data45)))){const err94 = {instancePath:instancePath+"/layout/origin/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(len2 > 1){let data46 = data44[1];if(!((typeof data46 == "number") && (isFinite(data46)))){const err95 = {instancePath:instancePath+"/layout/origin/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}const len3 = data44.length;if(!(len3 <= 2)){const err96 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}else {const err97 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}if(data42.cols !== undefined){let data47 = data42.cols;if(!(((typeof data47 == "number") && (!(data47 % 1) && !isNaN(data47))) && (isFinite(data47)))){const err98 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}if((typeof data47 == "number") && (isFinite(data47))){if(data47 > 12 || isNaN(data47)){const err99 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/maximum",keyword:"maximum",params:{comparison: "<=", limit: 12},message:"must be <= 12"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}if(data47 < 1 || isNaN(data47)){const err100 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}}if(data42.gapX !== undefined){let data48 = data42.gapX;if((typeof data48 == "number") && (isFinite(data48))){if(data48 < 0 || isNaN(data48)){const err101 = {instancePath:instancePath+"/layout/gapX",schemaPath:"#/properties/layout/properties/gapX/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}else {const err102 = {instancePath:instancePath+"/layout/gapX",schemaPath:"#/properties/layout/properties/gapX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(data42.gapY !== undefined){let data49 = data42.gapY;if((typeof data49 == "number") && (isFinite(data49))){if(data49 < 0 || isNaN(data49)){const err103 = {instancePath:instancePath+"/layout/gapY",schemaPath:"#/properties/layout/properties/gapY/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}else {const err104 = {instancePath:instancePath+"/layout/gapY",schemaPath:"#/properties/layout/properties/gapY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}if(data42.cellW !== undefined){let data50 = data42.cellW;if((typeof data50 == "number") && (isFinite(data50))){if(data50 < 40 || isNaN(data50)){const err105 = {instancePath:instancePath+"/layout/cellW",schemaPath:"#/properties/layout/properties/cellW/minimum",keyword:"minimum",params:{comparison: ">=", limit: 40},message:"must be >= 40"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}else {const err106 = {instancePath:instancePath+"/layout/cellW",schemaPath:"#/properties/layout/properties/cellW/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}if(data42.cellH !== undefined){let data51 = data42.cellH;if((typeof data51 == "number") && (isFinite(data51))){if(data51 < 24 || isNaN(data51)){const err107 = {instancePath:instancePath+"/layout/cellH",schemaPath:"#/properties/layout/properties/cellH/minimum",keyword:"minimum",params:{comparison: ">=", limit: 24},message:"must be >= 24"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}else {const err108 = {instancePath:instancePath+"/layout/cellH",schemaPath:"#/properties/layout/properties/cellH/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}}else {const err109 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}if(data.components !== undefined){let data52 = data.components;if(Array.isArray(data52)){if(data52.length < 1){const err110 = {instancePath:instancePath+"/components",schemaPath:"#/properties/components/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}const len4 = data52.length;for(let i0=0; i0<len4; i0++){let data53 = data52[i0];if(data53 && typeof data53 == "object" && !Array.isArray(data53)){if(data53.id === undefined){const err111 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(data53.type === undefined){const err112 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}if(data53.label === undefined){const err113 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}for(const key13 in data53){if(!(func1.call(schema129.properties.components.items.properties, key13))){const err114 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}if(data53.id !== undefined){let data54 = data53.id;if(typeof data54 === "string"){if(!pattern4.test(data54)){const err115 = {instancePath:instancePath+"/components/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}else {const err116 = {instancePath:instancePath+"/components/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data53.type !== undefined){let data55 = data53.type;if(!(((((((data55 === "frontend") || (data55 === "backend")) || (data55 === "database")) || (data55 === "cloud")) || (data55 === "security")) || (data55 === "messagebus")) || (data55 === "external"))){const err117 = {instancePath:instancePath+"/components/" + i0+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema52.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}if(data53.label !== undefined){let data56 = data53.label;if(typeof data56 === "string"){if(func3(data56) < 1){const err118 = {instancePath:instancePath+"/components/" + i0+"/label",schemaPath:"#/properties/components/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}else {const err119 = {instancePath:instancePath+"/components/" + i0+"/label",schemaPath:"#/properties/components/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}if(data53.sublabel !== undefined){if(typeof data53.sublabel !== "string"){const err120 = {instancePath:instancePath+"/components/" + i0+"/sublabel",schemaPath:"#/properties/components/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data53.tag !== undefined){if(typeof data53.tag !== "string"){const err121 = {instancePath:instancePath+"/components/" + i0+"/tag",schemaPath:"#/properties/components/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}if(data53.brand !== undefined){let data59 = data53.brand;const _errs136 = errors;let valid31 = false;let passing0 = null;const _errs137 = errors;const _errs139 = errors;let valid32 = false;const _errs140 = errors;if(typeof data59 === "string"){if(func3(data59) > 80){const err122 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}if(!pattern13.test(data59)){const err123 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}var _valid1 = _errs140 === errors;valid32 = valid32 || _valid1;const _errs141 = errors;if(typeof data59 === "string"){if(!pattern14.test(data59)){const err124 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}var _valid1 = _errs141 === errors;valid32 = valid32 || _valid1;if(!valid32){const err125 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}else {errors = _errs139;if(vErrors !== null){if(_errs139){vErrors.length = _errs139;}else {vErrors = null;}}}if(typeof data59 === "string"){if(func3(data59) > 2048){const err126 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}if(func3(data59) < 1){const err127 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}else {const err128 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}var _valid0 = _errs137 === errors;if(_valid0){valid31 = true;passing0 = 0;}const _errs142 = errors;if(data59 && typeof data59 == "object" && !Array.isArray(data59)){if(data59.url === undefined){const err129 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if(data59.sha256 === undefined){const err130 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}for(const key14 in data59){if(!((key14 === "url") || (key14 === "sha256"))){const err131 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}if(data59.url !== undefined){let data60 = data59.url;if(typeof data60 === "string"){if(func3(data60) > 2048){const err132 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}if(func3(data60) < 8){const err133 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}if(!pattern14.test(data60)){const err134 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}else {const err135 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}if(data59.sha256 !== undefined){let data61 = data59.sha256;if(typeof data61 === "string"){if(!pattern16.test(data61)){const err136 = {instancePath:instancePath+"/components/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}else {const err137 = {instancePath:instancePath+"/components/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}}else {const err138 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}var _valid0 = _errs142 === errors;if(_valid0 && valid31){valid31 = false;passing0 = [passing0, 1];}else {if(_valid0){valid31 = true;passing0 = 1;}}if(!valid31){const err139 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}else {errors = _errs136;if(vErrors !== null){if(_errs136){vErrors.length = _errs136;}else {vErrors = null;}}}}if(data53.sources !== undefined){let data62 = data53.sources;if(Array.isArray(data62)){if(data62.length > 3){const err140 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"#/properties/components/items/properties/sources/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}if(data62.length < 1){const err141 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"#/properties/components/items/properties/sources/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}const len5 = data62.length;for(let i1=0; i1<len5; i1++){let data63 = data62[i1];if(data63 && typeof data63 == "object" && !Array.isArray(data63)){if(data63.path === undefined){const err142 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"#/properties/components/items/properties/sources/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}for(const key15 in data63){if(!((((key15 === "path") || (key15 === "line")) || (key15 === "end_line")) || (key15 === "label"))){const err143 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"#/properties/components/items/properties/sources/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}if(data63.path !== undefined){let data64 = data63.path;if(typeof data64 === "string"){if(func3(data64) > 240){const err144 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"#/properties/components/items/properties/sources/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}if(func3(data64) < 1){const err145 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"#/properties/components/items/properties/sources/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}else {const err146 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"#/properties/components/items/properties/sources/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}if(data63.line !== undefined){let data65 = data63.line;if(!(((typeof data65 == "number") && (!(data65 % 1) && !isNaN(data65))) && (isFinite(data65)))){const err147 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/line",schemaPath:"#/properties/components/items/properties/sources/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}if((typeof data65 == "number") && (isFinite(data65))){if(data65 < 1 || isNaN(data65)){const err148 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/line",schemaPath:"#/properties/components/items/properties/sources/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}}if(data63.end_line !== undefined){let data66 = data63.end_line;if(!(((typeof data66 == "number") && (!(data66 % 1) && !isNaN(data66))) && (isFinite(data66)))){const err149 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/end_line",schemaPath:"#/properties/components/items/properties/sources/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}if((typeof data66 == "number") && (isFinite(data66))){if(data66 < 1 || isNaN(data66)){const err150 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/end_line",schemaPath:"#/properties/components/items/properties/sources/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}}if(data63.label !== undefined){let data67 = data63.label;if(typeof data67 === "string"){if(func3(data67) > 48){const err151 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"#/properties/components/items/properties/sources/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}if(func3(data67) < 1){const err152 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"#/properties/components/items/properties/sources/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}else {const err153 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"#/properties/components/items/properties/sources/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}}else {const err154 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"#/properties/components/items/properties/sources/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}}else {const err155 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"#/properties/components/items/properties/sources/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}if(data53.row !== undefined){let data68 = data53.row;if(!(((typeof data68 == "number") && (!(data68 % 1) && !isNaN(data68))) && (isFinite(data68)))){const err156 = {instancePath:instancePath+"/components/" + i0+"/row",schemaPath:"#/properties/components/items/properties/row/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}if((typeof data68 == "number") && (isFinite(data68))){if(data68 < 0 || isNaN(data68)){const err157 = {instancePath:instancePath+"/components/" + i0+"/row",schemaPath:"#/properties/components/items/properties/row/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}}if(data53.col !== undefined){let data69 = data53.col;if(!(((typeof data69 == "number") && (!(data69 % 1) && !isNaN(data69))) && (isFinite(data69)))){const err158 = {instancePath:instancePath+"/components/" + i0+"/col",schemaPath:"#/properties/components/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}if((typeof data69 == "number") && (isFinite(data69))){if(data69 < 0 || isNaN(data69)){const err159 = {instancePath:instancePath+"/components/" + i0+"/col",schemaPath:"#/properties/components/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}}if(data53.pos !== undefined){let data70 = data53.pos;if(Array.isArray(data70)){if(data70.length > 2){const err160 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}if(data70.length < 2){const err161 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}const len6 = data70.length;if(len6 > 0){let data71 = data70[0];if(!((typeof data71 == "number") && (isFinite(data71)))){const err162 = {instancePath:instancePath+"/components/" + i0+"/pos/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}if(len6 > 1){let data72 = data70[1];if(!((typeof data72 == "number") && (isFinite(data72)))){const err163 = {instancePath:instancePath+"/components/" + i0+"/pos/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}const len7 = data70.length;if(!(len7 <= 2)){const err164 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}else {const err165 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data53.size !== undefined){let data73 = data53.size;if(Array.isArray(data73)){if(data73.length > 2){const err166 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}if(data73.length < 2){const err167 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}const len8 = data73.length;if(len8 > 0){let data74 = data73[0];if((typeof data74 == "number") && (isFinite(data74))){if(data74 <= 0 || isNaN(data74)){const err168 = {instancePath:instancePath+"/components/" + i0+"/size/0",schemaPath:"#/properties/components/items/properties/size/prefixItems/0/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}else {const err169 = {instancePath:instancePath+"/components/" + i0+"/size/0",schemaPath:"#/properties/components/items/properties/size/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}if(len8 > 1){let data75 = data73[1];if((typeof data75 == "number") && (isFinite(data75))){if(data75 <= 0 || isNaN(data75)){const err170 = {instancePath:instancePath+"/components/" + i0+"/size/1",schemaPath:"#/properties/components/items/properties/size/prefixItems/1/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}else {const err171 = {instancePath:instancePath+"/components/" + i0+"/size/1",schemaPath:"#/properties/components/items/properties/size/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}const len9 = data73.length;if(!(len9 <= 2)){const err172 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}else {const err173 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}}else {const err174 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}}else {const err175 = {instancePath:instancePath+"/components",schemaPath:"#/properties/components/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}}if(data.boundaries !== undefined){let data76 = data.boundaries;if(Array.isArray(data76)){const len10 = data76.length;for(let i2=0; i2<len10; i2++){let data77 = data76[i2];if(data77 && typeof data77 == "object" && !Array.isArray(data77)){if(data77.kind === undefined){const err176 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}if(data77.label === undefined){const err177 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}if(data77.wraps === undefined){const err178 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "wraps"},message:"must have required property '"+"wraps"+"'"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}for(const key16 in data77){if(!((((key16 === "kind") || (key16 === "label")) || (key16 === "wraps")) || (key16 === "pad"))){const err179 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(data77.kind !== undefined){let data78 = data77.kind;if(!((data78 === "region") || (data78 === "security-group"))){const err180 = {instancePath:instancePath+"/boundaries/" + i2+"/kind",schemaPath:"#/properties/boundaries/items/properties/kind/enum",keyword:"enum",params:{allowedValues: schema129.properties.boundaries.items.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(data77.label !== undefined){let data79 = data77.label;if(typeof data79 === "string"){if(func3(data79) < 1){const err181 = {instancePath:instancePath+"/boundaries/" + i2+"/label",schemaPath:"#/properties/boundaries/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}else {const err182 = {instancePath:instancePath+"/boundaries/" + i2+"/label",schemaPath:"#/properties/boundaries/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data77.wraps !== undefined){let data80 = data77.wraps;if(Array.isArray(data80)){if(data80.length < 1){const err183 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps",schemaPath:"#/properties/boundaries/items/properties/wraps/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}const len11 = data80.length;for(let i3=0; i3<len11; i3++){let data81 = data80[i3];if(typeof data81 === "string"){if(!pattern4.test(data81)){const err184 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps/" + i3,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}else {const err185 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps/" + i3,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}}else {const err186 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps",schemaPath:"#/properties/boundaries/items/properties/wraps/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}if(data77.pad !== undefined){let data82 = data77.pad;if((typeof data82 == "number") && (isFinite(data82))){if(data82 < 0 || isNaN(data82)){const err187 = {instancePath:instancePath+"/boundaries/" + i2+"/pad",schemaPath:"#/properties/boundaries/items/properties/pad/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}else {const err188 = {instancePath:instancePath+"/boundaries/" + i2+"/pad",schemaPath:"#/properties/boundaries/items/properties/pad/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}}else {const err189 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}}else {const err190 = {instancePath:instancePath+"/boundaries",schemaPath:"#/properties/boundaries/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}if(data.connections !== undefined){let data83 = data.connections;if(Array.isArray(data83)){const len12 = data83.length;for(let i4=0; i4<len12; i4++){let data84 = data83[i4];if(data84 && typeof data84 == "object" && !Array.isArray(data84)){if(data84.from === undefined){const err191 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}if(data84.to === undefined){const err192 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}for(const key17 in data84){if(!(func1.call(schema129.properties.connections.items.properties, key17))){const err193 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key17},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}if(data84.id !== undefined){let data85 = data84.id;if(typeof data85 === "string"){if(!pattern4.test(data85)){const err194 = {instancePath:instancePath+"/connections/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}else {const err195 = {instancePath:instancePath+"/connections/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}if(data84.from !== undefined){let data86 = data84.from;if(typeof data86 === "string"){if(!pattern4.test(data86)){const err196 = {instancePath:instancePath+"/connections/" + i4+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}}else {const err197 = {instancePath:instancePath+"/connections/" + i4+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}}if(data84.to !== undefined){let data87 = data84.to;if(typeof data87 === "string"){if(!pattern4.test(data87)){const err198 = {instancePath:instancePath+"/connections/" + i4+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}}else {const err199 = {instancePath:instancePath+"/connections/" + i4+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}if(data84.label !== undefined){if(typeof data84.label !== "string"){const err200 = {instancePath:instancePath+"/connections/" + i4+"/label",schemaPath:"#/properties/connections/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}if(data84.variant !== undefined){let data89 = data84.variant;if(!((((data89 === "default") || (data89 === "emphasis")) || (data89 === "security")) || (data89 === "dashed"))){const err201 = {instancePath:instancePath+"/connections/" + i4+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema57.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}if(data84.fromSide !== undefined){let data90 = data84.fromSide;if(!((((data90 === "left") || (data90 === "right")) || (data90 === "top")) || (data90 === "bottom"))){const err202 = {instancePath:instancePath+"/connections/" + i4+"/fromSide",schemaPath:"#/properties/connections/items/properties/fromSide/enum",keyword:"enum",params:{allowedValues: schema129.properties.connections.items.properties.fromSide.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}if(data84.toSide !== undefined){let data91 = data84.toSide;if(!((((data91 === "left") || (data91 === "right")) || (data91 === "top")) || (data91 === "bottom"))){const err203 = {instancePath:instancePath+"/connections/" + i4+"/toSide",schemaPath:"#/properties/connections/items/properties/toSide/enum",keyword:"enum",params:{allowedValues: schema129.properties.connections.items.properties.toSide.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}}if(data84.route !== undefined){let data92 = data84.route;if(!((((data92 === "auto") || (data92 === "straight")) || (data92 === "orthogonal-h")) || (data92 === "orthogonal-v"))){const err204 = {instancePath:instancePath+"/connections/" + i4+"/route",schemaPath:"#/properties/connections/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema129.properties.connections.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}}if(data84.via !== undefined){let data93 = data84.via;if(Array.isArray(data93)){const len13 = data93.length;for(let i5=0; i5<len13; i5++){let data94 = data93[i5];if(Array.isArray(data94)){if(data94.length > 2){const err205 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}if(data94.length < 2){const err206 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}const len14 = data94.length;if(len14 > 0){let data95 = data94[0];if(!((typeof data95 == "number") && (isFinite(data95)))){const err207 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}if(len14 > 1){let data96 = data94[1];if(!((typeof data96 == "number") && (isFinite(data96)))){const err208 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}const len15 = data94.length;if(!(len15 <= 2)){const err209 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}}else {const err210 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}}}else {const err211 = {instancePath:instancePath+"/connections/" + i4+"/via",schemaPath:"#/properties/connections/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}}if(data84.labelAt !== undefined){let data97 = data84.labelAt;if(Array.isArray(data97)){if(data97.length > 2){const err212 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}if(data97.length < 2){const err213 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}const len16 = data97.length;if(len16 > 0){let data98 = data97[0];if(!((typeof data98 == "number") && (isFinite(data98)))){const err214 = {instancePath:instancePath+"/connections/" + i4+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}}if(len16 > 1){let data99 = data97[1];if(!((typeof data99 == "number") && (isFinite(data99)))){const err215 = {instancePath:instancePath+"/connections/" + i4+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}}const len17 = data97.length;if(!(len17 <= 2)){const err216 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err216];}else {vErrors.push(err216);}errors++;}}else {const err217 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err217];}else {vErrors.push(err217);}errors++;}}if(data84.labelDx !== undefined){let data100 = data84.labelDx;if(!((typeof data100 == "number") && (isFinite(data100)))){const err218 = {instancePath:instancePath+"/connections/" + i4+"/labelDx",schemaPath:"#/properties/connections/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err218];}else {vErrors.push(err218);}errors++;}}if(data84.labelDy !== undefined){let data101 = data84.labelDy;if(!((typeof data101 == "number") && (isFinite(data101)))){const err219 = {instancePath:instancePath+"/connections/" + i4+"/labelDy",schemaPath:"#/properties/connections/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err219];}else {vErrors.push(err219);}errors++;}}if(data84.labelSegment !== undefined){let data102 = data84.labelSegment;if(!(((typeof data102 == "number") && (!(data102 % 1) && !isNaN(data102))) && (isFinite(data102)))){const err220 = {instancePath:instancePath+"/connections/" + i4+"/labelSegment",schemaPath:"#/properties/connections/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err220];}else {vErrors.push(err220);}errors++;}if((typeof data102 == "number") && (isFinite(data102))){if(data102 < 0 || isNaN(data102)){const err221 = {instancePath:instancePath+"/connections/" + i4+"/labelSegment",schemaPath:"#/properties/connections/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err221];}else {vErrors.push(err221);}errors++;}}}if(data84.width !== undefined){let data103 = data84.width;if((typeof data103 == "number") && (isFinite(data103))){if(data103 < 0.5 || isNaN(data103)){const err222 = {instancePath:instancePath+"/connections/" + i4+"/width",schemaPath:"#/properties/connections/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err222];}else {vErrors.push(err222);}errors++;}}else {const err223 = {instancePath:instancePath+"/connections/" + i4+"/width",schemaPath:"#/properties/connections/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err223];}else {vErrors.push(err223);}errors++;}}}else {const err224 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err224];}else {vErrors.push(err224);}errors++;}}}else {const err225 = {instancePath:instancePath+"/connections",schemaPath:"#/properties/connections/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err225];}else {vErrors.push(err225);}errors++;}}if(data.cards !== undefined){let data104 = data.cards;if(Array.isArray(data104)){const len18 = data104.length;for(let i6=0; i6<len18; i6++){let data105 = data104[i6];if(data105 && typeof data105 == "object" && !Array.isArray(data105)){if(data105.dot === undefined){const err226 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err226];}else {vErrors.push(err226);}errors++;}if(data105.title === undefined){const err227 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err227];}else {vErrors.push(err227);}errors++;}if(data105.items === undefined){const err228 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err228];}else {vErrors.push(err228);}errors++;}for(const key18 in data105){if(!(((key18 === "dot") || (key18 === "title")) || (key18 === "items"))){const err229 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key18},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err229];}else {vErrors.push(err229);}errors++;}}if(data105.dot !== undefined){let data106 = data105.dot;if(!(((((((data106 === "cyan") || (data106 === "emerald")) || (data106 === "violet")) || (data106 === "amber")) || (data106 === "rose")) || (data106 === "orange")) || (data106 === "slate"))){const err230 = {instancePath:instancePath+"/cards/" + i6+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema62.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err230];}else {vErrors.push(err230);}errors++;}}if(data105.title !== undefined){let data107 = data105.title;if(typeof data107 === "string"){if(func3(data107) < 1){const err231 = {instancePath:instancePath+"/cards/" + i6+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err231];}else {vErrors.push(err231);}errors++;}}else {const err232 = {instancePath:instancePath+"/cards/" + i6+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err232];}else {vErrors.push(err232);}errors++;}}if(data105.items !== undefined){let data108 = data105.items;if(Array.isArray(data108)){const len19 = data108.length;for(let i7=0; i7<len19; i7++){if(typeof data108[i7] !== "string"){const err233 = {instancePath:instancePath+"/cards/" + i6+"/items/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err233];}else {vErrors.push(err233);}errors++;}}}else {const err234 = {instancePath:instancePath+"/cards/" + i6+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err234];}else {vErrors.push(err234);}errors++;}}}else {const err235 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err235];}else {vErrors.push(err235);}errors++;}}}else {const err236 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err236];}else {vErrors.push(err236);}errors++;}}}else {const err237 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err237];}else {vErrors.push(err237);}errors++;}validate33.errors = vErrors;return errors === 0;}validate33.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};+};const schema37 = {"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["id","label","focus"],"properties":{"id":{"$ref":"#/$defs/id"},"label":{"type":"string","minLength":1,"maxLength":48},"focus":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/id"}},"note":{"type":"string","maxLength":140}}}};const pattern4 = new RegExp("^[a-zA-Z][a-zA-Z0-9_-]*$", "u");function validate22(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate22.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern4.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};const pattern13 = new RegExp("^[^\\r\\n]+$", "u");const pattern14 = new RegExp("^https?://", "u");const pattern16 = new RegExp("^[a-f0-9]{64}$", "u");function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/workflow.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.lanes === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lanes"},message:"must have required property '"+"lanes"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.nodes === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "nodes"},message:"must have required property '"+"nodes"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.edges === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "edges"},message:"must have required property '"+"edges"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(func1.call(schema31.properties, key0))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("workflow" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "workflow"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key1 in data2){if(!(func1.call(schema31.properties.meta.properties, key1))){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!((data4 === "en") || (data4 === "zh-CN"))){const err13 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err14 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.output !== undefined){if(typeof data2.output !== "string"){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"#/properties/meta/properties/output/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err16 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema34.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err17 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema35.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err18 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema36.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data2.views !== undefined){if(!(validate22(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data11 = data2.legend;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){for(const key2 in data11){if(!((key2 === "mode") || (key2 === "entries"))){const err19 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data11.mode !== undefined){let data12 = data11.mode;if(!(((data12 === "auto") || (data12 === "all")) || (data12 === "hidden"))){const err20 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema40.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data11.entries !== undefined){let data13 = data11.entries;if(data13 && typeof data13 == "object" && !Array.isArray(data13)){for(const key3 in data13){if(!(((((((key3 === "frontend") || (key3 === "backend")) || (key3 === "database")) || (key3 === "cloud")) || (key3 === "security")) || (key3 === "messagebus")) || (key3 === "external"))){const err21 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data13.frontend !== undefined){let data14 = data13.frontend;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){if(Object.keys(data14).length < 1){const err22 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}for(const key4 in data14){if(!((key4 === "label") || (key4 === "visible"))){const err23 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data14.label !== undefined){let data15 = data14.label;if(typeof data15 === "string"){if(func3(data15) > 80){const err24 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(func3(data15) < 1){const err25 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data14.visible !== undefined){if(typeof data14.visible !== "boolean"){const err27 = {instancePath:instancePath+"/meta/legend/entries/frontend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data13.backend !== undefined){let data17 = data13.backend;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){if(Object.keys(data17).length < 1){const err29 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}for(const key5 in data17){if(!((key5 === "label") || (key5 === "visible"))){const err30 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data17.label !== undefined){let data18 = data17.label;if(typeof data18 === "string"){if(func3(data18) > 80){const err31 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func3(data18) < 1){const err32 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data17.visible !== undefined){if(typeof data17.visible !== "boolean"){const err34 = {instancePath:instancePath+"/meta/legend/entries/backend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}}else {const err35 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data13.database !== undefined){let data20 = data13.database;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){if(Object.keys(data20).length < 1){const err36 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key6 in data20){if(!((key6 === "label") || (key6 === "visible"))){const err37 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data20.label !== undefined){let data21 = data20.label;if(typeof data21 === "string"){if(func3(data21) > 80){const err38 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(func3(data21) < 1){const err39 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data20.visible !== undefined){if(typeof data20.visible !== "boolean"){const err41 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data13.cloud !== undefined){let data23 = data13.cloud;if(data23 && typeof data23 == "object" && !Array.isArray(data23)){if(Object.keys(data23).length < 1){const err43 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}for(const key7 in data23){if(!((key7 === "label") || (key7 === "visible"))){const err44 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data23.label !== undefined){let data24 = data23.label;if(typeof data24 === "string"){if(func3(data24) > 80){const err45 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data24) < 1){const err46 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data23.visible !== undefined){if(typeof data23.visible !== "boolean"){const err48 = {instancePath:instancePath+"/meta/legend/entries/cloud/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data13.security !== undefined){let data26 = data13.security;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(Object.keys(data26).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key8 in data26){if(!((key8 === "label") || (key8 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data26.label !== undefined){let data27 = data26.label;if(typeof data27 === "string"){if(func3(data27) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data27) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data26.visible !== undefined){if(typeof data26.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data13.messagebus !== undefined){let data29 = data13.messagebus;if(data29 && typeof data29 == "object" && !Array.isArray(data29)){if(Object.keys(data29).length < 1){const err57 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}for(const key9 in data29){if(!((key9 === "label") || (key9 === "visible"))){const err58 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data29.label !== undefined){let data30 = data29.label;if(typeof data30 === "string"){if(func3(data30) > 80){const err59 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(func3(data30) < 1){const err60 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data29.visible !== undefined){if(typeof data29.visible !== "boolean"){const err62 = {instancePath:instancePath+"/meta/legend/entries/messagebus/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}}else {const err63 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data13.external !== undefined){let data32 = data13.external;if(data32 && typeof data32 == "object" && !Array.isArray(data32)){if(Object.keys(data32).length < 1){const err64 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key10 in data32){if(!((key10 === "label") || (key10 === "visible"))){const err65 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data32.label !== undefined){let data33 = data32.label;if(typeof data33 === "string"){if(func3(data33) > 80){const err66 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if(func3(data33) < 1){const err67 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data32.visible !== undefined){if(typeof data32.visible !== "boolean"){const err69 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}}else {const err70 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}}else {const err71 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}}else {const err72 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data2.viewBox !== undefined){let data35 = data2.viewBox;if(Array.isArray(data35)){if(data35.length > 2){const err73 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(data35.length < 2){const err74 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}const len0 = data35.length;if(len0 > 0){let data36 = data35[0];if((typeof data36 == "number") && (isFinite(data36))){if(data36 < 700 || isNaN(data36)){const err75 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 700},message:"must be >= 700"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}else {const err76 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}if(len0 > 1){let data37 = data35[1];if((typeof data37 == "number") && (isFinite(data37))){if(data37 < 240 || isNaN(data37)){const err77 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 240},message:"must be >= 240"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}else {const err78 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}const len1 = data35.length;if(!(len1 <= 2)){const err79 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}else {const err80 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}}else {const err81 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data.lanes !== undefined){let data38 = data.lanes;if(Array.isArray(data38)){if(data38.length < 1){const err82 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}const len2 = data38.length;for(let i0=0; i0<len2; i0++){let data39 = data38[i0];if(data39 && typeof data39 == "object" && !Array.isArray(data39)){if(data39.id === undefined){const err83 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}if(data39.label === undefined){const err84 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}for(const key11 in data39){if(!(((key11 === "id") || (key11 === "label")) || (key11 === "variant"))){const err85 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}if(data39.id !== undefined){let data40 = data39.id;if(typeof data40 === "string"){if(!pattern4.test(data40)){const err86 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}else {const err87 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}if(data39.label !== undefined){let data41 = data39.label;if(typeof data41 === "string"){if(func3(data41) < 1){const err88 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}else {const err89 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}if(data39.variant !== undefined){let data42 = data39.variant;if(!((data42 === "normal") || (data42 === "exception"))){const err90 = {instancePath:instancePath+"/lanes/" + i0+"/variant",schemaPath:"#/properties/lanes/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema31.properties.lanes.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}}else {const err91 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}}else {const err92 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(data.phases !== undefined){let data43 = data.phases;if(Array.isArray(data43)){const len3 = data43.length;for(let i1=0; i1<len3; i1++){let data44 = data43[i1];if(data44 && typeof data44 == "object" && !Array.isArray(data44)){if(data44.id === undefined){const err93 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}if(data44.label === undefined){const err94 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}if(data44.fromCol === undefined){const err95 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "fromCol"},message:"must have required property '"+"fromCol"+"'"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}if(data44.toCol === undefined){const err96 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "toCol"},message:"must have required property '"+"toCol"+"'"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}for(const key12 in data44){if(!(((((key12 === "id") || (key12 === "label")) || (key12 === "fromCol")) || (key12 === "toCol")) || (key12 === "variant"))){const err97 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}if(data44.id !== undefined){let data45 = data44.id;if(typeof data45 === "string"){if(!pattern4.test(data45)){const err98 = {instancePath:instancePath+"/phases/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}else {const err99 = {instancePath:instancePath+"/phases/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data44.label !== undefined){let data46 = data44.label;if(typeof data46 === "string"){if(func3(data46) < 1){const err100 = {instancePath:instancePath+"/phases/" + i1+"/label",schemaPath:"#/properties/phases/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}else {const err101 = {instancePath:instancePath+"/phases/" + i1+"/label",schemaPath:"#/properties/phases/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}if(data44.fromCol !== undefined){let data47 = data44.fromCol;if(!(((typeof data47 == "number") && (!(data47 % 1) && !isNaN(data47))) && (isFinite(data47)))){const err102 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}if((typeof data47 == "number") && (isFinite(data47))){if(data47 > 5 || isNaN(data47)){const err103 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}if(data47 < 0 || isNaN(data47)){const err104 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}}if(data44.toCol !== undefined){let data48 = data44.toCol;if(!(((typeof data48 == "number") && (!(data48 % 1) && !isNaN(data48))) && (isFinite(data48)))){const err105 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}if((typeof data48 == "number") && (isFinite(data48))){if(data48 > 5 || isNaN(data48)){const err106 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}if(data48 < 0 || isNaN(data48)){const err107 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}}if(data44.variant !== undefined){let data49 = data44.variant;if(!((((data49 === "default") || (data49 === "emphasis")) || (data49 === "security")) || (data49 === "dashed"))){const err108 = {instancePath:instancePath+"/phases/" + i1+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema50.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}}else {const err109 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}}else {const err110 = {instancePath:instancePath+"/phases",schemaPath:"#/properties/phases/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data.groups !== undefined){let data50 = data.groups;if(Array.isArray(data50)){const len4 = data50.length;for(let i2=0; i2<len4; i2++){let data51 = data50[i2];if(data51 && typeof data51 == "object" && !Array.isArray(data51)){if(data51.id === undefined){const err111 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(data51.label === undefined){const err112 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}if(data51.lane === undefined){const err113 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}if(data51.fromCol === undefined){const err114 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "fromCol"},message:"must have required property '"+"fromCol"+"'"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(data51.toCol === undefined){const err115 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "toCol"},message:"must have required property '"+"toCol"+"'"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}for(const key13 in data51){if(!((((((key13 === "id") || (key13 === "label")) || (key13 === "lane")) || (key13 === "fromCol")) || (key13 === "toCol")) || (key13 === "variant"))){const err116 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data51.id !== undefined){let data52 = data51.id;if(typeof data52 === "string"){if(!pattern4.test(data52)){const err117 = {instancePath:instancePath+"/groups/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}else {const err118 = {instancePath:instancePath+"/groups/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data51.label !== undefined){let data53 = data51.label;if(typeof data53 === "string"){if(func3(data53) < 1){const err119 = {instancePath:instancePath+"/groups/" + i2+"/label",schemaPath:"#/properties/groups/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+"/groups/" + i2+"/label",schemaPath:"#/properties/groups/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data51.lane !== undefined){let data54 = data51.lane;if(typeof data54 === "string"){if(!pattern4.test(data54)){const err121 = {instancePath:instancePath+"/groups/" + i2+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}else {const err122 = {instancePath:instancePath+"/groups/" + i2+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}if(data51.fromCol !== undefined){let data55 = data51.fromCol;if(!(((typeof data55 == "number") && (!(data55 % 1) && !isNaN(data55))) && (isFinite(data55)))){const err123 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}if((typeof data55 == "number") && (isFinite(data55))){if(data55 > 5 || isNaN(data55)){const err124 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}if(data55 < 0 || isNaN(data55)){const err125 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}}if(data51.toCol !== undefined){let data56 = data51.toCol;if(!(((typeof data56 == "number") && (!(data56 % 1) && !isNaN(data56))) && (isFinite(data56)))){const err126 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}if((typeof data56 == "number") && (isFinite(data56))){if(data56 > 5 || isNaN(data56)){const err127 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}if(data56 < 0 || isNaN(data56)){const err128 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}}if(data51.variant !== undefined){let data57 = data51.variant;if(!((((data57 === "default") || (data57 === "emphasis")) || (data57 === "security")) || (data57 === "dashed"))){const err129 = {instancePath:instancePath+"/groups/" + i2+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema50.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}}else {const err130 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}}}else {const err131 = {instancePath:instancePath+"/groups",schemaPath:"#/properties/groups/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}if(data.mainPath !== undefined){let data58 = data.mainPath;if(Array.isArray(data58)){if(data58.length < 2){const err132 = {instancePath:instancePath+"/mainPath",schemaPath:"#/properties/mainPath/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}const len5 = data58.length;for(let i3=0; i3<len5; i3++){let data59 = data58[i3];if(typeof data59 === "string"){if(!pattern4.test(data59)){const err133 = {instancePath:instancePath+"/mainPath/" + i3,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}else {const err134 = {instancePath:instancePath+"/mainPath/" + i3,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}}else {const err135 = {instancePath:instancePath+"/mainPath",schemaPath:"#/properties/mainPath/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}if(data.nodes !== undefined){let data60 = data.nodes;if(Array.isArray(data60)){if(data60.length < 1){const err136 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}const len6 = data60.length;for(let i4=0; i4<len6; i4++){let data61 = data60[i4];if(data61 && typeof data61 == "object" && !Array.isArray(data61)){if(data61.id === undefined){const err137 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}if(data61.lane === undefined){const err138 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}if(data61.col === undefined){const err139 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "col"},message:"must have required property '"+"col"+"'"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}if(data61.type === undefined){const err140 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}if(data61.label === undefined){const err141 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}for(const key14 in data61){if(!(func1.call(schema31.properties.nodes.items.properties, key14))){const err142 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}}if(data61.id !== undefined){let data62 = data61.id;if(typeof data62 === "string"){if(!pattern4.test(data62)){const err143 = {instancePath:instancePath+"/nodes/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}else {const err144 = {instancePath:instancePath+"/nodes/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data61.lane !== undefined){let data63 = data61.lane;if(typeof data63 === "string"){if(!pattern4.test(data63)){const err145 = {instancePath:instancePath+"/nodes/" + i4+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}else {const err146 = {instancePath:instancePath+"/nodes/" + i4+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}if(data61.col !== undefined){let data64 = data61.col;if(!(((typeof data64 == "number") && (!(data64 % 1) && !isNaN(data64))) && (isFinite(data64)))){const err147 = {instancePath:instancePath+"/nodes/" + i4+"/col",schemaPath:"#/properties/nodes/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}if((typeof data64 == "number") && (isFinite(data64))){if(data64 > 5 || isNaN(data64)){const err148 = {instancePath:instancePath+"/nodes/" + i4+"/col",schemaPath:"#/properties/nodes/items/properties/col/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}if(data64 < 0 || isNaN(data64)){const err149 = {instancePath:instancePath+"/nodes/" + i4+"/col",schemaPath:"#/properties/nodes/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}}if(data61.type !== undefined){let data65 = data61.type;if(!(((((((data65 === "frontend") || (data65 === "backend")) || (data65 === "database")) || (data65 === "cloud")) || (data65 === "security")) || (data65 === "messagebus")) || (data65 === "external"))){const err150 = {instancePath:instancePath+"/nodes/" + i4+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema57.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}if(data61.label !== undefined){let data66 = data61.label;if(typeof data66 === "string"){if(func3(data66) < 1){const err151 = {instancePath:instancePath+"/nodes/" + i4+"/label",schemaPath:"#/properties/nodes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}else {const err152 = {instancePath:instancePath+"/nodes/" + i4+"/label",schemaPath:"#/properties/nodes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}if(data61.sublabel !== undefined){if(typeof data61.sublabel !== "string"){const err153 = {instancePath:instancePath+"/nodes/" + i4+"/sublabel",schemaPath:"#/properties/nodes/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}if(data61.tag !== undefined){if(typeof data61.tag !== "string"){const err154 = {instancePath:instancePath+"/nodes/" + i4+"/tag",schemaPath:"#/properties/nodes/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}if(data61.brand !== undefined){let data69 = data61.brand;const _errs166 = errors;let valid49 = false;let passing0 = null;const _errs167 = errors;const _errs169 = errors;let valid50 = false;const _errs170 = errors;if(typeof data69 === "string"){if(func3(data69) > 80){const err155 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}if(!pattern13.test(data69)){const err156 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}var _valid1 = _errs170 === errors;valid50 = valid50 || _valid1;const _errs171 = errors;if(typeof data69 === "string"){if(!pattern14.test(data69)){const err157 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}var _valid1 = _errs171 === errors;valid50 = valid50 || _valid1;if(!valid50){const err158 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}else {errors = _errs169;if(vErrors !== null){if(_errs169){vErrors.length = _errs169;}else {vErrors = null;}}}if(typeof data69 === "string"){if(func3(data69) > 2048){const err159 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}if(func3(data69) < 1){const err160 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}else {const err161 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}var _valid0 = _errs167 === errors;if(_valid0){valid49 = true;passing0 = 0;}const _errs172 = errors;if(data69 && typeof data69 == "object" && !Array.isArray(data69)){if(data69.url === undefined){const err162 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}if(data69.sha256 === undefined){const err163 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}for(const key15 in data69){if(!((key15 === "url") || (key15 === "sha256"))){const err164 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}if(data69.url !== undefined){let data70 = data69.url;if(typeof data70 === "string"){if(func3(data70) > 2048){const err165 = {instancePath:instancePath+"/nodes/" + i4+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}if(func3(data70) < 8){const err166 = {instancePath:instancePath+"/nodes/" + i4+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}if(!pattern14.test(data70)){const err167 = {instancePath:instancePath+"/nodes/" + i4+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}else {const err168 = {instancePath:instancePath+"/nodes/" + i4+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}if(data69.sha256 !== undefined){let data71 = data69.sha256;if(typeof data71 === "string"){if(!pattern16.test(data71)){const err169 = {instancePath:instancePath+"/nodes/" + i4+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}else {const err170 = {instancePath:instancePath+"/nodes/" + i4+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}}else {const err171 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}var _valid0 = _errs172 === errors;if(_valid0 && valid49){valid49 = false;passing0 = [passing0, 1];}else {if(_valid0){valid49 = true;passing0 = 1;}}if(!valid49){const err172 = {instancePath:instancePath+"/nodes/" + i4+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}else {errors = _errs166;if(vErrors !== null){if(_errs166){vErrors.length = _errs166;}else {vErrors = null;}}}}if(data61.width !== undefined){let data72 = data61.width;if((typeof data72 == "number") && (isFinite(data72))){if(data72 < 32 || isNaN(data72)){const err173 = {instancePath:instancePath+"/nodes/" + i4+"/width",schemaPath:"#/properties/nodes/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 32},message:"must be >= 32"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}else {const err174 = {instancePath:instancePath+"/nodes/" + i4+"/width",schemaPath:"#/properties/nodes/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}if(data61.height !== undefined){let data73 = data61.height;if((typeof data73 == "number") && (isFinite(data73))){if(data73 < 32 || isNaN(data73)){const err175 = {instancePath:instancePath+"/nodes/" + i4+"/height",schemaPath:"#/properties/nodes/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 32},message:"must be >= 32"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}}else {const err176 = {instancePath:instancePath+"/nodes/" + i4+"/height",schemaPath:"#/properties/nodes/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}if(data61.yOffset !== undefined){let data74 = data61.yOffset;if(!((typeof data74 == "number") && (isFinite(data74)))){const err177 = {instancePath:instancePath+"/nodes/" + i4+"/yOffset",schemaPath:"#/properties/nodes/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}}else {const err178 = {instancePath:instancePath+"/nodes/" + i4,schemaPath:"#/properties/nodes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}}else {const err179 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(data.edges !== undefined){let data75 = data.edges;if(Array.isArray(data75)){const len7 = data75.length;for(let i5=0; i5<len7; i5++){let data76 = data75[i5];if(data76 && typeof data76 == "object" && !Array.isArray(data76)){if(data76.from === undefined){const err180 = {instancePath:instancePath+"/edges/" + i5,schemaPath:"#/properties/edges/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}if(data76.to === undefined){const err181 = {instancePath:instancePath+"/edges/" + i5,schemaPath:"#/properties/edges/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}for(const key16 in data76){if(!(func1.call(schema31.properties.edges.items.properties, key16))){const err182 = {instancePath:instancePath+"/edges/" + i5,schemaPath:"#/properties/edges/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data76.id !== undefined){let data77 = data76.id;if(typeof data77 === "string"){if(!pattern4.test(data77)){const err183 = {instancePath:instancePath+"/edges/" + i5+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}else {const err184 = {instancePath:instancePath+"/edges/" + i5+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}if(data76.from !== undefined){let data78 = data76.from;if(typeof data78 === "string"){if(!pattern4.test(data78)){const err185 = {instancePath:instancePath+"/edges/" + i5+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}else {const err186 = {instancePath:instancePath+"/edges/" + i5+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}if(data76.to !== undefined){let data79 = data76.to;if(typeof data79 === "string"){if(!pattern4.test(data79)){const err187 = {instancePath:instancePath+"/edges/" + i5+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}else {const err188 = {instancePath:instancePath+"/edges/" + i5+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}if(data76.label !== undefined){if(typeof data76.label !== "string"){const err189 = {instancePath:instancePath+"/edges/" + i5+"/label",schemaPath:"#/properties/edges/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}if(data76.variant !== undefined){let data81 = data76.variant;if(!((((data81 === "default") || (data81 === "emphasis")) || (data81 === "security")) || (data81 === "dashed"))){const err190 = {instancePath:instancePath+"/edges/" + i5+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema50.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}if(data76.role !== undefined){let data82 = data76.role;if(!(((((data82 === "main") || (data82 === "branch")) || (data82 === "async")) || (data82 === "return")) || (data82 === "error"))){const err191 = {instancePath:instancePath+"/edges/" + i5+"/role",schemaPath:"#/properties/edges/items/properties/role/enum",keyword:"enum",params:{allowedValues: schema31.properties.edges.items.properties.role.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}if(data76.fromSide !== undefined){let data83 = data76.fromSide;if(!((((data83 === "left") || (data83 === "right")) || (data83 === "top")) || (data83 === "bottom"))){const err192 = {instancePath:instancePath+"/edges/" + i5+"/fromSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema63.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}if(data76.toSide !== undefined){let data84 = data76.toSide;if(!((((data84 === "left") || (data84 === "right")) || (data84 === "top")) || (data84 === "bottom"))){const err193 = {instancePath:instancePath+"/edges/" + i5+"/toSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema63.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}if(data76.route !== undefined){let data85 = data76.route;if(!(((((((data85 === "auto") || (data85 === "straight")) || (data85 === "drop")) || (data85 === "outside-right")) || (data85 === "return-left")) || (data85 === "bottom-channel")) || (data85 === "up-channel"))){const err194 = {instancePath:instancePath+"/edges/" + i5+"/route",schemaPath:"#/properties/edges/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema31.properties.edges.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}if(data76.via !== undefined){let data86 = data76.via;if(Array.isArray(data86)){const len8 = data86.length;for(let i6=0; i6<len8; i6++){let data87 = data86[i6];if(Array.isArray(data87)){if(data87.length > 2){const err195 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}if(data87.length < 2){const err196 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}const len9 = data87.length;if(len9 > 0){let data88 = data87[0];if(!((typeof data88 == "number") && (isFinite(data88)))){const err197 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}}if(len9 > 1){let data89 = data87[1];if(!((typeof data89 == "number") && (isFinite(data89)))){const err198 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}}const len10 = data87.length;if(!(len10 <= 2)){const err199 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}else {const err200 = {instancePath:instancePath+"/edges/" + i5+"/via/" + i6,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}}else {const err201 = {instancePath:instancePath+"/edges/" + i5+"/via",schemaPath:"#/properties/edges/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}if(data76.labelAt !== undefined){let data90 = data76.labelAt;if(Array.isArray(data90)){if(data90.length > 2){const err202 = {instancePath:instancePath+"/edges/" + i5+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}if(data90.length < 2){const err203 = {instancePath:instancePath+"/edges/" + i5+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}const len11 = data90.length;if(len11 > 0){let data91 = data90[0];if(!((typeof data91 == "number") && (isFinite(data91)))){const err204 = {instancePath:instancePath+"/edges/" + i5+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}}if(len11 > 1){let data92 = data90[1];if(!((typeof data92 == "number") && (isFinite(data92)))){const err205 = {instancePath:instancePath+"/edges/" + i5+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}}const len12 = data90.length;if(!(len12 <= 2)){const err206 = {instancePath:instancePath+"/edges/" + i5+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}}else {const err207 = {instancePath:instancePath+"/edges/" + i5+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}if(data76.labelDx !== undefined){let data93 = data76.labelDx;if(!((typeof data93 == "number") && (isFinite(data93)))){const err208 = {instancePath:instancePath+"/edges/" + i5+"/labelDx",schemaPath:"#/properties/edges/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}if(data76.labelDy !== undefined){let data94 = data76.labelDy;if(!((typeof data94 == "number") && (isFinite(data94)))){const err209 = {instancePath:instancePath+"/edges/" + i5+"/labelDy",schemaPath:"#/properties/edges/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}}if(data76.labelSegment !== undefined){let data95 = data76.labelSegment;if(!(((typeof data95 == "number") && (!(data95 % 1) && !isNaN(data95))) && (isFinite(data95)))){const err210 = {instancePath:instancePath+"/edges/" + i5+"/labelSegment",schemaPath:"#/properties/edges/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}if((typeof data95 == "number") && (isFinite(data95))){if(data95 < 0 || isNaN(data95)){const err211 = {instancePath:instancePath+"/edges/" + i5+"/labelSegment",schemaPath:"#/properties/edges/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}}}if(data76.channelX !== undefined){let data96 = data76.channelX;if(!((typeof data96 == "number") && (isFinite(data96)))){const err212 = {instancePath:instancePath+"/edges/" + i5+"/channelX",schemaPath:"#/properties/edges/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}}if(data76.channelY !== undefined){let data97 = data76.channelY;if(!((typeof data97 == "number") && (isFinite(data97)))){const err213 = {instancePath:instancePath+"/edges/" + i5+"/channelY",schemaPath:"#/properties/edges/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}}if(data76.bias !== undefined){let data98 = data76.bias;if((typeof data98 == "number") && (isFinite(data98))){if(data98 > 1 || isNaN(data98)){const err214 = {instancePath:instancePath+"/edges/" + i5+"/bias",schemaPath:"#/properties/edges/items/properties/bias/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1},message:"must be <= 1"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}if(data98 < 0 || isNaN(data98)){const err215 = {instancePath:instancePath+"/edges/" + i5+"/bias",schemaPath:"#/properties/edges/items/properties/bias/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}}else {const err216 = {instancePath:instancePath+"/edges/" + i5+"/bias",schemaPath:"#/properties/edges/items/properties/bias/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err216];}else {vErrors.push(err216);}errors++;}}if(data76.width !== undefined){let data99 = data76.width;if((typeof data99 == "number") && (isFinite(data99))){if(data99 < 0.5 || isNaN(data99)){const err217 = {instancePath:instancePath+"/edges/" + i5+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err217];}else {vErrors.push(err217);}errors++;}}else {const err218 = {instancePath:instancePath+"/edges/" + i5+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err218];}else {vErrors.push(err218);}errors++;}}}else {const err219 = {instancePath:instancePath+"/edges/" + i5,schemaPath:"#/properties/edges/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err219];}else {vErrors.push(err219);}errors++;}}}else {const err220 = {instancePath:instancePath+"/edges",schemaPath:"#/properties/edges/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err220];}else {vErrors.push(err220);}errors++;}}if(data.cards !== undefined){let data100 = data.cards;if(Array.isArray(data100)){const len13 = data100.length;for(let i7=0; i7<len13; i7++){let data101 = data100[i7];if(data101 && typeof data101 == "object" && !Array.isArray(data101)){if(data101.dot === undefined){const err221 = {instancePath:instancePath+"/cards/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err221];}else {vErrors.push(err221);}errors++;}if(data101.title === undefined){const err222 = {instancePath:instancePath+"/cards/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err222];}else {vErrors.push(err222);}errors++;}if(data101.items === undefined){const err223 = {instancePath:instancePath+"/cards/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err223];}else {vErrors.push(err223);}errors++;}for(const key17 in data101){if(!(((key17 === "dot") || (key17 === "title")) || (key17 === "items"))){const err224 = {instancePath:instancePath+"/cards/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key17},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err224];}else {vErrors.push(err224);}errors++;}}if(data101.dot !== undefined){let data102 = data101.dot;if(!(((((((data102 === "cyan") || (data102 === "emerald")) || (data102 === "violet")) || (data102 === "amber")) || (data102 === "rose")) || (data102 === "orange")) || (data102 === "slate"))){const err225 = {instancePath:instancePath+"/cards/" + i7+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema68.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err225];}else {vErrors.push(err225);}errors++;}}if(data101.title !== undefined){let data103 = data101.title;if(typeof data103 === "string"){if(func3(data103) < 1){const err226 = {instancePath:instancePath+"/cards/" + i7+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err226];}else {vErrors.push(err226);}errors++;}}else {const err227 = {instancePath:instancePath+"/cards/" + i7+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err227];}else {vErrors.push(err227);}errors++;}}if(data101.items !== undefined){let data104 = data101.items;if(Array.isArray(data104)){const len14 = data104.length;for(let i8=0; i8<len14; i8++){if(typeof data104[i8] !== "string"){const err228 = {instancePath:instancePath+"/cards/" + i7+"/items/" + i8,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err228];}else {vErrors.push(err228);}errors++;}}}else {const err229 = {instancePath:instancePath+"/cards/" + i7+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err229];}else {vErrors.push(err229);}errors++;}}}else {const err230 = {instancePath:instancePath+"/cards/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err230];}else {vErrors.push(err230);}errors++;}}}else {const err231 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err231];}else {vErrors.push(err231);}errors++;}}}else {const err232 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err232];}else {vErrors.push(err232);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};export const sequence = validate24;const schema69 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/sequence.schema.json","title":"Archify Sequence Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","participants","messages"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"sequence"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"type":"string"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"column_fit":{"description":"Horizontal participant layout. Omit this field or use fixed for the stable 86px boxes and 108px gap. Use spread when a wide viewBox would leave unused horizontal space or meaningful participant labels do not fit the fixed boxes; spread derives wider boxes and gaps from the viewBox without changing participant order or message semantics.","enum":["fixed","spread"]},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"default":{"$ref":"common.schema.json#/$defs/legendEntry"},"emphasis":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"dashed":{"$ref":"common.schema.json#/$defs/legendEntry"},"return":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":480},{"type":"number","minimum":480}],"items":false,"minItems":2,"maxItems":2}}},"participants":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"}}}},"segments":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to","label"],"properties":{"from":{"type":"number"},"to":{"type":"number"},"label":{"type":"string","minLength":1}}}},"messages":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["from","to","y","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"y":{"type":"number","minimum":160},"label":{"type":"string","minLength":1},"variant":{"enum":["default","emphasis","security","dashed","return"]},"note":{"type":"string"}}}},"activations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["participant","from","to"],"properties":{"participant":{"$ref":"common.schema.json#/$defs/id"},"from":{"type":"number"},"to":{"type":"number"},"type":{"$ref":"common.schema.json#/$defs/componentType"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};function validate25(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate25.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern4.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate25.errors = vErrors;return errors === 0;}validate25.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate24(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/sequence.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate24.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.participants === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "participants"},message:"must have required property '"+"participants"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.messages === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "messages"},message:"must have required property '"+"messages"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!((((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "participants")) || (key0 === "segments")) || (key0 === "messages")) || (key0 === "activations")) || (key0 === "cards"))){const err5 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err6 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.diagram_type !== undefined){if("sequence" !== data.diagram_type){const err7 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "sequence"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err8 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}for(const key1 in data2){if(!(func1.call(schema69.properties.meta.properties, key1))){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err10 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!((data4 === "en") || (data4 === "zh-CN"))){const err12 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err13 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.output !== undefined){if(typeof data2.output !== "string"){const err14 = {instancePath:instancePath+"/meta/output",schemaPath:"#/properties/meta/properties/output/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err15 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema34.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err16 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema35.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err17 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema36.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data2.column_fit !== undefined){let data10 = data2.column_fit;if(!((data10 === "fixed") || (data10 === "spread"))){const err18 = {instancePath:instancePath+"/meta/column_fit",schemaPath:"#/properties/meta/properties/column_fit/enum",keyword:"enum",params:{allowedValues: schema69.properties.meta.properties.column_fit.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data2.views !== undefined){if(!(validate25(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate25.errors : vErrors.concat(validate25.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data12 = data2.legend;if(data12 && typeof data12 == "object" && !Array.isArray(data12)){for(const key2 in data12){if(!((key2 === "mode") || (key2 === "entries"))){const err19 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data12.mode !== undefined){let data13 = data12.mode;if(!(((data13 === "auto") || (data13 === "all")) || (data13 === "hidden"))){const err20 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema40.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data12.entries !== undefined){let data14 = data12.entries;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){for(const key3 in data14){if(!(((((key3 === "default") || (key3 === "emphasis")) || (key3 === "security")) || (key3 === "dashed")) || (key3 === "return"))){const err21 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data14.default !== undefined){let data15 = data14.default;if(data15 && typeof data15 == "object" && !Array.isArray(data15)){if(Object.keys(data15).length < 1){const err22 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}for(const key4 in data15){if(!((key4 === "label") || (key4 === "visible"))){const err23 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data15.label !== undefined){let data16 = data15.label;if(typeof data16 === "string"){if(func3(data16) > 80){const err24 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(func3(data16) < 1){const err25 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data15.visible !== undefined){if(typeof data15.visible !== "boolean"){const err27 = {instancePath:instancePath+"/meta/legend/entries/default/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data14.emphasis !== undefined){let data18 = data14.emphasis;if(data18 && typeof data18 == "object" && !Array.isArray(data18)){if(Object.keys(data18).length < 1){const err29 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}for(const key5 in data18){if(!((key5 === "label") || (key5 === "visible"))){const err30 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data18.label !== undefined){let data19 = data18.label;if(typeof data19 === "string"){if(func3(data19) > 80){const err31 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func3(data19) < 1){const err32 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data18.visible !== undefined){if(typeof data18.visible !== "boolean"){const err34 = {instancePath:instancePath+"/meta/legend/entries/emphasis/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}}else {const err35 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data14.security !== undefined){let data21 = data14.security;if(data21 && typeof data21 == "object" && !Array.isArray(data21)){if(Object.keys(data21).length < 1){const err36 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key6 in data21){if(!((key6 === "label") || (key6 === "visible"))){const err37 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data21.label !== undefined){let data22 = data21.label;if(typeof data22 === "string"){if(func3(data22) > 80){const err38 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(func3(data22) < 1){const err39 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data21.visible !== undefined){if(typeof data21.visible !== "boolean"){const err41 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data14.dashed !== undefined){let data24 = data14.dashed;if(data24 && typeof data24 == "object" && !Array.isArray(data24)){if(Object.keys(data24).length < 1){const err43 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}for(const key7 in data24){if(!((key7 === "label") || (key7 === "visible"))){const err44 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data24.label !== undefined){let data25 = data24.label;if(typeof data25 === "string"){if(func3(data25) > 80){const err45 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data25) < 1){const err46 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data24.visible !== undefined){if(typeof data24.visible !== "boolean"){const err48 = {instancePath:instancePath+"/meta/legend/entries/dashed/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data14.return !== undefined){let data27 = data14.return;if(data27 && typeof data27 == "object" && !Array.isArray(data27)){if(Object.keys(data27).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key8 in data27){if(!((key8 === "label") || (key8 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data27.label !== undefined){let data28 = data27.label;if(typeof data28 === "string"){if(func3(data28) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data28) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data27.visible !== undefined){if(typeof data27.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/return/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}}else {const err57 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}}else {const err58 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data2.viewBox !== undefined){let data30 = data2.viewBox;if(Array.isArray(data30)){if(data30.length > 2){const err59 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(data30.length < 2){const err60 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}const len0 = data30.length;if(len0 > 0){let data31 = data30[0];if((typeof data31 == "number") && (isFinite(data31))){if(data31 < 480 || isNaN(data31)){const err61 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 480},message:"must be >= 480"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}else {const err62 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(len0 > 1){let data32 = data30[1];if((typeof data32 == "number") && (isFinite(data32))){if(data32 < 480 || isNaN(data32)){const err63 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 480},message:"must be >= 480"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}else {const err64 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}const len1 = data30.length;if(!(len1 <= 2)){const err65 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}else {const err66 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}}else {const err67 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}if(data.participants !== undefined){let data33 = data.participants;if(Array.isArray(data33)){if(data33.length < 2){const err68 = {instancePath:instancePath+"/participants",schemaPath:"#/properties/participants/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}const len2 = data33.length;for(let i0=0; i0<len2; i0++){let data34 = data33[i0];if(data34 && typeof data34 == "object" && !Array.isArray(data34)){if(data34.id === undefined){const err69 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}if(data34.type === undefined){const err70 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}if(data34.label === undefined){const err71 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}for(const key9 in data34){if(!(((((key9 === "id") || (key9 === "type")) || (key9 === "label")) || (key9 === "sublabel")) || (key9 === "brand"))){const err72 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data34.id !== undefined){let data35 = data34.id;if(typeof data35 === "string"){if(!pattern4.test(data35)){const err73 = {instancePath:instancePath+"/participants/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}else {const err74 = {instancePath:instancePath+"/participants/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}if(data34.type !== undefined){let data36 = data34.type;if(!(((((((data36 === "frontend") || (data36 === "backend")) || (data36 === "database")) || (data36 === "cloud")) || (data36 === "security")) || (data36 === "messagebus")) || (data36 === "external"))){const err75 = {instancePath:instancePath+"/participants/" + i0+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema57.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data34.label !== undefined){let data37 = data34.label;if(typeof data37 === "string"){if(func3(data37) < 1){const err76 = {instancePath:instancePath+"/participants/" + i0+"/label",schemaPath:"#/properties/participants/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}else {const err77 = {instancePath:instancePath+"/participants/" + i0+"/label",schemaPath:"#/properties/participants/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}if(data34.sublabel !== undefined){if(typeof data34.sublabel !== "string"){const err78 = {instancePath:instancePath+"/participants/" + i0+"/sublabel",schemaPath:"#/properties/participants/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}if(data34.brand !== undefined){let data39 = data34.brand;const _errs93 = errors;let valid26 = false;let passing0 = null;const _errs94 = errors;const _errs96 = errors;let valid27 = false;const _errs97 = errors;if(typeof data39 === "string"){if(func3(data39) > 80){const err79 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}if(!pattern13.test(data39)){const err80 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}var _valid1 = _errs97 === errors;valid27 = valid27 || _valid1;const _errs98 = errors;if(typeof data39 === "string"){if(!pattern14.test(data39)){const err81 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}var _valid1 = _errs98 === errors;valid27 = valid27 || _valid1;if(!valid27){const err82 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}else {errors = _errs96;if(vErrors !== null){if(_errs96){vErrors.length = _errs96;}else {vErrors = null;}}}if(typeof data39 === "string"){if(func3(data39) > 2048){const err83 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}if(func3(data39) < 1){const err84 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}else {const err85 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}var _valid0 = _errs94 === errors;if(_valid0){valid26 = true;passing0 = 0;}const _errs99 = errors;if(data39 && typeof data39 == "object" && !Array.isArray(data39)){if(data39.url === undefined){const err86 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}if(data39.sha256 === undefined){const err87 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}for(const key10 in data39){if(!((key10 === "url") || (key10 === "sha256"))){const err88 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data39.url !== undefined){let data40 = data39.url;if(typeof data40 === "string"){if(func3(data40) > 2048){const err89 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}if(func3(data40) < 8){const err90 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}if(!pattern14.test(data40)){const err91 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}else {const err92 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(data39.sha256 !== undefined){let data41 = data39.sha256;if(typeof data41 === "string"){if(!pattern16.test(data41)){const err93 = {instancePath:instancePath+"/participants/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}else {const err94 = {instancePath:instancePath+"/participants/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}}else {const err95 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}var _valid0 = _errs99 === errors;if(_valid0 && valid26){valid26 = false;passing0 = [passing0, 1];}else {if(_valid0){valid26 = true;passing0 = 1;}}if(!valid26){const err96 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}else {errors = _errs93;if(vErrors !== null){if(_errs93){vErrors.length = _errs93;}else {vErrors = null;}}}}}else {const err97 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/participants",schemaPath:"#/properties/participants/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}if(data.segments !== undefined){let data42 = data.segments;if(Array.isArray(data42)){const len3 = data42.length;for(let i1=0; i1<len3; i1++){let data43 = data42[i1];if(data43 && typeof data43 == "object" && !Array.isArray(data43)){if(data43.from === undefined){const err99 = {instancePath:instancePath+"/segments/" + i1,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}if(data43.to === undefined){const err100 = {instancePath:instancePath+"/segments/" + i1,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}if(data43.label === undefined){const err101 = {instancePath:instancePath+"/segments/" + i1,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}for(const key11 in data43){if(!(((key11 === "from") || (key11 === "to")) || (key11 === "label"))){const err102 = {instancePath:instancePath+"/segments/" + i1,schemaPath:"#/properties/segments/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(data43.from !== undefined){let data44 = data43.from;if(!((typeof data44 == "number") && (isFinite(data44)))){const err103 = {instancePath:instancePath+"/segments/" + i1+"/from",schemaPath:"#/properties/segments/items/properties/from/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}if(data43.to !== undefined){let data45 = data43.to;if(!((typeof data45 == "number") && (isFinite(data45)))){const err104 = {instancePath:instancePath+"/segments/" + i1+"/to",schemaPath:"#/properties/segments/items/properties/to/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}if(data43.label !== undefined){let data46 = data43.label;if(typeof data46 === "string"){if(func3(data46) < 1){const err105 = {instancePath:instancePath+"/segments/" + i1+"/label",schemaPath:"#/properties/segments/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}else {const err106 = {instancePath:instancePath+"/segments/" + i1+"/label",schemaPath:"#/properties/segments/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}}else {const err107 = {instancePath:instancePath+"/segments/" + i1,schemaPath:"#/properties/segments/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}}else {const err108 = {instancePath:instancePath+"/segments",schemaPath:"#/properties/segments/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}if(data.messages !== undefined){let data47 = data.messages;if(Array.isArray(data47)){if(data47.length < 1){const err109 = {instancePath:instancePath+"/messages",schemaPath:"#/properties/messages/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}const len4 = data47.length;for(let i2=0; i2<len4; i2++){let data48 = data47[i2];if(data48 && typeof data48 == "object" && !Array.isArray(data48)){if(data48.from === undefined){const err110 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}if(data48.to === undefined){const err111 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(data48.y === undefined){const err112 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "y"},message:"must have required property '"+"y"+"'"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}if(data48.label === undefined){const err113 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}for(const key12 in data48){if(!(((((((key12 === "id") || (key12 === "from")) || (key12 === "to")) || (key12 === "y")) || (key12 === "label")) || (key12 === "variant")) || (key12 === "note"))){const err114 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}if(data48.id !== undefined){let data49 = data48.id;if(typeof data49 === "string"){if(!pattern4.test(data49)){const err115 = {instancePath:instancePath+"/messages/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}else {const err116 = {instancePath:instancePath+"/messages/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data48.from !== undefined){let data50 = data48.from;if(typeof data50 === "string"){if(!pattern4.test(data50)){const err117 = {instancePath:instancePath+"/messages/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}else {const err118 = {instancePath:instancePath+"/messages/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data48.to !== undefined){let data51 = data48.to;if(typeof data51 === "string"){if(!pattern4.test(data51)){const err119 = {instancePath:instancePath+"/messages/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+"/messages/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data48.y !== undefined){let data52 = data48.y;if((typeof data52 == "number") && (isFinite(data52))){if(data52 < 160 || isNaN(data52)){const err121 = {instancePath:instancePath+"/messages/" + i2+"/y",schemaPath:"#/properties/messages/items/properties/y/minimum",keyword:"minimum",params:{comparison: ">=", limit: 160},message:"must be >= 160"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}else {const err122 = {instancePath:instancePath+"/messages/" + i2+"/y",schemaPath:"#/properties/messages/items/properties/y/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}if(data48.label !== undefined){let data53 = data48.label;if(typeof data53 === "string"){if(func3(data53) < 1){const err123 = {instancePath:instancePath+"/messages/" + i2+"/label",schemaPath:"#/properties/messages/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}else {const err124 = {instancePath:instancePath+"/messages/" + i2+"/label",schemaPath:"#/properties/messages/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}if(data48.variant !== undefined){let data54 = data48.variant;if(!(((((data54 === "default") || (data54 === "emphasis")) || (data54 === "security")) || (data54 === "dashed")) || (data54 === "return"))){const err125 = {instancePath:instancePath+"/messages/" + i2+"/variant",schemaPath:"#/properties/messages/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema69.properties.messages.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}if(data48.note !== undefined){if(typeof data48.note !== "string"){const err126 = {instancePath:instancePath+"/messages/" + i2+"/note",schemaPath:"#/properties/messages/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}}else {const err127 = {instancePath:instancePath+"/messages/" + i2,schemaPath:"#/properties/messages/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}}else {const err128 = {instancePath:instancePath+"/messages",schemaPath:"#/properties/messages/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}if(data.activations !== undefined){let data56 = data.activations;if(Array.isArray(data56)){const len5 = data56.length;for(let i3=0; i3<len5; i3++){let data57 = data56[i3];if(data57 && typeof data57 == "object" && !Array.isArray(data57)){if(data57.participant === undefined){const err129 = {instancePath:instancePath+"/activations/" + i3,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "participant"},message:"must have required property '"+"participant"+"'"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if(data57.from === undefined){const err130 = {instancePath:instancePath+"/activations/" + i3,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}if(data57.to === undefined){const err131 = {instancePath:instancePath+"/activations/" + i3,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}for(const key13 in data57){if(!((((key13 === "participant") || (key13 === "from")) || (key13 === "to")) || (key13 === "type"))){const err132 = {instancePath:instancePath+"/activations/" + i3,schemaPath:"#/properties/activations/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}if(data57.participant !== undefined){let data58 = data57.participant;if(typeof data58 === "string"){if(!pattern4.test(data58)){const err133 = {instancePath:instancePath+"/activations/" + i3+"/participant",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}else {const err134 = {instancePath:instancePath+"/activations/" + i3+"/participant",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}if(data57.from !== undefined){let data59 = data57.from;if(!((typeof data59 == "number") && (isFinite(data59)))){const err135 = {instancePath:instancePath+"/activations/" + i3+"/from",schemaPath:"#/properties/activations/items/properties/from/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}if(data57.to !== undefined){let data60 = data57.to;if(!((typeof data60 == "number") && (isFinite(data60)))){const err136 = {instancePath:instancePath+"/activations/" + i3+"/to",schemaPath:"#/properties/activations/items/properties/to/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}if(data57.type !== undefined){let data61 = data57.type;if(!(((((((data61 === "frontend") || (data61 === "backend")) || (data61 === "database")) || (data61 === "cloud")) || (data61 === "security")) || (data61 === "messagebus")) || (data61 === "external"))){const err137 = {instancePath:instancePath+"/activations/" + i3+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema57.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}}else {const err138 = {instancePath:instancePath+"/activations/" + i3,schemaPath:"#/properties/activations/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}}else {const err139 = {instancePath:instancePath+"/activations",schemaPath:"#/properties/activations/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data.cards !== undefined){let data62 = data.cards;if(Array.isArray(data62)){const len6 = data62.length;for(let i4=0; i4<len6; i4++){let data63 = data62[i4];if(data63 && typeof data63 == "object" && !Array.isArray(data63)){if(data63.dot === undefined){const err140 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}if(data63.title === undefined){const err141 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}if(data63.items === undefined){const err142 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}for(const key14 in data63){if(!(((key14 === "dot") || (key14 === "title")) || (key14 === "items"))){const err143 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}if(data63.dot !== undefined){let data64 = data63.dot;if(!(((((((data64 === "cyan") || (data64 === "emerald")) || (data64 === "violet")) || (data64 === "amber")) || (data64 === "rose")) || (data64 === "orange")) || (data64 === "slate"))){const err144 = {instancePath:instancePath+"/cards/" + i4+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema68.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data63.title !== undefined){let data65 = data63.title;if(typeof data65 === "string"){if(func3(data65) < 1){const err145 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}else {const err146 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}if(data63.items !== undefined){let data66 = data63.items;if(Array.isArray(data66)){const len7 = data66.length;for(let i5=0; i5<len7; i5++){if(typeof data66[i5] !== "string"){const err147 = {instancePath:instancePath+"/cards/" + i4+"/items/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}}else {const err148 = {instancePath:instancePath+"/cards/" + i4+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}}else {const err149 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}}else {const err150 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}}else {const err151 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}validate24.errors = vErrors;return errors === 0;}validate24.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};export const dataflow = validate27;const schema92 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/dataflow.schema.json","title":"Archify Data Flow Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","stages","nodes","flows"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"dataflow"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"type":"string"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"default":{"$ref":"common.schema.json#/$defs/legendEntry"},"emphasis":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"dashed":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":360},{"type":"number","minimum":360}],"items":false,"minItems":2,"maxItems":2}}},"stages":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["label"],"properties":{"label":{"type":"string","minLength":1}}}},"nodes":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label","stage","row"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"stage":{"type":"integer","minimum":0},"row":{"type":"integer","minimum":0},"width":{"type":"number","minimum":48},"height":{"type":"number","minimum":36},"yOffset":{"type":"number"}}}},"flows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"classification":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"route":{"enum":["auto","straight","vertical-channel","bottom-channel","top-channel"]},"fromSide":{"$ref":"common.schema.json#/$defs/side"},"toSide":{"$ref":"common.schema.json#/$defs/side"},"channelX":{"type":"number"},"channelY":{"type":"number"},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"width":{"$ref":"common.schema.json#/$defs/relationshipWidth"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};function validate28(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate28.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern4.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate28.errors = vErrors;return errors === 0;}validate28.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate27(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/dataflow.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate27.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.stages === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "stages"},message:"must have required property '"+"stages"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.nodes === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "nodes"},message:"must have required property '"+"nodes"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.flows === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "flows"},message:"must have required property '"+"flows"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "stages")) || (key0 === "nodes")) || (key0 === "flows")) || (key0 === "cards"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("dataflow" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "dataflow"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key1 in data2){if(!(func1.call(schema92.properties.meta.properties, key1))){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!((data4 === "en") || (data4 === "zh-CN"))){const err13 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err14 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.output !== undefined){if(typeof data2.output !== "string"){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"#/properties/meta/properties/output/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err16 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema34.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err17 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema35.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err18 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema36.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data2.views !== undefined){if(!(validate28(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate28.errors : vErrors.concat(validate28.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data11 = data2.legend;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){for(const key2 in data11){if(!((key2 === "mode") || (key2 === "entries"))){const err19 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data11.mode !== undefined){let data12 = data11.mode;if(!(((data12 === "auto") || (data12 === "all")) || (data12 === "hidden"))){const err20 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema40.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data11.entries !== undefined){let data13 = data11.entries;if(data13 && typeof data13 == "object" && !Array.isArray(data13)){for(const key3 in data13){if(!(((((key3 === "default") || (key3 === "emphasis")) || (key3 === "security")) || (key3 === "dashed")) || (key3 === "database"))){const err21 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data13.default !== undefined){let data14 = data13.default;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){if(Object.keys(data14).length < 1){const err22 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}for(const key4 in data14){if(!((key4 === "label") || (key4 === "visible"))){const err23 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data14.label !== undefined){let data15 = data14.label;if(typeof data15 === "string"){if(func3(data15) > 80){const err24 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(func3(data15) < 1){const err25 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data14.visible !== undefined){if(typeof data14.visible !== "boolean"){const err27 = {instancePath:instancePath+"/meta/legend/entries/default/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data13.emphasis !== undefined){let data17 = data13.emphasis;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){if(Object.keys(data17).length < 1){const err29 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}for(const key5 in data17){if(!((key5 === "label") || (key5 === "visible"))){const err30 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data17.label !== undefined){let data18 = data17.label;if(typeof data18 === "string"){if(func3(data18) > 80){const err31 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func3(data18) < 1){const err32 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data17.visible !== undefined){if(typeof data17.visible !== "boolean"){const err34 = {instancePath:instancePath+"/meta/legend/entries/emphasis/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}}else {const err35 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data13.security !== undefined){let data20 = data13.security;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){if(Object.keys(data20).length < 1){const err36 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key6 in data20){if(!((key6 === "label") || (key6 === "visible"))){const err37 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data20.label !== undefined){let data21 = data20.label;if(typeof data21 === "string"){if(func3(data21) > 80){const err38 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(func3(data21) < 1){const err39 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data20.visible !== undefined){if(typeof data20.visible !== "boolean"){const err41 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data13.dashed !== undefined){let data23 = data13.dashed;if(data23 && typeof data23 == "object" && !Array.isArray(data23)){if(Object.keys(data23).length < 1){const err43 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}for(const key7 in data23){if(!((key7 === "label") || (key7 === "visible"))){const err44 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data23.label !== undefined){let data24 = data23.label;if(typeof data24 === "string"){if(func3(data24) > 80){const err45 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data24) < 1){const err46 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data23.visible !== undefined){if(typeof data23.visible !== "boolean"){const err48 = {instancePath:instancePath+"/meta/legend/entries/dashed/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data13.database !== undefined){let data26 = data13.database;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(Object.keys(data26).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key8 in data26){if(!((key8 === "label") || (key8 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data26.label !== undefined){let data27 = data26.label;if(typeof data27 === "string"){if(func3(data27) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data27) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data26.visible !== undefined){if(typeof data26.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}}else {const err57 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}}else {const err58 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data2.viewBox !== undefined){let data29 = data2.viewBox;if(Array.isArray(data29)){if(data29.length > 2){const err59 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(data29.length < 2){const err60 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}const len0 = data29.length;if(len0 > 0){let data30 = data29[0];if((typeof data30 == "number") && (isFinite(data30))){if(data30 < 360 || isNaN(data30)){const err61 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 360},message:"must be >= 360"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}else {const err62 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(len0 > 1){let data31 = data29[1];if((typeof data31 == "number") && (isFinite(data31))){if(data31 < 360 || isNaN(data31)){const err63 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 360},message:"must be >= 360"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}else {const err64 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}const len1 = data29.length;if(!(len1 <= 2)){const err65 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}else {const err66 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}}else {const err67 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}if(data.stages !== undefined){let data32 = data.stages;if(Array.isArray(data32)){if(data32.length > 5){const err68 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}if(data32.length < 2){const err69 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}const len2 = data32.length;for(let i0=0; i0<len2; i0++){let data33 = data32[i0];if(data33 && typeof data33 == "object" && !Array.isArray(data33)){if(data33.label === undefined){const err70 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}for(const key9 in data33){if(!(key9 === "label")){const err71 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data33.label !== undefined){let data34 = data33.label;if(typeof data34 === "string"){if(func3(data34) < 1){const err72 = {instancePath:instancePath+"/stages/" + i0+"/label",schemaPath:"#/properties/stages/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}else {const err73 = {instancePath:instancePath+"/stages/" + i0+"/label",schemaPath:"#/properties/stages/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}}else {const err74 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}}else {const err75 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data.nodes !== undefined){let data35 = data.nodes;if(Array.isArray(data35)){if(data35.length < 2){const err76 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}const len3 = data35.length;for(let i1=0; i1<len3; i1++){let data36 = data35[i1];if(data36 && typeof data36 == "object" && !Array.isArray(data36)){if(data36.id === undefined){const err77 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}if(data36.type === undefined){const err78 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}if(data36.label === undefined){const err79 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}if(data36.stage === undefined){const err80 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "stage"},message:"must have required property '"+"stage"+"'"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}if(data36.row === undefined){const err81 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "row"},message:"must have required property '"+"row"+"'"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}for(const key10 in data36){if(!(func1.call(schema92.properties.nodes.items.properties, key10))){const err82 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}if(data36.id !== undefined){let data37 = data36.id;if(typeof data37 === "string"){if(!pattern4.test(data37)){const err83 = {instancePath:instancePath+"/nodes/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}else {const err84 = {instancePath:instancePath+"/nodes/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}if(data36.type !== undefined){let data38 = data36.type;if(!(((((((data38 === "frontend") || (data38 === "backend")) || (data38 === "database")) || (data38 === "cloud")) || (data38 === "security")) || (data38 === "messagebus")) || (data38 === "external"))){const err85 = {instancePath:instancePath+"/nodes/" + i1+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema57.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}if(data36.label !== undefined){let data39 = data36.label;if(typeof data39 === "string"){if(func3(data39) < 1){const err86 = {instancePath:instancePath+"/nodes/" + i1+"/label",schemaPath:"#/properties/nodes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}else {const err87 = {instancePath:instancePath+"/nodes/" + i1+"/label",schemaPath:"#/properties/nodes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}if(data36.sublabel !== undefined){if(typeof data36.sublabel !== "string"){const err88 = {instancePath:instancePath+"/nodes/" + i1+"/sublabel",schemaPath:"#/properties/nodes/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data36.tag !== undefined){if(typeof data36.tag !== "string"){const err89 = {instancePath:instancePath+"/nodes/" + i1+"/tag",schemaPath:"#/properties/nodes/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}if(data36.brand !== undefined){let data42 = data36.brand;const _errs101 = errors;let valid29 = false;let passing0 = null;const _errs102 = errors;const _errs104 = errors;let valid30 = false;const _errs105 = errors;if(typeof data42 === "string"){if(func3(data42) > 80){const err90 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}if(!pattern13.test(data42)){const err91 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}var _valid1 = _errs105 === errors;valid30 = valid30 || _valid1;const _errs106 = errors;if(typeof data42 === "string"){if(!pattern14.test(data42)){const err92 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}var _valid1 = _errs106 === errors;valid30 = valid30 || _valid1;if(!valid30){const err93 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}else {errors = _errs104;if(vErrors !== null){if(_errs104){vErrors.length = _errs104;}else {vErrors = null;}}}if(typeof data42 === "string"){if(func3(data42) > 2048){const err94 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}if(func3(data42) < 1){const err95 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}else {const err96 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}var _valid0 = _errs102 === errors;if(_valid0){valid29 = true;passing0 = 0;}const _errs107 = errors;if(data42 && typeof data42 == "object" && !Array.isArray(data42)){if(data42.url === undefined){const err97 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}if(data42.sha256 === undefined){const err98 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}for(const key11 in data42){if(!((key11 === "url") || (key11 === "sha256"))){const err99 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data42.url !== undefined){let data43 = data42.url;if(typeof data43 === "string"){if(func3(data43) > 2048){const err100 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}if(func3(data43) < 8){const err101 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}if(!pattern14.test(data43)){const err102 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}else {const err103 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}if(data42.sha256 !== undefined){let data44 = data42.sha256;if(typeof data44 === "string"){if(!pattern16.test(data44)){const err104 = {instancePath:instancePath+"/nodes/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}else {const err105 = {instancePath:instancePath+"/nodes/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}}else {const err106 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}var _valid0 = _errs107 === errors;if(_valid0 && valid29){valid29 = false;passing0 = [passing0, 1];}else {if(_valid0){valid29 = true;passing0 = 1;}}if(!valid29){const err107 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}else {errors = _errs101;if(vErrors !== null){if(_errs101){vErrors.length = _errs101;}else {vErrors = null;}}}}if(data36.stage !== undefined){let data45 = data36.stage;if(!(((typeof data45 == "number") && (!(data45 % 1) && !isNaN(data45))) && (isFinite(data45)))){const err108 = {instancePath:instancePath+"/nodes/" + i1+"/stage",schemaPath:"#/properties/nodes/items/properties/stage/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}if((typeof data45 == "number") && (isFinite(data45))){if(data45 < 0 || isNaN(data45)){const err109 = {instancePath:instancePath+"/nodes/" + i1+"/stage",schemaPath:"#/properties/nodes/items/properties/stage/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}}if(data36.row !== undefined){let data46 = data36.row;if(!(((typeof data46 == "number") && (!(data46 % 1) && !isNaN(data46))) && (isFinite(data46)))){const err110 = {instancePath:instancePath+"/nodes/" + i1+"/row",schemaPath:"#/properties/nodes/items/properties/row/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}if((typeof data46 == "number") && (isFinite(data46))){if(data46 < 0 || isNaN(data46)){const err111 = {instancePath:instancePath+"/nodes/" + i1+"/row",schemaPath:"#/properties/nodes/items/properties/row/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}}if(data36.width !== undefined){let data47 = data36.width;if((typeof data47 == "number") && (isFinite(data47))){if(data47 < 48 || isNaN(data47)){const err112 = {instancePath:instancePath+"/nodes/" + i1+"/width",schemaPath:"#/properties/nodes/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 48},message:"must be >= 48"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}else {const err113 = {instancePath:instancePath+"/nodes/" + i1+"/width",schemaPath:"#/properties/nodes/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data36.height !== undefined){let data48 = data36.height;if((typeof data48 == "number") && (isFinite(data48))){if(data48 < 36 || isNaN(data48)){const err114 = {instancePath:instancePath+"/nodes/" + i1+"/height",schemaPath:"#/properties/nodes/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 36},message:"must be >= 36"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}else {const err115 = {instancePath:instancePath+"/nodes/" + i1+"/height",schemaPath:"#/properties/nodes/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}if(data36.yOffset !== undefined){let data49 = data36.yOffset;if(!((typeof data49 == "number") && (isFinite(data49)))){const err116 = {instancePath:instancePath+"/nodes/" + i1+"/yOffset",schemaPath:"#/properties/nodes/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}}else {const err117 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}}else {const err118 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data.flows !== undefined){let data50 = data.flows;if(Array.isArray(data50)){const len4 = data50.length;for(let i2=0; i2<len4; i2++){let data51 = data50[i2];if(data51 && typeof data51 == "object" && !Array.isArray(data51)){if(data51.from === undefined){const err119 = {instancePath:instancePath+"/flows/" + i2,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}if(data51.to === undefined){const err120 = {instancePath:instancePath+"/flows/" + i2,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}if(data51.label === undefined){const err121 = {instancePath:instancePath+"/flows/" + i2,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}for(const key12 in data51){if(!(func1.call(schema92.properties.flows.items.properties, key12))){const err122 = {instancePath:instancePath+"/flows/" + i2,schemaPath:"#/properties/flows/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}if(data51.id !== undefined){let data52 = data51.id;if(typeof data52 === "string"){if(!pattern4.test(data52)){const err123 = {instancePath:instancePath+"/flows/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}else {const err124 = {instancePath:instancePath+"/flows/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}if(data51.from !== undefined){let data53 = data51.from;if(typeof data53 === "string"){if(!pattern4.test(data53)){const err125 = {instancePath:instancePath+"/flows/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}else {const err126 = {instancePath:instancePath+"/flows/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}if(data51.to !== undefined){let data54 = data51.to;if(typeof data54 === "string"){if(!pattern4.test(data54)){const err127 = {instancePath:instancePath+"/flows/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}else {const err128 = {instancePath:instancePath+"/flows/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}if(data51.label !== undefined){let data55 = data51.label;if(typeof data55 === "string"){if(func3(data55) < 1){const err129 = {instancePath:instancePath+"/flows/" + i2+"/label",schemaPath:"#/properties/flows/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}else {const err130 = {instancePath:instancePath+"/flows/" + i2+"/label",schemaPath:"#/properties/flows/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}}if(data51.classification !== undefined){if(typeof data51.classification !== "string"){const err131 = {instancePath:instancePath+"/flows/" + i2+"/classification",schemaPath:"#/properties/flows/items/properties/classification/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}if(data51.variant !== undefined){let data57 = data51.variant;if(!((((data57 === "default") || (data57 === "emphasis")) || (data57 === "security")) || (data57 === "dashed"))){const err132 = {instancePath:instancePath+"/flows/" + i2+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema50.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}if(data51.route !== undefined){let data58 = data51.route;if(!(((((data58 === "auto") || (data58 === "straight")) || (data58 === "vertical-channel")) || (data58 === "bottom-channel")) || (data58 === "top-channel"))){const err133 = {instancePath:instancePath+"/flows/" + i2+"/route",schemaPath:"#/properties/flows/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema92.properties.flows.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}if(data51.fromSide !== undefined){let data59 = data51.fromSide;if(!((((data59 === "left") || (data59 === "right")) || (data59 === "top")) || (data59 === "bottom"))){const err134 = {instancePath:instancePath+"/flows/" + i2+"/fromSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema63.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}if(data51.toSide !== undefined){let data60 = data51.toSide;if(!((((data60 === "left") || (data60 === "right")) || (data60 === "top")) || (data60 === "bottom"))){const err135 = {instancePath:instancePath+"/flows/" + i2+"/toSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema63.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}if(data51.channelX !== undefined){let data61 = data51.channelX;if(!((typeof data61 == "number") && (isFinite(data61)))){const err136 = {instancePath:instancePath+"/flows/" + i2+"/channelX",schemaPath:"#/properties/flows/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}if(data51.channelY !== undefined){let data62 = data51.channelY;if(!((typeof data62 == "number") && (isFinite(data62)))){const err137 = {instancePath:instancePath+"/flows/" + i2+"/channelY",schemaPath:"#/properties/flows/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}if(data51.labelAt !== undefined){let data63 = data51.labelAt;if(Array.isArray(data63)){if(data63.length > 2){const err138 = {instancePath:instancePath+"/flows/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}if(data63.length < 2){const err139 = {instancePath:instancePath+"/flows/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}const len5 = data63.length;if(len5 > 0){let data64 = data63[0];if(!((typeof data64 == "number") && (isFinite(data64)))){const err140 = {instancePath:instancePath+"/flows/" + i2+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}if(len5 > 1){let data65 = data63[1];if(!((typeof data65 == "number") && (isFinite(data65)))){const err141 = {instancePath:instancePath+"/flows/" + i2+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}const len6 = data63.length;if(!(len6 <= 2)){const err142 = {instancePath:instancePath+"/flows/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}}else {const err143 = {instancePath:instancePath+"/flows/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}if(data51.labelDx !== undefined){let data66 = data51.labelDx;if(!((typeof data66 == "number") && (isFinite(data66)))){const err144 = {instancePath:instancePath+"/flows/" + i2+"/labelDx",schemaPath:"#/properties/flows/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data51.labelDy !== undefined){let data67 = data51.labelDy;if(!((typeof data67 == "number") && (isFinite(data67)))){const err145 = {instancePath:instancePath+"/flows/" + i2+"/labelDy",schemaPath:"#/properties/flows/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}if(data51.labelSegment !== undefined){let data68 = data51.labelSegment;if(!(((typeof data68 == "number") && (!(data68 % 1) && !isNaN(data68))) && (isFinite(data68)))){const err146 = {instancePath:instancePath+"/flows/" + i2+"/labelSegment",schemaPath:"#/properties/flows/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}if((typeof data68 == "number") && (isFinite(data68))){if(data68 < 0 || isNaN(data68)){const err147 = {instancePath:instancePath+"/flows/" + i2+"/labelSegment",schemaPath:"#/properties/flows/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}}if(data51.via !== undefined){let data69 = data51.via;if(Array.isArray(data69)){const len7 = data69.length;for(let i3=0; i3<len7; i3++){let data70 = data69[i3];if(Array.isArray(data70)){if(data70.length > 2){const err148 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}if(data70.length < 2){const err149 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}const len8 = data70.length;if(len8 > 0){let data71 = data70[0];if(!((typeof data71 == "number") && (isFinite(data71)))){const err150 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}if(len8 > 1){let data72 = data70[1];if(!((typeof data72 == "number") && (isFinite(data72)))){const err151 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}const len9 = data70.length;if(!(len9 <= 2)){const err152 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}else {const err153 = {instancePath:instancePath+"/flows/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}}else {const err154 = {instancePath:instancePath+"/flows/" + i2+"/via",schemaPath:"#/properties/flows/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}if(data51.width !== undefined){let data73 = data51.width;if((typeof data73 == "number") && (isFinite(data73))){if(data73 < 0.5 || isNaN(data73)){const err155 = {instancePath:instancePath+"/flows/" + i2+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}else {const err156 = {instancePath:instancePath+"/flows/" + i2+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}}else {const err157 = {instancePath:instancePath+"/flows/" + i2,schemaPath:"#/properties/flows/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}}else {const err158 = {instancePath:instancePath+"/flows",schemaPath:"#/properties/flows/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}if(data.cards !== undefined){let data74 = data.cards;if(Array.isArray(data74)){const len10 = data74.length;for(let i4=0; i4<len10; i4++){let data75 = data74[i4];if(data75 && typeof data75 == "object" && !Array.isArray(data75)){if(data75.dot === undefined){const err159 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}if(data75.title === undefined){const err160 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}if(data75.items === undefined){const err161 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}for(const key13 in data75){if(!(((key13 === "dot") || (key13 === "title")) || (key13 === "items"))){const err162 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}if(data75.dot !== undefined){let data76 = data75.dot;if(!(((((((data76 === "cyan") || (data76 === "emerald")) || (data76 === "violet")) || (data76 === "amber")) || (data76 === "rose")) || (data76 === "orange")) || (data76 === "slate"))){const err163 = {instancePath:instancePath+"/cards/" + i4+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema68.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}if(data75.title !== undefined){let data77 = data75.title;if(typeof data77 === "string"){if(func3(data77) < 1){const err164 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}else {const err165 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data75.items !== undefined){let data78 = data75.items;if(Array.isArray(data78)){const len11 = data78.length;for(let i5=0; i5<len11; i5++){if(typeof data78[i5] !== "string"){const err166 = {instancePath:instancePath+"/cards/" + i4+"/items/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}}else {const err167 = {instancePath:instancePath+"/cards/" + i4+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}}else {const err168 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}}else {const err169 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}}else {const err170 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}validate27.errors = vErrors;return errors === 0;}validate27.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};export const lifecycle = validate30;const schema119 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/lifecycle.schema.json","title":"Archify Lifecycle Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","lanes","states","transitions"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"lifecycle"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"type":"string"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"start":{"$ref":"common.schema.json#/$defs/legendEntry"},"active":{"$ref":"common.schema.json#/$defs/legendEntry"},"waiting":{"$ref":"common.schema.json#/$defs/legendEntry"},"decision":{"$ref":"common.schema.json#/$defs/legendEntry"},"success":{"$ref":"common.schema.json#/$defs/legendEntry"},"failure":{"$ref":"common.schema.json#/$defs/legendEntry"},"neutral":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":420},{"type":"number","minimum":566}],"items":false,"minItems":2,"maxItems":2}}},"lanes":{"type":"array","minItems":1,"maxItems":4,"items":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1}}}},"states":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label","lane","col"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"enum":["start","active","waiting","decision","success","failure","neutral","external"]},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"step":{"type":"string"},"lane":{"$ref":"common.schema.json#/$defs/id"},"col":{"type":"integer","minimum":0,"maximum":4},"width":{"type":"number","minimum":48},"height":{"type":"number","minimum":36},"yOffset":{"type":"number"}}}},"transitions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"note":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"route":{"enum":["auto","straight","drop","bottom-channel","top-channel","right-channel","left-channel"]},"fromSide":{"$ref":"common.schema.json#/$defs/side"},"toSide":{"$ref":"common.schema.json#/$defs/side"},"channelX":{"type":"number"},"channelY":{"type":"number"},"cornerRadius":{"type":"number","minimum":0},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"width":{"$ref":"common.schema.json#/$defs/relationshipWidth"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};function validate31(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate31.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern4.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate31.errors = vErrors;return errors === 0;}validate31.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate30(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/lifecycle.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate30.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.lanes === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lanes"},message:"must have required property '"+"lanes"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.states === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "states"},message:"must have required property '"+"states"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.transitions === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "transitions"},message:"must have required property '"+"transitions"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "lanes")) || (key0 === "states")) || (key0 === "transitions")) || (key0 === "cards"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("lifecycle" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "lifecycle"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key1 in data2){if(!(func1.call(schema119.properties.meta.properties, key1))){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!((data4 === "en") || (data4 === "zh-CN"))){const err13 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err14 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.output !== undefined){if(typeof data2.output !== "string"){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"#/properties/meta/properties/output/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err16 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema34.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err17 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema35.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err18 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema36.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data2.views !== undefined){if(!(validate31(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data11 = data2.legend;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){for(const key2 in data11){if(!((key2 === "mode") || (key2 === "entries"))){const err19 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data11.mode !== undefined){let data12 = data11.mode;if(!(((data12 === "auto") || (data12 === "all")) || (data12 === "hidden"))){const err20 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema40.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data11.entries !== undefined){let data13 = data11.entries;if(data13 && typeof data13 == "object" && !Array.isArray(data13)){for(const key3 in data13){if(!((((((((key3 === "start") || (key3 === "active")) || (key3 === "waiting")) || (key3 === "decision")) || (key3 === "success")) || (key3 === "failure")) || (key3 === "neutral")) || (key3 === "external"))){const err21 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data13.start !== undefined){let data14 = data13.start;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){if(Object.keys(data14).length < 1){const err22 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}for(const key4 in data14){if(!((key4 === "label") || (key4 === "visible"))){const err23 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data14.label !== undefined){let data15 = data14.label;if(typeof data15 === "string"){if(func3(data15) > 80){const err24 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(func3(data15) < 1){const err25 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data14.visible !== undefined){if(typeof data14.visible !== "boolean"){const err27 = {instancePath:instancePath+"/meta/legend/entries/start/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data13.active !== undefined){let data17 = data13.active;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){if(Object.keys(data17).length < 1){const err29 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}for(const key5 in data17){if(!((key5 === "label") || (key5 === "visible"))){const err30 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data17.label !== undefined){let data18 = data17.label;if(typeof data18 === "string"){if(func3(data18) > 80){const err31 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func3(data18) < 1){const err32 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data17.visible !== undefined){if(typeof data17.visible !== "boolean"){const err34 = {instancePath:instancePath+"/meta/legend/entries/active/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}}else {const err35 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data13.waiting !== undefined){let data20 = data13.waiting;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){if(Object.keys(data20).length < 1){const err36 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key6 in data20){if(!((key6 === "label") || (key6 === "visible"))){const err37 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data20.label !== undefined){let data21 = data20.label;if(typeof data21 === "string"){if(func3(data21) > 80){const err38 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(func3(data21) < 1){const err39 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data20.visible !== undefined){if(typeof data20.visible !== "boolean"){const err41 = {instancePath:instancePath+"/meta/legend/entries/waiting/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data13.decision !== undefined){let data23 = data13.decision;if(data23 && typeof data23 == "object" && !Array.isArray(data23)){if(Object.keys(data23).length < 1){const err43 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}for(const key7 in data23){if(!((key7 === "label") || (key7 === "visible"))){const err44 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data23.label !== undefined){let data24 = data23.label;if(typeof data24 === "string"){if(func3(data24) > 80){const err45 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data24) < 1){const err46 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data23.visible !== undefined){if(typeof data23.visible !== "boolean"){const err48 = {instancePath:instancePath+"/meta/legend/entries/decision/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data13.success !== undefined){let data26 = data13.success;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(Object.keys(data26).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key8 in data26){if(!((key8 === "label") || (key8 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data26.label !== undefined){let data27 = data26.label;if(typeof data27 === "string"){if(func3(data27) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data27) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data26.visible !== undefined){if(typeof data26.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/success/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data13.failure !== undefined){let data29 = data13.failure;if(data29 && typeof data29 == "object" && !Array.isArray(data29)){if(Object.keys(data29).length < 1){const err57 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}for(const key9 in data29){if(!((key9 === "label") || (key9 === "visible"))){const err58 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data29.label !== undefined){let data30 = data29.label;if(typeof data30 === "string"){if(func3(data30) > 80){const err59 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(func3(data30) < 1){const err60 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data29.visible !== undefined){if(typeof data29.visible !== "boolean"){const err62 = {instancePath:instancePath+"/meta/legend/entries/failure/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}}else {const err63 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data13.neutral !== undefined){let data32 = data13.neutral;if(data32 && typeof data32 == "object" && !Array.isArray(data32)){if(Object.keys(data32).length < 1){const err64 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key10 in data32){if(!((key10 === "label") || (key10 === "visible"))){const err65 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data32.label !== undefined){let data33 = data32.label;if(typeof data33 === "string"){if(func3(data33) > 80){const err66 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if(func3(data33) < 1){const err67 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data32.visible !== undefined){if(typeof data32.visible !== "boolean"){const err69 = {instancePath:instancePath+"/meta/legend/entries/neutral/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}}else {const err70 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data13.external !== undefined){let data35 = data13.external;if(data35 && typeof data35 == "object" && !Array.isArray(data35)){if(Object.keys(data35).length < 1){const err71 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}for(const key11 in data35){if(!((key11 === "label") || (key11 === "visible"))){const err72 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data35.label !== undefined){let data36 = data35.label;if(typeof data36 === "string"){if(func3(data36) > 80){const err73 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(func3(data36) < 1){const err74 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}else {const err75 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data35.visible !== undefined){if(typeof data35.visible !== "boolean"){const err76 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}}else {const err78 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}}else {const err79 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}if(data2.viewBox !== undefined){let data38 = data2.viewBox;if(Array.isArray(data38)){if(data38.length > 2){const err80 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}if(data38.length < 2){const err81 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}const len0 = data38.length;if(len0 > 0){let data39 = data38[0];if((typeof data39 == "number") && (isFinite(data39))){if(data39 < 420 || isNaN(data39)){const err82 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 420},message:"must be >= 420"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}else {const err83 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}if(len0 > 1){let data40 = data38[1];if((typeof data40 == "number") && (isFinite(data40))){if(data40 < 566 || isNaN(data40)){const err84 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 566},message:"must be >= 566"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}else {const err85 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}const len1 = data38.length;if(!(len1 <= 2)){const err86 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}else {const err87 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}}else {const err88 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data.lanes !== undefined){let data41 = data.lanes;if(Array.isArray(data41)){if(data41.length > 4){const err89 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/maxItems",keyword:"maxItems",params:{limit: 4},message:"must NOT have more than 4 items"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}if(data41.length < 1){const err90 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}const len2 = data41.length;for(let i0=0; i0<len2; i0++){let data42 = data41[i0];if(data42 && typeof data42 == "object" && !Array.isArray(data42)){if(data42.id === undefined){const err91 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}if(data42.label === undefined){const err92 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}for(const key12 in data42){if(!((key12 === "id") || (key12 === "label"))){const err93 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(data42.id !== undefined){let data43 = data42.id;if(typeof data43 === "string"){if(!pattern4.test(data43)){const err94 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}else {const err95 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data42.label !== undefined){let data44 = data42.label;if(typeof data44 === "string"){if(func3(data44) < 1){const err96 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}else {const err97 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data.states !== undefined){let data45 = data.states;if(Array.isArray(data45)){if(data45.length < 2){const err100 = {instancePath:instancePath+"/states",schemaPath:"#/properties/states/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}const len3 = data45.length;for(let i1=0; i1<len3; i1++){let data46 = data45[i1];if(data46 && typeof data46 == "object" && !Array.isArray(data46)){if(data46.id === undefined){const err101 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}if(data46.type === undefined){const err102 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}if(data46.label === undefined){const err103 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}if(data46.lane === undefined){const err104 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}if(data46.col === undefined){const err105 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "col"},message:"must have required property '"+"col"+"'"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}for(const key13 in data46){if(!(func1.call(schema119.properties.states.items.properties, key13))){const err106 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}if(data46.id !== undefined){let data47 = data46.id;if(typeof data47 === "string"){if(!pattern4.test(data47)){const err107 = {instancePath:instancePath+"/states/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}else {const err108 = {instancePath:instancePath+"/states/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}if(data46.type !== undefined){let data48 = data46.type;if(!((((((((data48 === "start") || (data48 === "active")) || (data48 === "waiting")) || (data48 === "decision")) || (data48 === "success")) || (data48 === "failure")) || (data48 === "neutral")) || (data48 === "external"))){const err109 = {instancePath:instancePath+"/states/" + i1+"/type",schemaPath:"#/properties/states/items/properties/type/enum",keyword:"enum",params:{allowedValues: schema119.properties.states.items.properties.type.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}if(data46.label !== undefined){let data49 = data46.label;if(typeof data49 === "string"){if(func3(data49) < 1){const err110 = {instancePath:instancePath+"/states/" + i1+"/label",schemaPath:"#/properties/states/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}else {const err111 = {instancePath:instancePath+"/states/" + i1+"/label",schemaPath:"#/properties/states/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}if(data46.sublabel !== undefined){if(typeof data46.sublabel !== "string"){const err112 = {instancePath:instancePath+"/states/" + i1+"/sublabel",schemaPath:"#/properties/states/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}if(data46.tag !== undefined){if(typeof data46.tag !== "string"){const err113 = {instancePath:instancePath+"/states/" + i1+"/tag",schemaPath:"#/properties/states/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data46.brand !== undefined){let data52 = data46.brand;const _errs127 = errors;let valid35 = false;let passing0 = null;const _errs128 = errors;const _errs130 = errors;let valid36 = false;const _errs131 = errors;if(typeof data52 === "string"){if(func3(data52) > 80){const err114 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(!pattern13.test(data52)){const err115 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}var _valid1 = _errs131 === errors;valid36 = valid36 || _valid1;const _errs132 = errors;if(typeof data52 === "string"){if(!pattern14.test(data52)){const err116 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}var _valid1 = _errs132 === errors;valid36 = valid36 || _valid1;if(!valid36){const err117 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}else {errors = _errs130;if(vErrors !== null){if(_errs130){vErrors.length = _errs130;}else {vErrors = null;}}}if(typeof data52 === "string"){if(func3(data52) > 2048){const err118 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}if(func3(data52) < 1){const err119 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}var _valid0 = _errs128 === errors;if(_valid0){valid35 = true;passing0 = 0;}const _errs133 = errors;if(data52 && typeof data52 == "object" && !Array.isArray(data52)){if(data52.url === undefined){const err121 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}if(data52.sha256 === undefined){const err122 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}for(const key14 in data52){if(!((key14 === "url") || (key14 === "sha256"))){const err123 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}if(data52.url !== undefined){let data53 = data52.url;if(typeof data53 === "string"){if(func3(data53) > 2048){const err124 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}if(func3(data53) < 8){const err125 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}if(!pattern14.test(data53)){const err126 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}else {const err127 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}if(data52.sha256 !== undefined){let data54 = data52.sha256;if(typeof data54 === "string"){if(!pattern16.test(data54)){const err128 = {instancePath:instancePath+"/states/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}else {const err129 = {instancePath:instancePath+"/states/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}}else {const err130 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}var _valid0 = _errs133 === errors;if(_valid0 && valid35){valid35 = false;passing0 = [passing0, 1];}else {if(_valid0){valid35 = true;passing0 = 1;}}if(!valid35){const err131 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}else {errors = _errs127;if(vErrors !== null){if(_errs127){vErrors.length = _errs127;}else {vErrors = null;}}}}if(data46.step !== undefined){if(typeof data46.step !== "string"){const err132 = {instancePath:instancePath+"/states/" + i1+"/step",schemaPath:"#/properties/states/items/properties/step/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}if(data46.lane !== undefined){let data56 = data46.lane;if(typeof data56 === "string"){if(!pattern4.test(data56)){const err133 = {instancePath:instancePath+"/states/" + i1+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}else {const err134 = {instancePath:instancePath+"/states/" + i1+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}if(data46.col !== undefined){let data57 = data46.col;if(!(((typeof data57 == "number") && (!(data57 % 1) && !isNaN(data57))) && (isFinite(data57)))){const err135 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}if((typeof data57 == "number") && (isFinite(data57))){if(data57 > 4 || isNaN(data57)){const err136 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/maximum",keyword:"maximum",params:{comparison: "<=", limit: 4},message:"must be <= 4"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}if(data57 < 0 || isNaN(data57)){const err137 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}}if(data46.width !== undefined){let data58 = data46.width;if((typeof data58 == "number") && (isFinite(data58))){if(data58 < 48 || isNaN(data58)){const err138 = {instancePath:instancePath+"/states/" + i1+"/width",schemaPath:"#/properties/states/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 48},message:"must be >= 48"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}else {const err139 = {instancePath:instancePath+"/states/" + i1+"/width",schemaPath:"#/properties/states/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data46.height !== undefined){let data59 = data46.height;if((typeof data59 == "number") && (isFinite(data59))){if(data59 < 36 || isNaN(data59)){const err140 = {instancePath:instancePath+"/states/" + i1+"/height",schemaPath:"#/properties/states/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 36},message:"must be >= 36"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}else {const err141 = {instancePath:instancePath+"/states/" + i1+"/height",schemaPath:"#/properties/states/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}if(data46.yOffset !== undefined){let data60 = data46.yOffset;if(!((typeof data60 == "number") && (isFinite(data60)))){const err142 = {instancePath:instancePath+"/states/" + i1+"/yOffset",schemaPath:"#/properties/states/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}}}else {const err143 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}}else {const err144 = {instancePath:instancePath+"/states",schemaPath:"#/properties/states/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data.transitions !== undefined){let data61 = data.transitions;if(Array.isArray(data61)){const len4 = data61.length;for(let i2=0; i2<len4; i2++){let data62 = data61[i2];if(data62 && typeof data62 == "object" && !Array.isArray(data62)){if(data62.from === undefined){const err145 = {instancePath:instancePath+"/transitions/" + i2,schemaPath:"#/properties/transitions/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}if(data62.to === undefined){const err146 = {instancePath:instancePath+"/transitions/" + i2,schemaPath:"#/properties/transitions/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}for(const key15 in data62){if(!(func1.call(schema119.properties.transitions.items.properties, key15))){const err147 = {instancePath:instancePath+"/transitions/" + i2,schemaPath:"#/properties/transitions/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}if(data62.id !== undefined){let data63 = data62.id;if(typeof data63 === "string"){if(!pattern4.test(data63)){const err148 = {instancePath:instancePath+"/transitions/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}else {const err149 = {instancePath:instancePath+"/transitions/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}if(data62.from !== undefined){let data64 = data62.from;if(typeof data64 === "string"){if(!pattern4.test(data64)){const err150 = {instancePath:instancePath+"/transitions/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}else {const err151 = {instancePath:instancePath+"/transitions/" + i2+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}if(data62.to !== undefined){let data65 = data62.to;if(typeof data65 === "string"){if(!pattern4.test(data65)){const err152 = {instancePath:instancePath+"/transitions/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}else {const err153 = {instancePath:instancePath+"/transitions/" + i2+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}if(data62.label !== undefined){if(typeof data62.label !== "string"){const err154 = {instancePath:instancePath+"/transitions/" + i2+"/label",schemaPath:"#/properties/transitions/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}if(data62.note !== undefined){if(typeof data62.note !== "string"){const err155 = {instancePath:instancePath+"/transitions/" + i2+"/note",schemaPath:"#/properties/transitions/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}if(data62.variant !== undefined){let data68 = data62.variant;if(!((((data68 === "default") || (data68 === "emphasis")) || (data68 === "security")) || (data68 === "dashed"))){const err156 = {instancePath:instancePath+"/transitions/" + i2+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema50.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}if(data62.route !== undefined){let data69 = data62.route;if(!(((((((data69 === "auto") || (data69 === "straight")) || (data69 === "drop")) || (data69 === "bottom-channel")) || (data69 === "top-channel")) || (data69 === "right-channel")) || (data69 === "left-channel"))){const err157 = {instancePath:instancePath+"/transitions/" + i2+"/route",schemaPath:"#/properties/transitions/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema119.properties.transitions.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}if(data62.fromSide !== undefined){let data70 = data62.fromSide;if(!((((data70 === "left") || (data70 === "right")) || (data70 === "top")) || (data70 === "bottom"))){const err158 = {instancePath:instancePath+"/transitions/" + i2+"/fromSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema63.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}if(data62.toSide !== undefined){let data71 = data62.toSide;if(!((((data71 === "left") || (data71 === "right")) || (data71 === "top")) || (data71 === "bottom"))){const err159 = {instancePath:instancePath+"/transitions/" + i2+"/toSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema63.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}if(data62.channelX !== undefined){let data72 = data62.channelX;if(!((typeof data72 == "number") && (isFinite(data72)))){const err160 = {instancePath:instancePath+"/transitions/" + i2+"/channelX",schemaPath:"#/properties/transitions/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}if(data62.channelY !== undefined){let data73 = data62.channelY;if(!((typeof data73 == "number") && (isFinite(data73)))){const err161 = {instancePath:instancePath+"/transitions/" + i2+"/channelY",schemaPath:"#/properties/transitions/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}}if(data62.cornerRadius !== undefined){let data74 = data62.cornerRadius;if((typeof data74 == "number") && (isFinite(data74))){if(data74 < 0 || isNaN(data74)){const err162 = {instancePath:instancePath+"/transitions/" + i2+"/cornerRadius",schemaPath:"#/properties/transitions/items/properties/cornerRadius/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}else {const err163 = {instancePath:instancePath+"/transitions/" + i2+"/cornerRadius",schemaPath:"#/properties/transitions/items/properties/cornerRadius/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}if(data62.labelAt !== undefined){let data75 = data62.labelAt;if(Array.isArray(data75)){if(data75.length > 2){const err164 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}if(data75.length < 2){const err165 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}const len5 = data75.length;if(len5 > 0){let data76 = data75[0];if(!((typeof data76 == "number") && (isFinite(data76)))){const err166 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}if(len5 > 1){let data77 = data75[1];if(!((typeof data77 == "number") && (isFinite(data77)))){const err167 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}const len6 = data75.length;if(!(len6 <= 2)){const err168 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}else {const err169 = {instancePath:instancePath+"/transitions/" + i2+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}if(data62.labelDx !== undefined){let data78 = data62.labelDx;if(!((typeof data78 == "number") && (isFinite(data78)))){const err170 = {instancePath:instancePath+"/transitions/" + i2+"/labelDx",schemaPath:"#/properties/transitions/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}if(data62.labelDy !== undefined){let data79 = data62.labelDy;if(!((typeof data79 == "number") && (isFinite(data79)))){const err171 = {instancePath:instancePath+"/transitions/" + i2+"/labelDy",schemaPath:"#/properties/transitions/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}if(data62.labelSegment !== undefined){let data80 = data62.labelSegment;if(!(((typeof data80 == "number") && (!(data80 % 1) && !isNaN(data80))) && (isFinite(data80)))){const err172 = {instancePath:instancePath+"/transitions/" + i2+"/labelSegment",schemaPath:"#/properties/transitions/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}if((typeof data80 == "number") && (isFinite(data80))){if(data80 < 0 || isNaN(data80)){const err173 = {instancePath:instancePath+"/transitions/" + i2+"/labelSegment",schemaPath:"#/properties/transitions/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}}if(data62.via !== undefined){let data81 = data62.via;if(Array.isArray(data81)){const len7 = data81.length;for(let i3=0; i3<len7; i3++){let data82 = data81[i3];if(Array.isArray(data82)){if(data82.length > 2){const err174 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}if(data82.length < 2){const err175 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}const len8 = data82.length;if(len8 > 0){let data83 = data82[0];if(!((typeof data83 == "number") && (isFinite(data83)))){const err176 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}if(len8 > 1){let data84 = data82[1];if(!((typeof data84 == "number") && (isFinite(data84)))){const err177 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}const len9 = data82.length;if(!(len9 <= 2)){const err178 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}else {const err179 = {instancePath:instancePath+"/transitions/" + i2+"/via/" + i3,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}}else {const err180 = {instancePath:instancePath+"/transitions/" + i2+"/via",schemaPath:"#/properties/transitions/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(data62.width !== undefined){let data85 = data62.width;if((typeof data85 == "number") && (isFinite(data85))){if(data85 < 0.5 || isNaN(data85)){const err181 = {instancePath:instancePath+"/transitions/" + i2+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}else {const err182 = {instancePath:instancePath+"/transitions/" + i2+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}}else {const err183 = {instancePath:instancePath+"/transitions/" + i2,schemaPath:"#/properties/transitions/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}}else {const err184 = {instancePath:instancePath+"/transitions",schemaPath:"#/properties/transitions/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}if(data.cards !== undefined){let data86 = data.cards;if(Array.isArray(data86)){const len10 = data86.length;for(let i4=0; i4<len10; i4++){let data87 = data86[i4];if(data87 && typeof data87 == "object" && !Array.isArray(data87)){if(data87.dot === undefined){const err185 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}if(data87.title === undefined){const err186 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}if(data87.items === undefined){const err187 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}for(const key16 in data87){if(!(((key16 === "dot") || (key16 === "title")) || (key16 === "items"))){const err188 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}if(data87.dot !== undefined){let data88 = data87.dot;if(!(((((((data88 === "cyan") || (data88 === "emerald")) || (data88 === "violet")) || (data88 === "amber")) || (data88 === "rose")) || (data88 === "orange")) || (data88 === "slate"))){const err189 = {instancePath:instancePath+"/cards/" + i4+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema68.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}if(data87.title !== undefined){let data89 = data87.title;if(typeof data89 === "string"){if(func3(data89) < 1){const err190 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}else {const err191 = {instancePath:instancePath+"/cards/" + i4+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}if(data87.items !== undefined){let data90 = data87.items;if(Array.isArray(data90)){const len11 = data90.length;for(let i5=0; i5<len11; i5++){if(typeof data90[i5] !== "string"){const err192 = {instancePath:instancePath+"/cards/" + i4+"/items/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}}else {const err193 = {instancePath:instancePath+"/cards/" + i4+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}}else {const err194 = {instancePath:instancePath+"/cards/" + i4,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}}else {const err195 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}}else {const err196 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}validate30.errors = vErrors;return errors === 0;}validate30.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};export const architecture = validate33;const schema150 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/architecture.schema.json","title":"Archify Architecture Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","components"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"architecture"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"type":"string"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"engineering_profile":{"enum":["deployment-ownership"]},"repository":{"type":"object","additionalProperties":false,"required":["url","revision"],"properties":{"url":{"type":"string","pattern":"^https://github\\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+(?:\\.git)?/?$"},"revision":{"type":"string","pattern":"^[a-fA-F0-9]{40}$"}}},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"frontend":{"$ref":"common.schema.json#/$defs/legendEntry"},"backend":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"},"cloud":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"messagebus":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":320},{"type":"number","minimum":240}],"items":false,"minItems":2,"maxItems":2}}},"layout":{"type":"object","additionalProperties":false,"required":["mode"],"properties":{"mode":{"enum":["grid"]},"origin":{"$ref":"common.schema.json#/$defs/point"},"cols":{"type":"integer","minimum":1,"maximum":12},"gapX":{"type":"number","minimum":0},"gapY":{"type":"number","minimum":0},"cellW":{"type":"number","minimum":40},"cellH":{"type":"number","minimum":24}}},"components":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","additionalProperties":false,"required":["path"],"properties":{"path":{"type":"string","minLength":1,"maxLength":240},"line":{"type":"integer","minimum":1},"end_line":{"type":"integer","minimum":1},"label":{"type":"string","minLength":1,"maxLength":48}}}},"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0},"pos":{"$ref":"common.schema.json#/$defs/point"},"size":{"type":"array","prefixItems":[{"type":"number","exclusiveMinimum":0},{"type":"number","exclusiveMinimum":0}],"items":false,"minItems":2,"maxItems":2}}}},"boundaries":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","label","wraps"],"properties":{"kind":{"enum":["region","security-group"]},"label":{"type":"string","minLength":1},"wraps":{"type":"array","minItems":1,"items":{"$ref":"common.schema.json#/$defs/id"}},"pad":{"type":"number","minimum":0}}}},"connections":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"fromSide":{"$ref":"common.schema.json#/$defs/side"},"toSide":{"$ref":"common.schema.json#/$defs/side"},"route":{"enum":["auto","straight","orthogonal-h","orthogonal-v"]},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"width":{"$ref":"common.schema.json#/$defs/relationshipWidth"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};const pattern53 = new RegExp("^https://github\\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+(?:\\.git)?/?$", "u");const pattern54 = new RegExp("^[a-fA-F0-9]{40}$", "u");function validate34(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate34.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern4.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate34.errors = vErrors;return errors === 0;}validate34.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate33(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/architecture.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate33.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.components === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "components"},message:"must have required property '"+"components"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!((((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "layout")) || (key0 === "components")) || (key0 === "boundaries")) || (key0 === "connections")) || (key0 === "cards"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err5 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.diagram_type !== undefined){if("architecture" !== data.diagram_type){const err6 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "architecture"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err7 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}for(const key1 in data2){if(!(func1.call(schema150.properties.meta.properties, key1))){const err8 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err9 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!((data4 === "en") || (data4 === "zh-CN"))){const err11 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err12 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.output !== undefined){if(typeof data2.output !== "string"){const err13 = {instancePath:instancePath+"/meta/output",schemaPath:"#/properties/meta/properties/output/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err14 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema34.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err15 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema35.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err16 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema36.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data2.engineering_profile !== undefined){if(!(data2.engineering_profile === "deployment-ownership")){const err17 = {instancePath:instancePath+"/meta/engineering_profile",schemaPath:"#/properties/meta/properties/engineering_profile/enum",keyword:"enum",params:{allowedValues: schema150.properties.meta.properties.engineering_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data2.repository !== undefined){let data11 = data2.repository;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){if(data11.url === undefined){const err18 = {instancePath:instancePath+"/meta/repository",schemaPath:"#/properties/meta/properties/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(data11.revision === undefined){const err19 = {instancePath:instancePath+"/meta/repository",schemaPath:"#/properties/meta/properties/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}for(const key2 in data11){if(!((key2 === "url") || (key2 === "revision"))){const err20 = {instancePath:instancePath+"/meta/repository",schemaPath:"#/properties/meta/properties/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data11.url !== undefined){let data12 = data11.url;if(typeof data12 === "string"){if(!pattern53.test(data12)){const err21 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"#/properties/meta/properties/repository/properties/url/pattern",keyword:"pattern",params:{pattern: "^https://github\\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+(?:\\.git)?/?$"},message:"must match pattern \""+"^https://github\\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+(?:\\.git)?/?$"+"\""};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"#/properties/meta/properties/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data11.revision !== undefined){let data13 = data11.revision;if(typeof data13 === "string"){if(!pattern54.test(data13)){const err23 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"#/properties/meta/properties/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"#/properties/meta/properties/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}else {const err25 = {instancePath:instancePath+"/meta/repository",schemaPath:"#/properties/meta/properties/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data2.views !== undefined){if(!(validate34(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data15 = data2.legend;if(data15 && typeof data15 == "object" && !Array.isArray(data15)){for(const key3 in data15){if(!((key3 === "mode") || (key3 === "entries"))){const err26 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data15.mode !== undefined){let data16 = data15.mode;if(!(((data16 === "auto") || (data16 === "all")) || (data16 === "hidden"))){const err27 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema40.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data15.entries !== undefined){let data17 = data15.entries;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){for(const key4 in data17){if(!(((((((key4 === "frontend") || (key4 === "backend")) || (key4 === "database")) || (key4 === "cloud")) || (key4 === "security")) || (key4 === "messagebus")) || (key4 === "external"))){const err28 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data17.frontend !== undefined){let data18 = data17.frontend;if(data18 && typeof data18 == "object" && !Array.isArray(data18)){if(Object.keys(data18).length < 1){const err29 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}for(const key5 in data18){if(!((key5 === "label") || (key5 === "visible"))){const err30 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data18.label !== undefined){let data19 = data18.label;if(typeof data19 === "string"){if(func3(data19) > 80){const err31 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func3(data19) < 1){const err32 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data18.visible !== undefined){if(typeof data18.visible !== "boolean"){const err34 = {instancePath:instancePath+"/meta/legend/entries/frontend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}}else {const err35 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data17.backend !== undefined){let data21 = data17.backend;if(data21 && typeof data21 == "object" && !Array.isArray(data21)){if(Object.keys(data21).length < 1){const err36 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key6 in data21){if(!((key6 === "label") || (key6 === "visible"))){const err37 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data21.label !== undefined){let data22 = data21.label;if(typeof data22 === "string"){if(func3(data22) > 80){const err38 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(func3(data22) < 1){const err39 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data21.visible !== undefined){if(typeof data21.visible !== "boolean"){const err41 = {instancePath:instancePath+"/meta/legend/entries/backend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data17.database !== undefined){let data24 = data17.database;if(data24 && typeof data24 == "object" && !Array.isArray(data24)){if(Object.keys(data24).length < 1){const err43 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}for(const key7 in data24){if(!((key7 === "label") || (key7 === "visible"))){const err44 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data24.label !== undefined){let data25 = data24.label;if(typeof data25 === "string"){if(func3(data25) > 80){const err45 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data25) < 1){const err46 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data24.visible !== undefined){if(typeof data24.visible !== "boolean"){const err48 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data17.cloud !== undefined){let data27 = data17.cloud;if(data27 && typeof data27 == "object" && !Array.isArray(data27)){if(Object.keys(data27).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key8 in data27){if(!((key8 === "label") || (key8 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data27.label !== undefined){let data28 = data27.label;if(typeof data28 === "string"){if(func3(data28) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data28) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data27.visible !== undefined){if(typeof data27.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/cloud/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data17.security !== undefined){let data30 = data17.security;if(data30 && typeof data30 == "object" && !Array.isArray(data30)){if(Object.keys(data30).length < 1){const err57 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}for(const key9 in data30){if(!((key9 === "label") || (key9 === "visible"))){const err58 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data30.label !== undefined){let data31 = data30.label;if(typeof data31 === "string"){if(func3(data31) > 80){const err59 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(func3(data31) < 1){const err60 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data30.visible !== undefined){if(typeof data30.visible !== "boolean"){const err62 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}}else {const err63 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data17.messagebus !== undefined){let data33 = data17.messagebus;if(data33 && typeof data33 == "object" && !Array.isArray(data33)){if(Object.keys(data33).length < 1){const err64 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key10 in data33){if(!((key10 === "label") || (key10 === "visible"))){const err65 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data33.label !== undefined){let data34 = data33.label;if(typeof data34 === "string"){if(func3(data34) > 80){const err66 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if(func3(data34) < 1){const err67 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data33.visible !== undefined){if(typeof data33.visible !== "boolean"){const err69 = {instancePath:instancePath+"/meta/legend/entries/messagebus/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}}else {const err70 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data17.external !== undefined){let data36 = data17.external;if(data36 && typeof data36 == "object" && !Array.isArray(data36)){if(Object.keys(data36).length < 1){const err71 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}for(const key11 in data36){if(!((key11 === "label") || (key11 === "visible"))){const err72 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data36.label !== undefined){let data37 = data36.label;if(typeof data37 === "string"){if(func3(data37) > 80){const err73 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(func3(data37) < 1){const err74 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}else {const err75 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data36.visible !== undefined){if(typeof data36.visible !== "boolean"){const err76 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}}else {const err78 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}}else {const err79 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}if(data2.viewBox !== undefined){let data39 = data2.viewBox;if(Array.isArray(data39)){if(data39.length > 2){const err80 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}if(data39.length < 2){const err81 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}const len0 = data39.length;if(len0 > 0){let data40 = data39[0];if((typeof data40 == "number") && (isFinite(data40))){if(data40 < 320 || isNaN(data40)){const err82 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 320},message:"must be >= 320"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}else {const err83 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}if(len0 > 1){let data41 = data39[1];if((typeof data41 == "number") && (isFinite(data41))){if(data41 < 240 || isNaN(data41)){const err84 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 240},message:"must be >= 240"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}else {const err85 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}const len1 = data39.length;if(!(len1 <= 2)){const err86 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}else {const err87 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}}else {const err88 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data.layout !== undefined){let data42 = data.layout;if(data42 && typeof data42 == "object" && !Array.isArray(data42)){if(data42.mode === undefined){const err89 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/required",keyword:"required",params:{missingProperty: "mode"},message:"must have required property '"+"mode"+"'"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}for(const key12 in data42){if(!(((((((key12 === "mode") || (key12 === "origin")) || (key12 === "cols")) || (key12 === "gapX")) || (key12 === "gapY")) || (key12 === "cellW")) || (key12 === "cellH"))){const err90 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}if(data42.mode !== undefined){if(!(data42.mode === "grid")){const err91 = {instancePath:instancePath+"/layout/mode",schemaPath:"#/properties/layout/properties/mode/enum",keyword:"enum",params:{allowedValues: schema150.properties.layout.properties.mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}if(data42.origin !== undefined){let data44 = data42.origin;if(Array.isArray(data44)){if(data44.length > 2){const err92 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}if(data44.length < 2){const err93 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}const len2 = data44.length;if(len2 > 0){let data45 = data44[0];if(!((typeof data45 == "number") && (isFinite(data45)))){const err94 = {instancePath:instancePath+"/layout/origin/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(len2 > 1){let data46 = data44[1];if(!((typeof data46 == "number") && (isFinite(data46)))){const err95 = {instancePath:instancePath+"/layout/origin/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}const len3 = data44.length;if(!(len3 <= 2)){const err96 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}else {const err97 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}if(data42.cols !== undefined){let data47 = data42.cols;if(!(((typeof data47 == "number") && (!(data47 % 1) && !isNaN(data47))) && (isFinite(data47)))){const err98 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}if((typeof data47 == "number") && (isFinite(data47))){if(data47 > 12 || isNaN(data47)){const err99 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/maximum",keyword:"maximum",params:{comparison: "<=", limit: 12},message:"must be <= 12"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}if(data47 < 1 || isNaN(data47)){const err100 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}}if(data42.gapX !== undefined){let data48 = data42.gapX;if((typeof data48 == "number") && (isFinite(data48))){if(data48 < 0 || isNaN(data48)){const err101 = {instancePath:instancePath+"/layout/gapX",schemaPath:"#/properties/layout/properties/gapX/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}else {const err102 = {instancePath:instancePath+"/layout/gapX",schemaPath:"#/properties/layout/properties/gapX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(data42.gapY !== undefined){let data49 = data42.gapY;if((typeof data49 == "number") && (isFinite(data49))){if(data49 < 0 || isNaN(data49)){const err103 = {instancePath:instancePath+"/layout/gapY",schemaPath:"#/properties/layout/properties/gapY/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}else {const err104 = {instancePath:instancePath+"/layout/gapY",schemaPath:"#/properties/layout/properties/gapY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}if(data42.cellW !== undefined){let data50 = data42.cellW;if((typeof data50 == "number") && (isFinite(data50))){if(data50 < 40 || isNaN(data50)){const err105 = {instancePath:instancePath+"/layout/cellW",schemaPath:"#/properties/layout/properties/cellW/minimum",keyword:"minimum",params:{comparison: ">=", limit: 40},message:"must be >= 40"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}else {const err106 = {instancePath:instancePath+"/layout/cellW",schemaPath:"#/properties/layout/properties/cellW/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}if(data42.cellH !== undefined){let data51 = data42.cellH;if((typeof data51 == "number") && (isFinite(data51))){if(data51 < 24 || isNaN(data51)){const err107 = {instancePath:instancePath+"/layout/cellH",schemaPath:"#/properties/layout/properties/cellH/minimum",keyword:"minimum",params:{comparison: ">=", limit: 24},message:"must be >= 24"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}else {const err108 = {instancePath:instancePath+"/layout/cellH",schemaPath:"#/properties/layout/properties/cellH/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}}else {const err109 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}if(data.components !== undefined){let data52 = data.components;if(Array.isArray(data52)){if(data52.length < 1){const err110 = {instancePath:instancePath+"/components",schemaPath:"#/properties/components/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}const len4 = data52.length;for(let i0=0; i0<len4; i0++){let data53 = data52[i0];if(data53 && typeof data53 == "object" && !Array.isArray(data53)){if(data53.id === undefined){const err111 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(data53.type === undefined){const err112 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}if(data53.label === undefined){const err113 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}for(const key13 in data53){if(!(func1.call(schema150.properties.components.items.properties, key13))){const err114 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}if(data53.id !== undefined){let data54 = data53.id;if(typeof data54 === "string"){if(!pattern4.test(data54)){const err115 = {instancePath:instancePath+"/components/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}else {const err116 = {instancePath:instancePath+"/components/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data53.type !== undefined){let data55 = data53.type;if(!(((((((data55 === "frontend") || (data55 === "backend")) || (data55 === "database")) || (data55 === "cloud")) || (data55 === "security")) || (data55 === "messagebus")) || (data55 === "external"))){const err117 = {instancePath:instancePath+"/components/" + i0+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema57.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}if(data53.label !== undefined){let data56 = data53.label;if(typeof data56 === "string"){if(func3(data56) < 1){const err118 = {instancePath:instancePath+"/components/" + i0+"/label",schemaPath:"#/properties/components/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}else {const err119 = {instancePath:instancePath+"/components/" + i0+"/label",schemaPath:"#/properties/components/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}if(data53.sublabel !== undefined){if(typeof data53.sublabel !== "string"){const err120 = {instancePath:instancePath+"/components/" + i0+"/sublabel",schemaPath:"#/properties/components/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data53.tag !== undefined){if(typeof data53.tag !== "string"){const err121 = {instancePath:instancePath+"/components/" + i0+"/tag",schemaPath:"#/properties/components/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}if(data53.brand !== undefined){let data59 = data53.brand;const _errs139 = errors;let valid34 = false;let passing0 = null;const _errs140 = errors;const _errs142 = errors;let valid35 = false;const _errs143 = errors;if(typeof data59 === "string"){if(func3(data59) > 80){const err122 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}if(!pattern13.test(data59)){const err123 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}var _valid1 = _errs143 === errors;valid35 = valid35 || _valid1;const _errs144 = errors;if(typeof data59 === "string"){if(!pattern14.test(data59)){const err124 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}var _valid1 = _errs144 === errors;valid35 = valid35 || _valid1;if(!valid35){const err125 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}else {errors = _errs142;if(vErrors !== null){if(_errs142){vErrors.length = _errs142;}else {vErrors = null;}}}if(typeof data59 === "string"){if(func3(data59) > 2048){const err126 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}if(func3(data59) < 1){const err127 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}else {const err128 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}var _valid0 = _errs140 === errors;if(_valid0){valid34 = true;passing0 = 0;}const _errs145 = errors;if(data59 && typeof data59 == "object" && !Array.isArray(data59)){if(data59.url === undefined){const err129 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if(data59.sha256 === undefined){const err130 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}for(const key14 in data59){if(!((key14 === "url") || (key14 === "sha256"))){const err131 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}if(data59.url !== undefined){let data60 = data59.url;if(typeof data60 === "string"){if(func3(data60) > 2048){const err132 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}if(func3(data60) < 8){const err133 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}if(!pattern14.test(data60)){const err134 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}else {const err135 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}if(data59.sha256 !== undefined){let data61 = data59.sha256;if(typeof data61 === "string"){if(!pattern16.test(data61)){const err136 = {instancePath:instancePath+"/components/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}else {const err137 = {instancePath:instancePath+"/components/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}}else {const err138 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}var _valid0 = _errs145 === errors;if(_valid0 && valid34){valid34 = false;passing0 = [passing0, 1];}else {if(_valid0){valid34 = true;passing0 = 1;}}if(!valid34){const err139 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}else {errors = _errs139;if(vErrors !== null){if(_errs139){vErrors.length = _errs139;}else {vErrors = null;}}}}if(data53.sources !== undefined){let data62 = data53.sources;if(Array.isArray(data62)){if(data62.length > 3){const err140 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"#/properties/components/items/properties/sources/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}if(data62.length < 1){const err141 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"#/properties/components/items/properties/sources/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}const len5 = data62.length;for(let i1=0; i1<len5; i1++){let data63 = data62[i1];if(data63 && typeof data63 == "object" && !Array.isArray(data63)){if(data63.path === undefined){const err142 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"#/properties/components/items/properties/sources/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}for(const key15 in data63){if(!((((key15 === "path") || (key15 === "line")) || (key15 === "end_line")) || (key15 === "label"))){const err143 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"#/properties/components/items/properties/sources/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}if(data63.path !== undefined){let data64 = data63.path;if(typeof data64 === "string"){if(func3(data64) > 240){const err144 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"#/properties/components/items/properties/sources/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}if(func3(data64) < 1){const err145 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"#/properties/components/items/properties/sources/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}else {const err146 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"#/properties/components/items/properties/sources/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}if(data63.line !== undefined){let data65 = data63.line;if(!(((typeof data65 == "number") && (!(data65 % 1) && !isNaN(data65))) && (isFinite(data65)))){const err147 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/line",schemaPath:"#/properties/components/items/properties/sources/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}if((typeof data65 == "number") && (isFinite(data65))){if(data65 < 1 || isNaN(data65)){const err148 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/line",schemaPath:"#/properties/components/items/properties/sources/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}}if(data63.end_line !== undefined){let data66 = data63.end_line;if(!(((typeof data66 == "number") && (!(data66 % 1) && !isNaN(data66))) && (isFinite(data66)))){const err149 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/end_line",schemaPath:"#/properties/components/items/properties/sources/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}if((typeof data66 == "number") && (isFinite(data66))){if(data66 < 1 || isNaN(data66)){const err150 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/end_line",schemaPath:"#/properties/components/items/properties/sources/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}}if(data63.label !== undefined){let data67 = data63.label;if(typeof data67 === "string"){if(func3(data67) > 48){const err151 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"#/properties/components/items/properties/sources/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}if(func3(data67) < 1){const err152 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"#/properties/components/items/properties/sources/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}else {const err153 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"#/properties/components/items/properties/sources/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}}else {const err154 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"#/properties/components/items/properties/sources/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}}else {const err155 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"#/properties/components/items/properties/sources/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}if(data53.row !== undefined){let data68 = data53.row;if(!(((typeof data68 == "number") && (!(data68 % 1) && !isNaN(data68))) && (isFinite(data68)))){const err156 = {instancePath:instancePath+"/components/" + i0+"/row",schemaPath:"#/properties/components/items/properties/row/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}if((typeof data68 == "number") && (isFinite(data68))){if(data68 < 0 || isNaN(data68)){const err157 = {instancePath:instancePath+"/components/" + i0+"/row",schemaPath:"#/properties/components/items/properties/row/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}}if(data53.col !== undefined){let data69 = data53.col;if(!(((typeof data69 == "number") && (!(data69 % 1) && !isNaN(data69))) && (isFinite(data69)))){const err158 = {instancePath:instancePath+"/components/" + i0+"/col",schemaPath:"#/properties/components/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}if((typeof data69 == "number") && (isFinite(data69))){if(data69 < 0 || isNaN(data69)){const err159 = {instancePath:instancePath+"/components/" + i0+"/col",schemaPath:"#/properties/components/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}}if(data53.pos !== undefined){let data70 = data53.pos;if(Array.isArray(data70)){if(data70.length > 2){const err160 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}if(data70.length < 2){const err161 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}const len6 = data70.length;if(len6 > 0){let data71 = data70[0];if(!((typeof data71 == "number") && (isFinite(data71)))){const err162 = {instancePath:instancePath+"/components/" + i0+"/pos/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}if(len6 > 1){let data72 = data70[1];if(!((typeof data72 == "number") && (isFinite(data72)))){const err163 = {instancePath:instancePath+"/components/" + i0+"/pos/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}const len7 = data70.length;if(!(len7 <= 2)){const err164 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}else {const err165 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data53.size !== undefined){let data73 = data53.size;if(Array.isArray(data73)){if(data73.length > 2){const err166 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}if(data73.length < 2){const err167 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}const len8 = data73.length;if(len8 > 0){let data74 = data73[0];if((typeof data74 == "number") && (isFinite(data74))){if(data74 <= 0 || isNaN(data74)){const err168 = {instancePath:instancePath+"/components/" + i0+"/size/0",schemaPath:"#/properties/components/items/properties/size/prefixItems/0/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}else {const err169 = {instancePath:instancePath+"/components/" + i0+"/size/0",schemaPath:"#/properties/components/items/properties/size/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}if(len8 > 1){let data75 = data73[1];if((typeof data75 == "number") && (isFinite(data75))){if(data75 <= 0 || isNaN(data75)){const err170 = {instancePath:instancePath+"/components/" + i0+"/size/1",schemaPath:"#/properties/components/items/properties/size/prefixItems/1/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}else {const err171 = {instancePath:instancePath+"/components/" + i0+"/size/1",schemaPath:"#/properties/components/items/properties/size/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}const len9 = data73.length;if(!(len9 <= 2)){const err172 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}else {const err173 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}}else {const err174 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}}else {const err175 = {instancePath:instancePath+"/components",schemaPath:"#/properties/components/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}}if(data.boundaries !== undefined){let data76 = data.boundaries;if(Array.isArray(data76)){const len10 = data76.length;for(let i2=0; i2<len10; i2++){let data77 = data76[i2];if(data77 && typeof data77 == "object" && !Array.isArray(data77)){if(data77.kind === undefined){const err176 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}if(data77.label === undefined){const err177 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}if(data77.wraps === undefined){const err178 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "wraps"},message:"must have required property '"+"wraps"+"'"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}for(const key16 in data77){if(!((((key16 === "kind") || (key16 === "label")) || (key16 === "wraps")) || (key16 === "pad"))){const err179 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(data77.kind !== undefined){let data78 = data77.kind;if(!((data78 === "region") || (data78 === "security-group"))){const err180 = {instancePath:instancePath+"/boundaries/" + i2+"/kind",schemaPath:"#/properties/boundaries/items/properties/kind/enum",keyword:"enum",params:{allowedValues: schema150.properties.boundaries.items.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(data77.label !== undefined){let data79 = data77.label;if(typeof data79 === "string"){if(func3(data79) < 1){const err181 = {instancePath:instancePath+"/boundaries/" + i2+"/label",schemaPath:"#/properties/boundaries/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}else {const err182 = {instancePath:instancePath+"/boundaries/" + i2+"/label",schemaPath:"#/properties/boundaries/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data77.wraps !== undefined){let data80 = data77.wraps;if(Array.isArray(data80)){if(data80.length < 1){const err183 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps",schemaPath:"#/properties/boundaries/items/properties/wraps/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}const len11 = data80.length;for(let i3=0; i3<len11; i3++){let data81 = data80[i3];if(typeof data81 === "string"){if(!pattern4.test(data81)){const err184 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps/" + i3,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}else {const err185 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps/" + i3,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}}else {const err186 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps",schemaPath:"#/properties/boundaries/items/properties/wraps/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}if(data77.pad !== undefined){let data82 = data77.pad;if((typeof data82 == "number") && (isFinite(data82))){if(data82 < 0 || isNaN(data82)){const err187 = {instancePath:instancePath+"/boundaries/" + i2+"/pad",schemaPath:"#/properties/boundaries/items/properties/pad/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}else {const err188 = {instancePath:instancePath+"/boundaries/" + i2+"/pad",schemaPath:"#/properties/boundaries/items/properties/pad/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}}else {const err189 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}}else {const err190 = {instancePath:instancePath+"/boundaries",schemaPath:"#/properties/boundaries/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}if(data.connections !== undefined){let data83 = data.connections;if(Array.isArray(data83)){const len12 = data83.length;for(let i4=0; i4<len12; i4++){let data84 = data83[i4];if(data84 && typeof data84 == "object" && !Array.isArray(data84)){if(data84.from === undefined){const err191 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}if(data84.to === undefined){const err192 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}for(const key17 in data84){if(!(func1.call(schema150.properties.connections.items.properties, key17))){const err193 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key17},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}if(data84.id !== undefined){let data85 = data84.id;if(typeof data85 === "string"){if(!pattern4.test(data85)){const err194 = {instancePath:instancePath+"/connections/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}else {const err195 = {instancePath:instancePath+"/connections/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}if(data84.from !== undefined){let data86 = data84.from;if(typeof data86 === "string"){if(!pattern4.test(data86)){const err196 = {instancePath:instancePath+"/connections/" + i4+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}}else {const err197 = {instancePath:instancePath+"/connections/" + i4+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}}if(data84.to !== undefined){let data87 = data84.to;if(typeof data87 === "string"){if(!pattern4.test(data87)){const err198 = {instancePath:instancePath+"/connections/" + i4+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}}else {const err199 = {instancePath:instancePath+"/connections/" + i4+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}if(data84.label !== undefined){if(typeof data84.label !== "string"){const err200 = {instancePath:instancePath+"/connections/" + i4+"/label",schemaPath:"#/properties/connections/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}if(data84.variant !== undefined){let data89 = data84.variant;if(!((((data89 === "default") || (data89 === "emphasis")) || (data89 === "security")) || (data89 === "dashed"))){const err201 = {instancePath:instancePath+"/connections/" + i4+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema50.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}if(data84.fromSide !== undefined){let data90 = data84.fromSide;if(!((((data90 === "left") || (data90 === "right")) || (data90 === "top")) || (data90 === "bottom"))){const err202 = {instancePath:instancePath+"/connections/" + i4+"/fromSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema63.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}if(data84.toSide !== undefined){let data91 = data84.toSide;if(!((((data91 === "left") || (data91 === "right")) || (data91 === "top")) || (data91 === "bottom"))){const err203 = {instancePath:instancePath+"/connections/" + i4+"/toSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema63.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}}if(data84.route !== undefined){let data92 = data84.route;if(!((((data92 === "auto") || (data92 === "straight")) || (data92 === "orthogonal-h")) || (data92 === "orthogonal-v"))){const err204 = {instancePath:instancePath+"/connections/" + i4+"/route",schemaPath:"#/properties/connections/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema150.properties.connections.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}}if(data84.via !== undefined){let data93 = data84.via;if(Array.isArray(data93)){const len13 = data93.length;for(let i5=0; i5<len13; i5++){let data94 = data93[i5];if(Array.isArray(data94)){if(data94.length > 2){const err205 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}if(data94.length < 2){const err206 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}const len14 = data94.length;if(len14 > 0){let data95 = data94[0];if(!((typeof data95 == "number") && (isFinite(data95)))){const err207 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}if(len14 > 1){let data96 = data94[1];if(!((typeof data96 == "number") && (isFinite(data96)))){const err208 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}const len15 = data94.length;if(!(len15 <= 2)){const err209 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}}else {const err210 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}}}else {const err211 = {instancePath:instancePath+"/connections/" + i4+"/via",schemaPath:"#/properties/connections/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}}if(data84.labelAt !== undefined){let data97 = data84.labelAt;if(Array.isArray(data97)){if(data97.length > 2){const err212 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}if(data97.length < 2){const err213 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}const len16 = data97.length;if(len16 > 0){let data98 = data97[0];if(!((typeof data98 == "number") && (isFinite(data98)))){const err214 = {instancePath:instancePath+"/connections/" + i4+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}}if(len16 > 1){let data99 = data97[1];if(!((typeof data99 == "number") && (isFinite(data99)))){const err215 = {instancePath:instancePath+"/connections/" + i4+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}}const len17 = data97.length;if(!(len17 <= 2)){const err216 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err216];}else {vErrors.push(err216);}errors++;}}else {const err217 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err217];}else {vErrors.push(err217);}errors++;}}if(data84.labelDx !== undefined){let data100 = data84.labelDx;if(!((typeof data100 == "number") && (isFinite(data100)))){const err218 = {instancePath:instancePath+"/connections/" + i4+"/labelDx",schemaPath:"#/properties/connections/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err218];}else {vErrors.push(err218);}errors++;}}if(data84.labelDy !== undefined){let data101 = data84.labelDy;if(!((typeof data101 == "number") && (isFinite(data101)))){const err219 = {instancePath:instancePath+"/connections/" + i4+"/labelDy",schemaPath:"#/properties/connections/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err219];}else {vErrors.push(err219);}errors++;}}if(data84.labelSegment !== undefined){let data102 = data84.labelSegment;if(!(((typeof data102 == "number") && (!(data102 % 1) && !isNaN(data102))) && (isFinite(data102)))){const err220 = {instancePath:instancePath+"/connections/" + i4+"/labelSegment",schemaPath:"#/properties/connections/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err220];}else {vErrors.push(err220);}errors++;}if((typeof data102 == "number") && (isFinite(data102))){if(data102 < 0 || isNaN(data102)){const err221 = {instancePath:instancePath+"/connections/" + i4+"/labelSegment",schemaPath:"#/properties/connections/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err221];}else {vErrors.push(err221);}errors++;}}}if(data84.width !== undefined){let data103 = data84.width;if((typeof data103 == "number") && (isFinite(data103))){if(data103 < 0.5 || isNaN(data103)){const err222 = {instancePath:instancePath+"/connections/" + i4+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err222];}else {vErrors.push(err222);}errors++;}}else {const err223 = {instancePath:instancePath+"/connections/" + i4+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err223];}else {vErrors.push(err223);}errors++;}}}else {const err224 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err224];}else {vErrors.push(err224);}errors++;}}}else {const err225 = {instancePath:instancePath+"/connections",schemaPath:"#/properties/connections/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err225];}else {vErrors.push(err225);}errors++;}}if(data.cards !== undefined){let data104 = data.cards;if(Array.isArray(data104)){const len18 = data104.length;for(let i6=0; i6<len18; i6++){let data105 = data104[i6];if(data105 && typeof data105 == "object" && !Array.isArray(data105)){if(data105.dot === undefined){const err226 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err226];}else {vErrors.push(err226);}errors++;}if(data105.title === undefined){const err227 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err227];}else {vErrors.push(err227);}errors++;}if(data105.items === undefined){const err228 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err228];}else {vErrors.push(err228);}errors++;}for(const key18 in data105){if(!(((key18 === "dot") || (key18 === "title")) || (key18 === "items"))){const err229 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key18},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err229];}else {vErrors.push(err229);}errors++;}}if(data105.dot !== undefined){let data106 = data105.dot;if(!(((((((data106 === "cyan") || (data106 === "emerald")) || (data106 === "violet")) || (data106 === "amber")) || (data106 === "rose")) || (data106 === "orange")) || (data106 === "slate"))){const err230 = {instancePath:instancePath+"/cards/" + i6+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema68.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err230];}else {vErrors.push(err230);}errors++;}}if(data105.title !== undefined){let data107 = data105.title;if(typeof data107 === "string"){if(func3(data107) < 1){const err231 = {instancePath:instancePath+"/cards/" + i6+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err231];}else {vErrors.push(err231);}errors++;}}else {const err232 = {instancePath:instancePath+"/cards/" + i6+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err232];}else {vErrors.push(err232);}errors++;}}if(data105.items !== undefined){let data108 = data105.items;if(Array.isArray(data108)){const len19 = data108.length;for(let i7=0; i7<len19; i7++){if(typeof data108[i7] !== "string"){const err233 = {instancePath:instancePath+"/cards/" + i6+"/items/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err233];}else {vErrors.push(err233);}errors++;}}}else {const err234 = {instancePath:instancePath+"/cards/" + i6+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err234];}else {vErrors.push(err234);}errors++;}}}else {const err235 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err235];}else {vErrors.push(err235);}errors++;}}}else {const err236 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err236];}else {vErrors.push(err236);}errors++;}}}else {const err237 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err237];}else {vErrors.push(err237);}errors++;}validate33.errors = vErrors;return errors === 0;}validate33.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};diff --git a/archify/renderers/workflow/render-workflow.mjs b/archify/renderers/workflow/render-workflow.mjsindex 994173d2..fb3cf70c 100644--- a/archify/renderers/workflow/render-workflow.mjs+++ b/archify/renderers/workflow/render-workflow.mjs@@ -157,42 +157,6 @@ function nodeStep(node) {function validateWorkflow() {const problems = [];- if (workflow.schema_version !== 1) {- problems.push('Workflow files must set "schema_version": 1.');- }- if (workflow.diagram_type !== 'workflow') {- problems.push(`Unsupported diagram_type "${workflow.diagram_type}". Expected "workflow".`);- }- if (!workflow.meta || !workflow.meta.title) {- problems.push('Workflow files must include meta.title.');- }- if (!Array.isArray(workflow.lanes) || !workflow.lanes.length) {- problems.push('Workflow files must include at least one lane.');- }- if (!Array.isArray(workflow.nodes)) {- problems.push('Workflow files must include a nodes array.');- }- if (!Array.isArray(workflow.edges)) {- problems.push('Workflow files must include an edges array.');- }- if (workflow.phases !== undefined && !Array.isArray(workflow.phases)) {- problems.push('Workflow "phases" must be an array.');- }- if (workflow.groups !== undefined && !Array.isArray(workflow.groups)) {- problems.push('Workflow "groups" must be an array.');- }- if (workflow.mainPath !== undefined && !Array.isArray(workflow.mainPath)) {- problems.push('Workflow "mainPath" must be an array of node ids.');- }- if (workflow.cards !== undefined && !Array.isArray(workflow.cards)) {- problems.push('Workflow "cards" must be an array.');- }- if (problems.length) {- throwDiagnosticProblems('Workflow layout validation failed', problems, {- subject: { diagramType: 'workflow' },- });- }-const laneIds = new Set(workflow.lanes.map((lane) => lane.id));if (laneIds.size !== workflow.lanes.length) {problems.push('Lane ids must be unique.');@@ -708,7 +672,7 @@ function renderLegend() {}function renderSvg() {- return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(workflow.meta, 'workflow diagram')}>+ return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(workflow.meta)}>${svgAccessibleText(workflow.meta, 'workflow')}${renderDefinitions()}diff --git a/archify/schemas/architecture.schema.json b/archify/schemas/architecture.schema.jsonindex fa995492..b4cc68cd 100644--- a/archify/schemas/architecture.schema.json+++ b/archify/schemas/architecture.schema.json@@ -17,9 +17,9 @@"locale": { "$ref": "common.schema.json#/$defs/locale" },"subtitle": { "type": "string" },"output": { "type": "string" },- "animation": { "enum": ["trace", "none"] },- "visual_preset": { "enum": ["classic", "signal-flow", "blueprint", "editorial"] },- "quality_profile": { "enum": ["standard", "showcase"] },+ "animation": { "$ref": "common.schema.json#/$defs/animation" },+ "visual_preset": { "$ref": "common.schema.json#/$defs/visualPreset" },+ "quality_profile": { "$ref": "common.schema.json#/$defs/qualityProfile" },"engineering_profile": { "enum": ["deployment-ownership"] },"repository": {"type": "object",@@ -156,8 +156,8 @@"to": { "$ref": "common.schema.json#/$defs/id" },"label": { "type": "string" },"variant": { "$ref": "common.schema.json#/$defs/variant" },- "fromSide": { "enum": ["left", "right", "top", "bottom"] },- "toSide": { "enum": ["left", "right", "top", "bottom"] },+ "fromSide": { "$ref": "common.schema.json#/$defs/side" },+ "toSide": { "$ref": "common.schema.json#/$defs/side" },"route": { "enum": ["auto", "straight", "orthogonal-h", "orthogonal-v"] },"via": {"type": "array",@@ -167,7 +167,7 @@"labelDx": { "type": "number" },"labelDy": { "type": "number" },"labelSegment": { "type": "integer", "minimum": 0 },- "width": { "type": "number", "minimum": 0.5 }+ "width": { "$ref": "common.schema.json#/$defs/relationshipWidth" }}}},diff --git a/archify/schemas/common.schema.json b/archify/schemas/common.schema.jsonindex 64327f16..20a8515e 100644--- a/archify/schemas/common.schema.json+++ b/archify/schemas/common.schema.json@@ -10,6 +10,22 @@"locale": {"enum": ["en", "zh-CN"]},+ "animation": {+ "enum": ["trace", "none"]+ },+ "visualPreset": {+ "enum": ["classic", "signal-flow", "blueprint", "editorial"]+ },+ "qualityProfile": {+ "enum": ["standard", "showcase"]+ },+ "side": {+ "enum": ["left", "right", "top", "bottom"]+ },+ "relationshipWidth": {+ "type": "number",+ "minimum": 0.5+ },"point": {"type": "array","prefixItems": [diff --git a/archify/schemas/dataflow.schema.json b/archify/schemas/dataflow.schema.jsonindex 599ca18c..00f51487 100644--- a/archify/schemas/dataflow.schema.json+++ b/archify/schemas/dataflow.schema.json@@ -40,24 +40,13 @@"type": "string"},"animation": {- "enum": [- "trace",- "none"- ]+ "$ref": "common.schema.json#/$defs/animation"},"visual_preset": {- "enum": [- "classic",- "signal-flow",- "blueprint",- "editorial"- ]+ "$ref": "common.schema.json#/$defs/visualPreset"},"quality_profile": {- "enum": [- "standard",- "showcase"- ]+ "$ref": "common.schema.json#/$defs/qualityProfile"},"views": {"$ref": "common.schema.json#/$defs/guidedViews"@@ -211,20 +200,10 @@]},"fromSide": {- "enum": [- "left",- "right",- "top",- "bottom"- ]+ "$ref": "common.schema.json#/$defs/side"},"toSide": {- "enum": [- "left",- "right",- "top",- "bottom"- ]+ "$ref": "common.schema.json#/$defs/side"},"channelX": {"type": "number"@@ -252,8 +231,7 @@}},"width": {- "type": "number",- "minimum": 0.5+ "$ref": "common.schema.json#/$defs/relationshipWidth"}}}diff --git a/archify/schemas/lifecycle.schema.json b/archify/schemas/lifecycle.schema.jsonindex b05ef40f..017c155f 100644--- a/archify/schemas/lifecycle.schema.json+++ b/archify/schemas/lifecycle.schema.json@@ -40,24 +40,13 @@"type": "string"},"animation": {- "enum": [- "trace",- "none"- ]+ "$ref": "common.schema.json#/$defs/animation"},"visual_preset": {- "enum": [- "classic",- "signal-flow",- "blueprint",- "editorial"- ]+ "$ref": "common.schema.json#/$defs/visualPreset"},"quality_profile": {- "enum": [- "standard",- "showcase"- ]+ "$ref": "common.schema.json#/$defs/qualityProfile"},"views": {"$ref": "common.schema.json#/$defs/guidedViews"@@ -230,20 +219,10 @@]},"fromSide": {- "enum": [- "left",- "right",- "top",- "bottom"- ]+ "$ref": "common.schema.json#/$defs/side"},"toSide": {- "enum": [- "left",- "right",- "top",- "bottom"- ]+ "$ref": "common.schema.json#/$defs/side"},"channelX": {"type": "number"@@ -275,8 +254,7 @@}},"width": {- "type": "number",- "minimum": 0.5+ "$ref": "common.schema.json#/$defs/relationshipWidth"}}}diff --git a/archify/schemas/sequence.schema.json b/archify/schemas/sequence.schema.jsonindex 3449dd42..446d0ec6 100644--- a/archify/schemas/sequence.schema.json+++ b/archify/schemas/sequence.schema.json@@ -39,24 +39,13 @@"type": "string"},"animation": {- "enum": [- "trace",- "none"- ]+ "$ref": "common.schema.json#/$defs/animation"},"visual_preset": {- "enum": [- "classic",- "signal-flow",- "blueprint",- "editorial"- ]+ "$ref": "common.schema.json#/$defs/visualPreset"},"quality_profile": {- "enum": [- "standard",- "showcase"- ]+ "$ref": "common.schema.json#/$defs/qualityProfile"},"column_fit": {"description": "Horizontal participant layout. Omit this field or use fixed for the stable 86px boxes and 108px gap. Use spread when a wide viewBox would leave unused horizontal space or meaningful participant labels do not fit the fixed boxes; spread derives wider boxes and gaps from the viewBox without changing participant order or message semantics.",diff --git a/archify/schemas/workflow.schema.json b/archify/schemas/workflow.schema.jsonindex b1a16ff5..237f7f90 100644--- a/archify/schemas/workflow.schema.json+++ b/archify/schemas/workflow.schema.json@@ -40,24 +40,13 @@"type": "string"},"animation": {- "enum": [- "trace",- "none"- ]+ "$ref": "common.schema.json#/$defs/animation"},"visual_preset": {- "enum": [- "classic",- "signal-flow",- "blueprint",- "editorial"- ]+ "$ref": "common.schema.json#/$defs/visualPreset"},"quality_profile": {- "enum": [- "standard",- "showcase"- ]+ "$ref": "common.schema.json#/$defs/qualityProfile"},"views": {"$ref": "common.schema.json#/$defs/guidedViews"@@ -157,12 +146,7 @@"maximum": 5},"variant": {- "enum": [- "default",- "emphasis",- "security",- "dashed"- ]+ "$ref": "common.schema.json#/$defs/variant"}}}@@ -201,12 +185,7 @@"maximum": 5},"variant": {- "enum": [- "default",- "emphasis",- "security",- "dashed"- ]+ "$ref": "common.schema.json#/$defs/variant"}}}@@ -308,10 +287,10 @@]},"fromSide": {- "$ref": "#/$defs/side"+ "$ref": "common.schema.json#/$defs/side"},"toSide": {- "$ref": "#/$defs/side"+ "$ref": "common.schema.json#/$defs/side"},"route": {"enum": [@@ -355,8 +334,7 @@"maximum": 1},"width": {- "type": "number",- "minimum": 0.5+ "$ref": "common.schema.json#/$defs/relationshipWidth"}}}@@ -364,15 +342,5 @@"cards": {"$ref": "common.schema.json#/$defs/cards"}- },- "$defs": {- "side": {- "enum": [- "left",- "right",- "top",- "bottom"- ]- }}}diff --git a/archify/scripts/check-update.mjs b/archify/scripts/check-update.mjsnew file mode 100644index 00000000..dd12e4ba--- /dev/null+++ b/archify/scripts/check-update.mjs@@ -0,0 +1,1667 @@+#!/usr/bin/env node++import crypto from 'node:crypto';+import { constants as fsConstants } from 'node:fs';+import fs from 'node:fs/promises';+import os from 'node:os';+import path from 'node:path';+import { performance } from 'node:perf_hooks';+import { fileURLToPath } from 'node:url';++import {+ DEFAULT_MANIFEST_URL,+ SKILL_ID,+ UpdateContractError,+ compareSemver,+ isStableCoreVersion,+ parseSemver,+ validateLocalRelease,+ validateReleaseNotesUrl,+ validateStableUpdateManifest,+} from './update-contract.mjs';++const OPERATION_STATE_FILE = 'state.json';+const OPERATION_OWNER_FILE = 'owner.json';+const ACTIVE_CLAIM_DIRECTORY = 'active-claim';+const OPERATION_NAME = /^(reserved|pending|committed|fenced|cancelled)-(\d{1,20})$/;+const MAX_OPERATION_GENERATION = (10n ** 20n) - 1n;+const CHECK_TTL_MS = 72 * 60 * 60 * 1_000;+const MAX_CACHE_HORIZON_MS = Math.ceil(CHECK_TTL_MS * 1.2);+const FIRST_FAILURE_DELAY_MS = 6 * 60 * 60 * 1_000;+const LATER_FAILURE_DELAY_MS = 24 * 60 * 60 * 1_000;+const DEFAULT_TIMEOUT_MS = 1_000;+const MAX_RESPONSE_BYTES = 32 * 1_024;+const MAX_LOCAL_RELEASE_BYTES = 4 * 1_024;+const MAX_CACHE_STATE_BYTES = 64 * 1_024;+const MAX_CLAIM_OWNER_BYTES = 1_024;+const LONGEST_ISO_TIMESTAMP = '+275760-09-13T00:00:00.000Z';+const LOCK_STALE_MS = 30_000;+const ACK_LOCK_WAIT_MS = 1_200;+const LOCK_RETRY_DELAY_MS = 20;+const DIGEST_PATTERN = /^sha256:[a-f0-9]{64}$/;+const scriptDirectory = path.dirname(fileURLToPath(import.meta.url));+const defaultReleasePath = path.resolve(scriptDirectory, '..', 'skill-release.json');++class FileIdentityChangedError extends Error {}++function silent(reason) {+ return { status: 'silent', reason };+}++function isPlainObject(value) {+ return Boolean(value) && typeof value === 'object' && !Array.isArray(value);+}++function hasOnlyKeys(value, allowed) {+ return Object.keys(value).every((key) => allowed.has(key));+}++function validateManifest(value) {+ const manifest = validateStableUpdateManifest(value);+ return {+ version: manifest.version,+ targetDigest: `sha256:${manifest.artifact.sha256}`,+ severity: manifest.severity,+ releaseNotes: manifest.releaseNotes,+ };+}++function validateCachedCandidate(value) {+ if (!isPlainObject(value)+ || !hasOnlyKeys(value, new Set([+ 'version', 'targetDigest', 'severity', 'releaseNotes',+ ]))) return null;+ try {+ if (!isStableCoreVersion(value.version)) return null;+ if (!DIGEST_PATTERN.test(value.targetDigest)+ || !['normal', 'security'].includes(value.severity)) return null;+ validateReleaseNotesUrl(value.releaseNotes, value.version);+ return { ...value };+ } catch {+ return null;+ }+}++function emptyState(installedVersion = null) {+ return {+ schemaVersion: 1,+ skillId: SKILL_ID,+ installedVersion,+ check: {+ nextCheckAt: null,+ consecutiveFailures: 0,+ },+ notification: {+ offeredDigests: [],+ acknowledgedDigests: [],+ },+ };+}++function encodeBoundedState(state) {+ const encoded = Buffer.from(`${JSON.stringify(state)}\n`, 'utf8');+ return encoded.length <= MAX_CACHE_STATE_BYTES ? encoded : null;+}++function stateAfterAcknowledgement(state, targetDigest) {+ const alreadyAcknowledged = state.notification.acknowledgedDigests.includes(targetDigest);+ return {+ ...state,+ notification: {+ offeredDigests: state.notification.offeredDigests+ .filter((digest) => digest !== targetDigest),+ acknowledgedDigests: alreadyAcknowledged+ ? [...state.notification.acknowledgedDigests]+ : [...state.notification.acknowledgedDigests, targetDigest],+ },+ };+}++function stateWithFailureCheck(state, nextCheckAt, consecutiveFailures, withdrawCandidate = false) {+ const failedState = {+ ...state,+ check: { nextCheckAt, consecutiveFailures },+ };+ if (withdrawCandidate) delete failedState.candidate;+ return failedState;+}++function encodeRecoverableState(state) {+ const encoded = encodeBoundedState(state);+ if (!encoded) return null;+ if (!encodeBoundedState(stateWithFailureCheck(state, LONGEST_ISO_TIMESTAMP, 2))) return null;+ let acknowledgementState = state;+ for (const targetDigest of state.notification.offeredDigests) {+ acknowledgementState = stateAfterAcknowledgement(acknowledgementState, targetDigest);+ if (!encodeBoundedState(acknowledgementState)+ || !encodeBoundedState(stateWithFailureCheck(+ acknowledgementState,+ LONGEST_ISO_TIMESTAMP,+ 2,+ ))) return null;+ }+ return encoded;+}++function versionCacheDirectory(cacheDirectory, installedVersion) {+ const partition = crypto.createHash('sha256').update(installedVersion).digest('hex').slice(0, 24);+ return path.join(cacheDirectory, `version-${partition}`);+}++function normalizeState(value, installedVersion) {+ const effectiveInstalledVersion = installedVersion ?? value?.installedVersion ?? null;+ if (!isPlainObject(value) || value.schemaVersion !== 1 || value.skillId !== SKILL_ID+ || (installedVersion !== null && value.installedVersion !== installedVersion)+ || (value.installedVersion !== null && typeof value.installedVersion !== 'string')+ || !isPlainObject(value.check)+ || !(value.check.nextCheckAt === null || typeof value.check.nextCheckAt === 'string')+ || !Number.isSafeInteger(value.check.consecutiveFailures)+ || value.check.consecutiveFailures < 0+ || !isPlainObject(value.notification)) return null;+ if (effectiveInstalledVersion !== null) {+ try {+ parseSemver(effectiveInstalledVersion);+ } catch {+ return null;+ }+ }++ const state = emptyState(effectiveInstalledVersion);+ state.check.nextCheckAt = value.check.nextCheckAt;+ state.check.consecutiveFailures = value.check.consecutiveFailures;+ const { offeredDigests, acknowledgedDigests } = value.notification;+ if (!Array.isArray(offeredDigests)+ || offeredDigests.some((digest) => typeof digest !== 'string' || !DIGEST_PATTERN.test(digest))) {+ return null;+ }+ state.notification.offeredDigests = [...new Set(offeredDigests)];++ if (!Array.isArray(acknowledgedDigests)+ || acknowledgedDigests.some((digest) => typeof digest !== 'string' || !DIGEST_PATTERN.test(digest))) {+ return null;+ }+ state.notification.acknowledgedDigests = [...new Set(acknowledgedDigests)];+ const hasCandidate = Object.hasOwn(value, 'candidate');+ const candidate = validateCachedCandidate(value.candidate);+ if (hasCandidate && !candidate) return null;+ if (candidate) {+ if (effectiveInstalledVersion !== null+ && compareSemver(candidate.version, effectiveInstalledVersion) > 0+ && !state.notification.offeredDigests.includes(candidate.targetDigest)+ && !state.notification.acknowledgedDigests.includes(candidate.targetDigest)) return null;+ state.candidate = candidate;+ }+ return encodeRecoverableState(state) ? state : null;+}++function isSameFile(left, right) {+ if (left.dev !== right.dev || left.ino !== right.ino) return false;+ if (left.ino !== 0n) return true;+ if (left.birthtimeNs === 0n || right.birthtimeNs === 0n) return false;+ return left.birthtimeNs === right.birthtimeNs+ && left.mode === right.mode;+}++function assertBoundedRegularFile(metadata, maxBytes) {+ if (!metadata.isFile()+ || metadata.isSymbolicLink()+ || metadata.size > BigInt(maxBytes)) {+ throw new Error('unsafe JSON file');+ }+}++async function readJsonFile(target, maxBytes, expectedMetadata = null) {+ const pathMetadata = await fs.lstat(target, { bigint: true });+ if (expectedMetadata && !isSameFile(expectedMetadata, pathMetadata)) {+ throw new FileIdentityChangedError('JSON file identity changed');+ }+ assertBoundedRegularFile(pathMetadata, maxBytes);+ const flags = fsConstants.O_RDONLY+ | (fsConstants.O_NOFOLLOW ?? 0)+ | (fsConstants.O_NONBLOCK ?? 0);+ const handle = await fs.open(target, flags);+ try {+ const handleMetadata = await handle.stat({ bigint: true });+ const currentPathMetadata = await fs.lstat(target, { bigint: true });+ assertBoundedRegularFile(handleMetadata, maxBytes);+ assertBoundedRegularFile(currentPathMetadata, maxBytes);+ if (!isSameFile(pathMetadata, handleMetadata)+ || !isSameFile(currentPathMetadata, handleMetadata)) {+ throw new FileIdentityChangedError('JSON file changed while opening');+ }++ const chunks = [];+ let size = 0;+ while (size <= maxBytes) {+ const chunk = Buffer.allocUnsafe(Math.min(8 * 1_024, (maxBytes + 1) - size));+ const { bytesRead } = await handle.read(chunk, 0, chunk.length, size);+ if (bytesRead === 0) break;+ chunks.push(chunk.subarray(0, bytesRead));+ size += bytesRead;+ }+ if (size > maxBytes) throw new Error('JSON file is too large');+ return JSON.parse(Buffer.concat(chunks, size).toString('utf8'));+ } finally {+ await handle.close();+ }+}++function isWithinDirectory(directory, target) {+ const relative = path.relative(directory, target);+ return relative === ''+ || (!path.isAbsolute(relative) && relative !== '..' && !relative.startsWith(`..${path.sep}`));+}++async function canonicalizeTrustedDirectoryPrefix(target) {+ const absoluteTarget = path.resolve(target);+ const trustedDirectories = [...new Set([os.homedir(), os.tmpdir()].map((directory) => (+ path.resolve(directory)+ )))].sort((left, right) => right.length - left.length);+ for (const trustedDirectory of trustedDirectories) {+ if (!isWithinDirectory(trustedDirectory, absoluteTarget)) continue;+ try {+ const canonicalDirectory = await fs.realpath(trustedDirectory);+ return path.resolve(canonicalDirectory, path.relative(trustedDirectory, absoluteTarget));+ } catch {+ // Fall back to validating the absolute path from its filesystem root.+ }+ }+ return target;+}++function assertSafeDirectory(metadata) {+ if (!metadata.isDirectory() || metadata.isSymbolicLink()) {+ throw new Error('unsafe cache directory');+ }+}++class CachePathChangedError extends Error {}+class CacheOperationRaceError extends Error {}+class OperationFencedError extends Error {}++const preparedCacheDirectories = new Map();++function invalidateCacheToken(token, message, cause) {+ token.trusted = false;+ if (cause instanceof CachePathChangedError) return cause;+ const error = new CachePathChangedError(message);+ if (cause) error.cause = cause;+ return error;+}++async function verifyDirectorySnapshots(token, snapshots, description) {+ if (!token.trusted) throw new CachePathChangedError('cache directory is no longer trusted');+ try {+ for (const snapshot of snapshots) {+ const metadata = await fs.lstat(snapshot.directory, { bigint: true });+ assertSafeDirectory(metadata);+ if (!isSameFile(snapshot.metadata, metadata)) {+ throw new Error(`${description} changed`);+ }+ }+ } catch (error) {+ throw invalidateCacheToken(token, `${description} changed`, error);+ }+}++async function verifyCacheToken(token) {+ await verifyDirectorySnapshots(token, token.ancestorSnapshots, 'cache directory');+}++async function guardedCacheRead(token, read) {+ await verifyCacheToken(token);+ let result;+ try {+ result = await read();+ } catch (error) {+ await verifyCacheToken(token);+ throw error;+ }+ await verifyCacheToken(token);+ return result;+}++function cacheTokenFor(cacheDirectory) {+ const token = preparedCacheDirectories.get(path.resolve(cacheDirectory));+ if (!token || !token.trusted) {+ throw new CachePathChangedError('cache directory has not been prepared safely');+ }+ return token;+}++function resolveCacheTarget(token, target) {+ const resolved = path.resolve(target);+ if (resolved === token.directory || !isWithinDirectory(token.directory, resolved)) {+ throw invalidateCacheToken(token, 'cache mutation escaped its prepared directory');+ }+ return resolved;+}++async function captureMutationParentSnapshots(token, targets) {+ await verifyCacheToken(token);+ const snapshots = new Map();+ try {+ for (const target of targets) {+ const parent = path.dirname(resolveCacheTarget(token, target));+ const relative = path.relative(token.directory, parent);+ let current = token.directory;+ for (const component of relative.split(path.sep).filter(Boolean)) {+ current = path.join(current, component);+ if (snapshots.has(current)) continue;+ const metadata = await fs.lstat(current, { bigint: true });+ assertSafeDirectory(metadata);+ snapshots.set(current, { directory: current, metadata });+ }+ }+ } catch (error) {+ throw invalidateCacheToken(token, 'cache mutation parent changed', error);+ }+ const captured = [...snapshots.values()];+ await verifyMutationParentSnapshots(token, captured);+ await verifyCacheToken(token);+ return captured;+}++async function verifyMutationParentSnapshots(token, snapshots) {+ try {+ for (const snapshot of snapshots) {+ const metadata = await fs.lstat(snapshot.directory, { bigint: true });+ assertSafeDirectory(metadata);+ if (!isSameFile(snapshot.metadata, metadata)) {+ throw new Error('cache mutation parent changed');+ }+ }+ } catch (error) {+ const raced = new CacheOperationRaceError('cache mutation parent changed');+ raced.cause = error;+ throw raced;+ }+}++async function verifyMutationContext(token, parentSnapshots) {+ await verifyCacheToken(token);+ await verifyMutationParentSnapshots(token, parentSnapshots);+ await verifyCacheToken(token);+}++function assertSafeCacheEntry(metadata) {+ if (metadata.isSymbolicLink() || (!metadata.isDirectory() && !metadata.isFile())) {+ throw new Error('unsafe cache entry');+ }+}++function assertSafeRegularFile(metadata) {+ if (!metadata.isFile() || metadata.isSymbolicLink()) {+ throw new Error('unsafe cache file');+ }+}++function assertRenameableCacheEntry(metadata) {+ if (!metadata.isDirectory() && !metadata.isFile() && !metadata.isSymbolicLink()) {+ throw new Error('unsafe cache rename entry');+ }+}++async function stableCacheEntry(+ token,+ target,+ validate,+ expectedMetadata = null,+ missingIsOperationRace = false,+) {+ const resolved = resolveCacheTarget(token, target);+ try {+ const first = await fs.lstat(resolved, { bigint: true });+ validate(first);+ if (expectedMetadata && !isSameFile(expectedMetadata, first)) {+ throw new Error('cache entry identity changed');+ }+ await verifyCacheToken(token);+ const second = await fs.lstat(resolved, { bigint: true });+ validate(second);+ if (!isSameFile(first, second)+ || (expectedMetadata && !isSameFile(expectedMetadata, second))) {+ throw new Error('cache entry identity changed');+ }+ return second;+ } catch (error) {+ if (missingIsOperationRace && error?.code === 'ENOENT') {+ await verifyCacheToken(token);+ throw error;+ }+ throw invalidateCacheToken(token, 'cache mutation produced an untrusted object', error);+ }+}++async function guardedCacheEntryRead(+ token,+ target,+ validate,+ read,+ expectedMetadata = null,+) {+ const metadata = await stableCacheEntry(+ token,+ target,+ validate,+ expectedMetadata,+ true,+ );+ let result;+ try {+ result = await read(metadata);+ } catch (error) {+ await stableCacheEntry(token, target, validate, metadata, true);+ throw error;+ }+ await stableCacheEntry(token, target, validate, metadata, true);+ return result;+}++async function stablePreparedDirectory(token, target) {+ try {+ const first = await fs.lstat(target, { bigint: true });+ assertSafeDirectory(first);+ await verifyCacheToken(token);+ const second = await fs.lstat(target, { bigint: true });+ assertSafeDirectory(second);+ if (!isSameFile(first, second)) throw new Error('prepared directory identity changed');+ return second;+ } catch (error) {+ throw invalidateCacheToken(token, 'prepared directory could not be verified', error);+ }+}++async function assertCacheTargetAbsent(token, target) {+ const resolved = resolveCacheTarget(token, target);+ try {+ await fs.lstat(resolved, { bigint: true });+ } catch (error) {+ if (error?.code === 'ENOENT') return;+ throw invalidateCacheToken(token, 'cache mutation target could not be verified', error);+ }+ throw invalidateCacheToken(token, 'cache mutation left an unexpected object');+}++async function guardedCacheMutation(token, parentSnapshots, {+ mutate,+ verifyBefore = null,+ verifyAfter,+}) {+ await verifyMutationContext(token, parentSnapshots);+ if (verifyBefore) await verifyBefore();+ let result;+ try {+ result = await mutate();+ } catch (error) {+ await verifyMutationContext(token, parentSnapshots);+ throw error;+ }+ try {+ await verifyMutationContext(token, parentSnapshots);+ const verified = await verifyAfter(result);+ await verifyMutationContext(token, parentSnapshots);+ return verified ?? result;+ } catch (error) {+ if (error instanceof CacheOperationRaceError) throw error;+ throw invalidateCacheToken(token, 'cache mutation could not be verified', error);+ }+}++async function cacheMkdirWithToken(token, target, options, parentSnapshots = null) {+ const resolved = path.resolve(target);+ const parents = parentSnapshots ?? await captureMutationParentSnapshots(token, [resolved]);+ return guardedCacheMutation(token, parents, {+ mutate: () => fs.mkdir(resolved, options),+ verifyAfter: () => (parentSnapshots === null+ ? stableCacheEntry(token, resolved, assertSafeDirectory)+ : stablePreparedDirectory(token, resolved)),+ });+}++async function cacheMkdir(cacheDirectory, target, options) {+ return cacheMkdirWithToken(cacheTokenFor(cacheDirectory), target, options);+}++async function cacheWriteFile(cacheDirectory, target, data, options) {+ if (options?.flag !== 'wx') {+ throw new Error('cache files must be created exclusively');+ }+ const token = cacheTokenFor(cacheDirectory);+ const resolved = resolveCacheTarget(token, target);+ const parents = await captureMutationParentSnapshots(token, [resolved]);+ return guardedCacheMutation(token, parents, {+ mutate: async () => {+ const flags = fsConstants.O_WRONLY+ | fsConstants.O_CREAT+ | fsConstants.O_EXCL+ | (fsConstants.O_NOFOLLOW ?? 0);+ const handle = await fs.open(resolved, flags, options.mode);+ try {+ const openedMetadata = await handle.stat({ bigint: true });+ if (!openedMetadata.isFile() || openedMetadata.isSymbolicLink()) {+ throw new Error('cache write did not open a regular file');+ }+ await handle.writeFile(data, options.encoding ? { encoding: options.encoding } : undefined);+ const writtenMetadata = await handle.stat({ bigint: true });+ const expectedBytes = Buffer.isBuffer(data)+ ? data.length+ : Buffer.byteLength(data, options.encoding || 'utf8');+ if (!isSameFile(openedMetadata, writtenMetadata)+ || writtenMetadata.size !== BigInt(expectedBytes)) {+ throw new Error('cache write did not preserve the opened file identity and size');+ }+ return writtenMetadata;+ } finally {+ await handle.close();+ }+ },+ verifyAfter: (writtenMetadata) => stableCacheEntry(token, resolved, (metadata) => {+ if (!metadata.isFile() || metadata.isSymbolicLink()) {+ throw new Error('cache write did not create a regular file');+ }+ }, writtenMetadata),+ });+}++async function cacheRename(+ cacheDirectory,+ source,+ destination,+ validate,+ expectedSourceMetadata = null,+) {+ if (typeof validate !== 'function') {+ throw new TypeError('cache rename requires an explicit entry validator');+ }+ const token = cacheTokenFor(cacheDirectory);+ const resolvedSource = resolveCacheTarget(token, source);+ const resolvedDestination = resolveCacheTarget(token, destination);+ const parents = await captureMutationParentSnapshots(+ token,+ [resolvedSource, resolvedDestination],+ );+ const sourceMetadata = await stableCacheEntry(+ token,+ resolvedSource,+ validate,+ expectedSourceMetadata,+ true,+ );+ return guardedCacheMutation(token, parents, {+ verifyBefore: () => stableCacheEntry(+ token,+ resolvedSource,+ validate,+ sourceMetadata,+ true,+ ),+ mutate: () => fs.rename(resolvedSource, resolvedDestination),+ verifyAfter: async () => {+ await assertCacheTargetAbsent(token, resolvedSource);+ return stableCacheEntry(+ token,+ resolvedDestination,+ validate,+ sourceMetadata,+ );+ },+ });+}++async function cacheRm(cacheDirectory, target, options) {+ if (options?.recursive) {+ throw new Error('recursive cache removal is not allowed');+ }+ const token = cacheTokenFor(cacheDirectory);+ const resolved = resolveCacheTarget(token, target);+ const parents = await captureMutationParentSnapshots(token, [resolved]);+ let initialMetadata;+ try {+ initialMetadata = await fs.lstat(resolved, { bigint: true });+ } catch (error) {+ if (error?.code === 'ENOENT' && options?.force) {+ await verifyMutationContext(token, parents);+ return;+ }+ throw error;+ }+ try {+ assertSafeCacheEntry(initialMetadata);+ } catch (error) {+ throw invalidateCacheToken(token, 'cache removal target is unsafe', error);+ }+ const targetMetadata = await stableCacheEntry(+ token,+ resolved,+ assertSafeCacheEntry,+ initialMetadata,+ );+ return guardedCacheMutation(token, parents, {+ verifyBefore: () => stableCacheEntry(+ token,+ resolved,+ assertSafeCacheEntry,+ targetMetadata,+ ),+ mutate: () => fs.rm(resolved, options),+ verifyAfter: () => assertCacheTargetAbsent(token, resolved),+ });+}++async function prepareCacheDirectory(cacheDirectory) {+ const absoluteTarget = path.resolve(cacheDirectory);+ const target = await canonicalizeTrustedDirectoryPrefix(absoluteTarget);+ const parsed = path.parse(target);+ const components = target.slice(parsed.root.length).split(path.sep).filter(Boolean);+ let current = parsed.root;+ const token = {+ directory: target,+ ancestorSnapshots: [],+ trusted: true,+ };++ for (const component of components) {+ current = path.join(current, component);+ let metadata;+ try {+ metadata = await fs.lstat(current, { bigint: true });+ } catch (error) {+ if (error?.code !== 'ENOENT') throw error;+ try {+ await cacheMkdirWithToken(token, current, { mode: 0o700 }, []);+ } catch (mkdirError) {+ if (mkdirError?.code !== 'EEXIST') throw mkdirError;+ }+ metadata = await fs.lstat(current, { bigint: true });+ }+ assertSafeDirectory(metadata);+ token.ancestorSnapshots.push({ directory: current, metadata });+ }++ await verifyCacheToken(token);+ preparedCacheDirectories.set(target, token);+ return target;+}++function operationName(kind, generation) {+ return `${kind}-${generation.toString().padStart(20, '0')}`;+}++function parseOperationName(name) {+ const match = OPERATION_NAME.exec(name);+ if (!match) return null;+ return { kind: match[1], generation: BigInt(match[2]) };+}++async function listOperations(cacheDirectory, token = cacheTokenFor(cacheDirectory)) {+ return guardedCacheRead(token, async () => {+ try {+ const entries = await fs.readdir(cacheDirectory, { withFileTypes: true });+ return entries.flatMap((entry) => {+ const parsed = parseOperationName(entry.name);+ if (!parsed) return [];+ if (!entry.isDirectory() || entry.isSymbolicLink()) {+ throw invalidateCacheToken(+ token,+ `cache operation ${entry.name} is not a safe directory`,+ );+ }+ return [{ ...parsed, name: entry.name, directory: path.join(cacheDirectory, entry.name) }];+ });+ } catch (error) {+ if (error?.code === 'ENOENT') return [];+ throw error;+ }+ });+}++async function readState(cacheDirectory, installedVersion = null) {+ const token = cacheTokenFor(cacheDirectory);+ return guardedCacheRead(token, async () => {+ const operations = (await listOperations(cacheDirectory, token))+ .filter((operation) => operation.kind === 'committed')+ .sort((left, right) => (left.generation > right.generation ? -1 : 1));+ for (const operation of operations) {+ try {+ const state = await guardedCacheEntryRead(+ token,+ operation.directory,+ assertSafeDirectory,+ async () => normalizeState(+ await readJsonFile(+ path.join(operation.directory, OPERATION_STATE_FILE),+ MAX_CACHE_STATE_BYTES,+ ),+ installedVersion,+ ),+ );+ if (state) return state;+ } catch (error) {+ if (error instanceof FileIdentityChangedError+ || error instanceof CachePathChangedError+ || error instanceof CacheOperationRaceError) throw error;+ // An incomplete or corrupt generation is ignored in favor of the previous commit.+ }+ }+ return emptyState(installedVersion);+ });+}++async function operationIsActive(+ cacheDirectory,+ operation,+ token = cacheTokenFor(cacheDirectory),+) {+ try {+ return await guardedCacheEntryRead(+ token,+ operation.directory,+ assertSafeDirectory,+ async (directoryMetadata) => {+ try {+ const ownerMetadata = await fs.lstat(+ path.join(operation.directory, OPERATION_OWNER_FILE),+ { bigint: true },+ );+ if (!ownerMetadata.isFile() || ownerMetadata.isSymbolicLink()) return false;+ return metadataIsWithinLease(ownerMetadata);+ } catch (error) {+ if (error?.code !== 'ENOENT') throw error;+ return metadataIsWithinLease(directoryMetadata);+ }+ },+ );+ } catch (error) {+ if (error?.code === 'ENOENT') return false;+ throw error;+ }+}++function validateClaimOwner(value) {+ if (!isPlainObject(value)+ || !hasOnlyKeys(value, new Set(['pid', 'token', 'generation']))+ || !Number.isSafeInteger(value.pid)+ || value.pid <= 0+ || typeof value.token !== 'string'+ || !/^[a-f0-9]{32}$/.test(value.token)+ || typeof value.generation !== 'string'+ || !/^[1-9]\d*$/.test(value.generation)) return null;+ return { ...value, generation: BigInt(value.generation) };+}++function metadataIsWithinLease(metadata) {+ if (typeof metadata.mtimeNs === 'bigint') {+ const ageNs = (BigInt(Date.now()) * 1_000_000n) - metadata.mtimeNs;+ const absoluteAgeNs = ageNs < 0n ? -ageNs : ageNs;+ return absoluteAgeNs <= BigInt(LOCK_STALE_MS) * 1_000_000n;+ }+ return Math.abs(Date.now() - metadata.mtimeMs) <= LOCK_STALE_MS;+}++function corruptClaimStatus(directory, directoryMetadata, ownerMetadata = directoryMetadata) {+ if (metadataIsWithinLease(ownerMetadata)) {+ return { state: 'busy', directory, metadata: directoryMetadata, owner: null };+ }+ const fingerprint = crypto.createHash('sha256')+ .update(JSON.stringify({+ directory: {+ dev: directoryMetadata.dev.toString(),+ ino: directoryMetadata.ino.toString(),+ mode: directoryMetadata.mode.toString(),+ birthtimeNs: directoryMetadata.birthtimeNs.toString(),+ },+ }))+ .digest('hex')+ .slice(0, 24);+ return {+ state: 'releasable',+ directory,+ metadata: directoryMetadata,+ key: `corrupt-${fingerprint}`,+ owner: null,+ };+}++async function inspectActiveClaim(cacheDirectory) {+ const token = cacheTokenFor(cacheDirectory);+ return guardedCacheRead(token, async () => {+ const directory = path.join(cacheDirectory, ACTIVE_CLAIM_DIRECTORY);+ let directoryMetadata;+ try {+ directoryMetadata = await fs.lstat(directory, { bigint: true });+ } catch (error) {+ if (error?.code === 'ENOENT') return { state: 'absent', directory };+ throw error;+ }+ if (!directoryMetadata.isDirectory() || directoryMetadata.isSymbolicLink()) {+ return corruptClaimStatus(directory, directoryMetadata);+ }+ return guardedCacheEntryRead(+ token,+ directory,+ assertSafeDirectory,+ async (stableDirectoryMetadata) => {+ const ownerPath = path.join(directory, OPERATION_OWNER_FILE);+ let ownerMetadata = stableDirectoryMetadata;+ let owner = null;+ try {+ ownerMetadata = await fs.lstat(ownerPath, { bigint: true });+ if (!ownerMetadata.isFile()+ || ownerMetadata.isSymbolicLink()+ || ownerMetadata.size > BigInt(MAX_CLAIM_OWNER_BYTES)) {+ return corruptClaimStatus(directory, stableDirectoryMetadata, ownerMetadata);+ }+ const ownerSource = await readJsonFile(+ ownerPath,+ MAX_CLAIM_OWNER_BYTES,+ ownerMetadata,+ );+ owner = validateClaimOwner(ownerSource);+ } catch (error) {+ if (error instanceof FileIdentityChangedError) throw error;+ // A malformed claim is recoverable only after the same hard lease as a crashed owner.+ }++ if (owner) {+ const operations = await listOperations(cacheDirectory, token);+ if (operations.some((operation) => operation.generation === owner.generation+ && ['committed', 'fenced', 'cancelled'].includes(operation.kind))) {+ return {+ state: 'releasable',+ directory,+ metadata: stableDirectoryMetadata,+ key: owner.generation.toString(),+ owner,+ };+ }+ const pending = operations.find((operation) => operation.kind === 'pending'+ && operation.generation === owner.generation);+ if (pending) {+ if (await operationIsActive(cacheDirectory, pending, token)) {+ return {+ state: 'busy',+ directory,+ metadata: stableDirectoryMetadata,+ owner,+ };+ }+ return {+ state: 'releasable',+ directory,+ metadata: stableDirectoryMetadata,+ key: owner.generation.toString(),+ owner,+ };+ }+ }++ return corruptClaimStatus(directory, stableDirectoryMetadata, ownerMetadata);+ },+ directoryMetadata,+ );+ });+}++async function retireActiveClaim(cacheDirectory, claim) {+ const retirement = path.join(cacheDirectory, `retired-claim-${claim.key}`);+ await cacheMkdir(cacheDirectory, retirement, { mode: 0o700 }).catch((error) => {+ if (error?.code !== 'EEXIST') throw error;+ });+ try {+ const retirementMetadata = await fs.lstat(retirement);+ if (!retirementMetadata.isDirectory() || retirementMetadata.isSymbolicLink()) return false;+ } catch (error) {+ if (error instanceof CacheOperationRaceError) return false;+ if (error?.code === 'ENOENT') return false;+ throw error;+ }+ try {+ const metadata = await fs.lstat(claim.directory);+ if (metadata.isDirectory() && !metadata.isSymbolicLink()) {+ await cacheWriteFile(+ cacheDirectory,+ path.join(claim.directory, '.retirement-guard'),+ `${claim.key}\n`,+ { encoding: 'utf8', flag: 'wx', mode: 0o600 },+ ).catch((error) => {+ if (error?.code !== 'EEXIST') throw error;+ });+ }+ } catch (error) {+ if (error instanceof CacheOperationRaceError) return false;+ if (error?.code === 'ENOENT') return false;+ throw error;+ }+ try {+ await cacheRename(+ cacheDirectory,+ claim.directory,+ path.join(retirement, 'active'),+ assertRenameableCacheEntry,+ claim.metadata,+ );+ return true;+ } catch (error) {+ if (error instanceof CacheOperationRaceError) return false;+ if (['ENOENT', 'EEXIST', 'ENOTEMPTY', 'EPERM'].includes(error?.code)) return false;+ throw error;+ }+}++async function prepareOperationClaim(cacheDirectory, operation) {+ const directory = path.join(cacheDirectory, operationName('claim', operation.generation));+ await cacheMkdir(cacheDirectory, directory, { mode: 0o700 });+ await cacheWriteFile(+ cacheDirectory,+ path.join(directory, OPERATION_OWNER_FILE),+ `${JSON.stringify({+ pid: process.pid,+ token: operation.token,+ generation: operation.generation.toString(),+ })}\n`,+ { encoding: 'utf8', flag: 'wx', mode: 0o600 },+ );+ operation.preparedClaimDirectory = directory;+}++async function discardPreparedClaim(cacheDirectory, operation) {+ if (!operation.preparedClaimDirectory) return;+ const discarded = path.join(+ cacheDirectory,+ `discarded-claim-${operation.generation.toString().padStart(20, '0')}-${operation.token}`,+ );+ try {+ await cacheRename(+ cacheDirectory,+ operation.preparedClaimDirectory,+ discarded,+ assertSafeDirectory,+ );+ } catch (error) {+ if (error?.code !== 'ENOENT') throw error;+ }+ delete operation.preparedClaimDirectory;+}++async function promoteOperationClaim(cacheDirectory, operation) {+ await prepareOperationClaim(cacheDirectory, operation);+ const activeDirectory = path.join(cacheDirectory, ACTIVE_CLAIM_DIRECTORY);+ for (let attempt = 0; attempt < 8; attempt += 1) {+ if (await operationIsSuperseded(cacheDirectory, operation)) {+ await discardPreparedClaim(cacheDirectory, operation);+ return false;+ }+ const active = await inspectActiveClaim(cacheDirectory);+ if (active.state === 'busy') {+ await discardPreparedClaim(cacheDirectory, operation);+ return false;+ }+ if (active.state === 'releasable') {+ if (active.owner?.generation > operation.generation) {+ await discardPreparedClaim(cacheDirectory, operation);+ return false;+ }+ await retireActiveClaim(cacheDirectory, active);+ continue;+ }+ try {+ await cacheRename(+ cacheDirectory,+ operation.preparedClaimDirectory,+ activeDirectory,+ assertSafeDirectory,+ );+ delete operation.preparedClaimDirectory;+ if (!await operationIsActive(cacheDirectory, operation)) return false;+ return true;+ } catch (promotionError) {+ const raced = await inspectActiveClaim(cacheDirectory);+ if (raced.state === 'absent') {+ if (['EEXIST', 'ENOTEMPTY', 'EPERM'].includes(promotionError?.code)) continue;+ await discardPreparedClaim(cacheDirectory, operation);+ throw promotionError;+ }+ continue;+ }+ }+ await discardPreparedClaim(cacheDirectory, operation);+ return false;+}++async function operationOwnsActiveClaim(cacheDirectory, operation) {+ const active = await inspectActiveClaim(cacheDirectory);+ return active.state === 'busy'+ && active.owner?.generation === operation.generation+ && active.owner.token === operation.token;+}++async function hasActivePendingOperation(cacheDirectory) {+ const token = cacheTokenFor(cacheDirectory);+ return guardedCacheRead(token, async () => {+ const pending = (await listOperations(cacheDirectory, token))+ .filter((operation) => operation.kind === 'pending');+ return (await Promise.all(pending.map(+ (operation) => operationIsActive(cacheDirectory, operation, token),+ ))).some(Boolean);+ });+}++async function reserveOperation(cacheDirectory) {+ cacheDirectory = await prepareCacheDirectory(cacheDirectory);+ const operations = await listOperations(cacheDirectory);+ const occupied = new Set(operations.map((operation) => operation.generation.toString()));+ let generation = 1n;+ while (true) {+ while (occupied.has(generation.toString())) generation += 1n;+ if (generation > MAX_OPERATION_GENERATION) throw new Error('operation generation space exhausted');+ const reservation = path.join(cacheDirectory, operationName('reserved', generation));+ try {+ await cacheMkdir(cacheDirectory, reservation, { mode: 0o700 });+ } catch (error) {+ if (error?.code !== 'EEXIST') throw error;+ occupied.add(generation.toString());+ generation += 1n;+ continue;+ }+ const directory = path.join(cacheDirectory, operationName('pending', generation));+ try {+ await cacheMkdir(cacheDirectory, directory, { mode: 0o700 });+ const operation = {+ generation,+ token: crypto.randomBytes(16).toString('hex'),+ directory,+ };+ try {+ await cacheWriteFile(+ cacheDirectory,+ path.join(directory, OPERATION_OWNER_FILE),+ `${JSON.stringify({ pid: process.pid, token: operation.token })}\n`,+ { encoding: 'utf8', flag: 'wx', mode: 0o600 },+ );+ } catch (error) {+ if (await operationWasFenced(cacheDirectory, operation)) {+ const fencedError = new OperationFencedError('operation was fenced while reserving');+ fencedError.cause = error;+ throw fencedError;+ }+ await cacheRename(+ cacheDirectory,+ directory,+ path.join(cacheDirectory, operationName('cancelled', generation)),+ assertSafeDirectory,+ ).catch(() => {});+ throw error;+ }+ return operation;+ } catch (error) {+ if (error?.code !== 'EEXIST') throw error;+ occupied.add(generation.toString());+ generation += 1n;+ }+ }+}++async function operationIsSuperseded(cacheDirectory, operation) {+ return (await listOperations(cacheDirectory))+ .some((candidate) => candidate.generation > operation.generation);+}++async function operationWasFenced(cacheDirectory, operation) {+ const token = cacheTokenFor(cacheDirectory);+ return guardedCacheRead(token, async () => {+ try {+ await fs.lstat(operation.directory, { bigint: true });+ return false;+ } catch (error) {+ if (error?.code !== 'ENOENT') throw error;+ }+ const fencedDirectory = path.join(+ cacheDirectory,+ operationName('fenced', operation.generation),+ );+ try {+ await stableCacheEntry(+ token,+ fencedDirectory,+ assertSafeDirectory,+ null,+ true,+ );+ return true;+ } catch (error) {+ if (error?.code === 'ENOENT') return false;+ throw error;+ }+ });+}++async function transitionOperation(cacheDirectory, operation, kind) {+ const destination = path.join(cacheDirectory, operationName(kind, operation.generation));+ await cacheRename(cacheDirectory, operation.directory, destination, assertSafeDirectory);+}++async function cancelOperation(cacheDirectory, operation) {+ try {+ await transitionOperation(cacheDirectory, operation, 'cancelled');+ } catch (error) {+ // A higher generation may already have fenced this unique pending directory.+ if (error?.code !== 'ENOENT') throw error;+ }+}++async function acquireOperation(cacheDirectory) {+ cacheDirectory = await prepareCacheDirectory(cacheDirectory);+ if ((await inspectActiveClaim(cacheDirectory)).state === 'busy') return null;+ if (await hasActivePendingOperation(cacheDirectory)) return null;+ let operation;+ try {+ operation = await reserveOperation(cacheDirectory);+ } catch (error) {+ if (error instanceof OperationFencedError) return null;+ throw error;+ }+ if (!await operationIsSuperseded(cacheDirectory, operation)+ && await promoteOperationClaim(cacheDirectory, operation)) return operation;+ await cancelOperation(cacheDirectory, operation);+ return null;+}++async function fenceLowerOperations(cacheDirectory, operation) {+ const lower = (await listOperations(cacheDirectory))+ .filter((candidate) => candidate.kind === 'pending'+ && candidate.generation < operation.generation)+ .sort((left, right) => (left.generation < right.generation ? -1 : 1));+ for (const candidate of lower) {+ try {+ await cacheRename(+ cacheDirectory,+ candidate.directory,+ path.join(cacheDirectory, operationName('fenced', candidate.generation)),+ assertSafeDirectory,+ );+ } catch (error) {+ if (error?.code !== 'ENOENT') throw error;+ }+ }+}++async function commitOperation(cacheDirectory, operation, installedVersion, mutate) {+ if (!await operationOwnsActiveClaim(cacheDirectory, operation)) {+ await cancelOperation(cacheDirectory, operation);+ return { fenced: true, result: silent('check-in-progress') };+ }+ await fenceLowerOperations(cacheDirectory, operation);+ if (!await operationOwnsActiveClaim(cacheDirectory, operation)) {+ await cancelOperation(cacheDirectory, operation);+ return { fenced: true, result: silent('check-in-progress') };+ }+ const state = await readState(cacheDirectory, installedVersion);+ const decision = mutate(state);+ if (!decision.state) {+ await cancelOperation(cacheDirectory, operation);+ return { fenced: false, result: decision.result };+ }+ let committedState = decision.state;+ let committedResult = decision.result;+ let encodedState = encodeRecoverableState(committedState);+ if (!encodedState && decision.capacityFallback) {+ committedState = decision.capacityFallback.state;+ committedResult = decision.capacityFallback.result;+ encodedState = encodeRecoverableState(committedState);+ }+ if (!encodedState) {+ await cancelOperation(cacheDirectory, operation);+ return { fenced: false, result: silent('cache-unavailable') };+ }+ const temporary = path.join(+ operation.directory,+ `.state.${process.pid}.${crypto.randomBytes(8).toString('hex')}.tmp`,+ );+ try {+ await cacheWriteFile(cacheDirectory, temporary, encodedState, {+ flag: 'wx',+ mode: 0o600,+ });+ await cacheRename(+ cacheDirectory,+ temporary,+ path.join(operation.directory, OPERATION_STATE_FILE),+ assertSafeRegularFile,+ );+ await transitionOperation(cacheDirectory, operation, 'committed');+ return { fenced: false, result: committedResult };+ } catch (error) {+ if (await operationWasFenced(cacheDirectory, operation)) {+ return { fenced: true, result: silent('check-in-progress') };+ }+ await cacheRm(cacheDirectory, temporary, { force: true }).catch(() => {});+ throw error;+ }+}++function nextSuccessfulCheck(nowMs, random) {+ const boundedRandom = Math.min(1, Math.max(0, Number(random()) || 0));+ const multiplier = 0.8 + (boundedRandom * 0.4);+ return new Date(nowMs + Math.round(CHECK_TTL_MS * multiplier)).toISOString();+}++function nextFailedCheck(nowMs, failures) {+ const delay = failures <= 1 ? FIRST_FAILURE_DELAY_MS : LATER_FAILURE_DELAY_MS;+ return new Date(nowMs + delay).toISOString();+}++function stateAfterFailedCheck(state, nowMs, withdrawCandidate = false) {+ const failures = Math.min(state.check.consecutiveFailures + 1, 2);+ return stateWithFailureCheck(+ state,+ nextFailedCheck(nowMs, failures),+ failures,+ withdrawCandidate,+ );+}++function eventKeyForDigest(targetDigest) {+ return `${SKILL_ID}@${targetDigest}`;+}++function digestForEventKey(eventKey) {+ const prefix = `${SKILL_ID}@`;+ if (typeof eventKey !== 'string' || !eventKey.startsWith(prefix)) return null;+ const digest = eventKey.slice(prefix.length);+ return DIGEST_PATTERN.test(digest) ? digest : null;+}++function notification(localRelease, candidate) {+ return {+ status: 'update_available',+ eventKey: eventKeyForDigest(candidate.targetDigest),+ installedVersion: localRelease.version,+ latestVersion: candidate.version,+ targetDigest: candidate.targetDigest,+ severity: candidate.severity,+ summary: `Archify ${candidate.version} is available; see the official release notes for details.`,+ releaseNotes: candidate.releaseNotes,+ };+}++function resultForCandidate(localRelease, state) {+ if (!state.candidate) return silent('cache-valid');+ const comparison = compareSemver(state.candidate.version, localRelease.version);+ if (comparison <= 0) return silent('current');+ if (state.notification.acknowledgedDigests.includes(state.candidate.targetDigest)) {+ return silent('already-notified');+ }+ return notification(localRelease, state.candidate);+}++async function readBoundedBody(response) {+ const contentLength = Number(response.headers.get('content-length'));+ if (Number.isFinite(contentLength) && contentLength > MAX_RESPONSE_BYTES) {+ await cancelResponseBody(response);+ throw new UpdateContractError('manifest response is too large');+ }+ if (!response.body || typeof response.body.getReader !== 'function') {+ throw new UpdateContractError('manifest response has no bounded stream');+ }+ const reader = response.body.getReader();+ const chunks = [];+ let size = 0;+ try {+ while (true) {+ const { done, value } = await reader.read();+ if (done) break;+ size += value.byteLength;+ if (size > MAX_RESPONSE_BYTES) {+ await reader.cancel().catch(() => {});+ throw new UpdateContractError('manifest response is too large');+ }+ chunks.push(value);+ }+ } finally {+ reader.releaseLock();+ }+ const joined = new Uint8Array(size);+ let offset = 0;+ for (const chunk of chunks) {+ joined.set(chunk, offset);+ offset += chunk.byteLength;+ }+ try {+ return new TextDecoder('utf-8', { fatal: true }).decode(joined);+ } catch {+ throw new UpdateContractError('manifest is not valid UTF-8');+ }+}++async function cancelResponseBody(response) {+ try {+ if (response.body && typeof response.body.cancel === 'function') {+ await response.body.cancel();+ }+ } catch {+ // Network cleanup is best-effort; the original response classification wins.+ }+}++async function fetchCandidate({ fetchImpl, manifestUrl, timeoutMs }) {+ if (manifestUrl !== DEFAULT_MANIFEST_URL) throw new UpdateContractError('unexpected manifest URL');+ const controller = new AbortController();+ let timer;+ const timeout = new Promise((_resolve, reject) => {+ timer = setTimeout(() => {+ controller.abort();+ reject(new Error('update check timed out'));+ }, timeoutMs);+ });+ const request = (async () => {+ const headers = { accept: 'application/json' };+ const response = await fetchImpl(manifestUrl, {+ method: 'GET',+ headers,+ redirect: 'error',+ signal: controller.signal,+ });+ if (response.status !== 200) {+ await cancelResponseBody(response);+ throw new Error(`manifest returned HTTP ${response.status}`);+ }+ const mediaType = response.headers.get('content-type')?.split(';', 1)[0].trim().toLowerCase();+ if (mediaType !== 'application/json') {+ await cancelResponseBody(response);+ throw new UpdateContractError('manifest is not JSON');+ }+ const source = await readBoundedBody(response);+ let decoded;+ try {+ decoded = JSON.parse(source);+ } catch {+ throw new UpdateContractError('manifest is not valid bounded JSON');+ }+ return { candidate: validateManifest(decoded) };+ })();+ try {+ return await Promise.race([request, timeout]);+ } finally {+ clearTimeout(timer);+ }+}++function defaultCacheDirectory() {+ const homeDirectory = os.homedir();+ if (process.platform === 'win32') {+ const localData = process.env.LOCALAPPDATA;+ return path.join(localData && path.isAbsolute(localData) ? localData : path.join(homeDirectory, 'AppData', 'Local'), 'archify-skill');+ }+ if (process.platform === 'darwin') return path.join(homeDirectory, 'Library', 'Caches', 'archify-skill');+ const xdgCache = process.env.XDG_CACHE_HOME;+ return path.join(xdgCache && path.isAbsolute(xdgCache) ? xdgCache : path.join(homeDirectory, '.cache'), 'archify-skill');+}++function freshStateResult(localRelease, state, nowMs) {+ const nextCheckAt = Date.parse(state.check.nextCheckAt || '');+ if (Number.isFinite(nextCheckAt) && nextCheckAt > nowMs+ && nextCheckAt <= nowMs + MAX_CACHE_HORIZON_MS) {+ return resultForCandidate(localRelease, state);+ }+ return null;+}++async function resultAfterLosingOperation(cacheDirectory, operation, localRelease) {+ await cancelOperation(cacheDirectory, operation);+ const cached = await readState(cacheDirectory, localRelease.version);+ if (cached.candidate+ && cached.notification.offeredDigests.includes(cached.candidate.targetDigest)) {+ return resultForCandidate(localRelease, cached);+ }+ return silent('check-in-progress');+}++async function waitUntilRetry(deadline, monotonicNow) {+ let remaining;+ try {+ remaining = deadline - Number(monotonicNow());+ } catch {+ return false;+ }+ if (!Number.isFinite(remaining) || remaining <= 0) return false;+ await new Promise((resolve) => setTimeout(+ resolve,+ Math.min(LOCK_RETRY_DELAY_MS, remaining),+ ));+ return true;+}++export async function checkForUpdate({+ releasePath = defaultReleasePath,+ cacheDirectory = defaultCacheDirectory(),+ fetchImpl = globalThis.fetch,+ now = Date.now,+ random = Math.random,+ timeoutMs = DEFAULT_TIMEOUT_MS,+} = {}) {+ if (typeof fetchImpl !== 'function') return silent('runtime-unavailable');+ let localRelease;+ try {+ localRelease = validateLocalRelease(await readJsonFile(releasePath, MAX_LOCAL_RELEASE_BYTES));+ } catch {+ return silent('invalid-local-release');+ }++ const nowMs = Number(now());+ if (!Number.isFinite(nowMs)) return silent('invalid-clock');+ let stateDirectory = versionCacheDirectory(cacheDirectory, localRelease.version);+ let state;+ try {+ stateDirectory = await prepareCacheDirectory(stateDirectory);+ state = await readState(stateDirectory, localRelease.version);+ } catch {+ return silent('cache-unavailable');+ }+ const cachedResult = freshStateResult(localRelease, state, nowMs);+ if (cachedResult) return cachedResult;++ let operation;+ try {+ operation = await acquireOperation(stateDirectory);+ } catch {+ return silent('cache-unavailable');+ }+ if (!operation) {+ try {+ const cached = await readState(stateDirectory, localRelease.version);+ if (cached.candidate+ && cached.notification.offeredDigests.includes(cached.candidate.targetDigest)) {+ return resultForCandidate(localRelease, cached);+ }+ } catch {+ return silent('cache-unavailable');+ }+ return silent('check-in-progress');+ }++ try {+ state = await readState(stateDirectory, localRelease.version);+ const racedResult = freshStateResult(localRelease, state, nowMs);+ if (racedResult) {+ await cancelOperation(stateDirectory, operation);+ return racedResult;+ }++ if (!await operationOwnsActiveClaim(stateDirectory, operation)) {+ return await resultAfterLosingOperation(stateDirectory, operation, localRelease);+ }++ await verifyCacheToken(cacheTokenFor(stateDirectory));+ if (!await operationOwnsActiveClaim(stateDirectory, operation)) {+ return await resultAfterLosingOperation(stateDirectory, operation, localRelease);+ }+ let fetched;+ try {+ fetched = await fetchCandidate({+ fetchImpl,+ manifestUrl: localRelease.updateManifestUrl,+ timeoutMs,+ });+ } catch (error) {+ const reason = error instanceof UpdateContractError ? 'invalid-manifest' : 'check-failed';+ try {+ const committed = await commitOperation(+ stateDirectory,+ operation,+ localRelease.version,+ (current) => ({+ state: stateAfterFailedCheck(current, nowMs),+ result: silent(reason),+ }),+ );+ return committed.result;+ } catch {+ await cancelOperation(stateDirectory, operation).catch(() => {});+ return silent('cache-unavailable');+ }+ }++ try {+ const committed = await commitOperation(+ stateDirectory,+ operation,+ localRelease.version,+ (current) => {+ const next = {+ ...current,+ candidate: fetched.candidate,+ check: {+ nextCheckAt: nextSuccessfulCheck(nowMs, random),+ consecutiveFailures: 0,+ },+ notification: {+ offeredDigests: [...current.notification.offeredDigests],+ acknowledgedDigests: [...current.notification.acknowledgedDigests],+ },+ };+ const result = resultForCandidate(localRelease, next);+ if (result.status === 'update_available') {+ if (!next.notification.offeredDigests.includes(next.candidate.targetDigest)) {+ next.notification.offeredDigests.push(next.candidate.targetDigest);+ }+ }+ return {+ state: next,+ result,+ capacityFallback: {+ state: stateAfterFailedCheck(current, nowMs, true),+ result: silent('cache-unavailable'),+ },+ };+ },+ );+ return committed.result;+ } catch {+ await cancelOperation(stateDirectory, operation).catch(() => {});+ return silent('cache-unavailable');+ }+ } catch {+ await cancelOperation(stateDirectory, operation).catch(() => {});+ return silent('cache-unavailable');+ }+}++export async function acknowledgeUpdate({+ releasePath = defaultReleasePath,+ cacheDirectory = defaultCacheDirectory(),+ eventKey,+ monotonicNow = () => performance.now(),+} = {}) {+ const targetDigest = digestForEventKey(eventKey);+ if (!targetDigest || typeof monotonicNow !== 'function') {+ return silent('invalid-acknowledgement');+ }+ let localRelease;+ try {+ localRelease = validateLocalRelease(await readJsonFile(releasePath, MAX_LOCAL_RELEASE_BYTES));+ } catch {+ return silent('invalid-local-release');+ }+ let stateDirectory = versionCacheDirectory(cacheDirectory, localRelease.version);+ try {+ stateDirectory = await prepareCacheDirectory(stateDirectory);+ } catch {+ return silent('cache-unavailable');+ }+ let deadline;+ try {+ deadline = Number(monotonicNow()) + ACK_LOCK_WAIT_MS;+ } catch {+ return silent('invalid-acknowledgement');+ }+ if (!Number.isFinite(deadline)) return silent('invalid-acknowledgement');+ while (true) {+ let operation;+ try {+ operation = await acquireOperation(stateDirectory);+ } catch {+ return silent('cache-unavailable');+ }+ if (!operation) {+ if (!await waitUntilRetry(deadline, monotonicNow)) return silent('check-in-progress');+ continue;+ }+ try {+ const committed = await commitOperation(+ stateDirectory,+ operation,+ localRelease.version,+ (state) => {+ const wasOffered = state.notification.offeredDigests.includes(targetDigest);+ const wasAcknowledged = state.notification.acknowledgedDigests.includes(targetDigest);+ if (!wasOffered && !wasAcknowledged) {+ return { state: null, result: silent('invalid-acknowledgement') };+ }+ return {+ state: stateAfterAcknowledgement(state, targetDigest),+ result: { status: 'acknowledged', eventKey },+ };+ },+ );+ if (!committed.fenced) return committed.result;+ if (!await waitUntilRetry(deadline, monotonicNow)) return silent('check-in-progress');+ } catch {+ await cancelOperation(stateDirectory, operation).catch(() => {});+ return silent('cache-unavailable');+ }+ }+}++async function runCli() {+ if (process.env.ARCHIFY_UPDATE_CHECK_DISABLED === '1') return silent('disabled');+ const argumentsList = process.argv.slice(2);+ if (argumentsList.length === 0) return checkForUpdate();+ if (argumentsList.length === 2 && argumentsList[0] === '--ack') {+ return acknowledgeUpdate({ eventKey: argumentsList[1] });+ }+ return silent('invalid-arguments');+}++async function isMainModule() {+ if (!process.argv[1]) return false;+ try {+ const [entryPath, modulePath] = await Promise.all([+ fs.realpath(path.resolve(process.argv[1])),+ fs.realpath(fileURLToPath(import.meta.url)),+ ]);+ return entryPath === modulePath;+ } catch {+ return path.resolve(process.argv[1]) === path.resolve(fileURLToPath(import.meta.url));+ }+}++if (await isMainModule()) {+ let result;+ try {+ result = await runCli();+ } catch {+ result = silent('check-failed');+ }+ process.stdout.write(`${JSON.stringify(result)}\n`);+}diff --git a/archify/scripts/update-contract.mjs b/archify/scripts/update-contract.mjsnew file mode 100644index 00000000..527ae8a9--- /dev/null+++ b/archify/scripts/update-contract.mjs@@ -0,0 +1,182 @@+export const SKILL_ID = 'archify';+export const EXPECTED_REPOSITORY = 'https://github.com/tt-a1i/archify';+export const DEFAULT_MANIFEST_URL = 'https://tt-a1i.github.io/archify/skill-updates/archify/stable.json';++const CONTROL_OR_BIDI = /[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/u;+const HEX_40 = /^[a-f0-9]{40}$/;+const HEX_64 = /^[a-f0-9]{64}$/;+const SEMVER = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;+const UTC_SECONDS = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/;++export class UpdateContractError extends Error {+ constructor(message) {+ super(message);+ this.name = 'UpdateContractError';+ }+}++function isPlainObject(value) {+ return Boolean(value) && typeof value === 'object' && !Array.isArray(value);+}++function hasExactKeys(value, expected) {+ return isPlainObject(value)+ && Object.keys(value).sort().join('\0') === [...expected].sort().join('\0');+}++export function parseSemver(value) {+ if (typeof value !== 'string' || value.length > 128) {+ throw new UpdateContractError(`invalid SemVer: ${JSON.stringify(value)}`);+ }+ const match = SEMVER.exec(value);+ if (!match) throw new UpdateContractError(`invalid SemVer: ${JSON.stringify(value)}`);+ const prerelease = match[4]?.split('.') ?? null;+ if (prerelease?.some((identifier) => /^\d+$/.test(identifier)+ && identifier.length > 1 && identifier.startsWith('0'))) {+ throw new UpdateContractError(`invalid SemVer: ${JSON.stringify(value)}`);+ }+ return {+ core: match.slice(1, 4),+ prerelease,+ build: match[5]?.split('.') ?? null,+ };+}++function compareNumericIdentifiers(left, right) {+ if (left.length !== right.length) return left.length < right.length ? -1 : 1;+ if (left === right) return 0;+ return left < right ? -1 : 1;+}++function comparePrerelease(left, right) {+ if (left === null && right === null) return 0;+ if (left === null) return 1;+ if (right === null) return -1;+ const length = Math.max(left.length, right.length);+ for (let index = 0; index < length; index += 1) {+ if (left[index] === undefined) return -1;+ if (right[index] === undefined) return 1;+ if (left[index] === right[index]) continue;+ const leftNumeric = /^\d+$/.test(left[index]);+ const rightNumeric = /^\d+$/.test(right[index]);+ if (leftNumeric && rightNumeric) return compareNumericIdentifiers(left[index], right[index]);+ if (leftNumeric !== rightNumeric) return leftNumeric ? -1 : 1;+ return left[index] < right[index] ? -1 : 1;+ }+ return 0;+}++export function compareSemver(leftValue, rightValue) {+ const left = parseSemver(leftValue);+ const right = parseSemver(rightValue);+ for (let index = 0; index < left.core.length; index += 1) {+ const comparison = compareNumericIdentifiers(left.core[index], right.core[index]);+ if (comparison !== 0) return comparison;+ }+ return comparePrerelease(left.prerelease, right.prerelease);+}++export function releaseChannelForVersion(value) {+ return parseSemver(value).prerelease ? 'development' : 'stable';+}++export function isStableCoreVersion(value) {+ try {+ const parsed = parseSemver(value);+ return parsed.prerelease === null && parsed.build === null;+ } catch {+ return false;+ }+}++export function validateCanonicalUtcTimestamp(value) {+ if (typeof value !== 'string' || !UTC_SECONDS.test(value)) {+ throw new UpdateContractError('publication time must use YYYY-MM-DDTHH:mm:ssZ');+ }+ const timestamp = Date.parse(value);+ if (!Number.isFinite(timestamp)+ || new Date(timestamp).toISOString().replace('.000Z', 'Z') !== value) {+ throw new UpdateContractError('publication time is not a real UTC calendar instant');+ }+ return value;+}++export function validateLocalRelease(value) {+ if (!hasExactKeys(value, [+ 'schemaVersion', 'skillId', 'channel', 'version', 'source', 'updateManifestUrl',+ ])+ || value.schemaVersion !== 1+ || value.skillId !== SKILL_ID+ || !hasExactKeys(value.source, ['repository'])+ || value.source.repository !== EXPECTED_REPOSITORY+ || value.updateManifestUrl !== DEFAULT_MANIFEST_URL) {+ throw new UpdateContractError('invalid local release identity');+ }+ const expectedChannel = releaseChannelForVersion(value.version);+ if (value.channel !== expectedChannel) {+ throw new UpdateContractError('local release channel does not match its version');+ }+ return {+ schemaVersion: value.schemaVersion,+ skillId: value.skillId,+ channel: value.channel,+ version: value.version,+ source: { repository: value.source.repository },+ updateManifestUrl: value.updateManifestUrl,+ };+}++export function validateReleaseNotesUrl(value, version) {+ if (!isStableCoreVersion(version)) {+ throw new UpdateContractError('release notes require a stable core version');+ }+ const expected = `https://github.com/tt-a1i/archify/releases/tag/v${version}`;+ if (value !== expected) {+ throw new UpdateContractError('release notes URL is outside the exact trusted release path');+ }+ return value;+}++export function validateStableUpdateManifest(value) {+ if (!hasExactKeys(value, [+ 'schemaVersion', 'skillId', 'channel', 'version', 'publishedAt', 'source',+ 'artifact', 'summary', 'releaseNotes', 'severity',+ ])+ || value.schemaVersion !== 1+ || value.skillId !== SKILL_ID+ || value.channel !== 'stable'+ || !isStableCoreVersion(value.version)+ || !hasExactKeys(value.source, ['repository', 'ref', 'treeSha'])+ || value.source.repository !== EXPECTED_REPOSITORY+ || value.source.ref !== `v${value.version}`+ || !HEX_40.test(value.source.treeSha)+ || !hasExactKeys(value.artifact, ['sha256'])+ || !HEX_64.test(value.artifact.sha256)) {+ throw new UpdateContractError('invalid immutable stable release identity');+ }+ validateCanonicalUtcTimestamp(value.publishedAt);+ if (typeof value.summary !== 'string' || value.summary.length < 1 || value.summary.length > 160+ || CONTROL_OR_BIDI.test(value.summary)) {+ throw new UpdateContractError('invalid release summary');+ }+ validateReleaseNotesUrl(value.releaseNotes, value.version);+ if (!['normal', 'security'].includes(value.severity)) {+ throw new UpdateContractError('invalid update severity');+ }+ return {+ schemaVersion: value.schemaVersion,+ skillId: value.skillId,+ channel: value.channel,+ version: value.version,+ publishedAt: value.publishedAt,+ source: {+ repository: value.source.repository,+ ref: value.source.ref,+ treeSha: value.source.treeSha,+ },+ artifact: { sha256: value.artifact.sha256 },+ summary: value.summary,+ releaseNotes: value.releaseNotes,+ severity: value.severity,+ };+}diff --git a/archify/skill-release.json b/archify/skill-release.jsonnew file mode 100644index 00000000..3aa6499a--- /dev/null+++ b/archify/skill-release.json@@ -0,0 +1,10 @@+{+ "schemaVersion": 1,+ "skillId": "archify",+ "channel": "development",+ "version": "2.16.0-dev.0",+ "source": {+ "repository": "https://github.com/tt-a1i/archify"+ },+ "updateManifestUrl": "https://tt-a1i.github.io/archify/skill-updates/archify/stable.json"+}diff --git a/archify/test/clean-skill-staging.test.mjs b/archify/test/clean-skill-staging.test.mjsnew file mode 100644index 00000000..c7d7f84d--- /dev/null+++ b/archify/test/clean-skill-staging.test.mjs@@ -0,0 +1,244 @@+import assert from 'node:assert/strict';+import { spawnSync } from 'node:child_process';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import test from 'node:test';+import { fileURLToPath } from 'node:url';++import { stageCleanSkill } from '../../scripts/stage-clean-skill.mjs';++const stagerPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../scripts/stage-clean-skill.mjs');++function git(root, args) {+ const result = spawnSync('git', args, { cwd: root, encoding: 'utf8' });+ assert.equal(result.status, 0, result.stderr);+}++function write(root, relative, content, mode = null) {+ const target = path.join(root, relative);+ fs.mkdirSync(path.dirname(target), { recursive: true });+ fs.writeFileSync(target, content);+ if (mode !== null) fs.chmodSync(target, mode);+ return target;+}++function repositoryFixture() {+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-clean-stage-'));+ write(root, 'archify/package.json', JSON.stringify({+ name: 'archify-fixture',+ scripts: { test: 'node --test' },+ devDependencies: { ajv: '1.0.0' },+ }));+ write(root, 'archify/package-lock.json', '{}\n');+ write(root, 'archify/skill-release.json', '{}\n');+ write(root, 'archify/scripts/check-update.mjs', 'export {};\n');+ write(root, 'archify/scripts/update-contract.mjs', 'export {};\n');+ write(root, 'archify/renderers/shared/generated-validators.mjs', 'export {};\n');+ write(root, 'archify/test/repository-only.test.mjs', 'throw new Error();\n');+ git(root, ['init']);+ return root;+}++test('clean staging preserves index modes and strips repository-only package metadata', () => {+ const root = repositoryFixture();+ const destination = path.join(root, 'staged-skill');+ try {+ write(root, 'archify/bin/executable.mjs', '#!/usr/bin/env node\n', 0o755);+ write(root, 'archify/runtime/test/required.dat', 'runtime fixture\n');+ git(root, ['add', 'archify']);++ stageCleanSkill({ repoRoot: root, destination });++ assert.equal(fs.statSync(path.join(destination, 'bin', 'executable.mjs')).mode & 0o777, 0o755);+ assert.equal(fs.existsSync(path.join(destination, 'test')), false);+ assert.equal(+ fs.readFileSync(path.join(destination, 'runtime', 'test', 'required.dat'), 'utf8'),+ 'runtime fixture\n',+ 'only the repository-root test tree is excluded',+ );+ assert.equal(fs.existsSync(path.join(destination, 'package-lock.json')), false);+ const packageJson = JSON.parse(fs.readFileSync(path.join(destination, 'package.json'), 'utf8'));+ assert.equal(Object.hasOwn(packageJson, 'scripts'), false);+ assert.equal(Object.hasOwn(packageJson, 'devDependencies'), false);+ } finally {+ fs.rmSync(root, { recursive: true, force: true });+ }+});++test('clean staging rejects a symlink in a tracked file ancestor before copying bytes', (t) => {+ const root = repositoryFixture();+ const destination = path.join(root, 'staged-skill');+ try {+ const runtime = path.join(root, 'archify', 'runtime');+ write(root, 'archify/runtime/payload.txt', 'tracked fixture\n');+ git(root, ['add', 'archify']);+ fs.rmSync(runtime, { recursive: true });+ const external = path.join(root, 'outside-runtime');+ write(root, 'outside-runtime/payload.txt', 'external secret\n');+ try {+ fs.symlinkSync(external, runtime, process.platform === 'win32' ? 'junction' : 'dir');+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`symlinks unavailable: ${error.code}`);+ return;+ }+ throw error;+ }++ assert.throws(+ () => stageCleanSkill({ repoRoot: root, destination }),+ /refusing to package path through symlink: archify\/runtime/,+ );+ assert.equal(fs.existsSync(destination), false);+ } finally {+ fs.rmSync(root, { recursive: true, force: true });+ }+});++test('clean staging rejects tracked symlinks before reading through them', (t) => {+ const root = repositoryFixture();+ const destination = path.join(root, 'staged-skill');+ try {+ const external = write(root, 'outside.txt', 'private fixture\n');+ const linked = path.join(root, 'archify', 'linked.txt');+ try {+ fs.symlinkSync(external, linked);+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`symlinks unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ git(root, ['add', 'archify']);++ assert.throws(+ () => stageCleanSkill({ repoRoot: root, destination }),+ /refusing to package tracked symlink: archify\/linked\.txt/,+ );+ assert.equal(fs.existsSync(destination), false);+ } finally {+ fs.rmSync(root, { recursive: true, force: true });+ }+});++test('clean staging snapshots unstaged tracked bytes before a source ancestor can be swapped', (t) => {+ const root = repositoryFixture();+ const destination = path.join(root, 'staged-skill');+ const runtime = path.join(root, 'archify', 'runtime');+ const external = path.join(root, 'outside-runtime');+ const originalMkdirSync = fs.mkdirSync;+ let swapped = false;+ try {+ const payload = write(root, 'archify/runtime/payload.txt', 'indexed fixture\n');+ write(root, 'outside-runtime/payload.txt', 'external secret\n');+ git(root, ['add', 'archify']);+ fs.writeFileSync(payload, 'unstaged working-tree fixture\n');++ const probe = path.join(root, 'symlink-probe');+ try {+ fs.symlinkSync(external, probe, process.platform === 'win32' ? 'junction' : 'dir');+ fs.rmSync(probe, { force: true });+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`symlinks unavailable: ${error.code}`);+ return;+ }+ throw error;+ }++ fs.mkdirSync = function swapSourceAfterSnapshot(target, ...args) {+ const result = originalMkdirSync.call(fs, target, ...args);+ if (!swapped && path.resolve(target) === path.resolve(destination)) {+ fs.rmSync(runtime, { recursive: true });+ fs.symlinkSync(external, runtime, process.platform === 'win32' ? 'junction' : 'dir');+ swapped = true;+ }+ return result;+ };++ stageCleanSkill({ repoRoot: root, destination });++ assert.equal(swapped, true, 'the deterministic ancestor-swap attack must run');+ assert.equal(+ fs.readFileSync(path.join(destination, 'runtime', 'payload.txt'), 'utf8'),+ 'unstaged working-tree fixture\n',+ 'staging keeps the tracked working-tree snapshot and never follows the replacement ancestor',+ );+ } finally {+ fs.mkdirSync = originalMkdirSync;+ fs.rmSync(root, { recursive: true, force: true });+ }+});++test('clean staging rejects a source ancestor swapped during preflight traversal', (t) => {+ const root = repositoryFixture();+ const destination = path.join(root, 'staged-skill');+ const runtime = path.join(root, 'archify', 'runtime');+ const external = path.join(root, 'outside-runtime');+ const originalLstatSync = fs.lstatSync;+ let swapped = false;+ try {+ write(root, 'archify/runtime/payload.txt', 'tracked fixture\n');+ write(root, 'outside-runtime/payload.txt', 'external secret\n');+ git(root, ['add', 'archify']);+ const canonicalRuntime = path.join(fs.realpathSync(root), 'archify', 'runtime');++ const probe = path.join(root, 'symlink-probe');+ try {+ fs.symlinkSync(external, probe, process.platform === 'win32' ? 'junction' : 'dir');+ fs.rmSync(probe, { force: true });+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`symlinks unavailable: ${error.code}`);+ return;+ }+ throw error;+ }++ fs.lstatSync = function swapSourceBetweenAncestorAndLeaf(target, ...args) {+ const metadata = originalLstatSync.call(fs, target, ...args);+ if (!swapped && path.resolve(target) === canonicalRuntime) {+ // Guard before mutation: recursive removal can re-enter the patched+ // lstatSync implementation on Linux.+ swapped = true;+ fs.rmSync(runtime, { recursive: true });+ fs.symlinkSync(external, runtime, process.platform === 'win32' ? 'junction' : 'dir');+ }+ return metadata;+ };++ assert.throws(+ () => stageCleanSkill({ repoRoot: root, destination }),+ /(?:tracked package path changed before it could be read: archify\/|tracked package input is missing or unreadable: archify\/runtime\/payload\.txt)/,+ );+ assert.equal(swapped, true, 'the deterministic mid-preflight ancestor swap must run');+ assert.equal(fs.existsSync(destination), false);+ } finally {+ fs.lstatSync = originalLstatSync;+ fs.rmSync(root, { recursive: true, force: true });+ }+});++test('clean staging reports the Git spawn error when Git cannot start', () => {+ const root = repositoryFixture();+ const destination = path.join(root, 'staged-skill');+ try {+ git(root, ['add', 'archify']);+ const result = spawnSync(process.execPath, [+ stagerPath,+ '--root', root,+ '--dest', destination,+ ], {+ encoding: 'utf8',+ env: { ...process.env, PATH: '' },+ });+ assert.notEqual(result.status, 0);+ assert.match(result.stderr, /unable to enumerate tracked Archify files: .*ENOENT/);+ assert.doesNotMatch(result.stderr, /tracked Archify paths must be valid UTF-8/);+ assert.equal(fs.existsSync(destination), false);+ } finally {+ fs.rmSync(root, { recursive: true, force: true });+ }+});diff --git a/archify/test/generated-artifact-xml.test.mjs b/archify/test/generated-artifact-xml.test.mjsindex 3ed8d14a..22e7a7af 100644--- a/archify/test/generated-artifact-xml.test.mjs+++ b/archify/test/generated-artifact-xml.test.mjs@@ -70,3 +70,19 @@ test('tracked browsable HTML embeds well-formed XML SVG', () => {assert.equal(checkoutSvgs?.direct.length, 1, 'Checkout must contain one comparison SVG');assert.equal(checkoutSvgs?.embedded.length, 2, 'Checkout must retain its base/head SVG snapshots');});++test('legacy example URLs redirect to the current canonical artifacts', () => {+ for (const [legacy, canonical] of [+ ['examples/workflow-agent-tool-call.html', 'workflow-agent-tool-call-rendered.html'],+ ['examples/sequence-cache-miss.html', 'sequence-cache-miss-request.html'],+ ]) {+ const html = fs.readFileSync(path.join(repoRoot, legacy), 'utf8');+ assert.match(html, new RegExp(`<link rel="canonical" href="${canonical}">`));+ assert.match(+ html,+ new RegExp(`window\\.location\\.replace\\("${canonical}" \\+ window\\.location\\.search \\+ window\\.location\\.hash\\)`),+ `${legacy} must preserve query parameters and deep-link fragments`,+ );+ assert.equal(fs.existsSync(path.join(repoRoot, 'examples', canonical)), true);+ }+});diff --git a/archify/test/preview-contract.test.mjs b/archify/test/preview-contract.test.mjsindex 32eaf1c1..ccf5bb26 100644--- a/archify/test/preview-contract.test.mjs+++ b/archify/test/preview-contract.test.mjs@@ -12,7 +12,6 @@ const delivery = fs.readFileSync(path.join(skillRoot, 'references', 'delivery-coconst readme = fs.readFileSync(path.join(repoRoot, 'README.md'), 'utf8');const english = fs.readFileSync(path.join(repoRoot, 'README_EN.md'), 'utf8');const chinese = fs.readFileSync(path.join(repoRoot, 'README_ZH.md'), 'utf8');-const roadmap = fs.readFileSync(path.join(repoRoot, 'ROADMAP.md'), 'utf8');test('preview contract: the skill keeps live preview explicit, desktop-only, and last-good', () => {assert.match(delivery, /archify\.mjs preview <type> <input>\.json <output>\.html/);@@ -34,8 +33,8 @@ test('preview contract: all README languages document the same optional command}});-test('preview contract: roadmap records the no-leak and zero-dependency boundary', () => {- assert.match(roadmap, /Last-Good Live Preview/);- assert.match(roadmap, /installed ZIP skills keep the zero-dependency contract/i);- assert.match(roadmap, /no server state, port, path, error, or reload token enters HTML/i);+test('preview contract: the canonical delivery reference owns no-leak and zero-dependency boundaries', () => {+ assert.match(delivery, /Last-Good Live Preview/);+ assert.match(delivery, /zero-dependency Skill ZIP/i);+ assert.match(delivery, /Server state, port, source path, diagnostics, error text, and reload tokens must never enter/i);});diff --git a/archify/test/release-identity.test.mjs b/archify/test/release-identity.test.mjsindex 370e8331..aee8cb97 100644--- a/archify/test/release-identity.test.mjs+++ b/archify/test/release-identity.test.mjs@@ -22,6 +22,25 @@ function runCheck(root) {});}+function stableUpdateManifest(version) {+ return JSON.stringify({+ schemaVersion: 1,+ skillId: 'archify',+ channel: 'stable',+ version,+ publishedAt: '2026-07-29T00:00:00Z',+ source: {+ repository: 'https://github.com/tt-a1i/archify',+ ref: `v${version}`,+ treeSha: 'a'.repeat(40),+ },+ artifact: { sha256: 'b'.repeat(64) },+ summary: 'Published stable release.',+ releaseNotes: `https://github.com/tt-a1i/archify/releases/tag/v${version}`,+ severity: 'normal',+ });+}+function writeValidDevelopmentFixture(root, overrides = {}) {const version = '2.13.0-dev.0';const english = [@@ -41,6 +60,15 @@ function writeValidDevelopmentFixture(root, overrides = {}) {const files = {'archify/package.json': JSON.stringify({ version }),'archify/package-lock.json': JSON.stringify({ version, packages: { '': { version } } }),+ 'archify/skill-release.json': JSON.stringify({+ schemaVersion: 1,+ skillId: 'archify',+ channel: 'development',+ version,+ source: { repository: 'https://github.com/tt-a1i/archify' },+ updateManifestUrl: 'https://tt-a1i.github.io/archify/skill-updates/archify/stable.json',+ }),+ 'docs/skill-updates/archify/stable.json': stableUpdateManifest('2.12.0'),'archify/SKILL.md': '---\nmetadata:\n version: "2.13"\n---\n','archify/assets/template.html': '<meta name="generator" content="archify 2.13.0-dev.0">','CHANGELOG.md': [@@ -90,6 +118,15 @@ function writeValidStableFixture(root, overrides = {}) {const files = {'archify/package.json': JSON.stringify({ version }),'archify/package-lock.json': JSON.stringify({ version, packages: { '': { version } } }),+ 'archify/skill-release.json': JSON.stringify({+ schemaVersion: 1,+ skillId: 'archify',+ channel: 'stable',+ version,+ source: { repository: 'https://github.com/tt-a1i/archify' },+ updateManifestUrl: 'https://tt-a1i.github.io/archify/skill-updates/archify/stable.json',+ }),+ 'docs/skill-updates/archify/stable.json': stableUpdateManifest(version),'archify/SKILL.md': '---\nmetadata:\n version: "2.13"\n---\n','archify/assets/template.html': '<meta name="generator" content="archify 2.13.0">','CHANGELOG.md': [@@ -129,6 +166,136 @@ test('an empty Unreleased section accepts a coherent stable release identity', (}});+test('stable release preparation allows only the immediate prior public manifest', () => {+ const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-release-identity-'));+ try {+ const changelog = [+ '# Changelog',+ '',+ '## [Unreleased]',+ '',+ '## [2.13.0] — 2026-07-29',+ '- Release being prepared.',+ '',+ '## [2.12.0] — 2026-07-23',+ '- Previously published release.',+ '',+ ].join('\n');+ writeValidStableFixture(fixture, {+ 'CHANGELOG.md': changelog,+ 'docs/skill-updates/archify/stable.json': stableUpdateManifest('2.12.0'),+ });++ const prior = runCheck(fixture);+ assert.equal(prior.status, 0, prior.stderr);++ writeFile(fixture, 'docs/skill-updates/archify/stable.json', stableUpdateManifest('2.11.0'));+ const stale = runCheck(fixture);+ assert.notEqual(stale.status, 0);+ assert.match(stale.stderr, /immediate prior v2\.12\.0/);+ } finally {+ fs.rmSync(fixture, { recursive: true, force: true });+ }+});++test('the embedded update identity must match the package release exactly', () => {+ const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-release-identity-'));+ try {+ writeValidDevelopmentFixture(fixture, {+ 'archify/skill-release.json': JSON.stringify({+ schemaVersion: 1,+ skillId: 'archify',+ channel: 'stable',+ version: '2.12.0',+ source: { repository: 'https://example.com/untrusted/archify' },+ updateManifestUrl: 'https://example.com/latest.json',+ }),+ });++ const result = runCheck(fixture);+ assert.notEqual(result.status, 0);+ assert.match(result.stderr, /archify\/skill-release\.json must identify archify 2\.13\.0-dev\.0 as development/);+ } finally {+ fs.rmSync(fixture, { recursive: true, force: true });+ }+});++test('the published update manifest must track the newest stable changelog release', () => {+ const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-release-identity-'));+ try {+ writeValidDevelopmentFixture(fixture, {+ 'docs/skill-updates/archify/stable.json': stableUpdateManifest('2.11.0'),+ });++ const result = runCheck(fixture);+ assert.notEqual(result.status, 0);+ assert.match(result.stderr, /stable\.json must describe the newest published stable v2\.12\.0/);+ } finally {+ fs.rmSync(fixture, { recursive: true, force: true });+ }+});++test('the published update manifest must use a canonical UTC timestamp', () => {+ const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-release-identity-'));+ try {+ const manifest = JSON.parse(stableUpdateManifest('2.12.0'));+ manifest.publishedAt = '2026-07-29T08:00:00+08:00';+ writeValidDevelopmentFixture(fixture, {+ 'docs/skill-updates/archify/stable.json': JSON.stringify(manifest),+ });++ const result = runCheck(fixture);+ assert.notEqual(result.status, 0);+ assert.match(result.stderr, /stable\.json must describe the newest published stable v2\.12\.0/);+ } finally {+ fs.rmSync(fixture, { recursive: true, force: true });+ }+});++test('package identities reject leading-zero core and prerelease identifiers', () => {+ for (const version of ['02.13.0', '2.13.0-dev.01']) {+ const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-release-identity-'));+ try {+ writeValidDevelopmentFixture(fixture, {+ 'archify/package.json': JSON.stringify({ version }),+ });+ const result = runCheck(fixture);+ assert.notEqual(result.status, 0);+ assert.match(result.stderr, /not a supported SemVer identity/, version);+ } finally {+ fs.rmSync(fixture, { recursive: true, force: true });+ }+ }+});++test('the newest stable release is selected by SemVer rather than changelog order', () => {+ const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-release-identity-'));+ try {+ writeValidDevelopmentFixture(fixture, {+ 'CHANGELOG.md': [+ '# Changelog',+ '',+ '## [Unreleased]',+ '',+ '> Development identity: `v2.13.0-dev.0`. Not a stable release.',+ '',+ '### Added',+ '- Real unreleased work.',+ '',+ '## [2.11.0] — 2026-07-16',+ '',+ '## [2.12.0] — 2026-07-23',+ '',+ ].join('\n'),+ });++ const result = runCheck(fixture);+ assert.equal(result.status, 0, result.stderr);+ } finally {+ fs.rmSync(fixture, { recursive: true, force: true });+ }+});+test('real Unreleased changes cannot reuse a stable published package identity', () => {const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-release-identity-'));try {diff --git a/archify/test/release-package-gates.test.mjs b/archify/test/release-package-gates.test.mjsindex 567268ea..2eaf88a5 100644--- a/archify/test/release-package-gates.test.mjs+++ b/archify/test/release-package-gates.test.mjs@@ -6,6 +6,8 @@ import os from 'node:os';import path from 'node:path';import { fileURLToPath } from 'node:url';+import { stageCleanSkill } from '../../scripts/stage-clean-skill.mjs';+const __dirname = path.dirname(fileURLToPath(import.meta.url));const repoRoot = path.resolve(__dirname, '..', '..');const canonicalZipNodeMajor = 22;@@ -32,27 +34,93 @@ function workflowJob(workflow, name) {return workflow.slice(start, next === -1 ? workflow.length : start + marker.length + next);}-test('release smokes the exact archive built for the release before freshness and upload', () => {+test('release prevents manifest preannouncement and smokes the exact archive before upload', () => {const workflow = fs.readFileSync(path.join(repoRoot, '.github', 'workflows', 'release.yml'), 'utf8');const tagGate = workflowStep(workflow, 'Tag must match package.json version');+ const annotatedTagGate = workflowStep(workflow, 'Stable release tag must be annotated');+ const publicationOrder = workflowStep(workflow, 'Stable notifier manifest must remain on the previous release');const build = workflowStep(workflow, 'Build skill archive');const smoke = workflowStep(workflow, 'Validate the exact release archive without installing dependencies');const freshness = workflowStep(workflow, 'Committed zip must match the build (same gate as CI)');const upload = workflowStep(workflow, 'Create GitHub Release with the zip attached');+ const followUp = workflowStep(workflow, 'Record stable notifier publication follow-up');- assert.ok(workflow.indexOf(tagGate) < workflow.indexOf(build), 'tag/version gate must precede the release build');+ assert.ok(workflow.indexOf(tagGate) < workflow.indexOf(publicationOrder), 'tag/version gate must precede the publication-order gate');+ assert.ok(workflow.indexOf(tagGate) < workflow.indexOf(annotatedTagGate), 'tag/version gate must precede the annotated-tag gate');+ assert.ok(workflow.indexOf(annotatedTagGate) < workflow.indexOf(publicationOrder), 'annotated-tag gate must precede the publication-order gate');+ assert.ok(workflow.indexOf(publicationOrder) < workflow.indexOf(build), 'manifest preannouncement must fail before the release build');assert.ok(workflow.indexOf(build) < workflow.indexOf(smoke), 'release smoke must follow the archive build');assert.ok(workflow.indexOf(smoke) < workflow.indexOf(freshness), 'release smoke must inspect the built archive before comparison');assert.ok(workflow.indexOf(freshness) < workflow.indexOf(upload), 'freshness must pass before release upload');+ assert.ok(workflow.indexOf(upload) < workflow.indexOf(followUp), 'manifest follow-up must be recorded only after Release creation');assert.match(tagGate, /require\('\.\/archify\/package\.json'\)\.version/);assert.match(tagGate, /GITHUB_REF_NAME#v/);+ assert.match(annotatedTagGate, /steps\.release-kind\.outputs\.prerelease == 'false'/);+ assert.match(annotatedTagGate, /git cat-file -t "refs\/tags\/\$\{GITHUB_REF_NAME\}"/);+ assert.match(annotatedTagGate, /stable releases require an annotated tag/);+ assert.match(publicationOrder, /compareSemver\(published\.version, releasing\) >= 0/);+ assert.match(publicationOrder, /publish the manifest in a follow-up commit/);assert.match(build, /run: scripts\/build-zip\.sh \/tmp\/archify-built\.zip/);assert.match(smoke, /unzip -q \/tmp\/archify-built\.zip -d "\$package_root"/);assert.match(smoke, /node scripts\/package-smoke\.mjs "\$package_root\/archify"/);assert.doesNotMatch(smoke, /\bnpm\s+(?:ci|install)\b/);assert.match(freshness, /cmp -s \/tmp\/archify-built\.zip archify\.zip/);assert.match(upload, /files: archify\.zip/);+ assert.match(followUp, /docs\/skill-updates\/archify\/stable\.json/);+});++test('CI binds a public notifier manifest to the Release asset, tagged archive, and tag tree build', () => {+ const workflow = fs.readFileSync(path.join(repoRoot, '.github', 'workflows', 'ci.yml'), 'utf8');+ const job = workflowJob(workflow, 'published-update-manifest');+ assert.match(job, /validateStableUpdateManifest/);+ assert.match(job, /releases\/latest/);+ assert.match(job, /latest_stable_tag" != "v\$\{manifest_version\}"/);+ assert.match(job, /releases\/tags\/v\$\{manifest_version\}/);+ assert.match(job, /select\(\.draft == false and \.prerelease == false\)/);+ assert.match(job, /select\(\.name == "archify\.zip"\)/);+ assert.match(job, /releases\/assets\/\$\{release_asset_id\}/);+ assert.match(job, /Accept: application\/octet-stream/);+ assert.match(job, /refs\/tags\/v\$\{manifest_version\}:refs\/tags\/v\$\{manifest_version\}/);+ assert.match(job, /git show "v\$\{manifest_version\}:archify\.zip" > "\$tagged_archive"/);+ assert.match(job, /cmp -s "\$published_archive" "\$tagged_archive"/);+ assert.match(job, /check-stable-update-manifest\.mjs/);+ assert.match(job, /--archive "\$published_archive"/);+ assert.match(job, /--tag "v\$\{manifest_version\}"/);+ assert.match(job, /--source-ref "v\$\{manifest_version\}"/);+ assert.match(job, /git worktree add --detach "\$tag_checkout" "v\$\{manifest_version\}"/);+ assert.match(job, /"\$tag_checkout\/scripts\/build-zip\.sh" "\$rebuilt_archive"/);+ assert.match(job, /cmp -s "\$rebuilt_archive" "\$tagged_archive"/);+ assert.match(job, /manifest_version" == "2\.15\.0"/);+ assert.match(job, /missing the deterministic archive builder/);+});++test('release docs disclose that mutable Release assets are verified only at deployment time', () => {+ const design = fs.readFileSync(+ path.join(repoRoot, 'docs', 'skill-embedded-optional-update-notifier-design.md'),+ 'utf8',+ );+ assert.match(design, /部署时点/);+ assert.match(design, /部署后替换[^。]*不会自动触发复验/);+ assert.match(design, /immutable release/i);+ assert.doesNotMatch(design, /即使 Release 资产后来可被替换,也不能脱离/);+});++test('GitHub Pages deploys docs only after every repository gate succeeds', () => {+ const workflow = fs.readFileSync(path.join(repoRoot, '.github', 'workflows', 'ci.yml'), 'utf8');+ const job = workflowJob(workflow, 'deploy-pages');+ assert.match(job, /if: github\.event_name == 'push' && github\.ref == 'refs\/heads\/main'/);+ assert.match(job, /needs: \[test, webm-artifact, zip-freshness, published-update-manifest, package-smoke\]/);+ assert.match(job, /pages: write/);+ assert.match(job, /id-token: write/);+ assert.match(job, /repos\/\$\{GITHUB_REPOSITORY\}\/git\/ref\/heads\/main/);+ assert.match(job, /current_main" == "\$GITHUB_SHA"/);+ assert.match(job, /Skipping obsolete Pages deployment/);+ assert.match(job, /if: steps\.deployment-head\.outputs\.current == 'true'/);+ assert.match(job, /actions\/configure-pages@v5/);+ assert.match(job, /actions\/upload-pages-artifact@v4/);+ assert.match(job, /path: docs/);+ assert.match(job, /actions\/deploy-pages@v4/);});test('release tags with a SemVer prerelease are marked prerelease and never become latest', () => {@@ -62,7 +130,10 @@ test('release tags with a SemVer prerelease are marked prerelease and never becoassert.ok(workflow.indexOf(classifier) < workflow.indexOf(upload), 'release kind must be known before upload');assert.match(classifier, /version="\$\{GITHUB_REF_NAME#v\}"/);- assert.match(classifier, /if \[\[ "\$version" == \*-\* \]\]/);+ assert.match(classifier, /validateLocalRelease/);+ assert.match(classifier, /update-contract\.mjs/);+ assert.match(classifier, /release\.version !== process\.argv\[1\]/);+ assert.match(classifier, /if \[\[ "\$channel" == "development" \]\]/);assert.match(classifier, /echo "prerelease=true" >> "\$GITHUB_OUTPUT"/);assert.match(classifier, /echo "make_latest=false" >> "\$GITHUB_OUTPUT"/);assert.match(classifier, /echo "prerelease=false" >> "\$GITHUB_OUTPUT"/);@@ -107,6 +178,52 @@ test('package smoke rejects every dependency or repository-only artifact', () =>}});+test('package smoke verifies the embedded notifier identity and local disable switch', () => {+ const source = fs.readFileSync(path.join(repoRoot, 'scripts', 'package-smoke.mjs'), 'utf8');+ assert.match(source, /scripts', 'check-update\.mjs/);+ assert.match(source, /scripts', 'update-contract\.mjs/);+ assert.match(source, /skill-release\.json/);+ assert.match(source, /ARCHIFY_UPDATE_CHECK_DISABLED: '1'/);+ assert.match(source, /reason !== 'disabled'/);+});++test('package smoke increments an arbitrary-precision SemVer patch without Number coercion', () => {+ const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-package-bigint-version-'));+ const skillRoot = path.join(scratch, 'archify');+ try {+ stageCleanSkill({ repoRoot, destination: skillRoot });+ const packagePath = path.join(skillRoot, 'package.json');+ const releasePath = path.join(skillRoot, 'skill-release.json');+ const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));+ const release = JSON.parse(fs.readFileSync(releasePath, 'utf8'));+ const version = '2.16.9007199254740993';+ packageJson.version = version;+ release.version = version;+ release.channel = 'stable';+ fs.writeFileSync(packagePath, `${JSON.stringify(packageJson, null, 2)}\n`);+ fs.writeFileSync(releasePath, `${JSON.stringify(release, null, 2)}\n`);++ const smoke = spawnSync(process.execPath, [path.join(repoRoot, 'scripts/package-smoke.mjs'), skillRoot], {+ cwd: repoRoot,+ encoding: 'utf8',+ });+ assert.equal(smoke.status, 0, smoke.stderr || smoke.stdout);+ } finally {+ fs.rmSync(scratch, { recursive: true, force: true });+ }+});++test('archive build refuses to silently omit required notifier files', () => {+ const buildSource = fs.readFileSync(path.join(repoRoot, 'scripts', 'build-zip.sh'), 'utf8');+ const stageSource = fs.readFileSync(path.join(repoRoot, 'scripts', 'stage-clean-skill.mjs'), 'utf8');+ assert.match(buildSource, /stage-clean-skill\.mjs/);+ assert.match(stageSource, /archify\/skill-release\.json/);+ assert.match(stageSource, /archify\/scripts\/check-update\.mjs/);+ assert.match(stageSource, /archify\/scripts\/update-contract\.mjs/);+ assert.match(stageSource, /git', \['ls-files', '--stage', '-z'/);+ assert.match(stageSource, /required package input is not tracked by Git/);+});+canonicalZipTest('package smoke rejects every dependency metadata field in a built package', () => {const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-built-package-gate-'));try {@@ -150,6 +267,27 @@ canonicalZipTest('package smoke rejects every dependency metadata field in a bui}});+canonicalZipTest('built archives contain the embedded notifier runtime', () => {+ const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-notifier-package-gate-'));+ try {+ const archive = path.join(fixture, 'archify.zip');+ const build = spawnSync(path.join(repoRoot, 'scripts', 'build-zip.sh'), [archive], {+ cwd: repoRoot,+ encoding: 'utf8',+ });+ assert.equal(build.status, 0, `${build.stdout}\n${build.stderr}`);++ const listing = spawnSync('unzip', ['-Z1', archive], { encoding: 'utf8' });+ assert.equal(listing.status, 0, `${listing.stdout}\n${listing.stderr}`);+ const entries = new Set(listing.stdout.trim().split('\n'));+ assert.ok(entries.has('archify/skill-release.json'));+ assert.ok(entries.has('archify/scripts/check-update.mjs'));+ assert.ok(entries.has('archify/scripts/update-contract.mjs'));+ } finally {+ fs.rmSync(fixture, { recursive: true, force: true });+ }+});+canonicalZipTest('archive build excludes untracked files and external symlinks from the live working tree', () => {const marker = `.package-negative-${process.pid}-${Date.now()}`;const untracked = path.join(repoRoot, 'archify', `${marker}.txt`);@@ -196,13 +334,21 @@ canonicalZipTest('archive build rejects an unmerged index and preserves an existtry {fs.mkdirSync(path.join(skill, 'renderers', 'shared'), { recursive: true });+ fs.mkdirSync(path.join(skill, 'scripts'), { recursive: true });fs.mkdirSync(scripts);fs.copyFileSync(path.join(repoRoot, 'scripts', 'build-zip.sh'), path.join(scripts, 'build-zip.sh'));fs.copyFileSync(path.join(repoRoot, 'scripts', 'write-deterministic-zip.mjs'),path.join(scripts, 'write-deterministic-zip.mjs'),);+ fs.copyFileSync(+ path.join(repoRoot, 'scripts', 'stage-clean-skill.mjs'),+ path.join(scripts, 'stage-clean-skill.mjs'),+ );fs.writeFileSync(path.join(skill, 'renderers', 'shared', 'generated-validators.mjs'), 'export default {};\n');+ fs.writeFileSync(path.join(skill, 'scripts', 'check-update.mjs'), 'export {};\n');+ fs.writeFileSync(path.join(skill, 'scripts', 'update-contract.mjs'), 'export {};\n');+ fs.writeFileSync(path.join(skill, 'skill-release.json'), '{}\n');fs.writeFileSync(path.join(skill, 'package.json'), '{"name":"archify"}\n');fs.writeFileSync(license, 'base\n');assert.equal(git(['init']).status, 0);diff --git a/archify/test/skill-metadata.test.mjs b/archify/test/skill-metadata.test.mjsindex 02f1d310..589fdd4d 100644--- a/archify/test/skill-metadata.test.mjs+++ b/archify/test/skill-metadata.test.mjs@@ -48,6 +48,17 @@ test('main skill stays a bounded authoring router with progressive references',}});+test('update awareness is notification-only and never replaces the requested workflow', () => {+ assert.match(skill, /`scripts\/check-update\.mjs`/);+ assert.match(skill, /`silent`[\s\S]*without mentioning/i);+ assert.match(skill, /`update_available`[\s\S]*compact notice/i);+ assert.match(skill, /information, not permission/i);+ assert.match(skill, /`severity` is `security`[\s\S]*security update[\s\S]*emphasis only, never user autonomy/i);+ assert.match(skill, /continue the user's original task/i);+ assert.match(skill, /installed version unchanged/i);+ assert.doesNotMatch(skill, /npx skills update|gh skill update/i);+});+test('language behavior stays within the bounded locale contract', () => {assert.match(skill, /one primary authored language/);assert.match(skill, /explicit user choice; otherwise follow the request or conversation's dominant language/);diff --git a/archify/test/stable-update-manifest.test.mjs b/archify/test/stable-update-manifest.test.mjsnew file mode 100644index 00000000..3837ede6--- /dev/null+++ b/archify/test/stable-update-manifest.test.mjs@@ -0,0 +1,167 @@+import assert from 'node:assert/strict';+import crypto from 'node:crypto';+import { spawnSync } from 'node:child_process';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';+import test from 'node:test';+import { fileURLToPath } from 'node:url';++const here = path.dirname(fileURLToPath(import.meta.url));+const repoRoot = path.resolve(here, '..', '..');+const checker = path.join(repoRoot, 'scripts', 'check-stable-update-manifest.mjs');++function git(root, args) {+ return spawnSync('git', args, { cwd: root, encoding: 'utf8' });+}++function annotatedTaggerTime(root, tag) {+ const result = git(root, [+ 'for-each-ref',+ '--format=%(taggerdate:unix)',+ `refs/tags/${tag}`,+ ]);+ assert.equal(result.status, 0, result.stderr);+ assert.match(result.stdout.trim(), /^\d+$/);+ return new Date(Number(result.stdout.trim()) * 1_000)+ .toISOString()+ .replace('.000Z', 'Z');+}++function writeJson(target, value) {+ fs.mkdirSync(path.dirname(target), { recursive: true });+ fs.writeFileSync(target, `${JSON.stringify(value, null, 2)}\n`);+}++function runCheck(root, archive, extraArguments = []) {+ return spawnSync(process.execPath, [+ checker,+ '--root', root,+ '--archive', archive,+ '--tag', 'v3.0.0',+ ...extraArguments,+ ], { encoding: 'utf8' });+}++test('stable release gate binds manifest tag, tree, and final archive digest', () => {+ const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-stable-manifest-'));+ try {+ writeJson(path.join(fixture, 'archify', 'package.json'), { version: '3.0.0' });+ fs.writeFileSync(path.join(fixture, 'archify', 'SKILL.md'), 'stable fixture\n');+ assert.equal(git(fixture, ['init']).status, 0);+ assert.equal(git(fixture, ['add', 'archify']).status, 0);+ assert.equal(git(fixture, [+ '-c', 'user.name=Archify Test',+ '-c', '[email protected]',+ 'commit', '-m', 'stable fixture',+ ]).status, 0);+ assert.equal(git(fixture, [+ '-c', 'user.name=Archify Test',+ '-c', '[email protected]',+ 'tag', '-a', 'v3.0.0', '-m', 'stable v3.0.0',+ ]).status, 0);+ const publishedAt = annotatedTaggerTime(fixture, 'v3.0.0');+ const tree = git(fixture, ['rev-parse', 'HEAD:archify']);+ assert.equal(tree.status, 0, tree.stderr);+ const treeSha = tree.stdout.trim();+ const archive = path.join(fixture, 'archify.zip');+ const archiveBytes = Buffer.from('deterministic stable archive fixture');+ fs.writeFileSync(archive, archiveBytes);+ const artifactSha = crypto.createHash('sha256').update(archiveBytes).digest('hex');+ const manifestPath = path.join(fixture, 'docs', 'skill-updates', 'archify', 'stable.json');+ const manifest = {+ schemaVersion: 1,+ skillId: 'archify',+ channel: 'stable',+ version: '3.0.0',+ publishedAt,+ source: {+ repository: 'https://github.com/tt-a1i/archify',+ ref: 'v3.0.0',+ treeSha,+ },+ artifact: { sha256: artifactSha },+ summary: 'Stable release fixture.',+ releaseNotes: 'https://github.com/tt-a1i/archify/releases/tag/v3.0.0',+ severity: 'normal',+ };+ writeJson(manifestPath, manifest);++ const passing = runCheck(fixture, archive);+ assert.equal(passing.status, 0, passing.stderr);+ assert.match(passing.stdout, /stable update manifest ok: v3\.0\.0/);++ writeJson(path.join(fixture, 'archify', 'package.json'), { version: '4.0.0-dev.0' });+ const historicalRelease = runCheck(fixture, archive, ['--source-ref', 'v3.0.0']);+ assert.equal(historicalRelease.status, 0, historicalRelease.stderr);+ const wrongHistoricalRef = runCheck(fixture, archive, ['--source-ref', 'v2.9.0']);+ assert.notEqual(wrongHistoricalRef.status, 0);+ assert.match(wrongHistoricalRef.stderr, /--source-ref must be HEAD or the exact release tag/);+ writeJson(path.join(fixture, 'archify', 'package.json'), { version: '3.0.0' });++ writeJson(manifestPath, {+ ...manifest,+ publishedAt: '2026-08-28T08:00:00+08:00',+ });+ const nonUtcTimestamp = runCheck(fixture, archive);+ assert.notEqual(nonUtcTimestamp.status, 0);+ assert.match(nonUtcTimestamp.stderr, /stable update manifest identity/);+ writeJson(manifestPath, manifest);++ writeJson(manifestPath, {+ ...manifest,+ publishedAt: new Date(Date.parse(publishedAt) + 1_000)+ .toISOString()+ .replace('.000Z', 'Z'),+ });+ const wrongTaggerTime = runCheck(fixture, archive);+ assert.notEqual(wrongTaggerTime.status, 0);+ assert.match(wrongTaggerTime.stderr, /publishedAt .* annotated tagger time/);+ writeJson(manifestPath, manifest);++ const invalidContracts = [+ { ...manifest, extra: true },+ { ...manifest, source: { ...manifest.source, extra: true } },+ { ...manifest, artifact: { ...manifest.artifact, extra: true } },+ { ...manifest, summary: '\u202eunsafe' },+ { ...manifest, severity: 'urgent' },+ ];+ for (const invalid of invalidContracts) {+ writeJson(manifestPath, invalid);+ const rejected = runCheck(fixture, archive);+ assert.notEqual(rejected.status, 0);+ assert.match(rejected.stderr, /stable update manifest identity/);+ }+ writeJson(manifestPath, manifest);++ writeJson(manifestPath, null);+ const nullManifest = runCheck(fixture, archive);+ assert.notEqual(nullManifest.status, 0);+ assert.match(nullManifest.stderr, /stable update manifest identity/);+ assert.doesNotMatch(nullManifest.stderr, /TypeError|check-stable-update-manifest\.mjs:\d+/);+ writeJson(manifestPath, manifest);++ fs.appendFileSync(archive, 'tampered');+ const archiveMismatch = runCheck(fixture, archive);+ assert.notEqual(archiveMismatch.status, 0);+ assert.match(archiveMismatch.stderr, /archive sha256 .* does not match/);++ fs.writeFileSync(archive, archiveBytes);+ writeJson(manifestPath, {+ ...manifest,+ source: { ...manifest.source, treeSha: 'c'.repeat(40) },+ });+ const treeMismatch = runCheck(fixture, archive);+ assert.notEqual(treeMismatch.status, 0);+ assert.match(treeMismatch.stderr, /treeSha .* does not match HEAD:archify/);++ writeJson(manifestPath, manifest);+ assert.equal(git(fixture, ['tag', '-d', 'v3.0.0']).status, 0);+ assert.equal(git(fixture, ['tag', 'v3.0.0']).status, 0);+ const lightweightTag = runCheck(fixture, archive);+ assert.notEqual(lightweightTag.status, 0);+ assert.match(lightweightTag.stderr, /must be an annotated tag/);+ } finally {+ fs.rmSync(fixture, { recursive: true, force: true });+ }+});diff --git a/archify/test/update-contract.test.mjs b/archify/test/update-contract.test.mjsnew file mode 100644index 00000000..2ddf539d--- /dev/null+++ b/archify/test/update-contract.test.mjs@@ -0,0 +1,133 @@+import assert from 'node:assert/strict';+import test from 'node:test';++import {+ DEFAULT_MANIFEST_URL,+ EXPECTED_REPOSITORY,+ SKILL_ID,+ UpdateContractError,+ compareSemver,+ isStableCoreVersion,+ releaseChannelForVersion,+ validateCanonicalUtcTimestamp,+ validateLocalRelease,+ validateStableUpdateManifest,+} from '../scripts/update-contract.mjs';++function localRelease(overrides = {}) {+ return {+ schemaVersion: 1,+ skillId: SKILL_ID,+ channel: 'stable',+ version: '2.16.0',+ source: { repository: EXPECTED_REPOSITORY },+ updateManifestUrl: DEFAULT_MANIFEST_URL,+ ...overrides,+ };+}++function stableManifest(overrides = {}) {+ return {+ schemaVersion: 1,+ skillId: SKILL_ID,+ channel: 'stable',+ version: '2.16.0',+ publishedAt: '2026-08-28T07:00:00Z',+ source: {+ repository: EXPECTED_REPOSITORY,+ ref: 'v2.16.0',+ treeSha: 'a'.repeat(40),+ },+ artifact: { sha256: 'b'.repeat(64) },+ summary: 'Contract fixture.',+ releaseNotes: 'https://github.com/tt-a1i/archify/releases/tag/v2.16.0',+ severity: 'normal',+ ...overrides,+ };+}++test('shared release constants identify the only trusted updater source', () => {+ assert.equal(SKILL_ID, 'archify');+ assert.equal(EXPECTED_REPOSITORY, 'https://github.com/tt-a1i/archify');+ assert.equal(+ DEFAULT_MANIFEST_URL,+ 'https://tt-a1i.github.io/archify/skill-updates/archify/stable.json',+ );+});++test('SemVer precedence follows the complete prerelease ordering vector', () => {+ const ordered = [+ '1.0.0-alpha',+ '1.0.0-alpha.1',+ '1.0.0-alpha.beta',+ '1.0.0-beta',+ '1.0.0-beta.2',+ '1.0.0-beta.11',+ '1.0.0-rc.1',+ '1.0.0',+ ];+ for (let index = 1; index < ordered.length; index += 1) {+ assert.equal(compareSemver(ordered[index - 1], ordered[index]), -1);+ }+ assert.equal(compareSemver('1.0.0+build.9', '1.0.0+build.1'), 0);+ assert.equal(compareSemver('9007199254740993.0.0', '9007199254740992.0.0'), 1);+ assert.throws(() => compareSemver('1.0.0-alpha.01', '1.0.0'), UpdateContractError);+});++test('release channels and stable manifest versions use distinct SemVer policies', () => {+ assert.equal(releaseChannelForVersion('2.16.0'), 'stable');+ assert.equal(releaseChannelForVersion('2.16.0+local.1'), 'stable');+ assert.equal(releaseChannelForVersion('2.16.0-dev.0'), 'development');+ assert.equal(isStableCoreVersion('2.16.0'), true);+ assert.equal(isStableCoreVersion('2.16.0+build.1'), false);+ assert.equal(isStableCoreVersion('2.16.0-dev.0'), false);+ assert.equal(isStableCoreVersion('02.16.0'), false);+});++test('local release identity is exact and channel-consistent', () => {+ assert.deepEqual(validateLocalRelease(localRelease()), localRelease());+ assert.deepEqual(validateLocalRelease(localRelease({+ channel: 'development',+ version: '2.17.0-dev.0',+ })), localRelease({+ channel: 'development',+ version: '2.17.0-dev.0',+ }));+ assert.throws(() => validateLocalRelease(localRelease({ extra: true })), UpdateContractError);+ assert.throws(() => validateLocalRelease(localRelease({+ source: { repository: EXPECTED_REPOSITORY, extra: true },+ })), UpdateContractError);+ assert.throws(() => validateLocalRelease(localRelease({ channel: 'development' })), UpdateContractError);+ assert.throws(() => validateLocalRelease(localRelease({ version: '02.16.0' })), UpdateContractError);+});++test('publication timestamps are canonical UTC seconds with real calendar dates', () => {+ assert.equal(validateCanonicalUtcTimestamp('2024-02-29T23:59:59Z'), '2024-02-29T23:59:59Z');+ for (const value of [+ '2026-08-28T15:00:00+08:00',+ '2026-08-28',+ '2026-02-30T00:00:00Z',+ '2026-08-28T00:00:00.000Z',+ ]) {+ assert.throws(() => validateCanonicalUtcTimestamp(value), UpdateContractError, value);+ }+});++test('stable manifests enforce one exact schema and canonical release identity', () => {+ assert.deepEqual(validateStableUpdateManifest(stableManifest()), stableManifest());+ const invalid = [+ stableManifest({ extra: true }),+ stableManifest({ version: '2.16.0+build.1' }),+ stableManifest({ publishedAt: '2026-08-28T15:00:00+08:00' }),+ stableManifest({ source: { ...stableManifest().source, extra: true } }),+ stableManifest({ artifact: { sha256: 'b'.repeat(64), extra: true } }),+ stableManifest({ summary: '\u202eunsafe' }),+ stableManifest({ severity: 'urgent' }),+ stableManifest({ releaseNotes: 'https://github.com:443/tt-a1i/archify/releases/tag/v2.16.0' }),+ stableManifest({ releaseNotes: 'https://github.com/tt-a1i/archify/releases/tag/v2.16.0?' }),+ stableManifest({ releaseNotes: 'https://GITHUB.COM/tt-a1i/archify/releases/tag/v2.16.0' }),+ ];+ for (const value of invalid) {+ assert.throws(() => validateStableUpdateManifest(value), UpdateContractError);+ }+});diff --git a/archify/test/update-notifier.test.mjs b/archify/test/update-notifier.test.mjsnew file mode 100644index 00000000..80888a1b--- /dev/null+++ b/archify/test/update-notifier.test.mjs@@ -0,0 +1,3314 @@+import assert from 'node:assert/strict';+import crypto from 'node:crypto';+import fs from 'node:fs';+import fsPromises from 'node:fs/promises';+import os from 'node:os';+import path from 'node:path';+import { spawnSync } from 'node:child_process';+import test from 'node:test';+import { fileURLToPath, pathToFileURL } from 'node:url';++import {+ acknowledgeUpdate,+ checkForUpdate,+} from '../scripts/check-update.mjs';+import { DEFAULT_MANIFEST_URL, compareSemver } from '../scripts/update-contract.mjs';++const here = path.dirname(fileURLToPath(import.meta.url));+const skillRoot = path.resolve(here, '..');+const checkerPath = path.join(skillRoot, 'scripts', 'check-update.mjs');+const contractPath = path.join(skillRoot, 'scripts', 'update-contract.mjs');+const expectedRepository = 'https://github.com/tt-a1i/archify';+const expectedManifestUrl = 'https://tt-a1i.github.io/archify/skill-updates/archify/stable.json';+const baseTime = Date.parse('2026-08-28T08:00:00Z');+const childCheckTimeoutMs = 2_000;+const parentCheckTimeoutMs = 5_000;+const maxCacheStateBytes = 64 * 1_024;++function writeJson(target, value) {+ fs.mkdirSync(path.dirname(target), { recursive: true });+ fs.writeFileSync(target, `${JSON.stringify(value, null, 2)}\n`);+}++function compactStateSource(state) {+ return `${JSON.stringify(state)}\n`;+}++function metadataWithOverrides(metadata, overrides) {+ return new Proxy(metadata, {+ get(target, property) {+ if (Object.hasOwn(overrides, property)) return overrides[property];+ const value = Reflect.get(target, property, target);+ return typeof value === 'function' ? value.bind(target) : value;+ },+ });+}++function historyDigest(index) {+ return `sha256:${crypto.createHash('sha256').update(`history-${index}`).digest('hex')}`;+}++function cachedStateWithHistory({ offeredDigests = [], acknowledgedDigests = [] } = {}) {+ return {+ schemaVersion: 1,+ skillId: 'archify',+ installedVersion: '2.15.0',+ check: {+ nextCheckAt: '2020-01-01T00:00:00.000Z',+ consecutiveFailures: 0,+ },+ notification: {+ offeredDigests: [...offeredDigests],+ acknowledgedDigests: [...acknowledgedDigests],+ },+ };+}++function candidateStateForDigest(state, digest) {+ return {+ ...state,+ check: {+ nextCheckAt: new Date(baseTime + (72 * 60 * 60 * 1_000)).toISOString(),+ consecutiveFailures: 0,+ },+ notification: {+ offeredDigests: [...state.notification.offeredDigests, digest],+ acknowledgedDigests: [...state.notification.acknowledgedDigests],+ },+ candidate: {+ version: '2.16.0',+ targetDigest: digest,+ severity: 'normal',+ releaseNotes: 'https://github.com/tt-a1i/archify/releases/tag/v2.16.0',+ },+ };+}++function writeCompactCommittedState(testFixture, state, generation = 1n) {+ const target = path.join(operationPath(testFixture, 'committed', generation), 'state.json');+ fs.mkdirSync(path.dirname(target), { recursive: true });+ fs.writeFileSync(target, compactStateSource(state));+ return target;+}++function committedStateFiles(testFixture) {+ return fs.readdirSync(stateDirectory(testFixture), { withFileTypes: true })+ .filter((entry) => entry.isDirectory() && /^committed-\d+$/.test(entry.name))+ .map((entry) => path.join(stateDirectory(testFixture), entry.name, 'state.json'));+}++function localRelease(version = '2.15.0') {+ return {+ schemaVersion: 1,+ skillId: 'archify',+ channel: version.includes('-') ? 'development' : 'stable',+ version,+ source: { repository: expectedRepository },+ updateManifestUrl: expectedManifestUrl,+ };+}++function remoteRelease(overrides = {}) {+ return {+ schemaVersion: 1,+ skillId: 'archify',+ channel: 'stable',+ version: '2.16.0',+ publishedAt: '2026-08-28T07:00:00Z',+ source: {+ repository: expectedRepository,+ ref: 'v2.16.0',+ treeSha: 'a'.repeat(40),+ },+ artifact: {+ sha256: 'b'.repeat(64),+ },+ summary: 'Improve large-repository scanning and diagram layout.',+ releaseNotes: 'https://github.com/tt-a1i/archify/releases/tag/v2.16.0',+ severity: 'normal',+ ...overrides,+ };+}++function remoteReleaseForVersion(version, digest = 'b'.repeat(64)) {+ const release = remoteRelease();+ return {+ ...release,+ version,+ source: { ...release.source, ref: `v${version}` },+ artifact: { sha256: digest },+ releaseNotes: `https://github.com/tt-a1i/archify/releases/tag/v${version}`,+ };+}++function response(body, { status = 200, etag = '"archify-2.16.0"' } = {}) {+ return new Response(typeof body === 'string' ? body : JSON.stringify(body), {+ status,+ headers: {+ 'content-type': 'application/json',+ etag,+ },+ });+}++function fixture(version = '2.15.0') {+ const root = fs.realpathSync(fs.mkdtempSync(+ path.join(os.tmpdir(), 'archify-update-notifier-'),+ ));+ const releasePath = path.join(root, 'skill-release.json');+ const cacheDirectory = path.join(root, 'cache');+ writeJson(releasePath, localRelease(version));+ return { root, releasePath, cacheDirectory };+}++function stateDirectory(testFixture, version = '2.15.0') {+ const partition = crypto.createHash('sha256').update(version).digest('hex').slice(0, 24);+ return path.join(testFixture.cacheDirectory, `version-${partition}`);+}++function statePath(testFixture, version = '2.15.0') {+ const directory = stateDirectory(testFixture, version);+ let committed = [];+ try {+ committed = fs.readdirSync(directory)+ .filter((name) => /^committed-\d+$/.test(name))+ .sort((left, right) => {+ const leftGeneration = BigInt(left.slice('committed-'.length));+ const rightGeneration = BigInt(right.slice('committed-'.length));+ return leftGeneration > rightGeneration ? -1 : 1;+ });+ } catch {+ // A seed may be written before the cache partition exists.+ }+ return committed[0]+ ? path.join(directory, committed[0], 'state.json')+ : path.join(operationPath(testFixture, 'committed', 1n, version), 'state.json');+}++function operationPath(testFixture, kind, generation, version = '2.15.0') {+ return path.join(+ stateDirectory(testFixture, version),+ `${kind}-${BigInt(generation).toString().padStart(20, '0')}`,+ );+}++function writePendingOperation(testFixture, {+ generation = 1n,+ owner = { pid: process.pid, token: 'e'.repeat(32) },+ modifiedAt = new Date(),+} = {}) {+ const directory = operationPath(testFixture, 'pending', generation);+ fs.mkdirSync(directory, { recursive: true });+ const ownerPath = path.join(directory, 'owner.json');+ fs.writeFileSync(ownerPath, typeof owner === 'string' ? owner : `${JSON.stringify(owner)}\n`);+ fs.utimesSync(ownerPath, modifiedAt, modifiedAt);+ return directory;+}++function pauseMkdirOnce(targetPath) {+ const originalMkdir = fsPromises.mkdir;+ let release;+ let markReached;+ let intercepted = false;+ const reached = new Promise((resolve) => { markReached = resolve; });+ const gate = new Promise((resolve) => { release = resolve; });+ fsPromises.mkdir = async (target, ...args) => {+ if (!intercepted && path.resolve(target) === path.resolve(targetPath)) {+ intercepted = true;+ markReached();+ await gate;+ }+ return originalMkdir(target, ...args);+ };+ return {+ reached,+ release,+ restore() {+ release();+ fsPromises.mkdir = originalMkdir;+ },+ };+}++function pauseReaddirSnapshot(targetDirectory, callNumber) {+ const originalReaddir = fsPromises.readdir;+ let release;+ let markReached;+ let calls = 0;+ const reached = new Promise((resolve) => { markReached = resolve; });+ const gate = new Promise((resolve) => { release = resolve; });+ fsPromises.readdir = async (target, ...args) => {+ const result = await originalReaddir(target, ...args);+ if (path.resolve(target) === path.resolve(targetDirectory) && ++calls === callNumber) {+ markReached();+ await gate;+ }+ return result;+ };+ return {+ reached,+ release,+ restore() {+ release();+ fsPromises.readdir = originalReaddir;+ },+ };+}++function pauseReaddirSnapshotOnce(targetDirectory, predicate) {+ const originalReaddir = fsPromises.readdir;+ let release;+ let markReached;+ let intercepted = false;+ const reached = new Promise((resolve) => { markReached = resolve; });+ const gate = new Promise((resolve) => { release = resolve; });+ fsPromises.readdir = async (target, ...args) => {+ const result = await originalReaddir(target, ...args);+ if (!intercepted+ && path.resolve(target) === path.resolve(targetDirectory)+ && predicate(result)) {+ intercepted = true;+ markReached();+ await gate;+ }+ return result;+ };+ return {+ reached,+ release,+ restore() {+ release();+ fsPromises.readdir = originalReaddir;+ },+ };+}++function pauseOpenOnce(predicate) {+ const originalOpen = fsPromises.open;+ let release;+ let markReached;+ let intercepted = false;+ const reached = new Promise((resolve) => { markReached = resolve; });+ const gate = new Promise((resolve) => { release = resolve; });+ fsPromises.open = async (target, ...args) => {+ if (!intercepted && predicate(target)) {+ intercepted = true;+ markReached();+ await gate;+ }+ return originalOpen(target, ...args);+ };+ return {+ reached,+ release,+ restore() {+ release();+ fsPromises.open = originalOpen;+ },+ };+}++function pauseWriteOnce(basename) {+ return pauseOpenOnce((target) => path.basename(target) === basename);+}++function pauseRenameMatchingOnce(predicate) {+ const originalRename = fsPromises.rename;+ let release;+ let markReached;+ let intercepted = false;+ const reached = new Promise((resolve) => { markReached = resolve; });+ const gate = new Promise((resolve) => { release = resolve; });+ fsPromises.rename = async (source, destination, ...args) => {+ if (!intercepted && predicate(source, destination)) {+ intercepted = true;+ markReached();+ await gate;+ }+ return originalRename(source, destination, ...args);+ };+ return {+ reached,+ release,+ restore() {+ release();+ fsPromises.rename = originalRename;+ },+ };+}++function pauseRenameOnce(sourcePath, destinationPath) {+ return pauseRenameMatchingOnce((source, destination) => (+ path.resolve(source) === path.resolve(sourcePath)+ && path.resolve(destination) === path.resolve(destinationPath)+ ));+}++function options(testFixture, fetchImpl, overrides = {}) {+ return {+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ fetchImpl,+ now: () => baseTime,+ random: () => 0.5,+ timeoutMs: 50,+ ...overrides,+ };+}++function cachedUpdateState() {+ return {+ schemaVersion: 1,+ skillId: 'archify',+ installedVersion: '2.15.0',+ check: {+ nextCheckAt: new Date(baseTime + (24 * 60 * 60 * 1_000)).toISOString(),+ consecutiveFailures: 0,+ },+ notification: {+ offeredDigests: [`sha256:${'b'.repeat(64)}`],+ acknowledgedDigests: [],+ },+ candidate: {+ version: '2.16.0',+ targetDigest: `sha256:${'b'.repeat(64)}`,+ severity: 'normal',+ releaseNotes: 'https://github.com/tt-a1i/archify/releases/tag/v2.16.0',+ },+ };+}++function createFifo(target) {+ const created = spawnSync('mkfifo', [target], { encoding: 'utf8' });+ if (created.error?.code === 'ENOENT') return false;+ assert.equal(created.status, 0, created.stderr || created.error?.message);+ return true;+}++function runCheckInChild(testFixture) {+ const manifest = remoteReleaseForVersion('2.15.0', 'd'.repeat(64));+ const childSource = `+ import { checkForUpdate } from ${JSON.stringify(pathToFileURL(checkerPath).href)};+ const watchdog = setTimeout(() => {+ process.stderr.write('child update check timed out\\n');+ process.exit(124);+ }, ${childCheckTimeoutMs});+ let requests = 0;+ try {+ const result = await checkForUpdate({+ releasePath: ${JSON.stringify(testFixture.releasePath)},+ cacheDirectory: ${JSON.stringify(testFixture.cacheDirectory)},+ fetchImpl: async () => {+ requests += 1;+ return new Response(${JSON.stringify(JSON.stringify(manifest))}, {+ status: 200,+ headers: { 'content-type': 'application/json' },+ });+ },+ now: () => ${baseTime},+ random: () => 0.5,+ timeoutMs: 50,+ });+ process.stdout.write(JSON.stringify({ result, requests }));+ } finally {+ clearTimeout(watchdog);+ }+ `;+ const child = spawnSync(process.execPath, ['--input-type=module', '--eval', childSource], {+ cwd: skillRoot,+ encoding: 'utf8',+ timeout: parentCheckTimeoutMs,+ });+ const diagnostics = [child.error?.stack, child.stderr, child.stdout].filter(Boolean).join('\n');+ assert.equal(child.error, undefined, diagnostics);+ assert.equal(child.status, 0, diagnostics);+ return JSON.parse(child.stdout);+}++function assertUnsafeCacheStateIsIgnored(testFixture) {+ assert.deepEqual(runCheckInChild(testFixture), {+ result: { status: 'silent', reason: 'current' },+ requests: 1,+ });+}++test('production manifest URL is a fixed trusted GitHub Pages resource', () => {+ assert.equal(DEFAULT_MANIFEST_URL, expectedManifestUrl);+ const local = JSON.parse(fs.readFileSync(path.join(skillRoot, 'skill-release.json'), 'utf8'));+ assert.equal(local.updateManifestUrl, expectedManifestUrl);+ assert.equal(local.source.repository, expectedRepository);+});++test('SemVer comparison handles stable, prerelease, and downgrade ordering', () => {+ assert.equal(compareSemver('2.16.0', '2.15.0'), 1);+ assert.equal(compareSemver('2.16.0-dev.0', '2.15.0'), 1);+ assert.equal(compareSemver('2.16.0', '2.16.0-dev.9'), 1);+ assert.equal(compareSemver('2.16.0-dev.2', '2.16.0-dev.10'), -1);+ assert.equal(compareSemver('2.16.0', '2.16.0'), 0);+ assert.equal(compareSemver('2.16.0+build.9', '2.16.0+build.1'), 0);+ assert.equal(compareSemver('9007199254740993.0.0', '9007199254740992.0.0'), 1);+ assert.equal(compareSemver('2.16.0-dev.9007199254740993', '2.16.0-dev.9007199254740992'), 1);+ assert.throws(() => compareSemver('2.16.0-dev.01', '2.16.0'));+});++test('development installs never treat the older stable release as an update', async (t) => {+ const testFixture = fixture('2.16.0-dev.0');+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));++ const result = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease({+ version: '2.15.0',+ source: {+ repository: expectedRepository,+ ref: 'v2.15.0',+ treeSha: 'c'.repeat(40),+ },+ artifact: { sha256: 'd'.repeat(64) },+ releaseNotes: 'https://github.com/tt-a1i/archify/releases/tag/v2.15.0',+ })),+ ));++ assert.deepEqual(result, { status: 'silent', reason: 'current' });+});++test('a changed digest never bypasses same-version or downgrade protection', async () => {+ for (const [version, digest] of [+ ['2.15.0', 'c'.repeat(64)],+ ['2.14.9', 'd'.repeat(64)],+ ]) {+ const testFixture = fixture();+ try {+ const result = await checkForUpdate(options(+ testFixture,+ async () => response(remoteReleaseForVersion(version, digest)),+ ));+ assert.deepEqual(result, { status: 'silent', reason: 'current' });+ } finally {+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ }+ }+});++test('a successful refresh withdraws a previously offered higher candidate', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(requests === 1+ ? remoteReleaseForVersion('3.0.0', 'c'.repeat(64))+ : remoteReleaseForVersion('2.15.0', 'd'.repeat(64)));+ };++ const offered = await checkForUpdate(options(testFixture, fetchImpl));+ assert.equal(offered.status, 'update_available');+ assert.equal(offered.latestVersion, '3.0.0');++ const withdrawn = await checkForUpdate(options(testFixture, fetchImpl, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }));+ assert.deepEqual(withdrawn, { status: 'silent', reason: 'current' });+ assert.equal(JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8')).candidate.version, '2.15.0');+ assert.equal(requests, 2);+});++test('a newer immutable candidate is re-offered until the visible notice is acknowledged', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };++ const first = await checkForUpdate(options(testFixture, fetchImpl));+ assert.equal(first.status, 'update_available');+ assert.equal(first.installedVersion, '2.15.0');+ assert.equal(first.latestVersion, '2.16.0');+ assert.equal(first.eventKey, `archify@sha256:${'b'.repeat(64)}`);+ assert.equal(first.targetDigest, `sha256:${'b'.repeat(64)}`);+ assert.equal(Object.hasOwn(first, 'updateCommand'), false);+ assert.equal(first.summary, 'Archify 2.16.0 is available; see the official release notes for details.');+ const persisted = JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8'));+ assert.deepEqual(Object.keys(persisted.check).sort(), [+ 'consecutiveFailures', 'nextCheckAt',+ ]);+ assert.deepEqual(Object.keys(persisted.notification).sort(), [+ 'acknowledgedDigests', 'offeredDigests',+ ]);+ assert.deepEqual(Object.keys(persisted.candidate).sort(), [+ 'releaseNotes', 'severity', 'targetDigest', 'version',+ ]);++ const second = await checkForUpdate(options(testFixture, fetchImpl));+ assert.equal(second.status, 'update_available');+ assert.equal(second.eventKey, first.eventKey);+ assert.equal(requests, 1, 'fresh cached candidates must not make another request');++ const acknowledgement = await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: first.eventKey,+ now: () => baseTime + 1_000,+ });+ assert.deepEqual(acknowledgement, { status: 'acknowledged', eventKey: first.eventKey });+ assert.deepEqual(+ JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8')).notification.acknowledgedDigests,+ [first.targetDigest],+ );++ const third = await checkForUpdate(options(testFixture, fetchImpl));+ assert.deepEqual(third, { status: 'silent', reason: 'already-notified' });+ assert.equal(requests, 1);+});++test('an acknowledged candidate stays suppressed after a later candidate and manifest rollback', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const releases = [+ remoteReleaseForVersion('2.16.0', 'b'.repeat(64)),+ remoteReleaseForVersion('2.17.0', 'c'.repeat(64)),+ remoteReleaseForVersion('2.16.0', 'b'.repeat(64)),+ ];+ let requests = 0;+ const fetchImpl = async () => response(releases[requests++]);++ const first = await checkForUpdate(options(testFixture, fetchImpl));+ assert.equal(first.status, 'update_available');+ assert.deepEqual(await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: first.eventKey,+ }), { status: 'acknowledged', eventKey: first.eventKey });++ const second = await checkForUpdate(options(testFixture, fetchImpl, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }));+ assert.equal(second.status, 'update_available');+ assert.deepEqual(await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: second.eventKey,+ }), { status: 'acknowledged', eventKey: second.eventKey });++ assert.deepEqual(await checkForUpdate(options(testFixture, fetchImpl, {+ now: () => baseTime + (146 * 60 * 60 * 1_000),+ })), { status: 'silent', reason: 'already-notified' });+ assert.equal(requests, 3);+ assert.deepEqual(+ JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8')).notification.acknowledgedDigests,+ [first.targetDigest, second.targetDigest],+ );+});++test('a 64 KiB multi-offer cache only returns an event whose acknowledgement closure can commit', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const earlierDigest = `sha256:${'a'.repeat(64)}`;+ const currentDigest = `sha256:${'b'.repeat(64)}`;+ const replacementDigest = `sha256:${'c'.repeat(64)}`;+ const cachedVersion = `3.16.${'9'.repeat(35)}`;+ const state = cachedStateWithHistory({+ offeredDigests: [earlierDigest, currentDigest],+ acknowledgedDigests: Array.from({ length: 877 }, (_, index) => historyDigest(index)),+ });+ state.check.nextCheckAt = 'Mon, 31 Aug 2026 08:00:00 GMT';+ state.candidate = {+ version: cachedVersion,+ targetDigest: currentDigest,+ severity: 'normal',+ releaseNotes: `https://github.com/tt-a1i/archify/releases/tag/v${cachedVersion}`,+ };+ assert.equal(Buffer.byteLength(compactStateSource(state)), maxCacheStateBytes);+ writeCompactCommittedState(testFixture, state);+ let requests = 0;++ const offered = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteReleaseForVersion('2.16.0', 'c'.repeat(64)));+ }));+ assert.equal(offered.status, 'update_available');+ const acknowledgement = await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: offered.eventKey,+ });++ assert.deepEqual(acknowledgement, {+ status: 'acknowledged',+ eventKey: offered.eventKey,+ });+ assert.equal(requests, 1, 'an unrecoverable cached offer must be rebuilt before exposure');+ assert.equal(offered.targetDigest, replacementDigest);+});++test('a recoverable multi-offer boundary acknowledges every event without pruning history', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const earlierDigest = `sha256:${'a'.repeat(64)}`;+ const currentDigest = `sha256:${'b'.repeat(64)}`;+ const cachedVersion = `3.16.${'9'.repeat(35)}`;+ const exactHistory = Array.from({ length: 877 }, (_, index) => historyDigest(index));+ const state = cachedStateWithHistory({+ offeredDigests: [earlierDigest, currentDigest],+ acknowledgedDigests: exactHistory,+ });+ state.check.nextCheckAt = 'Mon, 31 Aug 2026 8:00:00 GMT';+ state.candidate = {+ version: cachedVersion,+ targetDigest: currentDigest,+ severity: 'normal',+ releaseNotes: `https://github.com/tt-a1i/archify/releases/tag/v${cachedVersion}`,+ };+ assert.equal(Buffer.byteLength(compactStateSource(state)), maxCacheStateBytes - 1);+ writeCompactCommittedState(testFixture, state);++ const current = await checkForUpdate(options(testFixture, async () => {+ throw new Error('a fresh recoverable cache must not use the network');+ }));+ assert.equal(current.targetDigest, currentDigest);+ assert.deepEqual(await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: current.eventKey,+ }), { status: 'acknowledged', eventKey: current.eventKey });+ const earlierEventKey = `archify@${earlierDigest}`;+ assert.deepEqual(await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: earlierEventKey,+ }), { status: 'acknowledged', eventKey: earlierEventKey });++ const persisted = JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8'));+ assert.deepEqual(persisted.notification, {+ offeredDigests: [],+ acknowledgedDigests: [...exactHistory, currentDigest, earlierDigest],+ });+ assert.equal(fs.statSync(statePath(testFixture)).size, maxCacheStateBytes);+});++test('a near-capacity null schedule does not retry the network on every activation', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const state = cachedStateWithHistory({+ acknowledgedDigests: Array.from({ length: 883 }, (_, index) => historyDigest(index)),+ });+ state.check.nextCheckAt = null;+ assert.equal(Buffer.byteLength(compactStateSource(state)), 65_524);+ writeCompactCommittedState(testFixture, state);+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };++ const first = await checkForUpdate(options(testFixture, fetchImpl));+ const second = await checkForUpdate(options(testFixture, fetchImpl));++ assert.equal(first.status, 'update_available');+ assert.deepEqual(second, first);+ assert.equal(requests, 1, 'the first check must commit a bounded retry or reusable candidate');+});++test('a saturated exact acknowledgement history never returns an unacknowledgeable offer', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const targetDigest = `sha256:${'f'.repeat(64)}`;+ const state = cachedStateWithHistory();+ let projected = candidateStateForDigest(state, targetDigest);+ let index = 0;+ while (Buffer.byteLength(compactStateSource(projected)) <= maxCacheStateBytes) {+ state.notification.acknowledgedDigests.push(historyDigest(index));+ index += 1;+ projected = candidateStateForDigest(state, targetDigest);+ }+ assert.ok(Buffer.byteLength(compactStateSource(state)) <= maxCacheStateBytes);+ assert.ok(Buffer.byteLength(compactStateSource(projected)) > maxCacheStateBytes);+ const exactHistory = [...state.notification.acknowledgedDigests];+ writeCompactCommittedState(testFixture, state);+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteReleaseForVersion('2.16.0', 'f'.repeat(64)));+ }));+ const acknowledgement = result.status === 'update_available'+ ? await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: result.eventKey,+ })+ : null;++ assert.deepEqual({ result, acknowledgement }, {+ result: { status: 'silent', reason: 'cache-unavailable' },+ acknowledgement: null,+ });+ assert.equal(requests, 1);+ assert.ok(committedStateFiles(testFixture).every(+ (target) => fs.statSync(target).size <= maxCacheStateBytes,+ ));+ assert.deepEqual(+ JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8')).notification.acknowledgedDigests,+ exactHistory,+ );++ assert.deepEqual(await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteReleaseForVersion('2.16.0', 'f'.repeat(64)));+ })), { status: 'silent', reason: 'cache-valid' });+ assert.equal(requests, 1, 'capacity rejection should commit a bounded retry delay');+});++test('capacity backoff withdraws a stale candidate while preserving its late acknowledgement', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const staleDigest = `sha256:${'b'.repeat(64)}`;+ const replacementDigest = `sha256:${'c'.repeat(64)}`;+ const state = cachedStateWithHistory({ offeredDigests: [staleDigest] });+ state.candidate = {+ version: '2.16.0',+ targetDigest: staleDigest,+ severity: 'normal',+ releaseNotes: 'https://github.com/tt-a1i/archify/releases/tag/v2.16.0',+ };+ let replacement = candidateStateForDigest(state, replacementDigest);+ let index = 0;+ while (Buffer.byteLength(compactStateSource(replacement)) <= maxCacheStateBytes) {+ state.notification.acknowledgedDigests.push(historyDigest(index));+ index += 1;+ replacement = candidateStateForDigest(state, replacementDigest);+ }+ assert.ok(Buffer.byteLength(compactStateSource(state)) <= maxCacheStateBytes);+ assert.ok(Buffer.byteLength(compactStateSource(replacement)) > maxCacheStateBytes);+ const exactHistory = [...state.notification.acknowledgedDigests];+ writeCompactCommittedState(testFixture, state);+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteReleaseForVersion('2.16.0', 'c'.repeat(64)));+ };++ const refresh = await checkForUpdate(options(testFixture, fetchImpl));+ const cached = await checkForUpdate(options(testFixture, fetchImpl));+ const staleEventKey = `archify@${staleDigest}`;+ const lateAcknowledgement = await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: staleEventKey,+ });++ assert.deepEqual({ refresh, cached, lateAcknowledgement }, {+ refresh: { status: 'silent', reason: 'cache-unavailable' },+ cached: { status: 'silent', reason: 'cache-valid' },+ lateAcknowledgement: { status: 'acknowledged', eventKey: staleEventKey },+ });+ assert.equal(requests, 1);+ assert.ok(committedStateFiles(testFixture).every(+ (target) => fs.statSync(target).size <= maxCacheStateBytes,+ ));+ const persisted = JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8'));+ assert.equal(Object.hasOwn(persisted, 'candidate'), false);+ assert.deepEqual(persisted.notification, {+ offeredDigests: [],+ acknowledgedDigests: [...exactHistory, staleDigest],+ });+});++test('a 64 KiB state can be acknowledged but a 64 KiB plus one state is ignored', async () => {+ const targetDigest = `sha256:${'e'.repeat(64)}`;+ const exactState = cachedStateWithHistory({ offeredDigests: [targetDigest] });+ exactState.candidate = {+ version: '2.16.0',+ targetDigest,+ severity: 'normal',+ releaseNotes: 'https://github.com/tt-a1i/archify/releases/tag/v2.16.0',+ };+ const initialBytes = Buffer.byteLength(compactStateSource(exactState));+ exactState.check.nextCheckAt += 'x'.repeat(maxCacheStateBytes - initialBytes);+ assert.equal(Buffer.byteLength(compactStateSource(exactState)), maxCacheStateBytes);++ const exactFixture = fixture();+ try {+ writeCompactCommittedState(exactFixture, exactState);+ const eventKey = `archify@${targetDigest}`;+ assert.deepEqual(await acknowledgeUpdate({+ releasePath: exactFixture.releasePath,+ cacheDirectory: exactFixture.cacheDirectory,+ eventKey,+ }), { status: 'acknowledged', eventKey });+ assert.equal(fs.statSync(statePath(exactFixture)).size, maxCacheStateBytes);+ assert.deepEqual(+ JSON.parse(fs.readFileSync(statePath(exactFixture), 'utf8')).notification,+ { offeredDigests: [], acknowledgedDigests: [targetDigest] },+ );+ } finally {+ fs.rmSync(exactFixture.root, { recursive: true, force: true });+ }++ const oversizedFixture = fixture();+ try {+ const target = writeCompactCommittedState(oversizedFixture, exactState);+ fs.appendFileSync(target, ' ');+ assert.equal(fs.statSync(target).size, maxCacheStateBytes + 1);+ assert.deepEqual(await acknowledgeUpdate({+ releasePath: oversizedFixture.releasePath,+ cacheDirectory: oversizedFixture.cacheDirectory,+ eventKey: `archify@${targetDigest}`,+ }), { status: 'silent', reason: 'invalid-acknowledgement' });+ } finally {+ fs.rmSync(oversizedFixture.root, { recursive: true, force: true });+ }+});++test('a boundary offer remains acknowledgeable without pruning exact history', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const targetDigest = `sha256:${'d'.repeat(64)}`;+ const state = cachedStateWithHistory();+ let index = 0;+ while (true) {+ state.notification.acknowledgedDigests.push(historyDigest(index));+ if (Buffer.byteLength(compactStateSource(+ candidateStateForDigest(state, targetDigest),+ )) > maxCacheStateBytes) {+ state.notification.acknowledgedDigests.pop();+ break;+ }+ index += 1;+ }+ const projected = candidateStateForDigest(state, targetDigest);+ assert.ok(Buffer.byteLength(compactStateSource(projected)) <= maxCacheStateBytes);+ const oneMoreAcknowledgement = cachedStateWithHistory({+ acknowledgedDigests: [...state.notification.acknowledgedDigests, historyDigest(index)],+ });+ assert.ok(Buffer.byteLength(compactStateSource(+ candidateStateForDigest(oneMoreAcknowledgement, targetDigest),+ )) > maxCacheStateBytes);+ const exactHistory = [...state.notification.acknowledgedDigests];+ writeCompactCommittedState(testFixture, state);+ const fetchImpl = async () => response(remoteReleaseForVersion('2.16.0', 'd'.repeat(64)));++ const offered = await checkForUpdate(options(testFixture, fetchImpl));+ assert.equal(offered.status, 'update_available');+ assert.deepEqual(await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: offered.eventKey,+ }), { status: 'acknowledged', eventKey: offered.eventKey });++ assert.ok(committedStateFiles(testFixture).every(+ (target) => fs.statSync(target).size <= maxCacheStateBytes,+ ));+ assert.deepEqual(+ JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8')).notification,+ {+ offeredDigests: [],+ acknowledgedDigests: [...exactHistory, targetDigest],+ },+ );+ assert.deepEqual(await checkForUpdate(options(testFixture, fetchImpl)), {+ status: 'silent',+ reason: 'already-notified',+ });+});++test('opaque response validators are neither persisted nor replayed after the check TTL', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let requests = 0;+ const fetchImpl = async (_url, init) => {+ requests += 1;+ assert.equal(init.headers['if-none-match'], undefined);+ return response(remoteRelease(), { etag: `"per-client-${requests}"` });+ };++ const first = await checkForUpdate(options(testFixture, fetchImpl));+ assert.equal(first.status, 'update_available');++ const second = await checkForUpdate(options(testFixture, fetchImpl, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }));+ assert.equal(second.status, 'update_available');+ assert.equal(second.eventKey, first.eventKey);+ assert.equal(requests, 2);+ assert.equal(Object.hasOwn(JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8')).check, 'etag'), false);+});++test('an HTTP 304 is always a failed unconditional refresh', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ if (requests === 1) {+ return new Response(JSON.stringify(remoteRelease()), {+ status: 200,+ headers: { 'content-type': 'application/json' },+ });+ }+ return new Response(null, { status: 304 });+ };++ assert.equal((await checkForUpdate(options(testFixture, fetchImpl))).status, 'update_available');+ const refresh = await checkForUpdate(options(testFixture, fetchImpl, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }));++ assert.deepEqual(refresh, { status: 'silent', reason: 'check-failed' });+ assert.equal(requests, 2);+});++test('a failed refresh preserves the last-good unacknowledged candidate', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ if (requests === 1) return response(remoteRelease());+ throw new Error('offline');+ };++ const first = await checkForUpdate(options(testFixture, fetchImpl));+ assert.equal(first.status, 'update_available');+ const failed = await checkForUpdate(options(testFixture, fetchImpl, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }));+ assert.deepEqual(failed, { status: 'silent', reason: 'check-failed' });++ const cached = await checkForUpdate(options(testFixture, fetchImpl, {+ now: () => baseTime + (74 * 60 * 60 * 1_000),+ }));+ assert.equal(cached.status, 'update_available');+ assert.equal(cached.eventKey, first.eventKey);+ assert.equal(requests, 2);+});++test('failure backoff saturates safely instead of overflowing the cache counter', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ writeJson(statePath(testFixture), {+ schemaVersion: 1,+ skillId: 'archify',+ installedVersion: '2.15.0',+ check: {+ nextCheckAt: new Date(baseTime - 1_000).toISOString(),+ consecutiveFailures: Number.MAX_SAFE_INTEGER,+ },+ notification: {+ offeredDigests: [],+ acknowledgedDigests: [],+ },+ });+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ throw new Error('offline');+ };++ assert.deepEqual(await checkForUpdate(options(testFixture, fetchImpl)), {+ status: 'silent',+ reason: 'check-failed',+ });+ assert.deepEqual(await checkForUpdate(options(testFixture, fetchImpl, {+ now: () => baseTime + (60 * 60 * 1_000),+ })), { status: 'silent', reason: 'cache-valid' });+ assert.equal(requests, 1);+ assert.equal(JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8')).check.consecutiveFailures, 2);+});++test('a committed cache FIFO is ignored without blocking the update check', (t) => {+ if (process.platform === 'win32') {+ t.skip('FIFO files are unavailable on Windows');+ return;+ }+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const cacheStatePath = statePath(testFixture);+ fs.mkdirSync(path.dirname(cacheStatePath), { recursive: true });+ if (!createFifo(cacheStatePath)) {+ t.skip('mkfifo is unavailable');+ return;+ }++ assertUnsafeCacheStateIsIgnored(testFixture);+});++test('a committed cache state symlink is ignored without following its target', (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const cacheStatePath = statePath(testFixture);+ const linkedTarget = path.join(testFixture.root, 'linked-state-target');+ fs.mkdirSync(path.dirname(cacheStatePath), { recursive: true });+ const targetIsFifo = process.platform !== 'win32' && createFifo(linkedTarget);+ if (!targetIsFifo) writeJson(linkedTarget, cachedUpdateState());+ fs.symlinkSync(linkedTarget, cacheStatePath, process.platform === 'win32' ? 'file' : undefined);++ assertUnsafeCacheStateIsIgnored(testFixture);+});++test('an oversized committed cache state is ignored without an unbounded read', (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const oversizedState = `${JSON.stringify(cachedUpdateState())}${' '.repeat(256 * 1_024)}`;+ const cacheStatePath = statePath(testFixture);+ fs.mkdirSync(path.dirname(cacheStatePath), { recursive: true });+ fs.writeFileSync(cacheStatePath, oversizedState);++ assertUnsafeCacheStateIsIgnored(testFixture);+});++test('a cache ancestor replaced before a cached read cannot inject a reminder', async (t) => {+ const testFixture = fixture();+ const originalReaddir = fsPromises.readdir;+ t.after(() => {+ fsPromises.readdir = originalReaddir;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ writeCompactCommittedState(testFixture, cachedStateWithHistory());+ const replacementRoot = path.join(testFixture.root, 'replacement-cache');+ writeJson(+ path.join(replacementRoot, path.basename(stateDirectory(testFixture)),+ path.basename(operationPath(testFixture, 'committed', 1n)), 'state.json'),+ cachedUpdateState(),+ );+ const detachedCache = path.join(testFixture.root, 'detached-cache');+ const probe = path.join(testFixture.root, 'symlink-probe');+ try {+ fs.symlinkSync(+ replacementRoot,+ probe,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ fs.unlinkSync(probe);+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`directory symlinks are unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ let replaced = false;+ fsPromises.readdir = async (target, ...args) => {+ if (!replaced && path.resolve(target) === path.resolve(stateDirectory(testFixture))) {+ replaced = true;+ fs.renameSync(testFixture.cacheDirectory, detachedCache);+ fs.symlinkSync(+ replacementRoot,+ testFixture.cacheDirectory,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ }+ return originalReaddir(target, ...args);+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(replaced, true);+ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+});++test('a committed directory replaced by a symlink cannot inject a reminder', async (t) => {+ const testFixture = fixture();+ const originalReaddir = fsPromises.readdir;+ t.after(() => {+ fsPromises.readdir = originalReaddir;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ writeCompactCommittedState(testFixture, cachedStateWithHistory());+ const committed = operationPath(testFixture, 'committed', 1n);+ const replacement = path.join(testFixture.root, 'replacement-committed');+ writeJson(path.join(replacement, 'state.json'), cachedUpdateState());+ const probe = path.join(testFixture.root, 'nested-symlink-probe');+ try {+ fs.symlinkSync(+ replacement,+ probe,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ fs.unlinkSync(probe);+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`directory symlinks are unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ const detached = path.join(stateDirectory(testFixture), 'detached-committed');+ let replaced = false;+ fsPromises.readdir = async (target, ...args) => {+ const entries = await originalReaddir(target, ...args);+ if (!replaced && path.resolve(target) === path.resolve(stateDirectory(testFixture))) {+ replaced = true;+ fs.renameSync(committed, detached);+ fs.symlinkSync(+ replacement,+ committed,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ }+ return entries;+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(replaced, true);+ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+});++test('a pending directory replaced by a symlink cannot be ignored as inactive', async (t) => {+ const testFixture = fixture();+ const originalReaddir = fsPromises.readdir;+ t.after(() => {+ fsPromises.readdir = originalReaddir;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const pending = writePendingOperation(testFixture);+ const replacement = path.join(testFixture.root, 'replacement-pending');+ writePendingOperation({+ ...testFixture,+ cacheDirectory: path.join(testFixture.root, 'replacement-cache'),+ }, { modifiedAt: new Date(Date.now() - 60_000) });+ const replacementPending = operationPath({+ ...testFixture,+ cacheDirectory: path.join(testFixture.root, 'replacement-cache'),+ }, 'pending', 1n);+ fs.renameSync(replacementPending, replacement);+ const probe = path.join(testFixture.root, 'pending-symlink-probe');+ try {+ fs.symlinkSync(+ replacement,+ probe,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ fs.unlinkSync(probe);+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`directory symlinks are unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ const detached = path.join(stateDirectory(testFixture), 'detached-pending');+ let replaced = false;+ fsPromises.readdir = async (target, ...args) => {+ const entries = await originalReaddir(target, ...args);+ if (!replaced && path.resolve(target) === path.resolve(stateDirectory(testFixture))) {+ replaced = true;+ fs.renameSync(pending, detached);+ fs.symlinkSync(+ replacement,+ pending,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ }+ return entries;+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(replaced, true);+ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+});++test('zero-inode cache metadata uses timestamp fallback to reject a replaced ancestor', async (t) => {+ const testFixture = fixture();+ const originalLstat = fsPromises.lstat;+ const originalReaddir = fsPromises.readdir;+ t.after(() => {+ fsPromises.lstat = originalLstat;+ fsPromises.readdir = originalReaddir;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ writeCompactCommittedState(testFixture, cachedStateWithHistory());+ const replacementRoot = path.join(testFixture.root, 'replacement-cache');+ writeJson(+ path.join(replacementRoot, path.basename(stateDirectory(testFixture)),+ path.basename(operationPath(testFixture, 'committed', 1n)), 'state.json'),+ cachedUpdateState(),+ );+ const detachedCache = path.join(testFixture.root, 'detached-cache');+ fsPromises.lstat = async (target, ...args) => {+ const metadata = await originalLstat(target, ...args);+ const resolved = path.resolve(target);+ const isCachePath = resolved === path.resolve(testFixture.cacheDirectory)+ || resolved.startsWith(`${path.resolve(testFixture.cacheDirectory)}${path.sep}`);+ if (args[0]?.bigint && isCachePath && metadata.isDirectory()) {+ return metadataWithOverrides(metadata, {+ ino: 0n,+ birthtimeNs: replaced ? 2_000n : 1_000n,+ });+ }+ return metadata;+ };+ let replaced = false;+ fsPromises.readdir = async (target, ...args) => {+ if (!replaced && path.resolve(target) === path.resolve(stateDirectory(testFixture))) {+ replaced = true;+ fs.renameSync(testFixture.cacheDirectory, detachedCache);+ fs.renameSync(replacementRoot, testFixture.cacheDirectory);+ }+ return originalReaddir(target, ...args);+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(replaced, true);+ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+});++test('zero-inode cache metadata still supports a normal check and acknowledgement', async (t) => {+ const testFixture = fixture();+ const originalLstat = fsPromises.lstat;+ const originalOpen = fsPromises.open;+ t.after(() => {+ fsPromises.lstat = originalLstat;+ fsPromises.open = originalOpen;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const cacheRoot = path.resolve(testFixture.cacheDirectory);+ const isCachePath = (target) => {+ const resolved = path.resolve(target);+ return resolved === cacheRoot || resolved.startsWith(`${cacheRoot}${path.sep}`);+ };+ fsPromises.lstat = async (target, ...args) => {+ const metadata = await originalLstat(target, ...args);+ if (args[0]?.bigint && isCachePath(target)) {+ return metadataWithOverrides(metadata, { ino: 0n, birthtimeNs: 1_000n });+ }+ return metadata;+ };+ fsPromises.open = async (target, ...args) => {+ const handle = await originalOpen(target, ...args);+ if (!isCachePath(target)) return handle;+ return new Proxy(handle, {+ get(fileHandle, property) {+ if (property === 'stat') {+ return async (...statArguments) => {+ const metadata = await fileHandle.stat(...statArguments);+ return statArguments[0]?.bigint+ ? metadataWithOverrides(metadata, { ino: 0n, birthtimeNs: 1_000n })+ : metadataWithOverrides(metadata, { ino: 0 });+ };+ }+ const value = Reflect.get(fileHandle, property, fileHandle);+ return typeof value === 'function' ? value.bind(fileHandle) : value;+ },+ });+ };+ let requests = 0;++ const offered = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));+ const acknowledged = await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: offered.eventKey,+ });++ assert.equal(offered.status, 'update_available');+ assert.deepEqual(acknowledged, { status: 'acknowledged', eventKey: offered.eventKey });+ assert.equal(requests, 1);+});++test('zero-inode cache metadata without birthtime fails closed', async (t) => {+ const testFixture = fixture();+ const originalLstat = fsPromises.lstat;+ t.after(() => {+ fsPromises.lstat = originalLstat;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const cacheRoot = path.resolve(testFixture.cacheDirectory);+ fsPromises.lstat = async (target, ...args) => {+ const metadata = await originalLstat(target, ...args);+ const resolved = path.resolve(target);+ if (args[0]?.bigint+ && (resolved === cacheRoot || resolved.startsWith(`${cacheRoot}${path.sep}`))) {+ return metadataWithOverrides(metadata, { ino: 0n, birthtimeNs: 0n });+ }+ return metadata;+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+});++test('a state write replaced before post-verification is never reported as committed', async (t) => {+ const testFixture = fixture();+ const originalOpen = fsPromises.open;+ const originalWriteFile = fsPromises.writeFile;+ t.after(() => {+ fsPromises.open = originalOpen;+ fsPromises.writeFile = originalWriteFile;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ let replaced = false;+ const replaceStateFile = (target) => {+ if (replaced) return;+ replaced = true;+ fs.renameSync(target, `${target}.written-by-checker`);+ fs.writeFileSync(target, '{}\n', { flag: 'wx', mode: 0o600 });+ };+ fsPromises.writeFile = async (target, ...args) => {+ const result = await originalWriteFile(target, ...args);+ if (path.basename(target).startsWith('.state.')) replaceStateFile(target);+ return result;+ };+ fsPromises.open = async (target, ...args) => {+ const handle = await originalOpen(target, ...args);+ if (!path.basename(target).startsWith('.state.')) return handle;+ return {+ stat: handle.stat.bind(handle),+ writeFile: handle.writeFile.bind(handle),+ close: async () => {+ const result = await handle.close();+ replaceStateFile(target);+ return result;+ },+ };+ };++ const result = await checkForUpdate(options(testFixture, async () => response(remoteRelease())));++ assert.equal(replaced, true);+ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ for (const committed of committedStateFiles(testFixture)) {+ assert.notDeepEqual(JSON.parse(fs.readFileSync(committed, 'utf8')), {});+ }+});++test('a pending directory replaced by a symlink cannot be reported as committed', async (t) => {+ const testFixture = fixture();+ const originalRename = fsPromises.rename;+ t.after(() => {+ fsPromises.rename = originalRename;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const probe = path.join(testFixture.root, 'symlink-probe');+ try {+ fs.mkdirSync(probe);+ const probeLink = `${probe}-link`;+ fs.symlinkSync(probe, probeLink, process.platform === 'win32' ? 'junction' : 'dir');+ fs.unlinkSync(probeLink);+ fs.rmdirSync(probe);+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`directory symlinks are unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ const detachedPending = path.join(testFixture.root, 'detached-pending');+ let pending = null;+ let replaced = false;+ fsPromises.rename = async (source, destination, ...args) => {+ if (!pending+ && path.basename(source).startsWith('.state.')+ && path.basename(destination) === 'state.json') {+ const result = await originalRename(source, destination, ...args);+ pending = path.dirname(destination);+ return result;+ }+ if (!replaced+ && pending+ && path.resolve(source) === path.resolve(pending)+ && path.basename(destination).startsWith('committed-')) {+ replaced = true;+ fs.renameSync(pending, detachedPending);+ fs.symlinkSync(+ detachedPending,+ pending,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ }+ return originalRename(source, destination, ...args);+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(replaced, true);+ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 1);+ assert.equal(fs.existsSync(path.join(detachedPending, 'state.json')), true);+});++test('a cache trust failure while cancelling cannot return a cached reminder', async (t) => {+ const testFixture = fixture();+ const originalRename = fsPromises.rename;+ t.after(() => {+ fsPromises.rename = originalRename;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const stale = cachedUpdateState();+ stale.check.nextCheckAt = new Date(baseTime - 1_000).toISOString();+ const committed = writeCompactCommittedState(testFixture, stale);+ const detachedCache = path.join(testFixture.root, 'detached-cache');+ let refreshed = false;+ let replaced = false;+ fsPromises.rename = async (source, destination, ...args) => {+ const sourceName = path.basename(source);+ const destinationName = path.basename(destination);+ if (!refreshed && sourceName.startsWith('claim-') && destinationName === 'active-claim') {+ const result = await originalRename(source, destination, ...args);+ const fresh = cachedUpdateState();+ writeJson(committed, fresh);+ refreshed = true;+ return result;+ }+ if (!replaced && sourceName.startsWith('pending-') && destinationName.startsWith('cancelled-')) {+ replaced = true;+ fs.renameSync(testFixture.cacheDirectory, detachedCache);+ fs.symlinkSync(+ detachedCache,+ testFixture.cacheDirectory,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ }+ return originalRename(source, destination, ...args);+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(refreshed, true);+ assert.equal(replaced, true);+ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+});++test('prepared claim cleanup never recursively deletes through a replaced cache ancestor', async (t) => {+ const testFixture = fixture();+ const originalOpen = fsPromises.open;+ const originalRm = fsPromises.rm;+ const originalWriteFile = fsPromises.writeFile;+ t.after(() => {+ fsPromises.open = originalOpen;+ fsPromises.rm = originalRm;+ fsPromises.writeFile = originalWriteFile;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const activeClaim = path.join(stateDirectory(testFixture), 'active-claim');+ let injectedActiveClaim = false;+ const injectActiveClaim = () => {+ if (injectedActiveClaim) return;+ injectedActiveClaim = true;+ fs.mkdirSync(activeClaim);+ };+ fsPromises.writeFile = async (target, ...args) => {+ const result = await originalWriteFile(target, ...args);+ if (path.basename(path.dirname(target)).startsWith('claim-')+ && path.basename(target) === 'owner.json') injectActiveClaim();+ return result;+ };+ fsPromises.open = async (target, ...args) => {+ const handle = await originalOpen(target, ...args);+ if (path.basename(path.dirname(target)).startsWith('claim-')+ && path.basename(target) === 'owner.json') {+ return {+ stat: handle.stat.bind(handle),+ writeFile: handle.writeFile.bind(handle),+ close: async () => {+ const result = await handle.close();+ injectActiveClaim();+ return result;+ },+ };+ }+ return handle;+ };+ const victimRoot = path.join(testFixture.root, 'victim-cache');+ const victimClaim = path.join(+ victimRoot,+ path.basename(stateDirectory(testFixture)),+ path.basename(operationPath(testFixture, 'claim', 1n)),+ );+ const victimFile = path.join(victimClaim, 'important.txt');+ fs.mkdirSync(victimClaim, { recursive: true });+ fs.writeFileSync(victimFile, 'must survive\n');+ const detachedCache = path.join(testFixture.root, 'detached-cache');+ let interceptedRemoval = false;+ fsPromises.rm = async (target, ...args) => {+ if (!interceptedRemoval && path.basename(target).startsWith('claim-')) {+ interceptedRemoval = true;+ fs.renameSync(testFixture.cacheDirectory, detachedCache);+ fs.symlinkSync(+ victimRoot,+ testFixture.cacheDirectory,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ }+ return originalRm(target, ...args);+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(injectedActiveClaim, true);+ assert.equal(requests, 0);+ assert.equal(result.status, 'silent');+ assert.equal(interceptedRemoval, false);+ assert.equal(fs.readFileSync(victimFile, 'utf8'), 'must survive\n');+ const coordinationEntries = fs.readdirSync(stateDirectory(testFixture));+ assert.deepEqual(+ coordinationEntries.filter((name) => name.startsWith('claim-')),+ [],+ );+ const discardedClaims = coordinationEntries+ .filter((name) => name.startsWith('discarded-claim-'));+ assert.equal(discardedClaims.length, 1);+ const discardedOwnerPath = path.join(+ stateDirectory(testFixture),+ discardedClaims[0],+ 'owner.json',+ );+ const discardedOwner = JSON.parse(fs.readFileSync(discardedOwnerPath, 'utf8'));+ assert.deepEqual(Object.keys(discardedOwner).sort(), ['generation', 'pid', 'token']);+ assert.equal(discardedOwner.generation, '1');+ assert.match(discardedOwner.token, /^[a-f0-9]{32}$/);+ assert.equal(discardedClaims[0].endsWith(`-${discardedOwner.token}`), true);+});++test('a symlink cache root cannot write into its target', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const protectedTarget = path.join(testFixture.root, 'simulated-project-config');+ fs.mkdirSync(protectedTarget);+ fs.writeFileSync(path.join(protectedTarget, 'settings.json'), '{"protected":true}\n');+ try {+ fs.symlinkSync(+ protectedTarget,+ testFixture.cacheDirectory,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`directory symlinks are unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+ assert.deepEqual(fs.readdirSync(protectedTarget), ['settings.json']);+});++test('a symlink cache ancestor cannot redirect cache writes', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const protectedTarget = path.join(testFixture.root, 'simulated-project-config');+ const linkedAncestor = path.join(testFixture.root, 'cache-parent');+ const cacheDirectory = path.join(linkedAncestor, 'nested', 'cache');+ fs.mkdirSync(protectedTarget);+ fs.writeFileSync(path.join(protectedTarget, 'settings.json'), '{"protected":true}\n');+ try {+ fs.symlinkSync(+ protectedTarget,+ linkedAncestor,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`directory symlinks are unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }, { cacheDirectory }));++ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+ assert.deepEqual(fs.readdirSync(protectedTarget), ['settings.json']);+});++test('a cache ancestor replaced during preparation cannot redirect later writes', async (t) => {+ const testFixture = fixture();+ const originalLstat = fsPromises.lstat;+ t.after(() => {+ fsPromises.lstat = originalLstat;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const protectedTarget = path.join(testFixture.root, 'simulated-project-config');+ const protectedVersion = path.join(protectedTarget, path.basename(stateDirectory(testFixture)));+ const detachedCache = path.join(testFixture.root, 'detached-cache');+ const probe = path.join(testFixture.root, 'symlink-probe');+ fs.mkdirSync(testFixture.cacheDirectory);+ fs.mkdirSync(protectedVersion, { recursive: true });+ fs.writeFileSync(path.join(protectedVersion, 'settings.json'), '{"protected":true}\n');+ try {+ fs.symlinkSync(+ protectedTarget,+ probe,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ fs.unlinkSync(probe);+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`directory symlinks are unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ let replaced = false;+ const versionDirectoryName = path.basename(stateDirectory(testFixture));+ fsPromises.lstat = async (target, ...args) => {+ if (!replaced && path.basename(target) === versionDirectoryName) {+ replaced = true;+ fs.renameSync(testFixture.cacheDirectory, detachedCache);+ fs.symlinkSync(+ protectedTarget,+ testFixture.cacheDirectory,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ }+ return originalLstat(target, ...args);+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(replaced, true);+ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+ assert.deepEqual(fs.readdirSync(protectedVersion), ['settings.json']);+});++test('a cache ancestor replaced before reservation creation fails closed', async (t) => {+ const testFixture = fixture();+ const originalMkdir = fsPromises.mkdir;+ t.after(() => {+ fsPromises.mkdir = originalMkdir;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const replacementRoot = path.join(testFixture.root, 'replacement-cache');+ const replacementVersion = path.join(+ replacementRoot,+ path.basename(stateDirectory(testFixture)),+ );+ const detachedCache = path.join(testFixture.root, 'detached-cache');+ const probe = path.join(testFixture.root, 'symlink-probe');+ fs.mkdirSync(replacementVersion, { recursive: true });+ fs.writeFileSync(path.join(replacementVersion, 'settings.json'), '{"protected":true}\n');+ try {+ fs.symlinkSync(+ replacementRoot,+ probe,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ fs.unlinkSync(probe);+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`directory symlinks are unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ let replaced = false;+ fsPromises.mkdir = async (target, ...args) => {+ if (!replaced && path.basename(target).startsWith('reserved-')) {+ replaced = true;+ fs.renameSync(testFixture.cacheDirectory, detachedCache);+ fs.symlinkSync(+ replacementRoot,+ testFixture.cacheDirectory,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ }+ return originalMkdir(target, ...args);+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(replaced, true);+ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+ const replacementEntries = fs.readdirSync(replacementVersion).sort();+ const reservations = replacementEntries.filter((entry) => entry.startsWith('reserved-'));+ assert.equal(reservations.length, 1);+ assert.deepEqual(+ replacementEntries.filter((entry) => !entry.startsWith('reserved-')),+ ['settings.json'],+ );+ assert.deepEqual(fs.readdirSync(path.join(replacementVersion, reservations[0])), []);+});++test('a cache ancestor replacement restored after reservation creation fails closed', async (t) => {+ const testFixture = fixture();+ const originalMkdir = fsPromises.mkdir;+ t.after(() => {+ fsPromises.mkdir = originalMkdir;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const replacementRoot = path.join(testFixture.root, 'replacement-cache');+ const replacementVersion = path.join(+ replacementRoot,+ path.basename(stateDirectory(testFixture)),+ );+ const detachedCache = path.join(testFixture.root, 'detached-cache');+ const probe = path.join(testFixture.root, 'symlink-probe');+ fs.mkdirSync(replacementVersion, { recursive: true });+ fs.writeFileSync(path.join(replacementVersion, 'settings.json'), '{"protected":true}\n');+ try {+ fs.symlinkSync(+ replacementRoot,+ probe,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ fs.unlinkSync(probe);+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`directory symlinks are unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ let restored = false;+ fsPromises.mkdir = async (target, ...args) => {+ if (!restored && path.basename(target).startsWith('reserved-')) {+ fs.renameSync(testFixture.cacheDirectory, detachedCache);+ fs.symlinkSync(+ replacementRoot,+ testFixture.cacheDirectory,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ try {+ return await originalMkdir(target, ...args);+ } finally {+ fs.unlinkSync(testFixture.cacheDirectory);+ fs.renameSync(detachedCache, testFixture.cacheDirectory);+ restored = true;+ }+ }+ return originalMkdir(target, ...args);+ };+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(restored, true);+ assert.deepEqual(result, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 0);+ const replacementEntries = fs.readdirSync(replacementVersion).sort();+ const reservations = replacementEntries.filter((entry) => entry.startsWith('reserved-'));+ assert.equal(reservations.length, 1);+ assert.deepEqual(+ replacementEntries.filter((entry) => !entry.startsWith('reserved-')),+ ['settings.json'],+ );+ assert.deepEqual(fs.readdirSync(path.join(replacementVersion, reservations[0])), []);+});++test('a trusted cache prefix switched after validation cannot redirect later writes', async (t) => {+ const testFixture = fixture();+ const originalHomedir = os.homedir;+ const originalLstat = fsPromises.lstat;+ t.after(() => {+ os.homedir = originalHomedir;+ fsPromises.lstat = originalLstat;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const trustedAlias = path.join(testFixture.root, 'trusted-home');+ const canonicalHome = path.join(testFixture.root, 'canonical-home');+ const protectedTarget = path.join(testFixture.root, 'simulated-project-config');+ const cacheDirectory = path.join(trustedAlias, 'cache');+ fs.mkdirSync(canonicalHome);+ fs.mkdirSync(protectedTarget);+ fs.writeFileSync(path.join(protectedTarget, 'settings.json'), '{"protected":true}\n');+ try {+ fs.symlinkSync(+ canonicalHome,+ trustedAlias,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`directory symlinks are unavailable: ${error.code}`);+ return;+ }+ throw error;+ }+ os.homedir = () => trustedAlias;+ const canonicalVersionDirectory = path.join(+ fs.realpathSync(canonicalHome),+ 'cache',+ path.basename(stateDirectory(testFixture)),+ );+ let targetVisits = 0;+ let switched = false;+ fsPromises.lstat = async (target, ...args) => {+ const metadata = await originalLstat(target, ...args);+ if (!switched && path.resolve(target) === canonicalVersionDirectory) {+ targetVisits += 1;+ if (targetVisits === 2) {+ switched = true;+ fs.unlinkSync(trustedAlias);+ fs.symlinkSync(+ protectedTarget,+ trustedAlias,+ process.platform === 'win32' ? 'junction' : 'dir',+ );+ }+ }+ return metadata;+ };++ const result = await checkForUpdate(options(testFixture, async () => response(remoteRelease()), {+ cacheDirectory,+ }));++ assert.equal(switched, true);+ assert.equal(result.status, 'update_available');+ assert.deepEqual(fs.readdirSync(protectedTarget), ['settings.json']);+ assert.ok(fs.readdirSync(canonicalVersionDirectory).some(+ (entry) => entry.startsWith('committed-'),+ ));+});++test('concurrent checks use one writer and leave a valid cache', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let releaseFetch;+ let markStarted;+ const started = new Promise((resolve) => { markStarted = resolve; });+ const fetchImpl = async () => {+ markStarted();+ return new Promise((resolve) => { releaseFetch = resolve; });+ };++ const firstCheck = checkForUpdate(options(testFixture, fetchImpl));+ await started;+ const overlapping = await checkForUpdate(options(testFixture, fetchImpl));+ assert.deepEqual(overlapping, { status: 'silent', reason: 'check-in-progress' });++ releaseFetch(response(remoteRelease()));+ const first = await firstCheck;+ assert.equal(first.status, 'update_available');+ assert.doesNotThrow(() => JSON.parse(+ fs.readFileSync(statePath(testFixture), 'utf8'),+ ));+});++test('an empty precheck snapshot cannot start a second concurrent network request', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ fs.mkdirSync(stateDirectory(testFixture), { recursive: true });+ const pause = pauseReaddirSnapshot(stateDirectory(testFixture), 2);+ t.after(() => pause.restore());+ let releaseFetch;+ let markFetchStarted;+ let requests = 0;+ const fetchStarted = new Promise((resolve) => { markFetchStarted = resolve; });+ const fetchImpl = async () => {+ requests += 1;+ markFetchStarted();+ return new Promise((resolve) => { releaseFetch = resolve; });+ };++ const delayedPrecheck = checkForUpdate(options(testFixture, fetchImpl));+ await pause.reached;+ const claimedCheck = checkForUpdate(options(testFixture, fetchImpl));+ await fetchStarted;+ pause.release();+ assert.deepEqual(await delayedPrecheck, { status: 'silent', reason: 'check-in-progress' });+ assert.equal(requests, 1);++ releaseFetch(response(remoteRelease()));+ assert.equal((await claimedCheck).status, 'update_available');+ pause.restore();+ assert.equal(requests, 1);+});++test('two promoters cannot replace and then steal a stale empty active claim', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const activeClaim = path.join(stateDirectory(testFixture), 'active-claim');+ fs.mkdirSync(activeClaim, { recursive: true });+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(activeClaim, staleTime, staleTime);+ const pause = pauseWriteOnce('.retirement-guard');+ t.after(() => pause.restore());+ let releaseFetch;+ let markFetchStarted;+ let requests = 0;+ const fetchStarted = new Promise((resolve) => { markFetchStarted = resolve; });+ const fetchImpl = async () => {+ requests += 1;+ markFetchStarted();+ return new Promise((resolve) => { releaseFetch = resolve; });+ };++ const delayedRetirement = checkForUpdate(options(testFixture, fetchImpl));+ await pause.reached;+ fs.utimesSync(+ path.join(operationPath(testFixture, 'pending', 1n), 'owner.json'),+ staleTime,+ staleTime,+ );+ const claimedCheck = checkForUpdate(options(testFixture, fetchImpl));+ await fetchStarted;+ pause.release();+ assert.deepEqual(await delayedRetirement, { status: 'silent', reason: 'check-in-progress' });+ assert.equal(requests, 1);++ releaseFetch(response(remoteRelease()));+ assert.equal((await claimedCheck).status, 'update_available');+ pause.restore();+ assert.equal(requests, 1);+});++test('a delayed lower-generation promoter cannot retire a completed higher claim', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const pause = pauseRenameOnce(+ operationPath(testFixture, 'claim', 1n),+ path.join(stateDirectory(testFixture), 'active-claim'),+ );+ t.after(() => pause.restore());+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };++ const delayedLower = checkForUpdate(options(testFixture, fetchImpl));+ await pause.reached;+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(+ path.join(operationPath(testFixture, 'pending', 1n), 'owner.json'),+ staleTime,+ staleTime,+ );+ assert.equal((await checkForUpdate(options(testFixture, fetchImpl))).status, 'update_available');+ assert.equal(requests, 1);++ pause.release();+ assert.equal((await delayedLower).status, 'update_available');+ pause.restore();+ assert.equal(requests, 1);+ assert.equal(+ JSON.parse(fs.readFileSync(+ path.join(stateDirectory(testFixture), 'active-claim', 'owner.json'),+ 'utf8',+ )).generation,+ '2',+ );+});++test('an expired contender cannot fetch after its delayed claim promotion succeeds', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const pause = pauseRenameOnce(+ operationPath(testFixture, 'claim', 1n),+ path.join(stateDirectory(testFixture), 'active-claim'),+ );+ t.after(() => pause.restore());+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };++ const delayedExpired = checkForUpdate(options(testFixture, fetchImpl));+ await pause.reached;+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(+ path.join(operationPath(testFixture, 'pending', 1n), 'owner.json'),+ staleTime,+ staleTime,+ );+ pause.release();+ assert.deepEqual(await delayedExpired, { status: 'silent', reason: 'check-in-progress' });+ assert.equal(requests, 0);++ assert.equal((await checkForUpdate(options(testFixture, fetchImpl))).status, 'update_available');+ pause.restore();+ assert.equal(requests, 1);+ assert.equal(+ JSON.parse(fs.readFileSync(+ path.join(stateDirectory(testFixture), 'active-claim', 'owner.json'),+ 'utf8',+ )).generation,+ '2',+ );+});++test('a stale supersession snapshot cannot let a lower promoter retire a higher claim', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const generationOneClaim = path.basename(operationPath(testFixture, 'claim', 1n));+ const pause = pauseReaddirSnapshotOnce(+ stateDirectory(testFixture),+ (entries) => entries.some((entry) => entry.name === generationOneClaim)+ && !entries.some((entry) => /-(?:0{19}2)$/.test(entry.name)),+ );+ t.after(() => pause.restore());+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };++ const delayedLower = checkForUpdate(options(testFixture, fetchImpl));+ await pause.reached;+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(+ path.join(operationPath(testFixture, 'pending', 1n), 'owner.json'),+ staleTime,+ staleTime,+ );+ assert.equal((await checkForUpdate(options(testFixture, fetchImpl))).status, 'update_available');+ assert.equal(requests, 1);++ pause.release();+ assert.equal((await delayedLower).status, 'update_available');+ pause.restore();+ assert.equal(requests, 1);+ assert.equal(+ JSON.parse(fs.readFileSync(+ path.join(stateDirectory(testFixture), 'active-claim', 'owner.json'),+ 'utf8',+ )).generation,+ '2',+ );+});++test('an owner fenced while active ownership is read cannot issue a second GET', {+ timeout: parentCheckTimeoutMs,+}, async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const directory = stateDirectory(testFixture);+ const originalOpen = fsPromises.open;+ let releaseVerification;+ let markVerification;+ let intercepted = false;+ const verificationReached = new Promise((resolve) => { markVerification = resolve; });+ const verificationGate = new Promise((resolve) => { releaseVerification = resolve; });+ fsPromises.open = async (target, ...args) => {+ const handle = await originalOpen(target, ...args);+ if (intercepted+ || path.resolve(target) !== path.join(directory, 'active-claim', 'owner.json')) {+ return handle;+ }+ intercepted = true;+ return new Proxy(handle, {+ get(fileHandle, property) {+ if (property === 'close') {+ return async () => {+ const result = await fileHandle.close();+ markVerification();+ await verificationGate;+ return result;+ };+ }+ const value = Reflect.get(fileHandle, property, fileHandle);+ return typeof value === 'function' ? value.bind(fileHandle) : value;+ },+ });+ };+ t.after(() => {+ releaseVerification();+ fsPromises.open = originalOpen;+ });+ let requests = 0;+ const checkOptions = options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ });++ const suspendedOwner = checkForUpdate(checkOptions);+ await verificationReached;+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(+ path.join(operationPath(testFixture, 'pending', 1n), 'owner.json'),+ staleTime,+ staleTime,+ );+ assert.equal((await checkForUpdate(checkOptions)).status, 'update_available');+ assert.equal(requests, 1);++ releaseVerification();+ assert.deepEqual(await suspendedOwner, { status: 'silent', reason: 'cache-unavailable' });+ assert.equal(requests, 1);+});++test('an expired active owner cannot start a network request', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const pendingOne = path.basename(operationPath(testFixture, 'pending', 1n));+ const claimOne = path.basename(operationPath(testFixture, 'claim', 1n));+ const pause = pauseReaddirSnapshotOnce(+ stateDirectory(testFixture),+ (entries) => entries.some((entry) => entry.name === 'active-claim')+ && entries.some((entry) => entry.name === pendingOne)+ && !entries.some((entry) => entry.name === claimOne),+ );+ t.after(() => pause.restore());+ let requests = 0;++ const check = checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));+ await pause.reached;+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(+ path.join(operationPath(testFixture, 'pending', 1n), 'owner.json'),+ staleTime,+ staleTime,+ );+ pause.release();++ assert.deepEqual(await check, { status: 'silent', reason: 'check-in-progress' });+ pause.restore();+ assert.equal(requests, 0);+});++test('a fenced owner rechecks its active claim immediately before network access', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const pendingOne = path.basename(operationPath(testFixture, 'pending', 1n));+ const claimOne = path.basename(operationPath(testFixture, 'claim', 1n));+ const pause = pauseReaddirSnapshotOnce(+ stateDirectory(testFixture),+ (entries) => entries.some((entry) => entry.name === 'active-claim')+ && entries.some((entry) => entry.name === pendingOne)+ && !entries.some((entry) => entry.name === claimOne),+ );+ t.after(() => pause.restore());+ let requests = 0;+ let releaseFetch;+ let markFetchStarted;+ const fetchStarted = new Promise((resolve) => { markFetchStarted = resolve; });+ const fetchImpl = async () => {+ requests += 1;+ markFetchStarted();+ return new Promise((resolve) => { releaseFetch = resolve; });+ };++ const delayedOwner = checkForUpdate(options(testFixture, fetchImpl));+ await pause.reached;+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(+ path.join(operationPath(testFixture, 'pending', 1n), 'owner.json'),+ staleTime,+ staleTime,+ );+ const successor = checkForUpdate(options(testFixture, fetchImpl));+ await fetchStarted;+ assert.equal(requests, 1);++ pause.release();+ assert.deepEqual(await delayedOwner, { status: 'silent', reason: 'check-in-progress' });+ pause.restore();+ assert.equal(requests, 1);++ releaseFetch(response(remoteRelease()));+ assert.equal((await successor).status, 'update_available');+ assert.equal(requests, 1);+});++test('an overlapping check reads the last-good candidate while another process refreshes it', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let requests = 0;+ let releaseRefresh;+ let markRefreshStarted;+ const refreshStarted = new Promise((resolve) => { markRefreshStarted = resolve; });+ const fetchImpl = async () => {+ requests += 1;+ if (requests === 1) return response(remoteRelease());+ markRefreshStarted();+ return new Promise((resolve) => { releaseRefresh = resolve; });+ };++ const first = await checkForUpdate(options(testFixture, fetchImpl));+ const refreshOptions = options(testFixture, fetchImpl, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ });+ const refresh = checkForUpdate(refreshOptions);+ await refreshStarted;++ const overlapping = await checkForUpdate(refreshOptions);+ assert.equal(overlapping.status, 'update_available');+ assert.equal(overlapping.eventKey, first.eventKey);+ assert.equal(requests, 2);++ releaseRefresh(response(remoteRelease()));+ assert.equal((await refresh).status, 'update_available');+});++test('acknowledgement waits briefly for an in-flight refresh instead of losing the notice', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const offered = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease()),+ ));+ let releaseRefresh;+ let markRefreshStarted;+ const refreshStarted = new Promise((resolve) => { markRefreshStarted = resolve; });+ const refresh = checkForUpdate(options(testFixture, async () => {+ markRefreshStarted();+ return new Promise((resolve) => { releaseRefresh = resolve; });+ }, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }));+ await refreshStarted;++ const acknowledgement = acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: offered.eventKey,+ now: () => baseTime + (73 * 60 * 60 * 1_000) + 1,+ });+ await new Promise((resolve) => setTimeout(resolve, 25));+ releaseRefresh(response(remoteRelease()));+ await refresh;++ assert.deepEqual(await acknowledgement, {+ status: 'acknowledged',+ eventKey: offered.eventKey,+ });+ assert.deepEqual(await checkForUpdate(options(testFixture, async () => response(remoteRelease()), {+ now: () => baseTime + (74 * 60 * 60 * 1_000),+ })), { status: 'silent', reason: 'already-notified' });+});++test('a last-good notice remains acknowledgeable after the refresh commits a new candidate', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const firstRelease = remoteReleaseForVersion('2.16.0', 'b'.repeat(64));+ const secondRelease = remoteReleaseForVersion('2.17.0', 'c'.repeat(64));+ const offered = await checkForUpdate(options(+ testFixture,+ async () => response(firstRelease),+ ));+ let releaseRefresh;+ let markRefreshStarted;+ const refreshStarted = new Promise((resolve) => { markRefreshStarted = resolve; });+ const refresh = checkForUpdate(options(testFixture, async () => {+ markRefreshStarted();+ return new Promise((resolve) => { releaseRefresh = resolve; });+ }, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }));+ await refreshStarted;++ const visibleDuringRefresh = await checkForUpdate(options(testFixture, async () => {+ assert.fail('an overlapping reader must not start another network request');+ }, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }));+ assert.equal(visibleDuringRefresh.eventKey, offered.eventKey);+ const acknowledgement = acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: visibleDuringRefresh.eventKey,+ });+ await new Promise((resolve) => setTimeout(resolve, 25));+ releaseRefresh(response(secondRelease));+ assert.equal((await refresh).latestVersion, '2.17.0');+ assert.deepEqual(await acknowledgement, {+ status: 'acknowledged',+ eventKey: offered.eventKey,+ });++ assert.deepEqual(await checkForUpdate(options(testFixture, async () => response(firstRelease), {+ now: () => baseTime + (146 * 60 * 60 * 1_000),+ })), { status: 'silent', reason: 'already-notified' });+});++test('acknowledgement retry budget uses a monotonic clock', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const offered = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease()),+ ));+ writePendingOperation(testFixture, { generation: 2n });+ const ticks = [100, 1_301];+ const started = Date.now();++ assert.deepEqual(await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: offered.eventKey,+ monotonicNow: () => ticks.shift() ?? 1_301,+ }), { status: 'silent', reason: 'check-in-progress' });+ assert.ok(Date.now() - started < 200, 'an exhausted monotonic budget should not sleep on wall time');+});++test('a delayed allocator cannot reuse a generation after its reservation name was taken', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const firstRelease = remoteReleaseForVersion('2.16.0', 'b'.repeat(64));+ const secondRelease = remoteReleaseForVersion('2.17.0', 'c'.repeat(64));+ const offered = await checkForUpdate(options(+ testFixture,+ async () => response(firstRelease),+ ));+ const pause = pauseMkdirOnce(operationPath(testFixture, 'reserved', 2n));+ t.after(() => pause.restore());++ const acknowledgement = acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: offered.eventKey,+ });+ await pause.reached;+ assert.equal((await checkForUpdate(options(testFixture, async () => response(secondRelease), {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }))).latestVersion, '2.17.0');++ pause.release();+ assert.deepEqual(await acknowledgement, { status: 'acknowledged', eventKey: offered.eventKey });+ pause.restore();+ assert.equal(fs.existsSync(operationPath(testFixture, 'reserved', 2n)), true);+ assert.equal(fs.existsSync(operationPath(testFixture, 'reserved', 3n)), true);+ assert.deepEqual(await checkForUpdate(options(testFixture, async () => response(firstRelease), {+ now: () => baseTime + (146 * 60 * 60 * 1_000),+ })), { status: 'silent', reason: 'already-notified' });+});++test('an oversized generation name cannot poison future allocation', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ fs.mkdirSync(stateDirectory(testFixture), { recursive: true });+ fs.mkdirSync(path.join(stateDirectory(testFixture), `reserved-${'9'.repeat(246)}`));+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };++ assert.equal((await checkForUpdate(options(testFixture, fetchImpl))).status, 'update_available');+ assert.equal((await checkForUpdate(options(testFixture, fetchImpl))).status, 'update_available');+ assert.equal(requests, 1);+ assert.ok(fs.existsSync(operationPath(testFixture, 'reserved', 1n)));+});++test('a lower generation stalled after reservation cannot commit behind a newer generation', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const firstRelease = remoteReleaseForVersion('2.16.0', 'b'.repeat(64));+ const secondRelease = remoteReleaseForVersion('2.17.0', 'c'.repeat(64));+ const offered = await checkForUpdate(options(+ testFixture,+ async () => response(firstRelease),+ ));+ const pause = pauseMkdirOnce(operationPath(testFixture, 'pending', 2n));+ t.after(() => pause.restore());++ const acknowledgement = acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: offered.eventKey,+ });+ await pause.reached;+ assert.equal(fs.existsSync(operationPath(testFixture, 'reserved', 2n)), true);+ assert.equal((await checkForUpdate(options(testFixture, async () => response(secondRelease), {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }))).latestVersion, '2.17.0');++ pause.release();+ assert.deepEqual(await acknowledgement, { status: 'acknowledged', eventKey: offered.eventKey });+ pause.restore();+ assert.equal(fs.existsSync(operationPath(testFixture, 'committed', 2n)), false);+ assert.equal(fs.existsSync(operationPath(testFixture, 'cancelled', 2n)), true);+ assert.equal(fs.existsSync(operationPath(testFixture, 'reserved', 3n)), true);+ assert.equal(fs.existsSync(operationPath(testFixture, 'reserved', 4n)), true);+ assert.deepEqual(await checkForUpdate(options(testFixture, async () => response(firstRelease), {+ now: () => baseTime + (146 * 60 * 60 * 1_000),+ })), { status: 'silent', reason: 'already-notified' });+});++test('acknowledgement fences an expired refresh and the resumed owner cannot erase it', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const offered = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease()),+ ));++ let resumeRefresh;+ let markRefreshStarted;+ const refreshStarted = new Promise((resolve) => { markRefreshStarted = resolve; });+ const refresh = checkForUpdate(options(testFixture, async () => {+ markRefreshStarted();+ return new Promise((resolve) => { resumeRefresh = resolve; });+ }, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ timeoutMs: 2_000,+ }));+ await refreshStarted;++ const refreshPending = operationPath(testFixture, 'pending', 2n);+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(path.join(refreshPending, 'owner.json'), staleTime, staleTime);+ assert.deepEqual(await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: offered.eventKey,+ now: () => baseTime + (73 * 60 * 60 * 1_000) + 1,+ }), { status: 'acknowledged', eventKey: offered.eventKey });++ resumeRefresh(response(remoteRelease()));+ assert.deepEqual(await refresh, { status: 'silent', reason: 'check-in-progress' });+ assert.deepEqual(await checkForUpdate(options(testFixture, async () => response(remoteRelease()), {+ now: () => baseTime + (71 * 60 * 60 * 1_000),+ })), { status: 'silent', reason: 'already-notified' });+});++for (const pausePoint of ['pending owner creation', 'state temp creation']) {+ test(`acknowledgement retries when fenced during ${pausePoint}`, async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const offered = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease()),+ ));+ const pending = operationPath(testFixture, 'pending', 2n);+ const pause = pauseOpenOnce((target) => {+ if (pausePoint === 'pending owner creation') {+ return path.resolve(target) === path.join(pending, 'owner.json');+ }+ return path.dirname(path.resolve(target)) === pending+ && /^\.state\..+\.tmp$/.test(path.basename(target));+ });+ t.after(() => pause.restore());++ const acknowledgement = acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: offered.eventKey,+ });+ await pause.reached;+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(+ pausePoint === 'pending owner creation' ? pending : path.join(pending, 'owner.json'),+ staleTime,+ staleTime,+ );++ assert.equal((await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease()),+ { now: () => baseTime + (73 * 60 * 60 * 1_000) },+ ))).status, 'update_available');+ assert.equal(fs.existsSync(operationPath(testFixture, 'fenced', 2n)), true);++ pause.release();+ assert.deepEqual(await acknowledgement, {+ status: 'acknowledged',+ eventKey: offered.eventKey,+ });+ pause.restore();+ });+}++test('a stale corrupt operation is fenced without exposing a failure', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const staleTime = new Date(Date.now() - 60_000);+ const pending = writePendingOperation(testFixture, {+ owner: 'corrupt-owner',+ modifiedAt: staleTime,+ });++ const result = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease()),+ ));++ assert.equal(result.status, 'update_available');+ assert.equal(fs.existsSync(pending), false);+ assert.equal(fs.existsSync(operationPath(testFixture, 'fenced', 1n)), true);+});++test('malformed active-claim shapes recover after the hard lease', async () => {+ for (const shape of ['file', 'symlink', 'owner-directory']) {+ const testFixture = fixture();+ try {+ const directory = stateDirectory(testFixture);+ const activeClaim = path.join(directory, 'active-claim');+ fs.mkdirSync(directory, { recursive: true });+ if (shape === 'file') {+ fs.writeFileSync(activeClaim, 'corrupt claim');+ } else if (shape === 'symlink') {+ fs.symlinkSync(path.join(testFixture.root, 'missing-claim-target'), activeClaim);+ } else {+ fs.mkdirSync(path.join(activeClaim, 'owner.json'), { recursive: true });+ }+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };++ assert.deepEqual(await checkForUpdate(options(testFixture, fetchImpl)), {+ status: 'silent',+ reason: 'check-in-progress',+ }, `${shape} should retain a fresh hard lease`);+ assert.equal(requests, 0);++ const staleTime = new Date(Date.now() - 60_000);+ if (shape === 'symlink') fs.lutimesSync(activeClaim, staleTime, staleTime);+ else if (shape === 'owner-directory') {+ fs.utimesSync(path.join(activeClaim, 'owner.json'), staleTime, staleTime);+ } else fs.utimesSync(activeClaim, staleTime, staleTime);++ assert.equal((await checkForUpdate(options(testFixture, fetchImpl))).status, 'update_available');+ assert.equal(requests, 1, `${shape} should be retired after its hard lease`);+ } finally {+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ }+ }+});++test('a delayed corrupt-claim retirement cannot move a successor active claim', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const directory = stateDirectory(testFixture);+ const activeClaim = path.join(directory, 'active-claim');+ fs.mkdirSync(activeClaim, { recursive: true });+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(activeClaim, staleTime, staleTime);+ let firstRetirement = null;+ const pause = pauseRenameMatchingOnce((source, destination) => {+ if (path.resolve(source) !== activeClaim+ || !path.basename(path.dirname(destination)).startsWith('retired-claim-corrupt-')) {+ return false;+ }+ firstRetirement = destination;+ return true;+ });+ t.after(() => pause.restore());++ const delayed = checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease()),+ ));+ await pause.reached;+ fs.utimesSync(activeClaim, staleTime, staleTime);+ fs.utimesSync(+ path.join(operationPath(testFixture, 'pending', 1n), 'owner.json'),+ staleTime,+ staleTime,+ );++ assert.equal((await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease()),+ ))).status, 'update_available');+ assert.equal(+ JSON.parse(fs.readFileSync(path.join(activeClaim, 'owner.json'), 'utf8')).generation,+ '2',+ );++ pause.release();+ assert.equal((await delayed).status, 'update_available');+ pause.restore();+ assert.equal(firstRetirement !== null, true);+ assert.equal(fs.existsSync(activeClaim), true);+ assert.equal(+ JSON.parse(fs.readFileSync(path.join(activeClaim, 'owner.json'), 'utf8')).generation,+ '2',+ );+});++test('repeated corrupt claim contents receive distinct retirement identities', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const directory = stateDirectory(testFixture);+ const activeClaim = path.join(directory, 'active-claim');+ fs.mkdirSync(directory, { recursive: true });+ fs.writeFileSync(activeClaim, 'same corrupt claim');+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(activeClaim, staleTime, staleTime);+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };++ assert.equal((await checkForUpdate(options(testFixture, fetchImpl))).status, 'update_available');+ fs.renameSync(activeClaim, path.join(directory, 'test-completed-active-claim'));+ fs.writeFileSync(activeClaim, 'same corrupt claim');+ fs.utimesSync(activeClaim, staleTime, staleTime);+ assert.equal((await checkForUpdate(options(testFixture, fetchImpl, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }))).status, 'update_available');++ assert.equal(requests, 2);+ assert.equal(+ fs.readdirSync(directory).filter((name) => name.startsWith('retired-claim-corrupt-')).length,+ 2,+ );+});++test('corrupt claim retirement preserves distinct 64-bit inode identities', async (t) => {+ const testFixture = fixture();+ const originalLstat = fsPromises.lstat;+ t.after(() => {+ fsPromises.lstat = originalLstat;+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ });+ const directory = stateDirectory(testFixture);+ const activeClaim = path.join(directory, 'active-claim');+ fs.mkdirSync(directory, { recursive: true });+ fs.writeFileSync(activeClaim, 'corrupt claim');+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(activeClaim, staleTime, staleTime);+ let instance = 1n;+ fsPromises.lstat = async (target, ...args) => {+ const metadata = await originalLstat(target, ...args);+ const resolved = path.resolve(target);+ const isCorruptClaimInstance = resolved === path.resolve(activeClaim)+ || (path.basename(resolved) === 'active'+ && path.basename(path.dirname(resolved)).startsWith('retired-claim-corrupt-'));+ if (!isCorruptClaimInstance || !metadata.isFile()) return metadata;+ const inode = 9_007_199_254_740_992n + (instance - 1n);+ return args[0]?.bigint+ ? metadataWithOverrides(metadata, {+ ino: inode,+ birthtimeNs: 1_000n,+ ctimeNs: 2_000n,+ })+ : metadataWithOverrides(metadata, {+ ino: Number(inode),+ birthtimeMs: 1,+ ctimeMs: 2,+ });+ };+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };++ assert.equal((await checkForUpdate(options(testFixture, fetchImpl))).status, 'update_available');+ fs.renameSync(activeClaim, path.join(directory, 'test-completed-active-claim'));+ fs.writeFileSync(activeClaim, 'corrupt claim');+ fs.utimesSync(activeClaim, staleTime, staleTime);+ instance = 2n;+ assert.equal((await checkForUpdate(options(testFixture, fetchImpl, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ }))).status, 'update_available');++ assert.equal(requests, 2);+ assert.equal(+ fs.readdirSync(directory).filter((name) => name.startsWith('retired-claim-corrupt-')).length,+ 2,+ );+});++test('a forged retirement symlink cannot move an active claim outside its cache partition', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };+ assert.equal((await checkForUpdate(options(testFixture, fetchImpl))).status, 'update_available');++ const outside = path.join(testFixture.root, 'outside');+ fs.mkdirSync(outside);+ fs.symlinkSync(outside, path.join(stateDirectory(testFixture), 'retired-claim-1'));+ const refreshOptions = options(testFixture, fetchImpl, {+ now: () => baseTime + (73 * 60 * 60 * 1_000),+ });+ assert.equal((await checkForUpdate(refreshOptions)).status, 'update_available');+ assert.deepEqual(fs.readdirSync(outside), []);+ assert.equal(requests, 1);++ fs.unlinkSync(path.join(stateDirectory(testFixture), 'retired-claim-1'));+ assert.equal((await checkForUpdate(refreshOptions)).status, 'update_available');+ assert.deepEqual(fs.readdirSync(outside), []);+ assert.equal(requests, 2);+});++test('an expired operation is fenced even when its PID was reused by a live process', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const staleTime = new Date(Date.now() - 60_000);+ const pending = writePendingOperation(testFixture, { modifiedAt: staleTime });+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(result.status, 'update_available');+ assert.equal(requests, 1);+ assert.equal(fs.existsSync(pending), false);+ assert.equal(fs.existsSync(operationPath(testFixture, 'fenced', 1n)), true);+});++test('a corrupt future-dated operation cannot suppress checks indefinitely', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const futureTime = new Date(Date.now() + (365 * 24 * 60 * 60 * 1_000));+ const pending = writePendingOperation(testFixture, {+ owner: 'corrupt-owner',+ modifiedAt: futureTime,+ });++ const result = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease()),+ ));++ assert.equal(result.status, 'update_available');+ assert.equal(fs.existsSync(pending), false);+ assert.equal(fs.existsSync(operationPath(testFixture, 'fenced', 1n)), true);+});++test('a newly-created operation with slight clock skew is never fenced as stale', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const nearFuture = new Date(Date.now() + 1_000);+ const pending = writePendingOperation(testFixture, {+ owner: 'writer-has-not-finished-the-record',+ modifiedAt: nearFuture,+ });+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.deepEqual(result, { status: 'silent', reason: 'check-in-progress' });+ assert.equal(requests, 0);+ assert.equal(fs.existsSync(pending), true);+});++test('a fenced stale owner cannot overwrite a newer committed candidate after resuming', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let resumeOldOwner;+ let markOldStarted;+ const oldStarted = new Promise((resolve) => { markOldStarted = resolve; });+ const oldCheck = checkForUpdate(options(testFixture, async () => {+ markOldStarted();+ return new Promise((resolve) => { resumeOldOwner = resolve; });+ }, { timeoutMs: 2_000 }));+ await oldStarted;++ const oldPending = operationPath(testFixture, 'pending', 1n);+ const staleTime = new Date(Date.now() - 60_000);+ fs.utimesSync(path.join(oldPending, 'owner.json'), staleTime, staleTime);++ const newer = await checkForUpdate(options(+ testFixture,+ async () => response(remoteReleaseForVersion('3.0.0', 'c'.repeat(64))),+ ));+ assert.equal(newer.status, 'update_available');+ assert.equal(newer.latestVersion, '3.0.0');++ resumeOldOwner(response(remoteReleaseForVersion('2.16.0', 'b'.repeat(64))));+ assert.deepEqual(await oldCheck, { status: 'silent', reason: 'check-in-progress' });+ const persisted = JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8'));+ assert.equal(persisted.candidate.version, '3.0.0');+ assert.equal(fs.existsSync(operationPath(testFixture, 'fenced', 1n)), true);+});++test('different installed versions share no acknowledgement or cache-reset state', async (t) => {+ const testFixture = fixture('2.15.0');+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const olderReleasePath = path.join(testFixture.root, 'older-skill-release.json');+ writeJson(olderReleasePath, localRelease('2.14.0'));+ let requests = 0;+ const fetchImpl = async () => {+ requests += 1;+ return response(remoteRelease());+ };++ const newerInstall = await checkForUpdate(options(testFixture, fetchImpl));+ assert.equal(newerInstall.status, 'update_available');+ assert.deepEqual(await acknowledgeUpdate({+ releasePath: testFixture.releasePath,+ cacheDirectory: testFixture.cacheDirectory,+ eventKey: newerInstall.eventKey,+ now: () => baseTime + 1_000,+ }), { status: 'acknowledged', eventKey: newerInstall.eventKey });++ const olderInstallOptions = options(testFixture, fetchImpl, { releasePath: olderReleasePath });+ const olderInstall = await checkForUpdate(olderInstallOptions);+ assert.equal(olderInstall.status, 'update_available');+ assert.equal(olderInstall.installedVersion, '2.14.0');++ assert.deepEqual(await checkForUpdate(options(testFixture, fetchImpl)), {+ status: 'silent',+ reason: 'already-notified',+ });+ const olderAgain = await checkForUpdate(olderInstallOptions);+ assert.equal(olderAgain.status, 'update_available');+ assert.equal(requests, 2, 'each installed version should retain its own fresh cache');+ assert.equal(fs.existsSync(statePath(testFixture, '2.15.0')), true);+ assert.equal(fs.existsSync(statePath(testFixture, '2.14.0')), true);+});++test('an identity mismatch is rejected silently and never cached as a candidate', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));++ const result = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease({ skillId: 'different-skill' })),+ ));++ assert.deepEqual(result, { status: 'silent', reason: 'invalid-manifest' });+ const state = JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8'));+ assert.equal(Object.hasOwn(state, 'candidate'), false);+});++test('release notes must byte-match the exact trusted GitHub URL', async () => {+ const base = 'https://github.com/tt-a1i/archify/releases/tag/v2.16.0';+ for (const releaseNotes of [+ 'https://github.com:443/tt-a1i/archify/releases/tag/v2.16.0',+ 'https://github.com:444/tt-a1i/archify/releases/tag/v2.16.0',+ `${base}?`,+ `${base}#`,+ `${base}?source=manifest`,+ 'https://GITHUB.COM/tt-a1i/archify/releases/tag/v2.16.0',+ ]) {+ const testFixture = fixture();+ try {+ const result = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease({ releaseNotes })),+ ));+ assert.deepEqual(result, { status: 'silent', reason: 'invalid-manifest' }, releaseNotes);+ } finally {+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ }+ }+});++test('malformed release notes are classified as an invalid manifest', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));++ const result = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease({ releaseNotes: 'not-a-url' })),+ ));++ assert.deepEqual(result, { status: 'silent', reason: 'invalid-manifest' });+});++test('publishedAt must use canonical UTC seconds and a real calendar date', async () => {+ for (const publishedAt of [+ '2026-08-28T15:00:00+08:00',+ '2026-08-28',+ '2026-02-30T00:00:00Z',+ ]) {+ const testFixture = fixture();+ try {+ const result = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease({ publishedAt })),+ ));+ assert.deepEqual(result, { status: 'silent', reason: 'invalid-manifest' }, publishedAt);+ } finally {+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ }+ }+});++test('stable candidates cannot use prerelease or build metadata', async () => {+ for (const version of ['2.16.0-dev.1', '2.16.0+build.1']) {+ const testFixture = fixture();+ try {+ const result = await checkForUpdate(options(+ testFixture,+ async () => response(remoteReleaseForVersion(version)),+ ));+ assert.deepEqual(result, { status: 'silent', reason: 'invalid-manifest' }, version);+ } finally {+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ }+ }+});++test('an invalid local identity fails before any network disclosure', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ writeJson(testFixture.releasePath, {+ ...localRelease(),+ source: { repository: 'https://example.com/untrusted/archify' },+ });+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.deepEqual(result, { status: 'silent', reason: 'invalid-local-release' });+ assert.equal(requests, 0);+});++test('a bounded timeout fails silently without retrying', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let requests = 0;+ const fetchImpl = (_url, init) => new Promise((_resolve, reject) => {+ requests += 1;+ init.signal.addEventListener('abort', () => {+ const error = new Error('aborted');+ error.name = 'AbortError';+ reject(error);+ }, { once: true });+ });++ const result = await checkForUpdate(options(testFixture, fetchImpl, { timeoutMs: 10 }));+ assert.deepEqual(result, { status: 'silent', reason: 'check-failed' });+ assert.equal(requests, 1);+});++test('non-success responses cancel their unread body before failing silently', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ let cancelled = false;++ const result = await checkForUpdate(options(testFixture, async () => ({+ status: 503,+ headers: new Headers(),+ body: {+ async cancel() {+ cancelled = true;+ },+ },+ })));++ assert.deepEqual(result, { status: 'silent', reason: 'check-failed' });+ assert.equal(cancelled, true);+});++test('media-type and declared-size rejection cancel unread response bodies', async () => {+ for (const headers of [+ { 'content-type': 'text/html' },+ { 'content-type': 'application/json', 'content-length': String((32 * 1024) + 1) },+ ]) {+ const testFixture = fixture();+ let cancelled = false;+ try {+ const result = await checkForUpdate(options(testFixture, async () => ({+ status: 200,+ headers: new Headers(headers),+ body: {+ async cancel() {+ cancelled = true;+ },+ },+ })));+ assert.deepEqual(result, { status: 'silent', reason: 'invalid-manifest' });+ assert.equal(cancelled, true);+ } finally {+ fs.rmSync(testFixture.root, { recursive: true, force: true });+ }+ }+});++test('response stream failures are classified as network failures', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));++ const result = await checkForUpdate(options(testFixture, async () => ({+ status: 200,+ headers: new Headers({ 'content-type': 'application/json' }),+ body: {+ getReader() {+ return {+ async read() {+ throw new TypeError('socket closed while reading');+ },+ releaseLock() {},+ };+ },+ },+ })));++ assert.deepEqual(result, { status: 'silent', reason: 'check-failed' });+});++test('invalid UTF-8 is classified as an invalid manifest rather than a network failure', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const result = await checkForUpdate(options(+ testFixture,+ async () => new Response(new Uint8Array([0xff]), {+ status: 200,+ headers: { 'content-type': 'application/json' },+ }),+ ));+ assert.deepEqual(result, { status: 'silent', reason: 'invalid-manifest' });+});++test('chunked responses above 32 KiB are rejected instead of fully trusted', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ const oversized = `${JSON.stringify(remoteRelease())}${' '.repeat(33 * 1024)}`;++ const result = await checkForUpdate(options(+ testFixture,+ async () => response(oversized),+ ));++ assert.deepEqual(result, { status: 'silent', reason: 'invalid-manifest' });+});++test('a poisoned far-future cache timestamp cannot suppress checks indefinitely', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ await checkForUpdate(options(testFixture, async () => response(remoteRelease())));+ const cacheStatePath = statePath(testFixture);+ const state = JSON.parse(fs.readFileSync(cacheStatePath, 'utf8'));+ state.check.nextCheckAt = '9999-12-31T23:59:59.000Z';+ writeJson(cacheStatePath, state);+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteRelease());+ }));++ assert.equal(result.status, 'update_available');+ assert.equal(requests, 1);+});++test('a semantically corrupt cached candidate discards legacy validators and rebuilds unconditionally', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ await checkForUpdate(options(testFixture, async () => response(remoteRelease())));+ const cacheStatePath = statePath(testFixture);+ const state = JSON.parse(fs.readFileSync(cacheStatePath, 'utf8'));+ state.candidate.targetDigest = 'sha256:corrupt';+ state.check.etag = '"legacy-tracker"';+ state.check.nextCheckAt = '9999-12-31T23:59:59.000Z';+ writeJson(cacheStatePath, state);+ let conditionalHeader = 'not-observed';++ const result = await checkForUpdate(options(testFixture, async (_url, init) => {+ conditionalHeader = init.headers['if-none-match'];+ return response(remoteRelease());+ }));++ assert.equal(result.status, 'update_available');+ assert.equal(conditionalHeader, undefined);+ assert.equal(+ JSON.parse(fs.readFileSync(statePath(testFixture), 'utf8')).candidate.targetDigest,+ result.targetDigest,+ );+});++test('a newer cached candidate without offered or acknowledged provenance is rebuilt', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ writeJson(statePath(testFixture), {+ schemaVersion: 1,+ skillId: 'archify',+ installedVersion: '2.15.0',+ check: {+ nextCheckAt: new Date(baseTime + (24 * 60 * 60 * 1_000)).toISOString(),+ consecutiveFailures: 0,+ },+ notification: {+ offeredDigests: [],+ acknowledgedDigests: [],+ },+ candidate: {+ version: '2.16.0',+ targetDigest: `sha256:${'b'.repeat(64)}`,+ severity: 'normal',+ releaseNotes: 'https://github.com/tt-a1i/archify/releases/tag/v2.16.0',+ },+ });+ let requests = 0;++ const result = await checkForUpdate(options(testFixture, async () => {+ requests += 1;+ return response(remoteReleaseForVersion('2.15.0', 'd'.repeat(64)));+ }));++ assert.deepEqual(result, { status: 'silent', reason: 'current' });+ assert.equal(requests, 1, 'semantic corruption must not produce an unacknowledgeable cached notice');+});++test('corrupt cache is rebuilt without exposing an error to the user', async (t) => {+ const testFixture = fixture();+ t.after(() => fs.rmSync(testFixture.root, { recursive: true, force: true }));+ fs.mkdirSync(stateDirectory(testFixture), { recursive: true });+ fs.mkdirSync(path.dirname(statePath(testFixture)), { recursive: true });+ fs.writeFileSync(statePath(testFixture), '{not-json');++ const result = await checkForUpdate(options(+ testFixture,+ async () => response(remoteRelease({ version: '2.15.0' })),+ ));++ assert.deepEqual(result, { status: 'silent', reason: 'invalid-manifest' });+ assert.doesNotThrow(() => JSON.parse(+ fs.readFileSync(statePath(testFixture), 'utf8'),+ ));+});++test('disabled CLI returns one silent JSON line and never needs the network', () => {+ const result = spawnSync(process.execPath, [checkerPath], {+ cwd: skillRoot,+ encoding: 'utf8',+ env: { ...process.env, ARCHIFY_UPDATE_CHECK_DISABLED: '1' },+ });++ assert.equal(result.status, 0, result.stderr);+ assert.deepEqual(JSON.parse(result.stdout), { status: 'silent', reason: 'disabled' });+ assert.equal(result.stdout.trim().split('\n').length, 1);+});++test('CLI acknowledgement emits the documented one-line success schema', async (t) => {+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-update-cli-ack-'));+ t.after(() => fs.rmSync(root, { recursive: true, force: true }));+ const home = path.join(root, 'home');+ const xdg = path.join(root, 'xdg-cache');+ const localData = path.join(root, 'local-data');+ for (const directory of [home, xdg, localData]) fs.mkdirSync(directory, { recursive: true });+ const cacheDirectory = process.platform === 'win32'+ ? path.join(localData, 'archify-skill')+ : process.platform === 'darwin'+ ? path.join(home, 'Library', 'Caches', 'archify-skill')+ : path.join(xdg, 'archify-skill');+ const releasePath = path.join(skillRoot, 'skill-release.json');+ const offered = await checkForUpdate({+ releasePath,+ cacheDirectory,+ fetchImpl: async () => response(remoteRelease()),+ now: () => baseTime,+ random: () => 0.5,+ timeoutMs: 50,+ });+ assert.equal(offered.status, 'update_available');++ const acknowledgement = spawnSync(process.execPath, [checkerPath, '--ack', offered.eventKey], {+ cwd: skillRoot,+ encoding: 'utf8',+ env: {+ ...process.env,+ HOME: home,+ USERPROFILE: home,+ XDG_CACHE_HOME: xdg,+ LOCALAPPDATA: localData,+ },+ });+ assert.equal(acknowledgement.status, 0, acknowledgement.stderr);+ assert.deepEqual(JSON.parse(acknowledgement.stdout), {+ status: 'acknowledged',+ eventKey: offered.eventKey,+ });+ assert.equal(acknowledgement.stdout.trim().split('\n').length, 1);+});++test('CLI entry detection survives a realpath or symlink alias', (t) => {+ const aliasRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-update-cli-alias-'));+ t.after(() => fs.rmSync(aliasRoot, { recursive: true, force: true }));+ const aliasPath = path.join(aliasRoot, 'check-update-alias.mjs');+ try {+ fs.symlinkSync(checkerPath, aliasPath);+ } catch (error) {+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {+ t.skip(`symlinks unavailable: ${error.code}`);+ return;+ }+ throw error;+ }++ const result = spawnSync(process.execPath, [aliasPath], {+ cwd: aliasRoot,+ encoding: 'utf8',+ env: { ...process.env, ARCHIFY_UPDATE_CHECK_DISABLED: '1' },+ });+ assert.equal(result.status, 0, result.stderr);+ assert.deepEqual(JSON.parse(result.stdout), { status: 'silent', reason: 'disabled' });+});++test('notifier source has no process execution or remote-origin override surface', () => {+ const checkerSource = fs.readFileSync(checkerPath, 'utf8');+ const contractSource = fs.readFileSync(contractPath, 'utf8');+ const combinedSource = `${checkerSource}\n${contractSource}`;+ assert.doesNotMatch(combinedSource, /(?:node:)?child_process/);+ assert.doesNotMatch(combinedSource, /(?:^|[^\w.])(?:spawn|exec|execFile|fork)(?:Sync)?\s*\(/m);+ assert.doesNotMatch(contractSource, /\bfetch\s*\(/);+ const environmentReads = [...combinedSource.matchAll(/process\.env\.([A-Z0-9_]+)/g)]+ .map((match) => match[1])+ .sort();+ assert.deepEqual(environmentReads, [+ 'ARCHIFY_UPDATE_CHECK_DISABLED',+ 'LOCALAPPDATA',+ 'XDG_CACHE_HOME',+ ]);+ assert.doesNotMatch(combinedSource, /updateCommand/);+});diff --git a/archify/test/webm-artifact.smoke.mjs b/archify/test/webm-artifact.smoke.mjsindex 82822d4b..c4f80c57 100644--- a/archify/test/webm-artifact.smoke.mjs+++ b/archify/test/webm-artifact.smoke.mjs@@ -350,6 +350,7 @@ let targetId;try {cdp = await connectCdp(await devtoolsEndpoint(port, chromeProcess, () => chromeStderr));({ targetId } = await cdp.send('Target.createTarget', { url: 'about:blank' }));+ await cdp.send('Target.activateTarget', { targetId });const { sessionId } = await cdp.send('Target.attachToTarget', { targetId, flatten: true });await cdp.send('Page.enable', {}, sessionId);await cdp.send('Runtime.enable', {}, sessionId);@@ -357,6 +358,8 @@ try {async function navigateReady(file, condition, label) {const url = file instanceof URL ? file.href : pathToFileURL(file).href;await cdp.send('Page.navigate', { url }, sessionId);+ await cdp.send('Page.bringToFront', {}, sessionId);+ await cdp.send('Emulation.setFocusEmulationEnabled', { enabled: true }, sessionId);let ready = false;for (let attempt = 0; attempt < 100 && !ready; attempt += 1) {ready = await evaluate(cdp, sessionId, `document.readyState === "complete" && (${condition})`);@@ -610,13 +613,25 @@ try {}async function verifyArchitectureDeltaNavigator(file) {+ await cdp.send('Emulation.setEmulatedMedia', {+ media: 'screen',+ features: [{ name: 'prefers-reduced-motion', value: 'no-preference' }],+ }, sessionId);const readyCondition = '!!document.querySelector("#review-play") && !document.querySelector("#review-play").disabled';async function waitForSelected(changeKey, label) {for (let attempt = 0; attempt < 80; attempt += 1) {if (await evaluate(cdp, sessionId, `document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey === ${JSON.stringify(changeKey)}`)) return;await delay(50);}- assert.fail(`${label} did not select ${changeKey} within the bounded wait`);+ const observed = await evaluate(cdp, sessionId, `({+ selected: document.querySelector('.change-row[aria-current="step"]')?.dataset.changeKey || null,+ pressed: document.querySelector('#review-play')?.getAttribute('aria-pressed'),+ label: document.querySelector('#review-play')?.textContent,+ status: document.querySelector('#review-status')?.textContent,+ reducedMotion: matchMedia('(prefers-reduced-motion: reduce)').matches,+ hidden: document.hidden+ })`);+ assert.fail(`${label} did not select ${changeKey} within the bounded wait: ${JSON.stringify(observed)}`);}async function waitForReviewFinished(label) {for (let attempt = 0; attempt < 400; attempt += 1) {@@ -771,7 +786,10 @@ try {same: getComputedStyle(document.querySelector('[data-view="delta"] [data-delta-state="same"]')).opacity})`);assert.deepEqual(printState, { strip: 'none', base: 'none', delta: 'block', head: 'none', current: '1', same: '1' });- await cdp.send('Emulation.setEmulatedMedia', { media: 'screen', features: [] }, sessionId);+ await cdp.send('Emulation.setEmulatedMedia', {+ media: 'screen',+ features: [{ name: 'prefers-reduced-motion', value: 'no-preference' }],+ }, sessionId);await navigateReady(file, readyCondition, 'architecture-delta tamper navigator');const tampered = await evaluate(cdp, sessionId, `(() => {diff --git a/docs/article-archify.md b/docs/article-archify.mdindex b20a235f..dfe495d0 100644--- a/docs/article-archify.md+++ b/docs/article-archify.md@@ -1,5 +1,8 @@# 让 AI 画架构图不难。难的是决定不画什么。+> [!IMPORTANT]+> 这是基于 Archify v2.6 的历史文章,用于保留当时的设计背景,不代表当前功能、命令或产品边界。最新能力与安装方式以 [README](../README.md) 为准;仍然有效的架构取舍以 [ROADMAP](../ROADMAP.md) 为准。+一条命令:diff --git a/docs/assets/brand-marks-before-after.png b/docs/assets/brand-marks-before-after.pngdeleted file mode 100644index 4670bacd..00000000Binary files a/docs/assets/brand-marks-before-after.png and /dev/null differdiff --git a/docs/assets/brand-marks-luna-test.png b/docs/assets/brand-marks-luna-test.pngdeleted file mode 100644index 7e775234..00000000Binary files a/docs/assets/brand-marks-luna-test.png and /dev/null differdiff --git a/docs/assets/brand-marks-url-capture.png b/docs/assets/brand-marks-url-capture.pngdeleted file mode 100644index 5109623a..00000000Binary files a/docs/assets/brand-marks-url-capture.png and /dev/null differdiff --git a/docs/assets/intent-trace-authored-direction.gif b/docs/assets/intent-trace-authored-direction.gifdeleted file mode 100644index baf4e578..00000000Binary files a/docs/assets/intent-trace-authored-direction.gif and /dev/null differdiff --git a/docs/research/skill-plugin-update-reminder-market-design.md b/docs/research/skill-plugin-update-reminder-market-design.mdnew file mode 100644index 00000000..04435875--- /dev/null+++ b/docs/research/skill-plugin-update-reminder-market-design.md@@ -0,0 +1,478 @@+# AI Agent Skills 频繁更新提醒:市场机制与统一方案++> 调研日期:2026-08-28+> 范围:Codex、Claude Code、GitHub Copilot、Gemini CLI、Cursor、OpenCode、VS Code Agent Plugins,以及跨 Agent Skills 管理器。+> 证据口径:只采用厂商官方文档、官方规范和官方源码。普通浏览器/IDE 扩展仅作极少量 UX 旁证,不作为方案主体。++## 结论先行++市场上还没有一套同时覆盖“跨 Agent 安装、可靠版本识别、权限差异、低打扰提醒、自动更新、回滚”的完整 Skills 更新系统。现有成熟能力分散在不同产品中:++- Claude Code 的插件自动更新最完整:按 marketplace 区分默认策略,启动后延迟检查,更新写盘但不热替换当前会话,并用一次 reload 提醒完成激活。+- GitHub `gh skill` 是目前最接近“跨 Agent Skill 更新控制面”的官方工具:覆盖多种宿主,具备来源追踪、目录树 SHA、固定版本、安装前 preview、dry-run 和交互确认。+- Gemini CLI Extensions 有逐扩展 opt-in 自动更新、手动更新、预发布选择和重启后生效。+- VS Code Agent Plugins 给出了很实用的边界:官方/受控来源可以自动检查,npm/PyPI 等外部命令来源只提示、再确认安装。+- Vercel Labs `skills` 覆盖大量 Agent 目录,是较强的跨 Agent 安装适配层,但更新仍是用户主动运行命令,缺少后台提醒、权限 diff 和回滚体验。+- Codex、Cursor、OpenCode 对 Skills 的发现和使用已有官方文档,但公开文档没有形成完整的“已安装远程 Skill 更新提醒”闭环。++因此推荐建设一个独立于各 Agent 的 **Skill Update Control Plane(技能更新控制面)**:一份规范化 release/lock 状态,一次检查和风险评估,一条聚合提醒,再由 Codex、Claude、Copilot、Gemini、Cursor、OpenCode adapter 分发到各自目录或调用原生更新能力。不要让六个 Agent 对同一个 Skill 各自检查、各自弹一次。++以下段落使用两个标签:++- **来源事实**:官方资料直接支持。+- **综合推断**:基于多家机制提炼的产品/架构建议,不表示任何一家已经完整实现。++## 1. 先定义对象:Skill 不是“无代码的小插件”++**来源事实。** Agent Skills 开放规范把 Skill 定义为至少包含 `SKILL.md` 的目录,还可包含可执行的 `scripts/`、按需读取的 `references/` 和 `assets/`。规范 frontmatter 强制字段只有 `name`、`description`;`compatibility` 是自由文本,`metadata` 是字符串键值映射,`allowed-tools` 仍是实验字段。规范没有强制的版本号、发布通道、内容摘要、签名、结构化权限或更新协议。[Agent Skills Specification](https://agentskills.io/specification)++**综合推断。** 更新系统不能只比较 `version: 1.2.3`,也不能把“只改 Markdown”默认视为无风险。Skill 的说明本身会改变 Agent 行为,脚本还可能直接执行;因此候选更新至少要比较:来源身份、内容摘要、指令变化、可执行内容、工具/网络/文件/命令能力、依赖和宿主兼容性。++## 2. 市场对比矩阵++表中“未见公开机制”表示本次查阅的官方材料没有给出该能力,不等于厂商内部一定不存在。++| 生态/工具 | 对象与更新触发 | 版本、来源与完整性 | 提醒与生效 | 用户控制 | 官方证据与主要缺口 |+|---|---|---|---|---|---|+| Claude Code | Plugin;启用自动更新后,启动后在后台检查,并随机延迟 0–10 分钟 | 版本依次可来自 `plugin.json`、marketplace、Git commit SHA 或 archive SHA256;archive 可声明并校验 SHA256 | 更新写入磁盘,但当前会话继续使用旧版本;只提示一次 `/reload-plugins`,也可下次启动生效 | 官方 marketplace 默认自动,第三方/本地默认关闭;可逐 marketplace 切换;环境变量可全局关闭或强制 | [自动更新](https://code.claude.com/docs/en/discover-plugins#configure-auto-updates)、[版本管理](https://code.claude.com/docs/en/plugins-reference#version-management)、[marketplace 完整性与发布通道](https://code.claude.com/docs/en/plugin-marketplaces)。缺口:公开文档未给出 snooze、skip-this-version 和可操作 rollback |+| GitHub Copilot CLI Plugins | First-party marketplace 在受信工作目录的每次会话开始时更新;第三方 marketplace 仅在 `autoUpdate: true` 时更新;也可手动 update | Git 来源可固定精确 SHA;插件清单有严格 schema | `/plugin` 显示更新状态;CLI 支持更新单个或全部插件 | marketplace 级自动更新;组织可通过 managed configuration 约束 | [Copilot CLI plugin update options](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-plugin-reference#copilot-plugins-update-options)。缺口:未见权限 diff、snooze、按版本跳过和 rollback 的公开说明 |+| GitHub `gh skill` | 独立 Skills;扫描 Copilot、Claude、Cursor、Codex、Gemini、OpenCode 等已知宿主目录;`gh skill update` 手动检查单个或全部 | 安装时把 source/ref/tree SHA 写入 `SKILL.md` provenance;更新比较本地 tree SHA 与远端;可固定 tag/SHA 或 `--pin` | `preview` 可在安装前浏览 `SKILL.md`、scripts/references;更新交互模式列出候选再确认;`--dry-run` 只报告 | pinned Skill 被跳过;可 `--unpin`;`--force` 覆盖本地修改 | [添加与更新 Skills](https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/add-skills)、[`gh skill update`](https://cli.github.com/manual/gh_skill_update)、[`gh skill preview`](https://cli.github.com/manual/gh_skill_preview)。目前最接近成熟跨 Agent 更新骨架;缺口是后台 cadence、聚合提醒、签名、兼容门和 rollback |+| Gemini CLI Extensions / Skills | Extension 可包含 agent skills;安装时 `--auto-update` 逐扩展 opt-in,也可 update 单个/全部。独立 Skill 可从 Git/本地安装,但公开 CLI 文档未见 `gemini skills update` | `gemini-extension.json` 有 `name/version`;Git 来源可指定 ref;支持 `--pre-release`;`migratedTo` 可迁移更新源。独立 `SKILL.md` 无强制 version | Extension 管理变化在 CLI 重启后生效;独立 Skill 上游提醒未见公开机制 | 安装 Extension 时可选自动更新、预发布;可启用/禁用扩展;企业安全配置可限制 Git 扩展 | [Gemini CLI extension reference](https://github.com/google-gemini/gemini-cli/blob/main/docs/extensions/reference.md)、[Managing Agent Skills](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/using-agent-skills.md)、[安全配置](https://github.com/google-gemini/gemini-cli/blob/main/docs/reference/configuration.md)。缺口:公开文档未说明提醒节流、权限 diff、完整性摘要和 rollback UX |+| VS Code Agent Plugins | Agent Plugin;自动更新开启时约每 24 小时检查,也可手动检查 | marketplace 安装有信任确认;插件可能包含 hooks/MCP;npm/PyPI 外部来源不自动更新 | marketplace 更新可自动;外部来源只显示 Update,点击后仍需确认才运行安装命令 | 全局更新策略和插件管理入口;可启用、禁用、卸载 | [VS Code Agent plugins](https://code.visualstudio.com/docs/agent-customization/agent-plugins)。优势是明确区分“受控包”和“外部安装命令” |+| Codex / ChatGPT Plugins | Plugin 是 skills/connectors 的安装包;公开商店发布时,Skill 是提交时快照;修改后需重新扫描、审阅并提交新版本 | plugin manifest 可声明版本和精确 Git/NPM 来源;提交链路会扫描和审核 Skill | 官方公开资料描述了发布与审核,但未建立本地已安装 Skill 的自动检查 cadence/提醒节流 | 发布者提交 release notes,审核后选择发布;连接服务与授权权限分开 | [Skills & Plugins](https://developers.openai.com/codex/skills-and-plugins)、[打包 Plugin](https://developers.openai.com/plugins/build/plugins)、[提交与发布](https://developers.openai.com/plugins/deploy/submission)。缺口:客户端更新提醒、permission diff 和自助 rollback 未见公开约定 |+| OpenAI Hosted Skills API | 服务端 Skill 版本对象 | 版本不可变,并有 default/latest 指向 | API 原语,不是本地 Codex Skill 更新提醒 UI | 调用方选择版本 | [OpenAI Skills API](https://developers.openai.com/api/reference/resources/skills)。可借鉴不可变版本,但不能当作 Codex 本地更新机制的证据 |+| Cursor | 启动时发现本地/插件 Skill;UI 支持从 GitHub 导入。公共 Marketplace 的首次发布和每次更新都人工审核;团队 Marketplace 可跟踪分支并在 push 后最多约 10 分钟内 re-index | Skills 可含脚本、引用和资产;Marketplace 审核是发布侧 gate,不等同于客户端签名 | 可在 Customize > Skills 查看;团队 re-index cadence 不能推断成客户端每 10 分钟检查 | 团队发布有 Default Off、Default On、Required | [Cursor Agent Skills](https://cursor.com/docs/skills)、[Plugins](https://cursor.com/docs/plugins)、[Marketplace security](https://cursor.com/help/security-and-privacy/marketplace-security)、[Plugin help](https://cursor.com/help/customization/plugins)。缺口:Skills 文档未说明 installed-vs-latest 提醒、固定版本、校验、diff 或回滚 |+| OpenCode | 从项目、用户以及 Claude/`.agents` 兼容目录发现 `SKILL.md`;V2 另支持本地目录和 HTTP catalog | 稳定版接受 `compatibility`、`metadata`;V2 catalog 有 opaque `version` 和文件列表,但无 checksum/signature;V2 明确 portability 字段不执行兼容门 | 原生 `skill` 工具按需加载;V2 catalog 可刷新缓存 | 可对 Skill 工具设权限或禁用 | [OpenCode Agent Skills](https://opencode.ai/docs/skills)、[OpenCode V2 Skills](https://opencode.ai/v2/docs/skills/)。缺口:稳定版未见 provenance/更新提醒;V2 也未见 pin、diff、签名、确认或回滚。`autoupdate: "notify"` 是 OpenCode 主程序更新,不是 Skill 更新 |+| Vercel Labs `skills` | 跨 Agent CLI;`npx skills update` 手动更新 project/global/specific Skills;推荐一份 canonical copy 再链接到多个宿主 | lock v3 记录 `skillFolderHash`/`skillPath`;GitHub 来源比较最新目录 tree SHA,well-known 来源比较 digest | 命令发现变化后直接用内部 `add -y` 重新安装;没有官方后台 reminder 服务 | 支持 scope 和指定 Skill;无法自动检查的来源会报告原因 | [Vercel Labs skills](https://github.com/vercel-labs/skills)、[项目架构与 lock 字段](https://github.com/vercel-labs/skills/blob/main/AGENTS.md)、[更新实现](https://github.com/vercel-labs/skills/blob/main/src/update.ts)。关键边界:源码把 `check`、`update`、`upgrade` 路由到同一更新流程,`check` 不是只读 dry-run;优势是宿主覆盖广,缺口是安全 diff、逐项确认、按版本抑制和 rollback |+| Agent Plugins 开放规范 | 定义可携带 Skills、MCP、hooks 等的跨 Agent Plugin 格式 | `$schema` 是机器可判定的格式兼容门;可选 `version` 推荐 SemVer | 安装、分发、启用、更新和 UI 被明确划为 client-managed | 由各客户端自行实现 | [Agent Plugins Specification](https://agent-plugins.org/specification)、[Plugin package boundary](https://agent-plugins.org/plugin-authors/build-an-agent-plugin)。说明市场为什么仍需要统一更新控制面:规范没有统一签名、checksum、提醒或回滚协议 |++## 3. 从现有产品中可复用的成熟模式++### 3.1 检查、下载、安装、激活、提醒必须解耦++**来源事实。** Claude Code 会在启动后延迟检查,更新落盘但当前会话不切换,只给一次 reload 提醒;Gemini CLI 的扩展变化也要重启会话才生效;VS Code Agent Plugins 则把自动检查与外部安装命令的显式确认分开。来源见上表。++**综合推断。** 用五个独立时间点建模:++1. `checked_at`:何时查询远端。+2. `staged_at`:何时下载到隔离区并完成校验。+3. `approved_at`:自动策略或用户何时批准。+4. `activated_at`:何时对新会话/宿主生效。+5. `notified_at`:何时真正打扰用户。++检查频繁不等于提醒频繁。后台每天检查一次完全可以只在每周摘要里提醒一次。++### 3.2 来源信任决定默认策略++**来源事实。** Claude Code 对官方 marketplace 默认开启自动更新,对第三方/本地 marketplace 默认关闭;Copilot CLI 对 first-party marketplace 在会话启动时更新,而第三方需显式 `autoUpdate: true`;VS Code Agent Plugins 的 npm/PyPI 外部来源永不自动更新,需要用户确认命令。[Claude 自动更新](https://code.claude.com/docs/en/discover-plugins#configure-auto-updates)、[Copilot 更新选项](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-plugin-reference#copilot-plugins-update-options)、[VS Code Agent Plugins](https://code.visualstudio.com/docs/agent-customization/agent-plugins)++**综合推断。** 默认策略不应只按 semver major/minor/patch 判断,应先按 `source_trust`:++- `official-managed`:可允许低风险更新自动 staged/activated。+- `verified-publisher`:用户 opt-in 后才自动。+- `community-git`:默认 Prompt。+- `local/path/external-command`:默认 Manual;更新源或命令变化必须重新确认。++### 3.3 不可变身份比版本字符串可靠++**来源事实。** Claude 的版本解析可落到 Git commit SHA 或 archive SHA256;`gh skill` 用目录 tree SHA 判断远端是否改变;Vercel Labs `skills` 也用 `skillFolderHash`/digest;OpenAI Hosted Skills 的版本对象不可变。[Claude 版本管理](https://code.claude.com/docs/en/plugins-reference#version-management)、[`gh skill update`](https://cli.github.com/manual/gh_skill_update)、[Vercel update source](https://github.com/vercel-labs/skills/blob/main/src/update.ts)、[OpenAI Skills API](https://developers.openai.com/api/reference/resources/skills)++**综合推断。** `version` 用于人类理解和兼容策略;真正的安装身份必须是不可变的 `resolved.commit_sha`、`resolved.tree_sha` 或 `resolved.content_sha256`。校验和证明“下载内容与声明一致”,但不证明发布者可信,二者不可混为一谈。++### 3.4 固定版本、通道和依赖约束是稳定性工具++**来源事实。** `gh skill` 支持指定 tag/SHA 与 pin;Claude marketplace 可通过不同 ref/marketplace 表达 stable/latest 等通道,插件依赖可用 semver 约束,自动更新时解析满足约束的最高版本;Gemini CLI 有 `--pre-release`。[GitHub Skills](https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/add-skills)、[Claude 发布通道](https://code.claude.com/docs/en/plugin-marketplaces#version-resolution-and-release-channels)、[Claude 依赖](https://code.claude.com/docs/en/plugin-dependencies)、[Gemini Extension reference](https://github.com/google-gemini/gemini-cli/blob/main/docs/extensions/reference.md)++**综合推断。** 用户设置应同时支持:`channel = stable|beta|nightly`、`constraint = ^1.4`、`pin = immutable digest`。Pin 是“明确保持现状”,Skip 是“只忽略这个候选版本”,Snooze 是“稍后提醒”;三者语义必须分开。++### 3.5 当前会话不热替换++**来源事实。** Claude Code 和 Gemini CLI 都把扩展更新推迟到 reload/restart/下一会话生效。来源见上表。++**综合推断。** Agent 会话已经加载了 Skill 名称、描述乃至正文,半途中热替换会造成同一任务前后规则不一致。默认应在会话边界原子切换;只有纯静态资产且宿主明确支持时才考虑热刷新。++### 3.6 高风险变化需要重新同意++**来源事实。** Claude marketplace 的命令来源和 `headersHelper` 等高风险配置变更需要精确批准;无同意的后台更新会被跳过并进入错误状态。Skill/Plugin 本身可能以用户权限执行代码,官方要求只安装可信来源。[Claude marketplace command sources](https://code.claude.com/docs/en/plugin-marketplaces)、[Claude plugin security](https://code.claude.com/docs/en/discover-plugins#security)++GitHub 同样明确警告,Agent Skills 并不由 GitHub 验证,可能包含 prompt injection、隐藏指令或恶意脚本,建议安装前先 preview;这也是独立 Skills 不应默认无感更新的重要事实基础。[GitHub: Add and update Agent Skills](https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/add-skills)、[`gh skill preview`](https://cli.github.com/manual/gh_skill_preview)++**综合推断。** 需要批准的边界应是“能力或信任发生变化”,而不是“版本号变化”:新增脚本/hooks/MCP、扩大网络/文件/命令/secret 权限、更换发布者或源、改变安装命令、降低宿主兼容置信度,都应暂停自动更新并展示 diff。++### 3.7 `check`、`preview`、`apply` 必须是不同操作++**来源事实。** `gh skill preview` 可以不安装就查看 Skill 文件和内容,`gh skill update --dry-run` 只报告候选,交互更新先列出再确认。相反,Vercel Labs `skills` 当前源码把 `check`、`update`、`upgrade` 都路由到同一 `runUpdate`,发现变化后会重新安装,只有上游删除另行确认。[`gh skill preview`](https://cli.github.com/manual/gh_skill_preview)、[`gh skill update`](https://cli.github.com/manual/gh_skill_update)、[Vercel CLI routing](https://github.com/vercel-labs/skills/blob/main/src/cli.ts)、[Vercel update implementation](https://github.com/vercel-labs/skills/blob/main/src/update.ts)++**综合推断。** 更新控制面的 API 和 UI 必须严格区分:++- `check`:只取元数据、解析 candidate,不写宿主目录。+- `preview/diff`:可下载到隔离缓存,但不激活。+- `stage`:验证后准备不可变内容。+- `apply/activate`:明确改变宿主状态。++任何名为 check/dry-run 的入口都不能产生安装副作用,这是自动提醒服务可被用户信任的前提。++## 4. 推荐架构:一个控制面,多个 Agent Adapter++```text+Registries / Git / Archives / Local sources+ │+ Resolver + Provenance verifier+ │+ Candidate diff + Risk classifier+ │+ Policy engine + Reminder scheduler+ │+ Content-addressed staging store+ │+ ┌────────┬────────┬────────┬────────┐+ Codex Claude Copilot Gemini Cursor/OpenCode+ adapter adapter adapter adapter adapters+ └────────┴────────┴────────┴────────┘+ │+ Activation / health / rollback log+```++**综合推断。** 同一个 canonical Skill 被多个 Agent 使用时,只生成一个候选、一次安全评估、一个提醒事件;adapter 只负责宿主路径、manifest 转换、reload/restart 和原生命令调用。内容保存在 content-addressed store,宿主目录使用原子复制或链接到当前版本,避免六份内容漂移。++### 4.1 三类数据必须分开++1. **Publisher release(发布者声明,不可变)**:版本、来源、摘要、通道、兼容性、权限、依赖、变更说明、签名。+2. **Installation lock(解析结果,不可变历史)**:最终 commit/tree/content SHA、安装时间、adapter 目标、previous/LKG。+3. **User policy & reminder state(用户本地可变)**:Auto/Prompt/Manual、pin、snooze、skip-version、已批准权限、上次提醒时间。++不要把 `snoozed_until` 写进发布者 manifest,也不要让发布者覆盖用户已批准权限。++### 4.2 推荐统一 release manifest++为保持 Agent Skills 兼容,继续把 `SKILL.md` 作为运行时入口;新增 sidecar `skill-release.json`,或由 registry 在服务端提供同构记录。Agent Skills 的 `metadata` 仅是字符串映射,不适合承载复杂权限和宿主矩阵。[Agent Skills Specification](https://agentskills.io/specification) Agent Plugins 的 `$schema` 已证明“宿主不支持 schema 就拒绝”是一条可机器执行的格式兼容边界,但其 update 生命周期仍由客户端管理;本方案沿用 schema gate,再补 host capability matrix。[Agent Plugins Specification](https://agent-plugins.org/specification)++```json+{+ "schema": "skill-release/v1",+ "id": "com.example/pdf-review",+ "name": "pdf-review",+ "version": "2.3.1",+ "channel": "stable",+ "publisher": { "id": "example", "keyId": "sigstore:key-123" },+ "source": {+ "type": "git",+ "url": "https://github.com/example/skills",+ "ref": "v2.3.1",+ "subdir": "skills/pdf-review"+ },+ "resolved": {+ "commitSha": "...",+ "treeSha": "...",+ "contentSha256": "..."+ },+ "compatibility": {+ "manager": ">=1.2.0",+ "agents": {+ "codex": ">=2026.8",+ "claude-code": ">=2.1",+ "copilot-cli": "*",+ "gemini-cli": ">=0.8",+ "cursor": "*",+ "opencode": "*"+ },+ "os": ["darwin", "linux", "win32"]+ },+ "components": {+ "instructions": true,+ "scripts": ["scripts/extract.py"],+ "hooks": [],+ "mcpServers": []+ },+ "permissions": {+ "tools": ["shell:python"],+ "filesystem": ["read:user-selected"],+ "network": ["api.example.com:443"],+ "secrets": [],+ "commands": ["python scripts/extract.py"]+ },+ "dependencies": { "skills": { "base-review": "^1.4" } },+ "release": {+ "publishedAt": "2026-08-28T00:00:00Z",+ "severity": "normal",+ "breaking": false,+ "notesUrl": "https://example.com/releases/2.3.1"+ },+ "signatures": [{ "type": "sigstore", "bundle": "..." }]+}+```++manifest 必须通过 canonical JSON 计算摘要;`resolved` 字段由 resolver 锁定后写入 lock,不能盲信远端自报。结构化 permissions 是更新评审用的“能力意图”,不替代宿主运行时 sandbox/approval。++### 4.3 推荐 lock 与提醒状态++```json+{+ "skillId": "com.example/pdf-review",+ "installed": {+ "version": "2.3.0",+ "contentSha256": "old...",+ "sourceIdentity": "git:https://github.com/example/skills#skills/pdf-review",+ "activatedAt": "2026-08-01T09:00:00Z"+ },+ "candidate": {+ "version": "2.3.1",+ "contentSha256": "new...",+ "risk": "R1",+ "compatibility": "pass",+ "permissionDiff": { "added": [], "removed": [] }+ },+ "policy": {+ "mode": "prompt",+ "channel": "stable",+ "constraint": "^2.3",+ "pin": null+ },+ "reminder": {+ "eventKey": "com.example/pdf-review@new...",+ "lastNotifiedAt": null,+ "snoozedUntil": null,+ "skippedCandidate": null+ },+ "activation": {+ "previousContentSha256": "older...",+ "lastKnownGoodContentSha256": "old...",+ "targets": ["codex", "claude-code", "cursor"]+ }+}+```++`eventKey = skill_id + target_digest` 是去重核心:同一候选无论检查多少次都只累计一条 inbox 事件;新 digest 到来会自动解除旧版本的 skip,但不会解除 pin。++### 4.4 状态机++```mermaid+stateDiagram-v2+ [*] --> Discovered+ Discovered --> Verified: resolve source + digest/signature+ Discovered --> Rejected: provenance/integrity failed+ Verified --> Incompatible: adapter/OS/dependency failed+ Verified --> NeedsReview: trust or capability expanded+ Verified --> Eligible: policy allows+ NeedsReview --> Eligible: user/org approves exact diff+ NeedsReview --> Skipped: skip candidate+ Eligible --> Staged+ Staged --> PendingActivation+ PendingActivation --> Active: reload/restart/next session+ Active --> Healthy+ Active --> RolledBack: load/health/user failure+ RolledBack --> Quarantined+ Healthy --> [*]+```++每个状态变化写入审计日志;`Rejected`、`Incompatible`、`Quarantined` 不能被普通自动更新策略绕过。++## 5. 风险分级与默认动作++| 等级 | 典型条件 | 默认更新动作 | 默认提醒 |+|---|---|---|---|+| R0 可信低风险 | 官方/已验证发布者;签名与 digest 有效;同源同通道;无权限、脚本、hook、MCP、依赖或兼容变化;用户已 opt-in 自动更新 | 24 小时冷静期后 staged,在下一会话原子激活 | 静默写入 Recent updates;周摘要可见 |+| R1 普通变化 | 指令/资产/常规功能变化;无新增特权能力;兼容通过 | Prompt 模式待用户批量更新;Auto 模式可 staged | 导航 badge + 更新收件箱;每日或每周摘要,不弹模态 |+| R2 高风险变化 | 新增/改变脚本、hooks、MCP、安装命令、网络/文件/secret 权限;换源/换发布者/换通道;兼容未知;本地副本已修改 | 阻断自动更新,要求批准精确 diff | 安静但持久的 badge;用户进入管理页时展示确认面板 |+| R3 安全事件 | 已知恶意、签名撤销、严重漏洞、来源劫持 | 立即 quarantine/禁用;有可信修复时按组织策略强制更新 | 高优先级通知,说明采取了什么动作、影响、审计与恢复入口 |++**综合推断。** 即使是 R0,也只有用户或组织事先允许该信任域自动更新时才能静默。Skill 的指令变化具有供应链风险,不建议对任意社区 Git 仓库默认自动更新。++## 6. 频繁更新时的低打扰提醒设计++### 6.1 检查 cadence++**来源事实。** VS Code Agent Plugins 提供了每 24 小时的明确行业锚点;Claude Code 使用启动后 0–10 分钟随机延迟,避免所有实例同时请求。[VS Code Agent Plugins](https://code.visualstudio.com/docs/agent-customization/agent-plugins)、[Claude 自动更新](https://code.claude.com/docs/en/discover-plugins#configure-auto-updates)++**综合推断。** 推荐默认:++- 后台:每 24 小时一次,加基于设备 ID 的确定性 ±20% jitter。+- 用户打开 Skills/Plugins 管理页:若缓存超过 15 分钟,立即刷新。+- 手动“检查更新”:立即检查,支持 dry-run。+- 网络错误:指数退避,最多 7 天;不要把失败当成“没有更新”。+- 安全撤销:独立 advisory 通道或更短 TTL,不等待普通轮询。+- 使用 ETag/If-None-Match、Git tree SHA 或 registry delta cursor,避免频繁下载完整 Skill。++### 6.2 提醒层级++1. **事件日志**:所有检查、staging、成功、失败、回滚都进入 Recent updates。+2. **导航 badge**:显示需要人处理的候选数,不显示已静默完成数。+3. **更新收件箱**:按 Skill 聚合,展示当前→目标、来源、发布者、diff、兼容、是否需 reload、回滚入口。+4. **摘要**:默认每天一次或每周一次,合并“可更新、成功、失败”。+5. **强交互**:只用于 R2 用户正主动更新时,或 R3 安全阻断;不要在 Agent 正执行任务时突然弹窗。++### 6.3 去重、延后与跳过++- 同一个 `eventKey` 最多生成一条 inbox 项;再次检查只刷新时间和严重度。+- `Snooze 1/3/7 days` 只改变下次提醒时间,不改变候选与安全状态。+- `Skip this version` 绑定不可变 target digest;新候选出现后重新提醒。+- `Pin` 绑定约束或 digest,直到用户显式 unpin;安全撤销仍可提示。+- 多 Agent adapter 失败只在同一条 Skill 事件里展开为 target 子状态,不生成六条通知。++**证据边界。** Pin/dry-run 在 `gh skill` 中有官方实现;“Snooze”和“Skip this version”在本次查阅的主流 Agent Skills 官方机制中未形成共同标准,属于本方案为高频更新补齐的产品能力。++### 6.4 一条合格的提醒至少显示++- `pdf-review 2.3.0 → 2.3.1`,以及 immutable target digest。+- 来源与发布者是否变化、签名/完整性状态。+- 变更摘要,并把 `SKILL.md` 指令、scripts、hooks、MCP、依赖分栏。+- 权限 diff:新增、收窄、移除。+- 各目标 Agent 的兼容状态与生效方式。+- “更新全部低风险项”“查看差异”“稍后”“跳过此版本”“固定当前版本”。+- 更新后“恢复上一版本”及其数据兼容警告。++## 7. 各 Agent Adapter 设计++| Adapter | 优先策略 | 激活语义 | 特殊处理 |+|---|---|---|---|+| Codex | 对公开 Plugin 走原生 marketplace/审核版本;对 standalone/local Skill 由控制面维护 lock 和内容目录 | 下一会话;宿主支持刷新时再显式调用 | 不把 OpenAI Hosted Skills API 当成本地更新器;本地修改必须 dirty-check |+| Claude Code | marketplace Plugin 优先委托原生自动更新;控制面读取/汇总 marketplace 错误和 reload 状态;独立 Skill 才走通用安装 | `/reload-plugins` 或下一启动 | 保留官方/第三方 marketplace 默认差异;高风险 command/source delta 不绕过原生同意 |+| GitHub Copilot | Plugin 走 Copilot 原生命令;独立 Skill 可复用 `gh skill` provenance/pin/dry-run,或读取同等 lock | 下一会话/宿主重载 | 避免同时让 `gh skill` 与控制面更新同一目录;明确唯一 owner |+| Gemini CLI | Extension 优先调用 `gemini extensions update`;纯 Skill 可由 adapter 安装到被发现目录或封装成 extension | 重启 CLI/extension | 映射 pre-release/channel;尊重 Git extension 安全策略与 enable/disable |+| Cursor | adapter 管理 GitHub 导入或本地 Skill 的 provenance、digest 和原子替换 | 下一次启动/重新发现 | 官方文档没有原生远端更新协议,控制面应成为唯一更新 owner |+| OpenCode | 写入 `.agents/skills` 或 OpenCode 专用目录,并维护独立 lock | 下一会话/重新扫描 | 保留 OpenCode 的 Skill tool 权限;frontmatter 未识别的更新字段放 sidecar,不依赖宿主解析 |+| VS Code Agent Plugins | marketplace 来源尽量委托原生 24h 更新;npm/PyPI/外部命令仍保留显式确认 | 按宿主 reload/restart | 不因统一控制面而绕过外部命令确认 |++Adapter 必须实现统一接口:++```ts+interface SkillHostAdapter {+ discover(): Promise<InstalledTarget[]>;+ validate(release: SkillRelease): Promise<CompatibilityResult>;+ stage(release: ResolvedRelease): Promise<StagedTarget>;+ activate(staged: StagedTarget, boundary: "reload" | "restart" | "next-session"): Promise<void>;+ healthCheck(target: InstalledTarget): Promise<HealthResult>;+ rollback(toDigest: string): Promise<void>;+}+```++## 8. 本地修改、依赖和回滚++### 8.1 本地修改++**来源事实。** `gh skill update --force` 可以覆盖本地修改,但不会删除额外本地文件;Vercel `skills` 的 update 实现会从 lock 中恢复来源并重新执行安装。[`gh skill update`](https://cli.github.com/manual/gh_skill_update)、[Vercel update implementation](https://github.com/vercel-labs/skills/blob/main/src/update.ts)++**综合推断。** 自动更新前计算安装基线与当前目录的差异。若 dirty:++- 默认进入 R2,不覆盖。+- 提供“保留当前并 fork 为 local Skill”“三方合并”“导出 patch 后替换”“放弃本地修改并更新”。+- 自动更新系统自己写入的 adapter/lock 元数据不应被误判为用户修改。++### 8.2 依赖求解++依赖求解要先于提醒:如果 A 的新版本要求 B `^3`,而 B 被 pin 在 `2.x`,通知应是“一组不可满足的更新”,而不是先提醒 A、更新后才报错。Claude 的 semver 依赖约束是可复用先例。[Claude plugin dependencies](https://code.claude.com/docs/en/plugin-dependencies)++### 8.3 真正可用的回滚++**来源事实。** Claude 会把旧 plugin 版本缓存约 14 天,但公开文档没有把它描述为面向用户的 downgrade/rollback 命令,不能把“有缓存”误报成“已有回滚”。[Claude plugin caching](https://code.claude.com/docs/en/plugins-reference#plugin-caching-and-file-resolution)++**综合推断。** 每次激活前保留 `previous` 与 `lastKnownGood`:++- 内容目录不可变,激活只是原子切换 `current` 指针。+- parse/load/adapter 部署失败自动回滚。+- 用户可在 Recent updates 中一键回滚。+- 回滚同时 quarantine 失败 digest,直到用户显式重试或发布新 digest。+- 若 Skill 写入了外部数据,release manifest 应声明数据迁移和 `rollbackSafe`;否则只回滚 Skill 文件可能不安全。++## 9. 反模式++1. **每次检查都弹窗。** 会把高频发布直接变成通知疲劳。+2. **只比较 semver。** 发布者可复用版本号,Git 分支会移动;必须锁不可变摘要。+3. **把 checksum 当成信任。** 它只能证明内容一致,不能证明来源善意。+4. **把“只改提示词”视为无风险。** 指令变化可能引入 prompt injection、数据外传或行为漂移。+5. **对所有第三方源默认自动更新。** 与 Claude、Copilot、VS Code Agent Plugins 的信任分层经验相反。+6. **更新当前活跃会话。** 同一任务内出现两套 Skill 规则,难以审计和复现。+7. **一个 Agent 一套提醒。** 同一 Skill 被六个宿主重复提醒,是跨 Agent 用户最明显的噪声来源。+8. **静默覆盖本地修改。** 破坏用户定制,且无法判断新版本失败还是本地 patch 失败。+9. **失败后继续反复尝试并反复提醒。** 应 quarantine 失败 digest,并对事件去重。+10. **把缓存宣传成回滚。** 没有原子切换、状态恢复、入口和审计的缓存不等于可用回滚。+11. **只写 changelog,不展示能力 diff。** 用户真正需要知道的是新增脚本、工具、网络、secret、MCP 和来源变化。+12. **由管理器绕过宿主安全确认。** Adapter 必须保留 Claude 高风险来源同意、Gemini 企业策略、VS Code 外部命令确认等原生边界。++## 10. 推荐落地路线++### MVP:先解决“知道有更新,但不骚扰,也不装错”++建议 4–6 周完成:++- 支持 Git/HTTPS archive/local 三类源,至少覆盖 Codex、Claude、Cursor、OpenCode 的目录 adapter。+- 建立 `skill-release.json`、lock v1、source identity、commit/tree/content SHA。+- 手动 `check --dry-run` 和每天一次后台检查;24h + jitter。+- 候选更新收件箱、导航 badge、按 `skill_id@digest` 去重。+- 展示 `SKILL.md`、scripts/hooks/MCP、来源和权限的结构化 diff。+- 默认模式:官方/验证源 Prompt,社区 Git Prompt,本地 Manual;MVP 不做静默自动激活。+- 下一会话原子激活,保留 previous,支持手动回滚。+- 检测本地 dirty,禁止静默覆盖。++MVP 验收指标:++- 同一候选在 30 天内最多产生 1 条活跃 inbox 事件。+- 六个 Agent 共用一个 Skill 时只生成 1 条用户提醒。+- 100% 安装都有不可变 digest 和来源记录。+- R2 条件 100% 阻断自动激活。+- adapter 安装失败不改变当前可用版本。++### V1:可信低风险自动更新++- 补齐 Gemini、Copilot、VS Code Agent Plugin adapter,并能委托原生 updater。+- Publisher key/signature、组织 allowlist、channel/constraint/pin。+- R0 自动 staged,下一会话激活;每日/每周摘要。+- 兼容矩阵、依赖求解、reload/restart 编排。+- 激活健康检查、自动 rollback、失败 digest quarantine。+- Snooze、Skip this version、Recent updates、审计导出。++### 进阶:面向团队和 marketplace++- Registry advisory/revocation 通道与强制 quarantine 策略。+- 灰度发布:1% → 5% → 25% → 100%,按加载失败、rollback、用户拒绝率自动暂停。+- 透明日志、可验证构建、签名轮换、SBOM/脚本依赖扫描。+- 团队策略:可信 publisher、自动更新窗口、最大版本跨度、冻结期、紧急例外。+- 多设备同步“策略”,但不跨设备复制 secret 或本地批准令牌。+- 语义评估:对高影响 Skill 在隔离样例任务上跑回归 eval,再进入 R0/R1。++## 11. 监控指标与防打扰预算++| 指标 | 目标方向 | 用途 |+|---|---|---|+| 每用户每周主动提醒数 | 下降;建议普通更新 ≤ 1 个摘要 | 衡量打扰 |+| badge 打开率 / 更新执行率 | 上升 | 衡量提醒是否有用 |+| 发现到安全修复激活时间 | 下降 | 衡量安全时效 |+| 自动更新失败率 | < 0.5% 起步目标 | 决定是否扩大 R0 |+| 更新后 24h rollback 率 | < 1% 起步目标 | 发现坏版本 |+| R2 误放行率 | 0 | 安全红线 |+| 重复事件率 | 0 | 验证 eventKey 去重 |+| 多 Agent 重复提醒率 | 0 | 验证控制面聚合 |+| 长期 stale 且有高危 advisory 的 Skill 数 | 下降并告警 | 避免 pin/skip 掩盖风险 |++自动更新只有在来源可验证、diff 可解释、激活可回滚、失败可观测四项同时成立时才应扩大范围。++## 12. 最终产品建议++推荐默认体验是:**后台每天检查,平时不弹;一个更新中心聚合所有 Agent;可信且无能力扩张的更新可在用户 opt-in 后于下一会话静默生效;新增脚本、权限、MCP、来源或不兼容变化必须持久提醒并重新批准;任何更新都能看到来源、digest、diff、目标 Agent 和回滚入口。**++这套设计不是复制某一家,而是以 GitHub `gh skill` 的 provenance/pin/preview/dry-run/confirm 为控制面骨架,组合 Claude 的信任分层与会话边界、Gemini 的逐扩展 auto-update 与 restart、VS Code Agent Plugins 的外部命令确认、Cursor 的 marketplace 更新复审、Vercel `skills` 的 canonical copy 与跨 Agent adapter 思路,再补上当前市场普遍缺失的统一提醒状态、权限 diff 和真正回滚。++## 官方来源索引++- [Agent Skills Specification](https://agentskills.io/specification)+- [OpenAI Skills & Plugins](https://developers.openai.com/codex/skills-and-plugins)+- [OpenAI: Package your plugin](https://developers.openai.com/plugins/build/plugins)+- [OpenAI: Submit plugins](https://developers.openai.com/plugins/deploy/submission)+- [OpenAI Skills API](https://developers.openai.com/api/reference/resources/skills)+- [Claude Code: Discover and install plugins](https://code.claude.com/docs/en/discover-plugins)+- [Claude Code: Plugins reference](https://code.claude.com/docs/en/plugins-reference)+- [Claude Code: Plugin marketplaces](https://code.claude.com/docs/en/plugin-marketplaces)+- [Claude Code: Plugin dependencies](https://code.claude.com/docs/en/plugin-dependencies)+- [GitHub Copilot CLI plugin reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-plugin-reference)+- [GitHub: Add and update Agent Skills](https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/add-skills)+- [GitHub CLI: gh skill update](https://cli.github.com/manual/gh_skill_update)+- [GitHub CLI: gh skill preview](https://cli.github.com/manual/gh_skill_preview)+- [Gemini CLI extension reference](https://github.com/google-gemini/gemini-cli/blob/main/docs/extensions/reference.md)+- [Gemini CLI security/configuration](https://github.com/google-gemini/gemini-cli/blob/main/docs/reference/configuration.md)+- [VS Code Agent Plugins](https://code.visualstudio.com/docs/agent-customization/agent-plugins)+- [Cursor Agent Skills](https://cursor.com/docs/skills)+- [OpenCode Agent Skills](https://opencode.ai/docs/skills)+- [OpenCode V2 Agent Skills](https://opencode.ai/v2/docs/skills/)+- [Vercel Labs skills](https://github.com/vercel-labs/skills)+- [Vercel Labs skills update implementation](https://github.com/vercel-labs/skills/blob/main/src/update.ts)+- [Agent Plugins Specification](https://agent-plugins.org/specification)diff --git a/docs/skill-embedded-optional-update-notifier-design.md b/docs/skill-embedded-optional-update-notifier-design.mdnew file mode 100644index 00000000..640752a4--- /dev/null+++ b/docs/skill-embedded-optional-update-notifier-design.md@@ -0,0 +1,637 @@+# Skill 内置可选更新提醒器:技术设计提案++> 状态:Implementation draft / Issue #167 / 待评审+> 提案版本:v0.1+> 日期:2026-08-28+> 面向对象:Skill 维护者、Agent 集成开发者、安全与发布工程师++## 1. 摘要++本提案设计一个嵌入 Skill 发布包的跨 Agent 更新提醒器。它在用户再次使用 Skill 时低频检查远端发布信息,仅在发现新版本时显示非阻断提醒;提醒成功确认后不再展示同一候选。是否查看变更、何时更新以及是否继续使用旧版本,均由用户决定。++v0.1 的唯一职责是:++> 发现候选版本并让用户感知,不下载、不安装、不执行远端命令、不覆盖 Skill 文件。++该方案用于补足 Codex、Claude Code、Cursor、OpenCode 等宿主中“独立 Skill 已安装,但用户长期不主动检查更新”的场景。它不是自动更新器,也不替代宿主 Plugin/Extension、`gh skill` 或其他安装管理器。++相关市场调研见:[AI Agent Skills 频繁更新提醒:市场机制与统一方案](research/skill-plugin-update-reminder-market-design.md)。++## 2. 背景与问题++Agent Skills 可以通过 Marketplace、Plugin、跨 Agent CLI、Git 仓库或直接复制目录等方式安装。不同安装方式的更新能力不一致,尤其是直接安装的 `SKILL.md` 目录,通常没有持续的上游版本提醒。++对于高关注度、频繁发布的 Skill,会出现以下问题:++- 用户长期停留在旧版本,却没有主动打开管理页面或运行更新命令。+- 同一个 Skill 分布在多个 Agent 宿主,维护者难以依赖单一 Marketplace 触达所有用户。+- 在 Skill 内直接执行安装会扩大供应链和权限风险。+- 每次激活都联网或弹出提示,会增加延迟、工具调用和通知疲劳。++本提案以“提醒与更新解耦”为核心:Skill 可以让用户知道有新版本,但用户不作选择时,已安装内容和当前任务均保持不变。++## 3. 目标与非目标++### 3.1 目标++- 在支持本地脚本和网络访问的 Agent 中提供一致的更新感知。+- 检查失败时保持静默,不阻断、不降级用户原任务。+- 同一个候选版本在成功确认展示后不再提醒;正常路径只展示一次。+- 让用户清楚看到当前版本、候选版本、本地固定状态摘要和官方发布说明。+- 将版本检查控制在低频、低流量、可缓存的只读请求内。+- 保持检查逻辑确定、可测试,并独立于模型的版本比较能力。+- 保证提醒事件本身不构成更新授权。++### 3.2 非目标++v0.1 不负责:++- 自动下载、安装或激活新版本。+- 调用 `gh skill update`、`npx skills update` 或宿主原生更新命令。+- 修改、替换或删除 Skill 安装目录中的任何文件。+- 解决跨 Skill 依赖、版本约束或回滚。+- 统一 Claude、Codex、Gemini、Cursor 等原生 Plugin 的更新状态。+- 将远端响应中的文本转换为可执行命令。+- 向从未安装过带提醒器版本的旧用户主动推送消息。++## 4. 设计原则与安全不变量++### 4.1 用户决定++提醒器只报告事实和候选版本。用户忽略提醒、选择稍后处理或继续使用旧版本时,不产生任何安装副作用。++### 4.2 非阻断++版本检查不是 Skill 主工作流的前置成功条件。超时、断网、缓存损坏、远端格式错误和运行时缺失均转换为静默结果,随后继续原任务。++### 4.3 本地决策++远端只声明发布元数据。是否显示提醒、是否已提醒过、何时再次检查,均由本地逻辑和本地状态决定。++### 4.4 不执行远端输入++远端 manifest 不包含 `updateCommand`。提醒器不把远端字符串传给 shell、包管理器、脚本解释器或动态模块加载器。++### 4.5 只写缓存++提醒器仅能写入自己的系统缓存目录。其实现中不提供写入 Skill 根目录、Agent 配置目录或项目目录的路径。++### 4.6 不以版本号作为提醒事件的唯一身份++`version` 用于比较和向用户解释;远端候选的发布 ZIP SHA-256 用于构造提醒 `eventKey`,Git tree SHA 用于发布门禁。摘要只能证明候选内容一致,不能单独证明发布者可信。本地快照不保存自身 ZIP digest,避免生成自引用摘要。++## 5. 方案范围++### 5.1 v0.1 支持模式与未来适配器++| 模式 | 触发方式 | Agent 额外工具调用 | v0.1 状态 |+|---|---|---:|---|+| Skill 激活调用 | `SKILL.md` 在首个候选产物存在后调用独立检查脚本 | 每次激活最多 1 次 | 已实现 |+| CLI/MCP 顺带检测 | 未来由原本必经的 CLI 或 MCP 调用附带检测结果 | 0 | 未实现;需单独评审 |+| 宿主 Hook 调用 | 未来由 SessionStart 或 Plugin Hook 在会话边界调用 | 通常为 0 | 未实现;需单独评审 |++v0.1 只有 Skill 激活调用路径。CLI/MCP 与 Hook 是可复用同一契约的未来适配点,不是当前 Archify 行为;它们不得在未经独立设计、测试和用户可见性评审时接入正常 CLI 输出。缓存只减少网络请求,不能消除当前纯 `SKILL.md` 模式下的 Agent 工具调用。对短小、纯提示词型 Skill,评审时需要确认该额外调用是否值得。++### 5.2 运行时基线++MVP 建议使用无第三方依赖的 Node.js ESM 脚本,并声明 Node.js 18+ 兼容要求。Node.js 不可用时返回静默结果。若目标用户中缺少 Node.js 的比例不可接受,再评估单文件二进制或宿主专用实现。++## 6. 组件与目录++建议发布包包含:++```text+archify/+├── SKILL.md+├── skill-release.json+└── scripts/+ ├── check-update.mjs+ └── update-contract.mjs+```++外部组件:++```text+https://tt-a1i.github.io/archify/skill-updates/archify/stable.json+<system-cache-dir>/archify-skill/version-<version-sha256-prefix>/committed-<generation>/state.json+```++职责划分:++- `SKILL.md`:定义何时调用检查器,以及不同状态对应的 Agent 行为。+- `skill-release.json`:随当前安装版本发布的本地身份快照。+- `update-contract.mjs`:零依赖纯模块,唯一拥有 SemVer、严格字段、UTC 时间、固定来源和发布说明 URL 契约;运行时、发布门禁和最终包烟测共同复用。+- `check-update.mjs`:执行缓存、HTTP、版本比较与提醒去重。+- `stable.json`:维护者发布的最新稳定版元数据。+- `committed-<generation>/state.json`:按已安装版本分片的完整检查与提醒快照,不随 Skill 更新覆盖;同版本的多个 Agent 共享去重,不同版本互不重置状态。`reserved`、`pending`、`fenced`、`cancelled`、`active-claim`、未晋升的 `discarded-claim` 与退役 claim 只承担并发协调,不是可读状态。++## 7. 运行流程++```mermaid+flowchart TD+ A[Skill 被激活] --> D[首个候选产物存在后运行 check-update.mjs]+ D --> E+ E --> F{nextCheckAt 尚未到期?}+ F -->|是| G[返回 silent]+ F -->|否| H[无条件 GET stable.json]+ H --> I{请求与校验成功?}+ I -->|否| J[记录退避时间并返回 silent]+ I -->|是| K{候选 SemVer 是否严格高于安装版本?}+ K -->|否| L[刷新缓存并返回 silent/current]+ K -->|是| M{候选 digest 是否已确认展示?}+ M -->|是| N[按提醒策略返回 silent]+ M -->|否| O[返回 update_available + eventKey]+ O --> P[Agent 展示提醒]+ P --> Q[确认 eventKey 已展示]+ Q --> R[继续原始任务]+ G --> R+ J --> R+ L --> R+ N --> R+```++### 7.1 检查步骤++1. 读取随包发布的 `skill-release.json`,确认本地 `skillId`、channel、版本、官方仓库和固定 manifest URL;完成条件是得到合法的本地身份,或安全地返回 `silent`。+2. 读取用户缓存并检查 `nextCheckAt`;完成条件是直接使用未过期缓存,或进入一次远端检查。+3. 使用硬编码可信 origin 无条件请求 `stable.json`;不持久化或回传服务端 validator。完成条件是在总超时内获得 `200` 或静默失败结果。+4. 校验响应大小、JSON schema、`skillId`、channel、来源和必要字段;完成条件是候选身份可被本地确定地接受或拒绝。+5. 先比较候选与本地版本的 SemVer precedence;只有严格更高的稳定版本才是更新。随后用不可变 digest 构造事件身份并检查是否已经展示;完成条件是输出一个机器可判定状态。同版本或降级候选即使 digest 不同也必须返回 `current`。+6. Agent 只在 `update_available` 时展示提醒,然后确认该 `eventKey` 已展示;完成条件是提醒状态与实际用户可见行为一致。+7. Agent 继续用户原始任务;完成条件是版本检查不会取代或缩减原请求。++## 8. 本地发布快照++`skill-release.json` 随每个版本构建,不由运行时修改:++```json+{+ "schemaVersion": 1,+ "skillId": "archify",+ "channel": "stable",+ "version": "3.1.0",+ "source": {+ "repository": "https://github.com/tt-a1i/archify"+ },+ "updateManifestUrl": "https://tt-a1i.github.io/archify/skill-updates/archify/stable.json"+}+```++本地快照使用严格字段白名单,并由 release identity 门禁保证与 `package.json` 完整版本一致。运行时只接受不超过 4 KiB 的非符号链接普通文件,并通过固定文件句柄执行有界读取;路径到句柄绑定期间发现替换即拒绝,绑定完成后只从该固定 inode 读取。FIFO、设备文件、符号链接和超限内容都按无效安装静默处理,不会阻塞 Skill 主流程。候选的 tree/archive digest 只存在于外部稳定版 manifest:把当前 ZIP 的 digest 写进 ZIP 内部会形成无法收敛的自引用。运行时永远不会用远端声明重写本地身份。++## 9. 远端发布协议++`stable.json` 示例:++```json+{+ "schemaVersion": 1,+ "skillId": "archify",+ "channel": "stable",+ "version": "3.2.0",+ "publishedAt": "2026-08-28T08:00:00Z",+ "source": {+ "repository": "https://github.com/tt-a1i/archify",+ "ref": "v3.2.0",+ "treeSha": "8f11d3..."+ },+ "artifact": {+ "sha256": "56da..."+ },+ "summary": "改进大型项目扫描与架构图布局",+ "releaseNotes": "https://github.com/tt-a1i/archify/releases/tag/v3.2.0",+ "severity": "normal"+}+```++### 9.1 字段约束++| 字段 | 要求 |+|---|---|+| `schemaVersion` | 必须为检查器支持的整数版本 |+| `skillId` | 必须与本地快照完全一致 |+| `channel` | v0.1 仅接受 `stable` |+| `version` | 必须是严格的稳定 SemVer `MAJOR.MINOR.PATCH`;不接受 prerelease、build metadata 或数字前导零 |+| `publishedAt` | 必须是秒精度、真实日历日期的 UTC `YYYY-MM-DDTHH:mm:ssZ`;v0.1 以稳定版 annotated tag 的 tagger time 为权威值,运行时不把它用于调度或事件身份 |+| `source.repository` | 必须匹配本地允许的官方仓库 |+| `source.ref` | 必须精确等于 `v<version>`;只能验证,不能拼接成 shell 命令 |+| `source.treeSha` | 必须是发布 tag 中 `archify/` 的 40 位小写 Git tree SHA |+| `artifact.sha256` | 必须是发布 `archify.zip` 的 64 位小写 SHA-256;用于提醒事件身份 |+| `summary` | 必填纯文本,1–160 个字符;v0.1 校验但不直接输出远端文本 |+| `releaseNotes` | 必须逐字节等于 `https://github.com/tt-a1i/archify/releases/tag/v<version>`,不接受显式端口、大小写变体、查询或片段 |+| `severity` | `normal` 或 `security`;两者都不触发自动安装 |++响应体硬上限为 32 KiB,重定向禁用。非成功响应、错误媒体类型和声明超限的响应会先取消未读 body,再静默失败。++## 10. 本地缓存协议++某个完整 `committed-<generation>/state.json` 示例:++```json+{+ "schemaVersion": 1,+ "skillId": "archify",+ "installedVersion": "3.1.0",+ "check": {+ "nextCheckAt": "2026-08-31T08:00:00Z",+ "consecutiveFailures": 0+ },+ "notification": {+ "offeredDigests": [+ "sha256:56da..."+ ],+ "acknowledgedDigests": [+ "sha256:12ab..."+ ]+ },+ "candidate": {+ "version": "3.2.0",+ "targetDigest": "sha256:56da...",+ "severity": "normal",+ "releaseNotes": "https://github.com/tt-a1i/archify/releases/tag/v3.2.0"+ }+}+```++缓存状态载荷只持久化调度、去重和展示候选所需的最小事实。`eventKey` 始终由 `skillId` 与 `targetDigest` 确定推导;远端 `publishedAt` 在网络边界校验后不进入缓存。未被行为读取的观测时间不成为持久协议字段。每个 `state.json` 只接受不超过 64 KiB 的非符号链接普通文件,需要解析的 `active-claim/owner.json` 只接受不超过 1 KiB 的非符号链接普通文件;读取器使用 `O_NOFOLLOW`、`O_NONBLOCK`,并在读取前完成路径 → 句柄 → 路径的身份绑定,随后最多从固定 inode 读取“上限 + 1”字节。`pending-*/owner.json` 不解析内容,只要求它是非符号链接普通文件,并把 mtime 当作 lease marker。缓存叶文件还必须位于读取前后身份不变的真实 `committed`、`pending` 或 `active-claim` 父目录中;嵌套父目录替换不能借叶文件检查绕过。绑定期间发现替换、特殊文件、链接或超限文件时,该记录被跳过或使本轮缓存失败关闭;绑定后的路径改名不改变本次固定句柄读取,因此恶意 FIFO 不能让检查器永久阻塞。++缓存目录准备也属于协议边界。检查器先把位于用户主目录或系统临时目录下的受信任前缀解析成真实路径,再从文件系统根开始逐级 `lstat`;已有组件必须是真实目录,缺失组件只按单层创建,符号链接和其他文件类型一律拒绝。创建完成后使用 BigInt 设备号/inode(零 inode 且 `birthtimeNs` 可用时回退到 birthtime 与文件模式;两者都不可用时失败关闭)重验全部组件,并把已经验证的规范路径和祖先快照作为本次进程的缓存 token。缓存读取和每次 `mkdir`、独占写入、改名、非递归清理都在操作前后复验同一 token;独占写入固定新建文件句柄,并把句柄的 BigInt inode 与预期字节数绑定到路径后置检查,创建或改名也必须验证原缓存路径中的预期对象及其类型。operation/claim 状态转换只接受真实目录,临时 state 转换只接受普通文件;仅损坏 active claim 的退役路径显式允许文件或符号链接。发现身份变化、结果缺失或类型错误时返回 `silent/cache-unavailable`,不发起后续网络请求,也不把提醒或确认报告为成功。未成功晋升的预填充 claim 只原子改名为唯一的 `discarded-claim`,不递归删除目录。++写入端使用紧凑 JSON,并在提交前执行同一个 64 KiB 硬门禁。除了待提交快照本身必须可读,还要按顺序模拟全部 `offeredDigest` 的确认闭包,验证每个中间态和最终态均可提交;每个状态还要为“保留 last-good candidate 的失败刷新”预留最长 ISO 时间戳所需空间。只有 offered 状态已经原子持久化、全部后续确认可落盘且失败退避可提交时,检查器才允许返回 `update_available`。确认历史保持精确且不剪枝。极端情况下,若加入新候选会超过容量,检查器不会展示一个无法确认的提醒,而是保留全部 offered/acknowledged 历史、撤销旧 `candidate`、提交失败退避并返回 `silent/cache-unavailable`;已有 offered 事件仍可晚到确认。++缓存根目录下面按本地完整版本的 SHA-256 前缀分片。未过期缓存直接读取最高完整、合法的 `committed` generation,不创建协调记录。需要写入时,检查器先以原子 `mkdir` 创建永久的 `reserved-<generation>` 分配标记,再只写自己的 `pending-<generation>` 目录;reservation 从不改名、删除或复用。generation 只接受最多 20 位十进制文本,分配器从全部合法操作目录中选择最小未占用编号;超长或非规范伪名称不参与分配,不能借稀疏高水位制造超长文件名并永久阻断检查。++v0.1 把协调目录视为追加式本地 journal:`reserved`、完整 `committed`、`fenced`、`cancelled`、`retired-claim` 和 `discarded-claim` 均保留,避免在并发路径中引入递归清理或 generation 复用。正常完成路径会转换 `pending` 和预填充 claim;最后一个成功 writer 的 `active-claim` 会保留到下一位 writer 退役,进程在 claim 晋升前崩溃也可能留下长期 orphan `claim-*`。这些残留同样计入 journal 增长。代价是同一版本分片的 inode 数和 `readdir` 成本会随写入次数增长。v0.1 不在运行路径内压缩 journal;回收依赖操作系统缓存清理、用户删除整个版本分片,或后续提供经过身份校验的整体压缩协议。升级产生的新版本分片天然与旧 journal 隔离。++generation 只负责提交顺序,固定的 `active-claim` 负责网络请求互斥。候选 writer 先在自己的预填充 claim 目录写入 generation 与随机 token;每轮先检查固定 claim,只有路径不存在时才通过原子 rename 晋升,绝不直接覆盖一个空目录。晋升成功后还必须确认自己的 pending lease 仍新鲜,并在最终缓存 token 复验之后、调用 fetch 前再次确认 active generation/token;任何一个可观测等待点失权都取消而不发请求。即使两个进程都读到“没有 pending”的旧快照,在 lease 有效的协作竞态中也只有一个能进入 fetch,失败者取消自己的 pending。完成者不删除固定 claim;下一位只在看到对应 terminal generation 或 30 秒硬 lease 过期时,才把它原子移动到按旧实例稳定身份命名的退役目录。移动前写入不可覆盖的 retirement guard;损坏 claim 的 retirement key 不包含会被 guard 合法改变的 ctime,且 rename 仍绑定检查时的对象身份,因此延迟退休者不能搬走后继 claim。退役目标必须经 `lstat` 确认为分片内的真实非符号链接目录;异常目标只会静默拒绝,绝不沿嵌套链接把 claim 移出缓存分区。退役目标确定且保留,因此落后竞争者不能把新 owner 的 claim 当作旧空目录移走。旧 owner 也从不触碰后继 claim,所以即使 PID 已复用或进程在 lease 后恢复,也只能被更高 generation fencing,不能发布旧状态。普通文件、符号链接、缺失或错误类型的 `owner.json` 等损坏 claim 在 lease 内按 busy 处理,超时后按稳定实例身份退役;重复的相同坏内容不会撞上旧 retirement 路径而永久阻塞。++提交不是“读 token 后覆盖固定文件”。writer 在 mutation 前后验证自己仍持有同一 active generation/token;更高 generation 接管后,会把所有较低 pending 逐个原子改名为唯一的 `fenced` 目录,再重新读取最高 committed 快照、应用本次 mutation、写完自己的完整 state,最后把自身 pending 原子改名为 committed。尚未取得 claim 的低 generation 在 promote 的每一轮都重新检查更高 reservation;一旦被超越或看到 active owner 的 generation 更高就必须放弃,不能退役已经完成的高代 claim 并让 active generation 回退。因此它暂停在 reservation、pending、claim 晋升、晋升后重读状态或最终 token 复验等可观测窗口时,恢复后不会在高代之后发起第二次 GET,也不能补交一份 reader 会忽略的旧提交。低 generation 若已先提交,高 generation 必然读到并继承它;若 fencing 先完成,旧 owner 的原路径永久消失,后续写入或提交只能失败,不能覆盖新状态。reader 永远忽略 reserved、pending、fenced、cancelled、claim、临时文件和不完整 committed。generation 标记不回退或复用;缓存或协调记录损坏时回退到上一条合法 committed,不影响 Skill 主流程。++### 10.1 `offered` 与 `acknowledged`++检查器输出提醒并不等于用户已经看见。为了避免 Agent 未展示结果却把版本永久标记为已提醒,采用两阶段状态:++1. `check` 返回 `update_available` 和 `eventKey`,把 digest 加入尚待确认的 `offeredDigests`。+2. Agent 展示提醒后执行轻量本地确认,把该事件从 `offeredDigests` 移入 `acknowledgedDigests`。++确认调用只写缓存,不联网。它仅在真正出现新候选时增加一次工具调用。+确认按 `eventKey` 中的 digest 匹配已 offered 集合,而不要求它仍是当前候选;因此刷新从 A 切到 B 时,刷新期间已经展示的 A 仍可可靠确认。确认集合在当前安装版本的缓存分片内持久保留,所以 stable manifest 即使经历 A → B → A 回退,已确认的 A 也不会再次提醒。++`acknowledgedDigests` 不采用概率结构或有损淘汰;这样不会因容量治理而重新提醒已经确认的事件。单一安装版本在积累到 64 KiB 极限后会进入静默退避,不再接纳新提醒,直至该版本分片被替换或清理。这是 v0.1 用“永不返回不可确认提醒”换取精确去重的显式边界。++如果评审认为第二次调用成本高于“偶尔漏提醒”的风险,可在 MVP 中合并 offered/acknowledged,但需要把该取舍记录为已知限制。++## 11. 检查器输出协议++检查器 stdout 只输出一行 JSON;诊断日志写入受控 debug 日志或 stderr,并且默认关闭。++### 11.1 静默++```json+{"status":"silent","reason":"cache-valid"}+```++可用 `reason`:++- `cache-valid`+- `current`+- `already-notified`+- `runtime-unavailable`+- `check-failed`+- `invalid-manifest`+- `invalid-local-release`+- `cache-unavailable`+- `check-in-progress`+- `disabled`+- `invalid-clock`+- `invalid-acknowledgement`+- `invalid-arguments`++所有 `silent` 状态对用户表现一致,Agent 不输出“当前已是最新版”或内部错误。++### 11.2 有可选更新++```json+{+ "status": "update_available",+ "eventKey": "archify@sha256:56da...",+ "installedVersion": "3.1.0",+ "latestVersion": "3.2.0",+ "targetDigest": "sha256:56da...",+ "severity": "normal",+ "summary": "Archify 3.2.0 is available; see the official release notes for details.",+ "releaseNotes": "https://github.com/tt-a1i/archify/releases/tag/v3.2.0"+}+```++`summary` 由已安装检查器根据已校验版本号生成固定文案,不透传远端 `summary`。manifest 仍保留供发布审核使用的简短摘要,但不能借提醒通道向 Agent 注入动态指令。++### 11.3 展示确认++Agent 只在提醒已经对用户可见后运行 `--ack "<eventKey>"`。成功 stdout 为:++```json+{"status":"acknowledged","eventKey":"archify@sha256:56da..."}+```++无效、过期或竞争失败的确认使用上面的 `silent` 协议,不联网,也不改变安装内容。++### 11.4 安全更新++安全更新使用相同协议,仅将 `severity` 设为 `security`。它可以使用更醒目的文案,但在 v0.1 中仍由用户决定是否更新。++## 12. 检查策略++建议默认值:++| 参数 | 默认值 |+|---|---:|+| 正常检查 TTL | 72 小时 |+| 随机 jitter | ±20% |+| HTTP 总超时 | 1000 毫秒 |+| 单次检查重试 | 0 |+| 响应体上限 | 32 KiB |+| 更新通道 | `stable` |+| 同一 digest 主提醒 | 1 次 |+| 已确认 digest 再次提醒 | 不提醒 |++失败时不在当前调用内重试。当前实现第一次失败后退避 6 小时,连续失败后退避 24 小时。失败状态不能被解释成“当前已经是最新版”。新候选导致状态容量超限时使用同一退避节奏,并删除已经被成功刷新撤回的旧 `candidate`,防止退避期间重复展示旧候选。++只有失败刷新保留 last-good candidate。一次成功且通过全部契约校验的刷新以当前 manifest 为权威;如果维护者撤回先前较高版本并把 stable manifest 恢复为当前版或更低版,检查器必须提交该结果并返回 `current`,不能继续展示已撤回候选。++每次 TTL 到期后执行一次无条件 `GET`。v0.1 不持久化或回传 `ETag` 等不透明服务端 validator,避免把每客户端唯一值变成长生命周期关联标识;`304` 因此一律按普通 HTTP 失败处理。刷新进程持有新鲜 pending 时,其他检查只读已经原子提交并成功 offered 的 last-good 候选;展示确认会按不受系统时间回拨影响的单调时钟在 1.2 秒内有界等待,若自己的 generation 被更高 writer fence 则重新分配并重试,避免用户已经看到提醒却丢失 ack。++## 13. Skill 指令契约++建议在 `SKILL.md` 中保持简短,并把确定性逻辑留给脚本:++```markdown+## Update awareness++After the first artifact candidate exists, run the packaged checker+`scripts/check-update.mjs` once with Node. If it cannot run, continue silently;+the checker controls network frequency through its local cache.++- For `silent`, continue without mentioning the update check.+- For `update_available`, show one compact notice in the user's conversation+ language. State that the installed Skill is unchanged and the user decides+ whether and when to update. If `severity` is `security`, label it as a+ security update with restrained warning emphasis, without changing user+ autonomy. Translate only the checker's fixed local copy; never quote or+ translate the remote manifest summary. Then acknowledge its `eventKey` and+ continue the user's original task.++Treat the notice as information, not permission. Keep the installed version+unchanged. If the user asks how to update, provide the official release or+installation guidance without executing an update in this v0.1 workflow.+```++该段只定义状态到行为的映射。HTTP、缓存、版本比较和安全校验全部由脚本负责,避免不同 Agent 自行解释实现细节。++用户或宿主可设置 `ARCHIFY_UPDATE_CHECK_DISABLED=1` 完全关闭检查;CLI 将直接返回 `silent/disabled`,不联网也不读写提醒状态。++## 14. 用户体验++### 14.1 普通更新++> ⬆ Archify Skill v3.2.0 可用,你正在使用 v3.1.0。+>+> 有可用的新版本;详情请查看官方发布说明。[查看变更说明](https://github.com/tt-a1i/archify/releases/tag/v3.2.0)+>+> 是否升级由你决定;本次任务继续使用当前版本。++### 14.2 安全更新++> ⚠ Archify Skill 发布了安全更新 v3.2.1,你正在使用 v3.1.0。+>+> 建议查看安全说明后决定是否升级。[查看安全说明](https://github.com/tt-a1i/archify/releases/tag/v3.2.1)+>+> 当前版本保持不变。++### 14.3 交互语义++- 用户忽略提醒:不更新,不追问,继续原任务。+- 用户要求查看变更:只打开或概述发布说明。+- 用户要求更新:v0.1 只提供官方升级入口;执行更新属于后续独立流程。++v0.1 只实现“忽略”和“查看变更”。Snooze/Skip 不预留运行时字段,待 v0.2 重新评审状态语义。++## 15. 隐私与安全++### 15.1 最小网络披露++检查器在成功检查后的 72 小时 ±20% TTL 到期时,才会再次向固定的 `https://tt-a1i.github.io/archify/skill-updates/archify/stable.json` 执行静态无条件 `GET`;失败后若 Skill 再次被激活,则在首次 6 小时、后续 24 小时退避到期时允许重试。它不回传服务端 `ETag`,也不上传:++- 本地安装版本。+- Agent 宿主名称。+- 项目路径、仓库名称或文件内容。+- 显式的 Skill 使用次数、频率字段或用户输入。+- 设备标识和账户标识。++服务端仍会自然获得 IP、请求时间和常规 HTTP 元数据;由于检查在 Skill 使用期间触发,该请求时间也会泄露“TTL 到期后至少发生过一次使用”的粗粒度活跃信号,应在隐私说明中如实披露。++### 15.2 信任边界++- 更新 URL 和允许的官方仓库由本地发布包固定。+- `releaseNotes` 只作为用户可见链接,不作为指令来源。+- 远端 `summary` 作为不可信纯文本校验长度和控制字符,但不进入检查器输出;用户看到的是本地固定摘要。+- 远端返回的字段不能决定本地文件路径和可执行程序。+- 缓存路径由本地常量和操作系统 API 构造,不接受远端片段。+- 检查器不导入 `child_process`,也不提供 shell 执行接口。++### 15.3 残余风险++- HTTPS origin 或发布账号被劫持时,攻击者可能伪造“存在新版本”和发布说明链接。+- checksum 能证明候选身份稳定,不能证明发布者善意。+- Skill 指令是否稳定执行仍受具体 Agent 宿主影响。+- 纯 Skill 模式需要一次额外工具调用,会增加少量时延和上下文开销。+- 展示与本地确认不是同一原子动作;若 Agent 在两者之间崩溃、确认失败或多个 Agent 同时读取未确认事件,同一候选可能重复提醒。系统选择 at-least-once 展示,避免把用户尚未看到的提醒误记为已确认。+- 30 秒 hard lease 只能约束本地提交,不能给已经发出的 HTTP 请求提供远端 exactly-once。若进程在最终所有权检查之后或请求发出后被操作系统暂停到 lease 过期,后继可合法接管并再次执行同一个幂等静态 `GET`;旧结果恢复后会被 fencing 丢弃,不能提交或覆盖新状态。要消除重复 GET 需要远端幂等键或 fencing token,超出静态 GitHub Pages v0.1 的能力。+- Node 18+ 没有稳定、跨平台的 `openat`/`renameat` 目录句柄 API。实现会拒绝验证时可见的符号链接和身份变化,并在关键 mutation 前后失败关闭;但能以同一用户权限精确插入两个系统调用之间、替换 canonical 祖先的恶意进程不属于本地缓存安全边界。该极端竞态仍可能把一次路径级创建、改名或非递归 unlink 落到镜像命名的替代树中;实现不使用递归删除,因此不会沿替代树遍历清理,但无法承诺零外部单路径 mutation。后置复验会阻止它得到成功提醒或成功确认。root/管理员、映射盘或网络挂载重映射同样不在保证范围内。++后续可通过签名发布、透明日志或宿主原生 Marketplace 降低来源风险,但不属于 v0.1。++## 16. 失败处理++| 故障 | 行为 | 下次检查 |+|---|---|---|+| DNS、离线、超时 | `silent/check-failed` | 6 小时后 |+| HTTP 304 | `silent/check-failed`;无条件请求不接受 304 | 退避 |+| HTTP 4xx/5xx | `silent/check-failed` | 退避 |+| 响应超过上限 | `silent/invalid-manifest` | 首次 6 小时,连续失败 24 小时 |+| JSON/schema 错误 | `silent/invalid-manifest` | 首次 6 小时,连续失败 24 小时 |+| `skillId`/仓库不匹配 | `silent/invalid-manifest` | 首次 6 小时,连续失败 24 小时 |+| 验证时缓存根或任一祖先是符号链接/非目录,或关键 mutation 前后身份变化/后置条件不成立 | `silent/cache-unavailable`;停止后续联网且不报告提醒/确认成功 | 下次激活重新验证 |+| `state.json` 或需解析的 `active-claim/owner.json` 是 FIFO、符号链接、非普通文件、超限或内容损坏 | 不跟随该叶文件;回退合法 generation,或按 claim lease 恢复 | 正常 TTL |+| `pending-*/owner.json` 缺失、是链接或非普通文件 | 不读取内容并把该 pending 视为无有效 lease;更高 generation 可 fencing | 正常 TTL |+| 合法 operation 名称对应的目录被替换成符号链接或非目录 | `silent/cache-unavailable`;不能把活跃 writer 当成不存在 | 下次激活重新验证 |+| 新候选使提交、顺序确认闭包或失败退避投影超过 64 KiB | 不返回提醒;保留精确历史、撤销旧候选并 `silent/cache-unavailable` | 首次 6 小时,连续失败 24 小时 |+| 本地发布快照是 FIFO、符号链接、非普通文件、超限或内容损坏 | `silent/invalid-local-release`,不联网 | 修复安装后 |+| Node.js 不可用 | 跳过检测 | 下次激活 |+| 并发检查 | 新鲜 lease 内一个进程检查,其余使用缓存;跨越 lease 的进程暂停可能产生重复幂等 GET,但只有当前 generation 可提交 | 正常 TTL |+| 系统时间回拨 | 对异常时间戳设上限并重新计算 | 正常 TTL |++无论哪种故障,都不能改变主任务结果或安装内容。++## 17. 测试方案++### 17.1 单元测试++- TTL 未到期时不发起网络请求。+- 响应中的不透明 validator 不持久化、不回传,`304` 一律失败静默。+- 同版本或降级候选无论 digest 是否变化都返回 `current`。+- 成功刷新可以撤回先前较高候选;失败刷新保留 last-good 候选。+- 严格更高的稳定 SemVer 返回 `update_available`;digest 只负责事件身份和展示确认去重。+- 已确认展示的 digest 按策略静默。+- timeout、无效 JSON、超大响应、字段缺失均返回 `silent`。+- `skillId`、channel、repository 不匹配时拒绝候选。+- `summary` 和 URL 不会进入命令执行路径。+- 只有完整 committed generation 可读,并发调用不会发布半写 JSON。+- 刷新持有新鲜 pending 时其他检查只读 last-good offered 候选,展示确认有界等待或被 fence 后重试并持久化。+- 过期 lease 即使记录了存活或复用的 PID 也可被高 generation 接管;恢复的旧 owner 无 pending 路径可提交,也不会删除新 owner 的唯一目录。+- allocation 暂停在扫描后或 reservation 后时,generation 仍不复用;任何已被更高 reservation 超越的低代提交都会失败并按确认预算重试。+- 两个调用即使都拿到空 precheck 快照,在新鲜 lease 的协作竞态中也只有 active-claim winner 可以发出网络请求;stale 空 claim 的并发接管不能覆盖或偷走新 owner。+- 晋升后已过期的 contender、持有旧 supersession 快照的低代,以及在重读状态或最终 token 复验时失权的 owner 都不得发出第二次 GET 或退役更高代 active claim;跨 lease 暂停可能重复幂等 GET,但旧 owner 仍不能提交。+- 超过 20 位的伪 generation 不影响分配;伪造的 retirement 文件或符号链接不能让 rename 写出版本缓存分区。+- 文件、符号链接、空目录和错误 `owner.json` 等 claim 损坏在 30 秒 lease 后都可恢复;重复坏内容使用不同实例身份退役。+- 刷新期间展示的 last-good digest 即使随后被新候选替换,仍可确认;A → B → A 回退不会再次展示已确认的 A。+- 不同已安装版本使用独立状态分片,不会互相清除 ack。+- 合法 JSON 但候选缓存语义损坏时拒绝整个 generation,回退上一条合法 committed 或执行一次无条件重建。+- 本地发布快照和 `state.json` 遇到 FIFO、指向 FIFO 的符号链接或超限普通文件时,在看门狗时限内静默返回或恢复,绝不永久阻塞;active owner 的异常类型按 claim lease 恢复,pending owner 只作为 mtime marker 而不读取内容。+- 验证时可见的缓存根/嵌套祖先符号链接、准备期替换、缓存读取期替换、关键 mutation 前后的祖先替换和替换—恢复 ABA 都会失败关闭;系统调用间的同权限精确竞态可能影响替代树中一个镜像命名路径,但不存在递归清理,不会触发后续联网,也不会把提醒或确认返回为成功。+- 恰好 64 KiB 且具备恢复余量的 offered 状态仍可确认,64 KiB + 1 字节的状态被忽略;多个 offered 的顺序确认闭包和 `nextCheckAt: null` 的最坏失败退避均覆盖容量边界,新候选容量不足时不剪枝确认历史。++### 17.2 集成测试++- Codex、Claude Code、Cursor、OpenCode 至少各验证一次激活流程。+- 有更新时,提醒出现后原任务继续完成。+- 没有更新时,用户看不到任何版本检查文案。+- 断网条件下,端到端额外等待不超过配置的总超时。+- Agent 未展示提醒时,候选不会被错误永久标记为已读。+- debug 日志不包含项目路径、用户输入和响应正文之外的敏感数据。++### 17.3 安全不变量测试++- 检查器不引用 shell 或进程执行 API。+- 远端字段和验证时可见的符号链接不能把检查器写入导向 Skill 根目录、项目目录或 Agent 配置目录;同权限系统调用间竞态按 15.3 的残余边界处理。+- 任意远端 manifest 都不能改变请求 origin、缓存路径或本地命令。+- 恢复性错误统一退出成功并返回有效的 `silent` JSON。++## 18. 验收标准++v0.1 达到以下条件后可进入小范围发布:++- 100% 更新检查仅执行只读网络请求和本地缓存写入。+- 0 条代码路径可以下载、安装或执行候选版本内容。+- 缓存命中时脚本执行时间目标低于 50 毫秒,不计 Agent 工具调用调度。+- 网络检查的额外等待由 1000 毫秒总超时严格封顶。+- 同一个候选 digest 成功确认后不再提醒;正常路径展示一次,展示与确认间故障允许重复。+- 所有恢复性故障均不阻断用户任务。+- 用户未明确选择后续动作时,Skill 安装状态完全不变。+- 提醒内容包含当前版本、候选版本、摘要和官方发布说明。+- 至少在四个目标 Agent 中完成真实调用验收。++## 19. 发布与旧版本迁移++### 19.1 两阶段稳定版发布++本仓库原先由 `main:/docs` 直接发布;该模式不会等待普通 CI,因此不能承载 manifest 的发布门禁。启用本方案前,仓库管理员必须在 **Settings → Pages → Build and deployment → Source** 将来源一次性切换为 **GitHub Actions**。仓库内的 `deploy-pages` job 只在 `main` push 上运行,并显式依赖全部测试、ZIP freshness、包内 smoke 与 published-manifest 门禁;切换前不得发布新的 stable manifest。稳定版必须按以下顺序发布:++1. 发布准备提交更新包版本、Changelog 与确定性 `archify.zip`,但 `docs/skill-updates/archify/stable.json` 仍保留紧邻的上一稳定版。+2. stable tag 工作流拒绝任何已经等于或高于待发布版本的公共 manifest,然后烟测并创建带 `archify.zip` 资产的 GitHub Release。+3. Release 成功后,单独提交 manifest 跟进变更,填入该 tag 的 `archify` tree SHA、最终 Release 资产 SHA-256,以及 annotated tag 的 canonical UTC tagger time。GitHub Release `published_at` 只作为运营观测值,不进入 v0.1 运行时身份。+4. 后续 commit 更新 `stable.json`。CI 通过 GitHub API 要求 manifest 精确等于当前 latest stable Release(不是任意历史 Release),确认目标非 draft、非 prerelease,下载其中的 `archify.zip`,并要求它逐字节等于目标 tag 根目录提交的 `archify.zip`。从首个携带确定性构建器的 v2.16.0 起,CI 还会在独立 worktree 从该 tag 重建 ZIP,并再次逐字节比较;仅历史 bootstrap v2.15.0 允许以 tagged blob 作为闭环。最后再把资产 SHA-256 与 manifest、目标 tag 的 `archify` tree 同时核对。该门禁证明的是 manifest 部署时点的 Release 资产、tagged ZIP、确定性重建结果与 manifest 一致;如果仓库尚未启用 GitHub immutable releases,资产在部署后替换不会自动触发复验,Release 页面因而可能暴露与 manifest digest 不同的字节。v0.1 将其列为发布运营残余风险:维护者不得替换已发布资产,任何资产变更都必须使用新版本、新 tag 和新 manifest;公开启用前应优先启用并验证 immutable release。发布准备阶段可暂时保留上一版,而新 Release 建立后的下一次 `main` push 必须完成 manifest 跟进,不能无限期滞后。+5. 只有全部 CI job 成功,`deploy-pages` 才上传 `docs/` artifact 并公开新候选;部署前还会确认本次 `GITHUB_SHA` 仍是远端 `main`,因此完成较晚的旧 workflow run 不能把站点回滚。PR、失败或已过时的 `main` push 与分支发布源都没有部署路径。++release identity 只允许公共 manifest 等于最新稳定版,或在稳定版发布准备窗口中暂时等于紧邻的上一稳定版;更旧版本不能借两阶段流程长期滞后。工作流失败时,公共 manifest 仍指向上一条完整 Release,不会提醒用户访问尚不存在的发布说明。++### 19.2 新安装用户++从引入提醒器的版本开始,发布包携带本地快照和检查脚本,后续可在再次使用 Skill 时发现候选版本。++### 19.3 旧安装用户++旧版本没有检查逻辑,无法通过本方案被远程唤醒。首次上线需要一次独立迁移活动:++- 发布 GitHub Release,并明确这是“更新提醒能力迁移版本”。+- 在 README 顶部增加阶段性升级公告。+- 置顶 Issue 或 Discussion。+- 通过已有社群、文章和发布渠道通知。+- 提供一个经过验证的官方重新安装入口。++完成这次人工迁移后,新版本用户才进入持续的内置提醒链路。++## 20. 分阶段实现++### v0.1:通知闭环++- 本地 `skill-release.json`。+- 远端 `stable.json`。+- 无依赖检查脚本。+- 72 小时 TTL、无条件 GET、1 秒超时、失败静默。+- SemVer 更新资格判断、digest 事件身份和确认后去重。+- Agent 提醒后继续原任务。+- 只提供发布说明,不执行更新。++### v0.2:用户提醒偏好++- Snooze。+- Skip this version。+- 关闭普通更新提醒但保留安全提示。+- 提醒历史和调试诊断。++### 后续独立提案++- 识别原生 Plugin/Extension 更新所有者。+- 对接 `gh skill` 或其他跨 Agent 更新管理器。+- 展示脚本、MCP、Hooks 和权限差异。+- 签名发布、安装验证和回滚。++这些能力不应通过扩充 v0.1 检查脚本顺带实现,应分别评审其权限与生命周期。++## 21. v0.1 已落地决策与待评审项++实现分支为便于代码评审,先采用以下可撤销决策:++1. 纯 Skill 激活增加一次本地检查器调用;网络频率由缓存限制。+2. 正常 TTL 为 72 小时,带随机 ±20% jitter。+3. 采用 offered/acknowledged 两阶段确认,只有可见提醒之后才去重。+4. 同一安装版本下,相同 ZIP digest 确认后不再提醒;不同安装版本状态分片。+5. v0.1 不实现或预留 Snooze/Skip 状态字段。+6. 运行时基线为无第三方依赖的 Node.js 18+。+7. manifest 固定为 GitHub Pages URL;发布门禁校验 stable tag、Git tree 和最终 ZIP SHA-256。+8. 安全更新只提高提醒级别,仍不下载、不安装,完全由用户选择。+9. 不收集匿名指标;请求不上传本地版本、Agent 或项目数据。++仍需评审确认:四个目标 Agent 的真实验收安排,以及旧版本迁移活动覆盖哪些安装渠道。公共 manifest 的发布 owner 已收敛到上述 Release 后跟进提交与 CI 门禁;上一稳定版 manifest 始终保留在 Git 历史和对应 Release 中作为恢复依据。++## 22. 建议评审结论模板++```text+结论:接受 / 修改后接受 / 拒绝++必须修改:+- ...++延后到 v0.2:+- ...++已接受的关键取舍:+- 检查周期:+- 提醒去重:+- 支持运行时:+- 安全更新交互:+- 远端 manifest owner:++评审人:+日期:+```++## 23. 参考资料++- [Agent Skills Specification](https://agentskills.io/specification)+- [GitHub CLI `gh skill update`](https://cli.github.com/manual/gh_skill_update)+- [Claude Code Plugin auto-update](https://code.claude.com/docs/en/discover-plugins#configure-auto-updates)+- [Gemini CLI Extension reference](https://geminicli.com/docs/extensions/reference/)+- [Codex Skills and Plugins](https://developers.openai.com/codex/skills-and-plugins)+- [Vercel Labs `skills`](https://github.com/vercel-labs/skills)diff --git a/docs/skill-updates/archify/stable.json b/docs/skill-updates/archify/stable.jsonnew file mode 100644index 00000000..23acecca--- /dev/null+++ b/docs/skill-updates/archify/stable.json@@ -0,0 +1,18 @@+{+ "schemaVersion": 1,+ "skillId": "archify",+ "channel": "stable",+ "version": "2.15.0",+ "publishedAt": "2026-08-17T15:47:24Z",+ "source": {+ "repository": "https://github.com/tt-a1i/archify",+ "ref": "v2.15.0",+ "treeSha": "f748f9d0c4833061d657a55cbcd9707aecc73234"+ },+ "artifact": {+ "sha256": "156f0d3cd6ba11706344683e3d94e6b6b44b5732bd3c8c81b75c267c3f5d04c4"+ },+ "summary": "Adds authored brand identity, sequence column fitting, and the DeepSeek Harness distribution.",+ "releaseNotes": "https://github.com/tt-a1i/archify/releases/tag/v2.15.0",+ "severity": "normal"+}diff --git a/examples/checkout-platform-delta.html b/examples/checkout-platform-delta.htmlindex 7dbea51c..6be7702a 100644--- a/examples/checkout-platform-delta.html+++ b/examples/checkout-platform-delta.html@@ -4819,7 +4819,7 @@ rect[data-graph-role="structural-frame"][data-delta-state="added"]{stroke:var(--details{margin-top:12px;border:1px solid var(--d-line);border-radius:9px;background:#0a141e}summary{padding:13px 15px;cursor:pointer;font-weight:700}.changes{list-style:none;margin:0;padding:0 8px 8px}.changes li{border-top:1px solid rgba(138,160,181,.16)}.change-row{display:grid;grid-template-columns:30px 90px minmax(140px,1fr) minmax(100px,.7fr) minmax(120px,.8fr) minmax(140px,1.2fr);gap:10px;width:100%;margin:0;padding:9px 7px;border:0;border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:11px;text-align:left;align-items:baseline;cursor:pointer}.change-row:hover{background:rgba(125,211,252,.06)}.change-row[aria-current="step"]{background:rgba(125,211,252,.1);box-shadow:inset 0 0 0 1px var(--d-focus)}.change-row:disabled{cursor:default}.token{font:800 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.changes code,.change-row>span:last-child{color:var(--d-muted)}.proof-foot{display:flex;justify-content:space-between;gap:24px;margin-top:14px;color:var(--d-muted);font:650 10px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace}html[data-theme="dark"] body{background:#071019!important;background-image:none!important}html[data-theme="light"]{color-scheme:light;--d-ink:#10283c;--d-muted:#587187;--d-line:#c8d6e2;--d-focus:#006b8f}html[data-theme="light"] body{background:#eef3f7!important;background-image:none!important;color:var(--d-ink)}html[data-theme="light"] .metric,html[data-theme="light"] .view-switch,html[data-theme="light"] details{background:#fff}html[data-theme="light"] .canvas{background:#f8fbfd}html[data-theme="light"] .view-switch button[aria-selected="true"]{background:#dbeaf5;color:#10283c}html[data-theme="light"] .delta-node-marker circle{fill:#fff}html[data-preset="blueprint"] body{background-image:none!important}@media(max-width:760px){.proof-page{width:100%;padding:12px}.proof-head{grid-template-columns:1fr;gap:14px;align-items:start}.proof-head h1{font-size:32px}.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.metric{min-width:0}.proof-tools{align-items:stretch;flex-wrap:wrap;gap:8px}.view-switch{display:flex;flex:1 1 100%}.view-switch button{flex:1;padding-inline:8px}.legend{flex-wrap:wrap;gap:8px}.proof-tools>div:last-child{margin-left:auto}.review-strip{grid-template-columns:auto auto auto auto}.review-status{grid-column:1/-1;padding:4px 2px 0}.canvas{min-height:0;padding:6px;overflow:auto}.canvas svg{min-width:720px;max-height:none}.snapshot-frame{min-width:720px}.changes{overflow-x:auto}.change-row{min-width:820px}.proof-foot{flex-direction:column;gap:4px}}-@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}.canvas[data-delta-review-active] [data-delta-review-current]{transition:none!important}}@media print{body{min-width:0;background:#fff;color:#111}.proof-page{width:100%;padding:0}.proof-tools,.review-strip,details{display:none!important}.canvas{display:none!important}.canvas[data-view="delta"]{display:block!important;border:0}.canvas[data-delta-review-active]{--review-same-opacity:1;--review-change-opacity:1}.canvas[data-delta-review-active] [data-delta-review-current]{opacity:1!important;transition:none!important}.proof-foot{color:#444}}+@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}.canvas[data-delta-review-active] [data-delta-review-current]{transition:none!important}}@media print{body{min-width:0;background:#fff;color:#111}.proof-page{width:100%;padding:0}.proof-tools,.review-strip,details{display:none!important}.canvas{display:none!important}.canvas[data-view="delta"]{display:block!important;border:0}.canvas[data-view="delta"] [data-delta-state="same"]{opacity:1!important;transition:none!important}.canvas[data-delta-review-active]{--review-same-opacity:1;--review-change-opacity:1}.canvas[data-delta-review-active] [data-delta-review-current]{opacity:1!important;transition:none!important}.proof-foot{color:#444}}</style></head><body><main class="proof-page"><header class="proof-head"><div><p class="eyebrow">ARCHITECTURE DELTA · AUTHORED SNAPSHOTS</p><h1>See what changed<br>before you merge.</h1><p class="subtitle">Checkout Platform — Baseline → Checkout Platform — Fraud Gate</p></div><div class="metrics"><div class="metric add"><strong>2</strong><span>ADDED</span></div><div class="metric remove"><strong>2</strong><span>REMOVED</span></div><div class="metric change"><strong>5</strong><span>CHANGED</span></div></div></header><div class="proof-tools"><div class="view-switch" role="tablist" aria-label="Architecture snapshot"><button role="tab" data-target="base" aria-selected="false">Before</button><button role="tab" data-target="delta" aria-selected="true">Delta</button><button role="tab" data-target="head" aria-selected="false">After</button></div><div class="legend"><span class="add"><i></i>+ ADD</span><span class="remove"><i></i>− DEL</span><span class="change"><i></i>~ MOD</span><span class="move"><i></i>↔ MOVE</span></div><div><button class="utility" id="export-svg" type="button">Export SVG</button> <button class="utility" id="share-card" type="button">Share Card</button> <button class="utility" id="preset" type="button">Preset</button> <button class="utility" id="theme" type="button">Theme</button></div></div>diff --git a/examples/checkout-platform-delta.receipt.json b/examples/checkout-platform-delta.receipt.jsonindex a099d9b9..d2b6a097 100644--- a/examples/checkout-platform-delta.receipt.json+++ b/examples/checkout-platform-delta.receipt.json@@ -219,8 +219,8 @@"Boundary identity is conservatively derived from kind + label."],"artifact": {- "sha256": "77547966a24755da8ea21914afff28503567f95b99544b3144b18571412acdce",- "bytes": 2023742+ "sha256": "fac25cdc6d96bf5be6fa42520c80e161964a5d8d7f5f61031150bcde41094596",+ "bytes": 2023841},"validation": {"checksPassed": 28,diff --git a/examples/sequence-cache-miss.html b/examples/sequence-cache-miss.htmlindex bc63cec9..426fb434 100644--- a/examples/sequence-cache-miss.html+++ b/examples/sequence-cache-miss.html@@ -1,1250 +1,14 @@-<!DOCTYPE html>-<html lang="en" data-theme="dark">+<!doctype html>+<html lang="en"><head>- <meta charset="UTF-8">- <meta name="viewport" content="width=device-width, initial-scale=1.0">- <meta name="generator" content="archify 2.9.0">- <title>Cache Miss Request Sequence Diagram</title>- <script>- // Resolve the theme before first paint so light-preference users don't- // see a dark flash. The toolbar script below re-applies with UI state.- (function () {- try {- var theme = null;- try {- var param = new URLSearchParams(window.location.search).get('theme');- if (param === 'light' || param === 'dark') theme = param;- } catch (_) {}- if (!theme) {- try { theme = localStorage.getItem('archify-theme'); } catch (_) {}- }- if (theme !== 'light' && theme !== 'dark') {- theme = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';- }- document.documentElement.setAttribute('data-theme', theme);- } catch (_) {}- })();- </script>- <!-- Async font load: a blackholed network must not block first paint.- The body font stack falls back to system monospace until it lands. -->- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>- <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap"- rel="stylesheet" media="print" onload="this.media='all'">- <noscript>- <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">- </noscript>- <style>- /* ==========================================================- THEME VARIABLES — switch by toggling [data-theme] on <html>- ========================================================== */- :root,- [data-theme="dark"] {- --bg: #020617;- --grid: #1e293b;- --text: #ffffff;- --text-muted: #94a3b8;- --text-dim: #475569;- /* UI chrome (menu hints, footer) needs more contrast than SVG .t-dim accents */- --text-faint: #7d8da1;-- --panel: rgba(15, 23, 42, 0.5);- --panel-border: #1e293b;- --lane-fill: rgba(15, 23, 42, 0.22);- --lane-stroke: #334155;-- --arrow: #64748b;- --arrow-emphasis: #34d399;-- /* Opaque mask color used behind semi-transparent component fills- so the arrows drawn underneath are properly hidden. */- --mask: #0f172a;-- --frontend-fill: rgba(8, 51, 68, 0.4);- --frontend-stroke: #22d3ee;- --backend-fill: rgba(6, 78, 59, 0.4);- --backend-stroke: #34d399;- --database-fill: rgba(76, 29, 149, 0.4);- --database-stroke: #a78bfa;- --cloud-fill: rgba(120, 53, 15, 0.3);- --cloud-stroke: #fbbf24;- --security-fill: rgba(136, 19, 55, 0.4);- --security-stroke: #fb7185;- --messagebus-fill: rgba(251, 146, 60, 0.3);- --messagebus-stroke:#fb923c;- --external-fill: rgba(30, 41, 59, 0.5);- --external-stroke: #94a3b8;-- --toolbar-bg: rgba(15, 23, 42, 0.8);- --toolbar-border: #334155;- --toolbar-text: #e2e8f0;- --toolbar-hover: rgba(15, 23, 42, 0.95);- --toolbar-menu-bg: #0f172a;- }-- [data-theme="light"] {- --bg: #f8fafc;- --grid: #e2e8f0;- --text: #0f172a;- --text-muted: #64748b;- --text-dim: #94a3b8;- --text-faint: #64748b;-- --panel: #ffffff;- --panel-border: #e2e8f0;- --lane-fill: rgba(248, 250, 252, 0.65);- --lane-stroke: #cbd5e1;-- --arrow: #94a3b8;- --arrow-emphasis: #059669;-- --mask: #ffffff;-- --frontend-fill: rgba(34, 211, 238, 0.15);- --frontend-stroke: #0891b2;- --backend-fill: rgba(52, 211, 153, 0.18);- --backend-stroke: #059669;- --database-fill: rgba(167, 139, 250, 0.2);- --database-stroke: #7c3aed;- --cloud-fill: rgba(251, 191, 36, 0.18);- --cloud-stroke: #d97706;- --security-fill: rgba(251, 113, 133, 0.15);- --security-stroke: #e11d48;- --messagebus-fill: rgba(251, 146, 60, 0.15);- --messagebus-stroke:#ea580c;- --external-fill: rgba(148, 163, 184, 0.18);- --external-stroke: #64748b;-- --toolbar-bg: rgba(255, 255, 255, 0.92);- --toolbar-border: #cbd5e1;- --toolbar-text: #334155;- --toolbar-hover: #ffffff;- --toolbar-menu-bg: #ffffff;- }-- * { margin: 0; padding: 0; box-sizing: border-box; }-- body {- font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;- background: var(--bg);- min-height: 100vh;- padding: 2rem;- color: var(--text);- transition: background 0.2s ease, color 0.2s ease;- }-- .container { max-width: 1200px; margin: 0 auto; }-- .header { margin-bottom: 2rem; }-- .header-row {- display: flex;- align-items: center;- gap: 1rem;- margin-bottom: 0.5rem;- }-- .pulse-dot {- width: 12px;- height: 12px;- background: var(--frontend-stroke);- border-radius: 50%;- animation: pulse 2s infinite;- }-- @keyframes pulse {- 0%, 100% { opacity: 1; }- 50% { opacity: 0.5; }- }-- h1 {- font-size: 1.5rem;- font-weight: 700;- letter-spacing: -0.025em;- }-- .subtitle {- color: var(--text-muted);- font-size: 0.875rem;- margin-left: 1.75rem;- }-- .diagram-container {- background: var(--panel);- border-radius: 1rem;- border: 1px solid var(--panel-border);- padding: 1.5rem;- overflow-x: auto;- }-- svg {- width: 100%;- min-width: min(900px, 100%);- display: block;- }-- .cards {- display: grid;- grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));- gap: 1rem;- margin-top: 2rem;- }-- .card {- background: var(--panel);- border-radius: 0.75rem;- border: 1px solid var(--panel-border);- padding: 1.25rem;- }-- .card-header {- display: flex;- align-items: center;- gap: 0.5rem;- margin-bottom: 0.75rem;- }-- .card-dot {- width: 8px;- height: 8px;- border-radius: 50%;- }-- .card-dot.cyan { background: var(--frontend-stroke); }- .card-dot.emerald { background: var(--backend-stroke); }- .card-dot.violet { background: var(--database-stroke); }- .card-dot.amber { background: var(--cloud-stroke); }- .card-dot.rose { background: var(--security-stroke); }- .card-dot.orange { background: var(--messagebus-stroke); }- .card-dot.slate { background: var(--external-stroke); }-- .card h3 { font-size: 0.875rem; font-weight: 600; color: var(--text); }-- .card ul {- list-style: none;- color: var(--text-muted);- font-size: 0.75rem;- }-- .card li { margin-bottom: 0.375rem; }-- /* ==========================================================- Print stylesheet — hide interactive controls, force light,- drop the grid so the diagram doesn't waste ink, use landscape- so wide diagrams fit, pack summary cards into 2 columns to- avoid an orphan card on a trailing page.- ========================================================== */- @page { size: landscape; margin: 1.5cm; }-- @media print {- /* Force the FULL light palette — including component fills/strokes and- lane/arrow colors — so printing from dark theme doesn't put neon- strokes and translucent dark fills on white paper. */- :root, [data-theme="dark"], [data-theme="light"] {- --bg: #ffffff;- --grid: transparent;- --panel: #ffffff;- --panel-border: #e2e8f0;- --text: #0f172a;- --text-muted: #475569;- --text-dim: #94a3b8;- --text-faint: #64748b;- --mask: #ffffff;- --lane-fill: rgba(248, 250, 252, 0.65);- --lane-stroke: #cbd5e1;- --arrow: #94a3b8;- --arrow-emphasis: #059669;- --frontend-fill: rgba(34, 211, 238, 0.15);- --frontend-stroke: #0891b2;- --backend-fill: rgba(52, 211, 153, 0.18);- --backend-stroke: #059669;- --database-fill: rgba(167, 139, 250, 0.2);- --database-stroke: #7c3aed;- --cloud-fill: rgba(251, 191, 36, 0.18);- --cloud-stroke: #d97706;- --security-fill: rgba(251, 113, 133, 0.15);- --security-stroke: #e11d48;- --messagebus-fill: rgba(251, 146, 60, 0.15);- --messagebus-stroke:#ea580c;- --external-fill: rgba(148, 163, 184, 0.18);- --external-stroke: #64748b;- }- body { background: #ffffff !important; padding: 0; }- .container { max-width: none; }- .toolbar, .archify-toast, .no-print { display: none !important; }- .diagram-container, .card { box-shadow: none; border-color: #e2e8f0; }- .cards { grid-template-columns: 1fr 1fr; }- /* Ensure elements break sensibly across pages */- .card { break-inside: avoid; page-break-inside: avoid; }- .diagram-container { break-inside: avoid; page-break-inside: avoid; }- h1, .subtitle { color: #0f172a; }- }-- /* ==========================================================- TOOLBAR (theme toggle + export menu)- ========================================================== */- .toolbar {- position: fixed;- top: 1rem;- right: 1rem;- display: flex;- gap: 0.5rem;- z-index: 100;- }- .toolbar button {- background: var(--toolbar-bg);- color: var(--toolbar-text);- border: 1px solid var(--toolbar-border);- padding: 0.5rem 0.875rem;- border-radius: 0.5rem;- font-family: inherit;- font-size: 0.75rem;- font-weight: 500;- cursor: pointer;- backdrop-filter: blur(8px);- transition: background 0.15s, border-color 0.15s;- display: inline-flex;- align-items: center;- gap: 0.375rem;- }- .toolbar button:hover {- background: var(--toolbar-hover);- border-color: var(--arrow);- }- .toolbar button:focus-visible {- outline: 2px solid var(--frontend-stroke);- outline-offset: 2px;- }- .toolbar .export-wrap { position: relative; }- .toolbar .export-menu {- position: absolute;- top: calc(100% + 0.375rem);- right: 0;- background: var(--toolbar-menu-bg);- border: 1px solid var(--toolbar-border);- border-radius: 0.5rem;- padding: 0.375rem;- min-width: 160px;- display: none;- flex-direction: column;- box-shadow: 0 4px 20px rgba(0,0,0,0.25);- }- .toolbar .export-menu.open { display: flex; }- .toolbar .export-menu button {- background: transparent;- border: 0;- justify-content: space-between;- width: 100%;- text-align: left;- padding: 0.5rem 0.75rem;- }- .toolbar .export-menu button:hover {- background: var(--toolbar-hover);- }- .toolbar .export-menu .hint {- color: var(--text-faint);- font-size: 0.625rem;- }- .toolbar .export-menu hr {- border: 0;- border-top: 1px solid var(--toolbar-border);- margin: 0.25rem 0.375rem;- opacity: 0.5;- }-- /* Toast — brief feedback for actions like "copied" */- .archify-toast {- position: fixed;- top: 1rem;- left: 50%;- transform: translateX(-50%) translateY(-8px);- background: var(--toolbar-menu-bg);- color: var(--text);- border: 1px solid var(--toolbar-border);- padding: 0.5rem 1rem;- border-radius: 0.5rem;- font-family: inherit;- font-size: 0.75rem;- opacity: 0;- transition: opacity 0.2s, transform 0.2s;- z-index: 200;- pointer-events: none;- box-shadow: 0 4px 20px rgba(0,0,0,0.25);- }- .archify-toast.show {- opacity: 1;- transform: translateX(-50%) translateY(0);- }-- @media (max-width: 720px) {- body { padding: 1rem; }- .toolbar {- position: static;- justify-content: flex-end;- margin-bottom: 1rem;- }- .header { margin-bottom: 1.25rem; }- .header-row {- gap: 0.75rem;- align-items: flex-start;- }- h1 {- font-size: 1.25rem;- line-height: 1.25;- }- .subtitle {- margin-left: 0;- font-size: 0.8125rem;- line-height: 1.55;- }- .diagram-container {- padding: 0.75rem;- border-radius: 0.75rem;- }- .cards {- grid-template-columns: 1fr;- margin-top: 1rem;- }- }-- /* ==========================================================- SVG SEMANTIC CLASSES — use these instead of inline fill/stroke- ========================================================== */- .c-grid { stroke: var(--grid); fill: none; }- .c-mask { fill: var(--mask); stroke: none; }-- .c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }- .c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }- .c-database { fill: var(--database-fill); stroke: var(--database-stroke); }- .c-cloud { fill: var(--cloud-fill); stroke: var(--cloud-stroke); }- .c-security { fill: var(--security-fill); stroke: var(--security-stroke); }- .c-messagebus { fill: var(--messagebus-fill); stroke: var(--messagebus-stroke); }- .c-external { fill: var(--external-fill); stroke: var(--external-stroke); }-- /* Text helpers */- .t-primary { fill: var(--text); }- .t-muted { fill: var(--text-muted); }- .t-dim { fill: var(--text-dim); }- .t-frontend { fill: var(--frontend-stroke); }- .t-backend { fill: var(--backend-stroke); }- .t-database { fill: var(--database-stroke); }- .t-cloud { fill: var(--cloud-stroke); }- .t-security { fill: var(--security-stroke); }- .t-messagebus { fill: var(--messagebus-stroke); }- .t-external { fill: var(--external-stroke); }-- /* Arrows */- .a-default { stroke: var(--arrow); fill: none; }- .a-emphasis { stroke: var(--arrow-emphasis); fill: none; }- .a-security { stroke: var(--security-stroke); fill: none; stroke-dasharray: 5,5; }- .a-dashed { stroke: var(--database-stroke); fill: none; stroke-dasharray: 4,4; }-- /* Arrowhead markers reference these */- .m-default { fill: var(--arrow); }- .m-emphasis { fill: var(--arrow-emphasis); }- .m-security { fill: var(--security-stroke); }- .m-dashed { fill: var(--database-stroke); }-- /* Dashed boundary variants */- .c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }- .c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }- .c-lane { fill: var(--lane-fill); stroke: var(--lane-stroke); stroke-dasharray: 6,6; }-- /* Optional trace animation, enabled only by meta.animation = "trace".- Static diagrams do not carry data-animation and render exactly as before. */- svg[data-animation="trace"] [data-animate="edge"] {- stroke-dasharray: 10 8;- stroke-dashoffset: 54;- animation: archify-edge-flow 2.4s linear infinite;- animation-delay: calc(var(--step, 0) * 160ms);- }- svg[data-animation="trace"] [data-animate="node"] {- transform-box: fill-box;- transform-origin: center;- animation: archify-node-pulse 3.6s ease-in-out infinite;- animation-delay: calc(var(--step, 0) * 160ms);- }- @keyframes archify-edge-flow {- to { stroke-dashoffset: 0; }- }- @keyframes archify-node-pulse {- 0%, 72%, 100% { filter: none; stroke-width: 1.5; }- 18%, 36% {- filter: drop-shadow(0 0 8px var(--arrow-emphasis));- stroke-width: 2.4;- }- }- @media (prefers-reduced-motion: reduce) {- svg[data-animation="trace"] [data-animate] {- animation: none !important;- stroke-dashoffset: 0;- }- }- </style>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <meta http-equiv="refresh" content="0; url=sequence-cache-miss-request.html">+ <link rel="canonical" href="sequence-cache-miss-request.html">+ <title>Archify example moved</title>+ <script>window.location.replace("sequence-cache-miss-request.html" + window.location.search + window.location.hash);</script></head><body>- <!-- Toolbar: theme toggle + export menu (present on every generated diagram)- Keyboard: T toggles theme, E opens export menu (when no input focused) -->- <div class="toolbar" role="toolbar" aria-label="Diagram actions">- <button id="btn-theme" type="button"- title="Toggle theme (T)"- aria-label="Toggle color theme"- aria-pressed="false">- <span id="theme-icon" aria-hidden="true">☾</span>- <span id="theme-label">Dark</span>- </button>- <div class="export-wrap">- <button id="btn-export" type="button"- title="Export diagram (E)"- aria-label="Export diagram"- aria-haspopup="menu"- aria-expanded="false"- aria-controls="export-menu">- Export <span aria-hidden="true">▾</span>- </button>- <div class="export-menu" id="export-menu" role="menu" aria-label="Export">- <button data-action="copy" type="button" role="menuitem" tabindex="-1">Copy to clipboard <span class="hint">PNG</span></button>- <hr role="separator">- <button data-format="png" type="button" role="menuitem" tabindex="-1">Download PNG</button>- <button data-format="jpeg" type="button" role="menuitem" tabindex="-1">Download JPEG</button>- <button data-format="webp" type="button" role="menuitem" tabindex="-1">Download WebP</button>- <hr role="separator">- <button data-format="svg" type="button" role="menuitem" tabindex="-1">Download SVG <span class="hint">vector</span></button>- </div>- </div>- </div>-- <div class="container">- <!-- Header -->- <div class="header">- <div class="header-row">- <div class="pulse-dot"></div>- <h1>Cache Miss Request Sequence</h1>- </div>- <p class="subtitle">Frontend request path with auth, cache fallback, persistence, and async trace</p>- </div>-- <!-- Main Diagram -->- <div class="diagram-container">- <svg viewBox="0 0 820 760" role="img" aria-label="Cache Miss Request Sequence — Frontend request path with auth, cache fallback, persistence, and async trace (sequence diagram)">- <!-- Definitions -->- <defs>- <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">- <polygon points="0 0, 10 3.5, 0 7" class="m-default" />- </marker>- <marker id="arrowhead-emphasis" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">- <polygon points="0 0, 10 3.5, 0 7" class="m-emphasis" />- </marker>- <marker id="arrowhead-security" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">- <polygon points="0 0, 10 3.5, 0 7" class="m-security" />- </marker>- <marker id="arrowhead-dashed" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">- <polygon points="0 0, 10 3.5, 0 7" class="m-dashed" />- </marker>- <pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">- <path d="M 40 0 L 0 0 0 40" class="c-grid" stroke-width="0.5"/>- </pattern>- </defs>-- <!-- Background Grid -->- <rect width="100%" height="100%" fill="url(#grid)" />-- <!-- Time Segments -->- <rect x="48" y="150" width="724" height="145" rx="10" class="c-lane" stroke-width="1"/>- <text x="62" y="168" class="t-dim" font-size="9" font-weight="600">Request</text>-- <rect x="48" y="315" width="724" height="190" rx="10" class="c-lane" stroke-width="1"/>- <text x="62" y="333" class="t-dim" font-size="9" font-weight="600">Fallback</text>-- <rect x="48" y="525" width="724" height="140" rx="10" class="c-lane" stroke-width="1"/>- <text x="62" y="543" class="t-dim" font-size="9" font-weight="600">Response + trace</text>-- <!-- Lifelines -->- <path d="M 62 142 L 62 695" class="a-default" stroke-width="0.8" stroke-dasharray="3,7"/>- <path d="M 170 142 L 170 695" class="a-default" stroke-width="0.8" stroke-dasharray="3,7"/>- <path d="M 278 142 L 278 695" class="a-default" stroke-width="0.8" stroke-dasharray="3,7"/>- <path d="M 386 142 L 386 695" class="a-default" stroke-width="0.8" stroke-dasharray="3,7"/>- <path d="M 494 142 L 494 695" class="a-default" stroke-width="0.8" stroke-dasharray="3,7"/>- <path d="M 602 142 L 602 695" class="a-default" stroke-width="0.8" stroke-dasharray="3,7"/>- <path d="M 710 142 L 710 695" class="a-default" stroke-width="0.8" stroke-dasharray="3,7"/>-- <!-- Messages -->- <path d="M 69 185 L 163 185" class="a-default" stroke-width="1.4" marker-end="url(#arrowhead)"/>- <rect x="86.6" y="165" width="58.800000000000004" height="16" rx="3" class="c-mask"/>- <text x="116" y="175" class="t-backend" font-size="9" text-anchor="middle">open page</text>-- <path d="M 177 228 L 271 228" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>- <rect x="181.6" y="208" width="84.8" height="16" rx="3" class="c-mask"/>- <text x="224" y="218" class="t-backend" font-size="9" text-anchor="middle">GET /dashboard</text>-- <path d="M 285 270 L 379 270" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>- <rect x="300" y="250" width="64" height="16" rx="3" class="c-mask"/>- <text x="332" y="260" class="t-security" font-size="9" text-anchor="middle">verify JWT</text>-- <path d="M 379 305 L 285 305" class="a-default" stroke-width="1.4" stroke-dasharray="3,5" marker-end="url(#arrowhead)"/>- <rect x="302.6" y="285" width="58.800000000000004" height="16" rx="3" class="c-mask"/>- <text x="332" y="295" class="t-muted" font-size="9" text-anchor="middle">claims ok</text>-- <path d="M 285 354 L 487 354" class="a-default" stroke-width="1.4" marker-end="url(#arrowhead)"/>- <rect x="354" y="334" width="64" height="16" rx="3" class="c-mask"/>- <text x="386" y="344" class="t-backend" font-size="9" text-anchor="middle">read cache</text>-- <path d="M 487 391 L 285 391" class="a-default" stroke-width="1.4" stroke-dasharray="3,5" marker-end="url(#arrowhead)"/>- <rect x="369" y="371" width="34" height="16" rx="3" class="c-mask"/>- <text x="386" y="381" class="t-muted" font-size="9" text-anchor="middle">miss</text>-- <path d="M 285 443 L 595 443" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>- <rect x="374.2" y="423" width="131.60000000000002" height="16" rx="3" class="c-mask"/>- <text x="440" y="433" class="t-backend" font-size="9" text-anchor="middle">query profile + metrics</text>-- <path d="M 595 489 L 285 489" class="a-default" stroke-width="1.4" stroke-dasharray="3,5" marker-end="url(#arrowhead)"/>- <rect x="423" y="469" width="34" height="16" rx="3" class="c-mask"/>- <text x="440" y="479" class="t-muted" font-size="9" text-anchor="middle">rows</text>-- <path d="M 285 536 L 487 536" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>- <rect x="356.6" y="516" width="58.800000000000004" height="16" rx="3" class="c-mask"/>- <text x="386" y="526" class="t-messagebus" font-size="9" text-anchor="middle">set cache</text>-- <path d="M 285 580 L 703 580" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>- <rect x="462" y="560" width="64" height="16" rx="3" class="c-mask"/>- <text x="494" y="570" class="t-messagebus" font-size="9" text-anchor="middle">emit trace</text>-- <path d="M 271 625 L 177 625" class="a-default" stroke-width="1.4" stroke-dasharray="3,5" marker-end="url(#arrowhead)"/>- <rect x="197.2" y="605" width="53.6" height="16" rx="3" class="c-mask"/>- <text x="224" y="615" class="t-muted" font-size="9" text-anchor="middle">200 JSON</text>-- <path d="M 163 662 L 69 662" class="a-default" stroke-width="1.4" stroke-dasharray="3,5" marker-end="url(#arrowhead)"/>- <rect x="94.4" y="642" width="43.2" height="16" rx="3" class="c-mask"/>- <text x="116" y="652" class="t-muted" font-size="9" text-anchor="middle">render</text>-- <!-- Activations -->- <rect x="165" y="220" width="10" height="448" rx="3" class="c-mask"/>- <rect x="165" y="220" width="10" height="448" rx="3" class="c-frontend" stroke-width="1"/>- <rect x="273" y="228" width="10" height="404" rx="3" class="c-mask"/>- <rect x="273" y="228" width="10" height="404" rx="3" class="c-backend" stroke-width="1"/>- <rect x="381" y="265" width="10" height="45" rx="3" class="c-mask"/>- <rect x="381" y="265" width="10" height="45" rx="3" class="c-security" stroke-width="1"/>- <rect x="489" y="349" width="10" height="49" rx="3" class="c-mask"/>- <rect x="489" y="349" width="10" height="49" rx="3" class="c-database" stroke-width="1"/>- <rect x="597" y="438" width="10" height="58" rx="3" class="c-mask"/>- <rect x="597" y="438" width="10" height="58" rx="3" class="c-database" stroke-width="1"/>- <rect x="705" y="575" width="10" height="55" rx="3" class="c-mask"/>- <rect x="705" y="575" width="10" height="55" rx="3" class="c-messagebus" stroke-width="1"/>-- <!-- Participants -->- <rect x="19" y="72" width="86" height="54" rx="6" class="c-mask"/>- <rect x="19" y="72" width="86" height="54" rx="6" class="c-external" stroke-width="1.5"/>- <text x="62" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>- <text x="62" y="111" class="t-muted" font-size="7" text-anchor="middle">browser session</text>-- <rect x="127" y="72" width="86" height="54" rx="6" class="c-mask"/>- <rect x="127" y="72" width="86" height="54" rx="6" class="c-frontend" stroke-width="1.5"/>- <text x="170" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Web App</text>- <text x="170" y="111" class="t-muted" font-size="7" text-anchor="middle">React UI</text>-- <rect x="235" y="72" width="86" height="54" rx="6" class="c-mask"/>- <rect x="235" y="72" width="86" height="54" rx="6" class="c-backend" stroke-width="1.5"/>- <text x="278" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API</text>- <text x="278" y="111" class="t-muted" font-size="7" text-anchor="middle">request handler</text>-- <rect x="343" y="72" width="86" height="54" rx="6" class="c-mask"/>- <rect x="343" y="72" width="86" height="54" rx="6" class="c-security" stroke-width="1.5"/>- <text x="386" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth</text>- <text x="386" y="111" class="t-muted" font-size="7" text-anchor="middle">JWT verify</text>-- <rect x="451" y="72" width="86" height="54" rx="6" class="c-mask"/>- <rect x="451" y="72" width="86" height="54" rx="6" class="c-database" stroke-width="1.5"/>- <text x="494" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Redis</text>- <text x="494" y="111" class="t-muted" font-size="7" text-anchor="middle">cache</text>-- <rect x="559" y="72" width="86" height="54" rx="6" class="c-mask"/>- <rect x="559" y="72" width="86" height="54" rx="6" class="c-database" stroke-width="1.5"/>- <text x="602" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Postgres</text>- <text x="602" y="111" class="t-muted" font-size="7" text-anchor="middle">source of truth</text>-- <rect x="667" y="72" width="86" height="54" rx="6" class="c-mask"/>- <rect x="667" y="72" width="86" height="54" rx="6" class="c-messagebus" stroke-width="1.5"/>- <text x="710" y="94" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace</text>- <text x="710" y="111" class="t-muted" font-size="7" text-anchor="middle">async event</text>-- <!-- Legend -->- <text x="150" y="686" class="t-primary" font-size="10" font-weight="600">Legend</text>- <path d="M 150 706 L 184 706" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>- <text x="193" y="709" class="t-muted" font-size="8">request</text>- <path d="M 270 706 L 304 706" class="a-default" stroke-width="1.4" stroke-dasharray="3,5" marker-end="url(#arrowhead)"/>- <text x="313" y="709" class="t-muted" font-size="8">return</text>- <path d="M 385 706 L 419 706" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>- <text x="428" y="709" class="t-muted" font-size="8">security</text>- <path d="M 530 706 L 564 706" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>- <text x="573" y="709" class="t-muted" font-size="8">async trace</text>- </svg>- </div>-- <!-- Info Cards -->- <div class="cards">- <div class="card">- <div class="card-header">- <div class="card-dot emerald"></div>- <h3>Happy Path</h3>- </div>- <ul>- <li>• The main request is Web App -> API -> data source -> response</li>- <li>• Return messages are quieter than forward calls</li>- <li>• Activation bars make ownership duration visible</li>- </ul>- </div>-- <div class="card">- <div class="card-header">- <div class="card-dot rose"></div>- <h3>Policy + Fallback</h3>- </div>- <ul>- <li>• JWT verification is colored as a security interaction</li>- <li>• Cache miss is visible without overpowering the main path</li>- <li>• Database access only appears after cache fallback</li>- </ul>- </div>-- <div class="card">- <div class="card-header">- <div class="card-dot orange"></div>- <h3>Async Trace</h3>- </div>- <ul>- <li>• Trace emission is dashed and secondary</li>- <li>• It does not block the response path</li>- <li>• The diagram separates user-facing latency from observability</li>- </ul>- </div>- </div>-- </div>-- <script>- /* ============================================================- Theme toggle — persists to localStorage, respects system pref- ============================================================ */- var Archify = {};-- Archify.theme = (function () {- var STORAGE_KEY = 'archify-theme';- var html = document.documentElement;- var btn = document.getElementById('btn-theme');- var icon = document.getElementById('theme-icon');- var label = document.getElementById('theme-label');-- // localStorage can throw (blocked cookies, sandboxed iframes); the whole- // script element dies on an uncaught error, so guard every access.- function readStored() {- try { return localStorage.getItem(STORAGE_KEY); } catch (_) { return null; }- }- function writeStored(value) {- try { localStorage.setItem(STORAGE_KEY, value); } catch (_) {}- }- function urlOverride() {- // URL param wins (useful for deterministic screenshots / share links)- try {- var param = new URLSearchParams(window.location.search).get('theme');- if (param === 'light' || param === 'dark') return param;- } catch (_) {}- return null;- }-- function resolveInitial() {- var fromUrl = urlOverride();- if (fromUrl) return fromUrl;- var saved = readStored();- if (saved === 'light' || saved === 'dark') return saved;- return window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';- }-- function apply(theme) {- html.setAttribute('data-theme', theme);- icon.textContent = theme === 'dark' ? '\u263E' : '\u263C';- label.textContent = theme === 'dark' ? 'Dark' : 'Light';- btn.setAttribute('aria-pressed', theme === 'light' ? 'true' : 'false');- }-- function toggle() {- var next = html.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';- apply(next);- writeStored(next);- }-- apply(resolveInitial());- btn.addEventListener('click', toggle);-- // Follow live OS theme changes while the user has no explicit preference.- try {- var media = window.matchMedia('(prefers-color-scheme: light)');- var onChange = function (e) {- var saved = readStored();- if (urlOverride() || saved === 'light' || saved === 'dark') return;- apply(e.matches ? 'light' : 'dark');- };- if (media.addEventListener) media.addEventListener('change', onChange);- else if (media.addListener) media.addListener(onChange);- } catch (_) {}-- return { toggle: toggle };- })();-- /* ============================================================- Export — PNG / JPEG / WebP / SVG (download) and Copy PNG (clipboard)-- Raster exports are always rendered at 4x source resolution for- maximum sharpness. The trick: we set the serialized SVG's- `width`/`height` to viewBox * 4 so the browser rasterizes the- vectors at that resolution natively. drawImage then draws at- the image's natural size (no upscaling = no blur).-- JPEG/WebP paint the current theme's background explicitly since- those formats have no alpha channel.- ============================================================ */- (function () {- var RASTER_SCALE = 4;-- function diagramFilename() {- var title = (document.title || 'diagram')- .replace(/\s+Architecture(\s+Diagram)?$/i, '')- .replace(/\s+Diagram$/i, '')- .trim();- return title.replace(/[^a-z0-9_\-]+/gi, '-')- .toLowerCase()- .replace(/^-+|-+$/g, '') || 'diagram';- }-- function currentBg() {- return getComputedStyle(document.body).backgroundColor || '#ffffff';- }-- /**- * Serialize the main SVG into a standalone document.- *- * Two modes:- * - Default (opts.autoTheme=false) — locks the serialized SVG to the- * viewer's current theme. Used by the raster pipeline- * (PNG/JPEG/WebP/clipboard) because canvas rasterization needs- * deterministic colors; a raster cannot react to- * prefers-color-scheme after encoding.- * - autoTheme=true — emits BOTH dark and light variable sets plus a- * `@media (prefers-color-scheme)` rule so the resulting SVG- * self-themes when embedded in GitHub READMEs or other hosts that- * expose a color scheme. Used for "Download SVG".- */- function serializeSvg(scale, opts) {- // scale: integer multiplier for intrinsic SVG pixel dimensions used by- // the raster path. Defaults to 1 (natural size) for SVG download.- scale = scale || 1;- opts = opts || {};- var autoTheme = opts.autoTheme === true;-- var svg = document.querySelector('.diagram-container svg');- var clone = svg.cloneNode(true);-- var vb = svg.viewBox.baseVal;- // Scale width/height so the browser rasterizes the vectors at target- // resolution directly. viewBox stays unchanged so coordinates don't- // shift. This is the key to sharp rasters — do NOT scale later via- // canvas upscaling.- clone.setAttribute('width', vb.width * scale);- clone.setAttribute('height', vb.height * scale);- clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');-- // Only the SVG-relevant rules: semantic classes, markers, and the- // theme variable blocks. Toolbar/cards/print CSS can never apply- // inside a standalone SVG and would only bloat the export.- var hostStyle = (function () {- var out = [];- Array.prototype.forEach.call(document.styleSheets, function (sheet) {- var rules;- try { rules = sheet.cssRules; } catch (_) { return; } // cross-origin- if (!rules) return;- Array.prototype.forEach.call(rules, function (rule) {- if (rule.type !== 1) return; // plain style rules only- var sel = rule.selectorText || '';- if (/(^|,)\s*(svg|:root|\[data-theme|\.c-|\.t-|\.a-|\.m-)/.test(sel)) {- out.push(rule.cssText);- }- });- });- return out.join('\n');- })();-- // Derive the variable list from the stylesheet so newly added theme- // variables can never be missed by the export pipeline again- // (--lane-fill/--lane-stroke once were).- var varNames = (function () {- var seen = {};- var names = [];- (hostStyle.match(/--[a-zA-Z0-9-]+(?=\s*:)/g) || []).forEach(function (n) {- if (!seen[n]) { seen[n] = true; names.push(n); }- });- return names;- })();-- // Resolve the full variable set for a given data-theme via an- // off-DOM probe, independent of what the viewer is currently set to.- function resolveVars(themeAttr) {- var probe = document.createElement('div');- probe.setAttribute('data-theme', themeAttr);- probe.style.cssText = 'position:absolute;width:0;height:0;visibility:hidden;';- document.body.appendChild(probe);- try {- var c = getComputedStyle(probe);- return varNames.map(function (n) {- return n + ': ' + c.getPropertyValue(n).trim() + ';';- }).join(' ');- } finally {- document.body.removeChild(probe);- }- }-- // Prepend a local()-only @font-face block for each weight so that the- // sandboxed image-rendering context used during PNG/JPEG/WebP export- // can find JetBrains Mono if the user has it installed locally, and- // falls through cleanly to the monospace stack otherwise. The usual- // Google-Fonts <link> in the host document is unreachable from the- // serialized SVG, so url()-sourced faces would just hang.- var fontFallback = [400, 500, 600, 700].map(function (w) {- return "@font-face { font-family: 'JetBrains Mono'; font-weight: " + w +- "; src: local('JetBrains Mono'), local('JetBrainsMono-Regular'); }";- }).join('\n');-- var style = document.createElementNS('http://www.w3.org/2000/svg', 'style');- var bgRect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');- bgRect.setAttribute('width', '100%');- bgRect.setAttribute('height', '100%');-- if (autoTheme) {- // Dual-theme SVG. Dark is the default (so hosts without- // prefers-color-scheme still render), light swaps in via media- // query, and svg[data-theme="..."] still lets downstream- // consumers force a specific theme.- var darkVars = resolveVars('dark');- var lightVars = resolveVars('light');-- style.textContent =- fontFallback + "\n" +- "svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +- hostStyle + "\n" +- ":root, svg { " + darkVars + " }\n" +- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +- "rect.c-bg-rect { fill: var(--bg); }\n";-- // Don't lock the serialized SVG to the viewer's current theme.- clone.removeAttribute('data-theme');- // Background follows the CSS variable, not a fixed color, so it- // swaps with the media query.- bgRect.setAttribute('class', 'c-bg-rect');- } else {- // Raster path: lock to the viewer's current theme.- var theme = document.documentElement.getAttribute('data-theme') || 'dark';- var themeHost = document.querySelector('[data-theme="' + theme + '"]') || document.documentElement;- var computed = getComputedStyle(themeHost);- var vars = varNames.map(function (n) {- return n + ': ' + computed.getPropertyValue(n).trim() + ';';- }).join(' ');-- // IMPORTANT: inject the resolved variables AFTER hostStyle,- // otherwise hostStyle's ":root, [data-theme=\"dark\"] { ... }" rule- // overrides our chosen theme via later-in-cascade equal-specificity.- // Keep this order.- style.textContent =- fontFallback + "\n" +- "svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +- hostStyle + "\n" +- ":root, svg { " + vars + " }\n";-- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');- }-- clone.insertBefore(style, clone.firstChild);- clone.insertBefore(bgRect, style.nextSibling);-- return {- svgString: new XMLSerializer().serializeToString(clone),- width: vb.width * scale,- height: vb.height * scale- };- }-- function download(blob, filename) {- var url = URL.createObjectURL(blob);- var a = document.createElement('a');- a.href = url;- a.download = filename;- document.body.appendChild(a);- a.click();- a.remove();- setTimeout(function () { URL.revokeObjectURL(url); }, 1000);- }-- // Conservative upper bound on total canvas pixels. Older Safari on iOS- // silently produces a blank canvas above ~16 Mpx; Chrome / Firefox /- // desktop Safari are far higher but start failing on memory-constrained- // devices. We pick the largest integer scale in {4,3,2,1} whose target- // pixel count fits under this cap.- var MAX_CANVAS_PIXELS = 16 * 1024 * 1024;-- function pickSafeScale(vbW, vbH) {- for (var s = RASTER_SCALE; s >= 1; s--) {- if (vbW * s * vbH * s <= MAX_CANVAS_PIXELS) return s;- }- return 1;- }-- function rasterize(format) {- // Serialize at a safe scale (RASTER_SCALE=4 by default, reduced if the- // resulting canvas would exceed MAX_CANVAS_PIXELS). The SVG itself is- // rasterized at target resolution natively; drawImage draws at natural- // size — no upsampling blur.- var svg = document.querySelector('.diagram-container svg');- var vb = svg.viewBox.baseVal;- var scale = pickSafeScale(vb.width, vb.height);- var data = serializeSvg(scale);- var svgBlob = new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' });- var svgUrl = URL.createObjectURL(svgBlob);-- return new Promise(function (resolve, reject) {- var img = new Image();- img.onload = function () {- var canvas = document.createElement('canvas');- canvas.width = data.width;- canvas.height = data.height;- var ctx = canvas.getContext('2d');- if (format === 'jpeg') {- ctx.fillStyle = currentBg();- ctx.fillRect(0, 0, canvas.width, canvas.height);- }- // Draw at natural size — SVG was already rasterized at target res.- ctx.drawImage(img, 0, 0);- URL.revokeObjectURL(svgUrl);- var mime = format === 'jpeg' ? 'image/jpeg' :- format === 'webp' ? 'image/webp' : 'image/png';- var quality = format === 'png' ? undefined : 0.95;- canvas.toBlob(function (blob) {- if (!blob) reject(new Error('toBlob returned null for ' + format));- else resolve(blob);- }, mime, quality);- };- img.onerror = function (e) {- URL.revokeObjectURL(svgUrl);- reject(e);- };- img.src = svgUrl;- });- }-- var menu = document.getElementById('export-menu');- var btn = document.getElementById('btn-export');- var items = function () {- return Array.prototype.slice.call(menu.querySelectorAll('button[role="menuitem"]'));- };-- // ---- Clipboard support ----------------------------------------------- function canCopyImage() {- return typeof ClipboardItem !== 'undefined' &&- navigator.clipboard &&- typeof navigator.clipboard.write === 'function';- }-- // ---- Raster format detection ----------------------------------------- // canvas.toBlob('image/webp') silently returns a PNG on browsers without- // WebP encoding (older Safari), so detect explicitly.- function supports(format) {- if (format === 'svg' || format === 'png') return true;- var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';- try {- var c = document.createElement('canvas');- c.width = c.height = 2;- return c.toDataURL(mime).indexOf('data:' + mime) === 0;- } catch (_) { return false; }- }-- // Gray out unsupported items.- items().forEach(function (it) {- if (it.dataset.format && !supports(it.dataset.format)) {- it.disabled = true;- it.title = 'Not supported by this browser';- it.style.opacity = '0.5';- }- if (it.dataset.action === 'copy' && !canCopyImage()) {- it.disabled = true;- it.title = 'Clipboard image write not supported by this browser';- it.style.opacity = '0.5';- }- });-- // ---- Toast ----------------------------------------------------------- // A live region only announces CHANGES to an existing node, so the toast- // element is created once up front and updated in place.- var toastEl = document.createElement('div');- toastEl.className = 'archify-toast';- toastEl.setAttribute('role', 'status');- document.body.appendChild(toastEl);- var toastTimer = null;-- function toast(msg) {- toastEl.textContent = '';- requestAnimationFrame(function () {- toastEl.textContent = msg;- toastEl.classList.add('show');- });- clearTimeout(toastTimer);- toastTimer = setTimeout(function () { toastEl.classList.remove('show'); }, 1500);- }-- function open(focusLast) {- menu.classList.add('open');- btn.setAttribute('aria-expanded', 'true');- var available = items().filter(function (i) { return !i.disabled; });- var target = focusLast ? available[available.length - 1] : available[0];- if (target) target.focus();- }- function close(focusTrigger) {- menu.classList.remove('open');- btn.setAttribute('aria-expanded', 'false');- if (focusTrigger) btn.focus();- }- function isOpen() { return menu.classList.contains('open'); }-- btn.addEventListener('click', function (e) {- e.stopPropagation();- if (isOpen()) close(false);- else open();- });- // APG menu-button pattern: ArrowDown/ArrowUp on the trigger opens the menu.- btn.addEventListener('keydown', function (e) {- if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {- e.preventDefault();- if (!isOpen()) open(e.key === 'ArrowUp');- }- });- document.addEventListener('click', function (e) {- if (!menu.contains(e.target) && e.target !== btn) close(false);- });-- // Keyboard navigation inside the menu.- // Menu items: Up/Down, Home/End.- // Esc closes + returns focus to trigger; Tab closes.- menu.addEventListener('keydown', function (e) {- if (e.key === 'Escape') { e.preventDefault(); close(true); return; }- if (e.key === 'Tab') { close(false); return; }-- var available = items().filter(function (i) { return !i.disabled; });- var current = available.indexOf(document.activeElement);- switch (e.key) {- case 'ArrowDown':- e.preventDefault();- if (available.length) available[(current + 1 + available.length) % available.length].focus();- break;- case 'ArrowUp':- e.preventDefault();- if (available.length) available[(current - 1 + available.length) % available.length].focus();- break;- case 'Home':- e.preventDefault();- if (available[0]) available[0].focus();- break;- case 'End':- e.preventDefault();- if (available.length) available[available.length - 1].focus();- break;- }- });-- function runExport(format) {- var base = diagramFilename();- close(true);- return (format === 'svg'- ? Promise.resolve(serializeSvg(1, { autoTheme: true })).then(function (d) {- download(new Blob([d.svgString], { type: 'image/svg+xml;charset=utf-8' }), base + '.svg');- })- : rasterize(format).then(function (blob) {- download(blob, base + '.' + format);- })- ).catch(function (err) {- console.error(err);- alert('Export failed: ' + (err && err.message ? err.message : format));- });- }-- function runCopy() {- close(true);- if (!canCopyImage()) {- alert('Clipboard image write not supported in this browser.');- return;- }- // WebKit requires ClipboardItem to be constructed synchronously inside- // the user gesture — pass the pending Promise<Blob> as the item value.- // Browsers that reject promise values throw synchronously; fall back- // to awaiting the blob first (works in Chromium/Firefox).- var blobPromise = rasterize('png');- var writePromise;- try {- writePromise = navigator.clipboard.write([new ClipboardItem({ 'image/png': blobPromise })]);- } catch (_) {- writePromise = blobPromise.then(function (blob) {- return navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })]);- });- }- return writePromise.then(function () {- toast('Copied PNG to clipboard');- }).catch(function (err) {- console.error(err);- alert('Copy failed: ' + (err && err.message ? err.message : 'unknown'));- });- }-- menu.addEventListener('click', function (e) {- var copyBtn = e.target.closest('button[data-action="copy"]');- if (copyBtn && !copyBtn.disabled) { runCopy(); return; }-- var formatBtn = e.target.closest('button[data-format]');- if (formatBtn && !formatBtn.disabled) { runExport(formatBtn.dataset.format); }- });-- Archify.exportMenu = { open: open, close: close, isOpen: isOpen, run: runExport };-- // Auto-open on page load for demo/screenshot purposes: ?openExport=1- // Wait for fonts (so the menu doesn't flash before typography lands)- // and paint before opening. Fallback timeout for browsers without the- // Font Loading API.- try {- if (new URLSearchParams(window.location.search).get('openExport') === '1') {- var openWhenReady = function () {- requestAnimationFrame(function () { requestAnimationFrame(open); });- };- if (document.fonts && document.fonts.ready) {- document.fonts.ready.then(openWhenReady);- } else {- setTimeout(openWhenReady, 200);- }- }- } catch (_) {}- })();-- /* ============================================================- Global keyboard shortcuts- T -> toggle theme- E -> open export menu- Ignored when focus is inside an input/textarea/contenteditable.- ============================================================ */- document.addEventListener('keydown', function (e) {- if (e.metaKey || e.ctrlKey || e.altKey) return;- var t = e.target;- if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return;- if (e.key === 't' || e.key === 'T') {- e.preventDefault();- Archify.theme.toggle();- } else if (e.key === 'e' || e.key === 'E') {- e.preventDefault();- if (!Archify.exportMenu.isOpen()) Archify.exportMenu.open();- }- });- </script>+ <p>This legacy example moved to <a href="sequence-cache-miss-request.html">sequence-cache-miss-request.html</a>.</p></body></html>diff --git a/examples/workflow-agent-tool-call.html b/examples/workflow-agent-tool-call.htmlindex 2d25b4ab..f014e92e 100644--- a/examples/workflow-agent-tool-call.html+++ b/examples/workflow-agent-tool-call.html@@ -1,1271 +1,14 @@-<!DOCTYPE html>-<html lang="en" data-theme="dark">+<!doctype html>+<html lang="en"><head>- <meta charset="UTF-8">- <meta name="viewport" content="width=device-width, initial-scale=1.0">- <meta name="generator" content="archify 2.9.0">- <title>Agent Tool Call Workflow Diagram</title>- <script>- // Resolve the theme before first paint so light-preference users don't- // see a dark flash. The toolbar script below re-applies with UI state.- (function () {- try {- var theme = null;- try {- var param = new URLSearchParams(window.location.search).get('theme');- if (param === 'light' || param === 'dark') theme = param;- } catch (_) {}- if (!theme) {- try { theme = localStorage.getItem('archify-theme'); } catch (_) {}- }- if (theme !== 'light' && theme !== 'dark') {- theme = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';- }- document.documentElement.setAttribute('data-theme', theme);- } catch (_) {}- })();- </script>- <!-- Async font load: a blackholed network must not block first paint.- The body font stack falls back to system monospace until it lands. -->- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>- <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap"- rel="stylesheet" media="print" onload="this.media='all'">- <noscript>- <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">- </noscript>- <style>- /* ==========================================================- THEME VARIABLES — switch by toggling [data-theme] on <html>- ========================================================== */- :root,- [data-theme="dark"] {- --bg: #020617;- --grid: #1e293b;- --text: #ffffff;- --text-muted: #94a3b8;- --text-dim: #475569;- /* UI chrome (menu hints, footer) needs more contrast than SVG .t-dim accents */- --text-faint: #7d8da1;-- --panel: rgba(15, 23, 42, 0.5);- --panel-border: #1e293b;- --lane-fill: rgba(15, 23, 42, 0.22);- --lane-stroke: #334155;-- --arrow: #64748b;- --arrow-emphasis: #34d399;-- /* Opaque mask color used behind semi-transparent component fills- so the arrows drawn underneath are properly hidden. */- --mask: #0f172a;-- --frontend-fill: rgba(8, 51, 68, 0.4);- --frontend-stroke: #22d3ee;- --backend-fill: rgba(6, 78, 59, 0.4);- --backend-stroke: #34d399;- --database-fill: rgba(76, 29, 149, 0.4);- --database-stroke: #a78bfa;- --cloud-fill: rgba(120, 53, 15, 0.3);- --cloud-stroke: #fbbf24;- --security-fill: rgba(136, 19, 55, 0.4);- --security-stroke: #fb7185;- --messagebus-fill: rgba(251, 146, 60, 0.3);- --messagebus-stroke:#fb923c;- --external-fill: rgba(30, 41, 59, 0.5);- --external-stroke: #94a3b8;-- --toolbar-bg: rgba(15, 23, 42, 0.8);- --toolbar-border: #334155;- --toolbar-text: #e2e8f0;- --toolbar-hover: rgba(15, 23, 42, 0.95);- --toolbar-menu-bg: #0f172a;- }-- [data-theme="light"] {- --bg: #f8fafc;- --grid: #e2e8f0;- --text: #0f172a;- --text-muted: #64748b;- --text-dim: #94a3b8;- --text-faint: #64748b;-- --panel: #ffffff;- --panel-border: #e2e8f0;- --lane-fill: rgba(248, 250, 252, 0.65);- --lane-stroke: #cbd5e1;-- --arrow: #94a3b8;- --arrow-emphasis: #059669;-- --mask: #ffffff;-- --frontend-fill: rgba(34, 211, 238, 0.15);- --frontend-stroke: #0891b2;- --backend-fill: rgba(52, 211, 153, 0.18);- --backend-stroke: #059669;- --database-fill: rgba(167, 139, 250, 0.2);- --database-stroke: #7c3aed;- --cloud-fill: rgba(251, 191, 36, 0.18);- --cloud-stroke: #d97706;- --security-fill: rgba(251, 113, 133, 0.15);- --security-stroke: #e11d48;- --messagebus-fill: rgba(251, 146, 60, 0.15);- --messagebus-stroke:#ea580c;- --external-fill: rgba(148, 163, 184, 0.18);- --external-stroke: #64748b;-- --toolbar-bg: rgba(255, 255, 255, 0.92);- --toolbar-border: #cbd5e1;- --toolbar-text: #334155;- --toolbar-hover: #ffffff;- --toolbar-menu-bg: #ffffff;- }-- * { margin: 0; padding: 0; box-sizing: border-box; }-- body {- font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;- background: var(--bg);- min-height: 100vh;- padding: 2rem;- color: var(--text);- transition: background 0.2s ease, color 0.2s ease;- }-- .container { max-width: 1200px; margin: 0 auto; }-- .header { margin-bottom: 2rem; }-- .header-row {- display: flex;- align-items: center;- gap: 1rem;- margin-bottom: 0.5rem;- }-- .pulse-dot {- width: 12px;- height: 12px;- background: var(--frontend-stroke);- border-radius: 50%;- animation: pulse 2s infinite;- }-- @keyframes pulse {- 0%, 100% { opacity: 1; }- 50% { opacity: 0.5; }- }-- h1 {- font-size: 1.5rem;- font-weight: 700;- letter-spacing: -0.025em;- }-- .subtitle {- color: var(--text-muted);- font-size: 0.875rem;- margin-left: 1.75rem;- }-- .diagram-container {- background: var(--panel);- border-radius: 1rem;- border: 1px solid var(--panel-border);- padding: 1.5rem;- overflow-x: auto;- }-- svg {- width: 100%;- min-width: min(900px, 100%);- display: block;- }-- .cards {- display: grid;- grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));- gap: 1rem;- margin-top: 2rem;- }-- .card {- background: var(--panel);- border-radius: 0.75rem;- border: 1px solid var(--panel-border);- padding: 1.25rem;- }-- .card-header {- display: flex;- align-items: center;- gap: 0.5rem;- margin-bottom: 0.75rem;- }-- .card-dot {- width: 8px;- height: 8px;- border-radius: 50%;- }-- .card-dot.cyan { background: var(--frontend-stroke); }- .card-dot.emerald { background: var(--backend-stroke); }- .card-dot.violet { background: var(--database-stroke); }- .card-dot.amber { background: var(--cloud-stroke); }- .card-dot.rose { background: var(--security-stroke); }- .card-dot.orange { background: var(--messagebus-stroke); }- .card-dot.slate { background: var(--external-stroke); }-- .card h3 { font-size: 0.875rem; font-weight: 600; color: var(--text); }-- .card ul {- list-style: none;- color: var(--text-muted);- font-size: 0.75rem;- }-- .card li { margin-bottom: 0.375rem; }-- /* ==========================================================- Print stylesheet — hide interactive controls, force light,- drop the grid so the diagram doesn't waste ink, use landscape- so wide diagrams fit, pack summary cards into 2 columns to- avoid an orphan card on a trailing page.- ========================================================== */- @page { size: landscape; margin: 1.5cm; }-- @media print {- /* Force the FULL light palette — including component fills/strokes and- lane/arrow colors — so printing from dark theme doesn't put neon- strokes and translucent dark fills on white paper. */- :root, [data-theme="dark"], [data-theme="light"] {- --bg: #ffffff;- --grid: transparent;- --panel: #ffffff;- --panel-border: #e2e8f0;- --text: #0f172a;- --text-muted: #475569;- --text-dim: #94a3b8;- --text-faint: #64748b;- --mask: #ffffff;- --lane-fill: rgba(248, 250, 252, 0.65);- --lane-stroke: #cbd5e1;- --arrow: #94a3b8;- --arrow-emphasis: #059669;- --frontend-fill: rgba(34, 211, 238, 0.15);- --frontend-stroke: #0891b2;- --backend-fill: rgba(52, 211, 153, 0.18);- --backend-stroke: #059669;- --database-fill: rgba(167, 139, 250, 0.2);- --database-stroke: #7c3aed;- --cloud-fill: rgba(251, 191, 36, 0.18);- --cloud-stroke: #d97706;- --security-fill: rgba(251, 113, 133, 0.15);- --security-stroke: #e11d48;- --messagebus-fill: rgba(251, 146, 60, 0.15);- --messagebus-stroke:#ea580c;- --external-fill: rgba(148, 163, 184, 0.18);- --external-stroke: #64748b;- }- body { background: #ffffff !important; padding: 0; }- .container { max-width: none; }- .toolbar, .archify-toast, .no-print { display: none !important; }- .diagram-container, .card { box-shadow: none; border-color: #e2e8f0; }- .cards { grid-template-columns: 1fr 1fr; }- /* Ensure elements break sensibly across pages */- .card { break-inside: avoid; page-break-inside: avoid; }- .diagram-container { break-inside: avoid; page-break-inside: avoid; }- h1, .subtitle { color: #0f172a; }- }-- /* ==========================================================- TOOLBAR (theme toggle + export menu)- ========================================================== */- .toolbar {- position: fixed;- top: 1rem;- right: 1rem;- display: flex;- gap: 0.5rem;- z-index: 100;- }- .toolbar button {- background: var(--toolbar-bg);- color: var(--toolbar-text);- border: 1px solid var(--toolbar-border);- padding: 0.5rem 0.875rem;- border-radius: 0.5rem;- font-family: inherit;- font-size: 0.75rem;- font-weight: 500;- cursor: pointer;- backdrop-filter: blur(8px);- transition: background 0.15s, border-color 0.15s;- display: inline-flex;- align-items: center;- gap: 0.375rem;- }- .toolbar button:hover {- background: var(--toolbar-hover);- border-color: var(--arrow);- }- .toolbar button:focus-visible {- outline: 2px solid var(--frontend-stroke);- outline-offset: 2px;- }- .toolbar .export-wrap { position: relative; }- .toolbar .export-menu {- position: absolute;- top: calc(100% + 0.375rem);- right: 0;- background: var(--toolbar-menu-bg);- border: 1px solid var(--toolbar-border);- border-radius: 0.5rem;- padding: 0.375rem;- min-width: 160px;- display: none;- flex-direction: column;- box-shadow: 0 4px 20px rgba(0,0,0,0.25);- }- .toolbar .export-menu.open { display: flex; }- .toolbar .export-menu button {- background: transparent;- border: 0;- justify-content: space-between;- width: 100%;- text-align: left;- padding: 0.5rem 0.75rem;- }- .toolbar .export-menu button:hover {- background: var(--toolbar-hover);- }- .toolbar .export-menu .hint {- color: var(--text-faint);- font-size: 0.625rem;- }- .toolbar .export-menu hr {- border: 0;- border-top: 1px solid var(--toolbar-border);- margin: 0.25rem 0.375rem;- opacity: 0.5;- }-- /* Toast — brief feedback for actions like "copied" */- .archify-toast {- position: fixed;- top: 1rem;- left: 50%;- transform: translateX(-50%) translateY(-8px);- background: var(--toolbar-menu-bg);- color: var(--text);- border: 1px solid var(--toolbar-border);- padding: 0.5rem 1rem;- border-radius: 0.5rem;- font-family: inherit;- font-size: 0.75rem;- opacity: 0;- transition: opacity 0.2s, transform 0.2s;- z-index: 200;- pointer-events: none;- box-shadow: 0 4px 20px rgba(0,0,0,0.25);- }- .archify-toast.show {- opacity: 1;- transform: translateX(-50%) translateY(0);- }-- @media (max-width: 720px) {- body { padding: 1rem; }- .toolbar {- position: static;- justify-content: flex-end;- margin-bottom: 1rem;- }- .header { margin-bottom: 1.25rem; }- .header-row {- gap: 0.75rem;- align-items: flex-start;- }- h1 {- font-size: 1.25rem;- line-height: 1.25;- }- .subtitle {- margin-left: 0;- font-size: 0.8125rem;- line-height: 1.55;- }- .diagram-container {- padding: 0.75rem;- border-radius: 0.75rem;- }- .cards {- grid-template-columns: 1fr;- margin-top: 1rem;- }- }-- /* ==========================================================- SVG SEMANTIC CLASSES — use these instead of inline fill/stroke- ========================================================== */- .c-grid { stroke: var(--grid); fill: none; }- .c-mask { fill: var(--mask); stroke: none; }-- .c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }- .c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }- .c-database { fill: var(--database-fill); stroke: var(--database-stroke); }- .c-cloud { fill: var(--cloud-fill); stroke: var(--cloud-stroke); }- .c-security { fill: var(--security-fill); stroke: var(--security-stroke); }- .c-messagebus { fill: var(--messagebus-fill); stroke: var(--messagebus-stroke); }- .c-external { fill: var(--external-fill); stroke: var(--external-stroke); }-- /* Text helpers */- .t-primary { fill: var(--text); }- .t-muted { fill: var(--text-muted); }- .t-dim { fill: var(--text-dim); }- .t-frontend { fill: var(--frontend-stroke); }- .t-backend { fill: var(--backend-stroke); }- .t-database { fill: var(--database-stroke); }- .t-cloud { fill: var(--cloud-stroke); }- .t-security { fill: var(--security-stroke); }- .t-messagebus { fill: var(--messagebus-stroke); }- .t-external { fill: var(--external-stroke); }-- /* Arrows */- .a-default { stroke: var(--arrow); fill: none; }- .a-emphasis { stroke: var(--arrow-emphasis); fill: none; }- .a-security { stroke: var(--security-stroke); fill: none; stroke-dasharray: 5,5; }- .a-dashed { stroke: var(--database-stroke); fill: none; stroke-dasharray: 4,4; }-- /* Arrowhead markers reference these */- .m-default { fill: var(--arrow); }- .m-emphasis { fill: var(--arrow-emphasis); }- .m-security { fill: var(--security-stroke); }- .m-dashed { fill: var(--database-stroke); }-- /* Dashed boundary variants */- .c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }- .c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }- .c-lane { fill: var(--lane-fill); stroke: var(--lane-stroke); stroke-dasharray: 6,6; }-- /* Optional trace animation, enabled only by meta.animation = "trace".- Static diagrams do not carry data-animation and render exactly as before. */- svg[data-animation="trace"] [data-animate="edge"] {- stroke-dasharray: 10 8;- stroke-dashoffset: 54;- animation: archify-edge-flow 2.4s linear infinite;- animation-delay: calc(var(--step, 0) * 160ms);- }- svg[data-animation="trace"] [data-animate="node"] {- transform-box: fill-box;- transform-origin: center;- animation: archify-node-pulse 3.6s ease-in-out infinite;- animation-delay: calc(var(--step, 0) * 160ms);- }- @keyframes archify-edge-flow {- to { stroke-dashoffset: 0; }- }- @keyframes archify-node-pulse {- 0%, 72%, 100% { filter: none; stroke-width: 1.5; }- 18%, 36% {- filter: drop-shadow(0 0 8px var(--arrow-emphasis));- stroke-width: 2.4;- }- }- @media (prefers-reduced-motion: reduce) {- svg[data-animation="trace"] [data-animate] {- animation: none !important;- stroke-dashoffset: 0;- }- }- </style>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <meta http-equiv="refresh" content="0; url=workflow-agent-tool-call-rendered.html">+ <link rel="canonical" href="workflow-agent-tool-call-rendered.html">+ <title>Archify example moved</title>+ <script>window.location.replace("workflow-agent-tool-call-rendered.html" + window.location.search + window.location.hash);</script></head><body>- <!-- Toolbar: theme toggle + export menu (present on every generated diagram)- Keyboard: T toggles theme, E opens export menu (when no input focused) -->- <div class="toolbar" role="toolbar" aria-label="Diagram actions">- <button id="btn-theme" type="button"- title="Toggle theme (T)"- aria-label="Toggle color theme"- aria-pressed="false">- <span id="theme-icon" aria-hidden="true">☾</span>- <span id="theme-label">Dark</span>- </button>- <div class="export-wrap">- <button id="btn-export" type="button"- title="Export diagram (E)"- aria-label="Export diagram"- aria-haspopup="menu"- aria-expanded="false"- aria-controls="export-menu">- Export <span aria-hidden="true">▾</span>- </button>- <div class="export-menu" id="export-menu" role="menu" aria-label="Export">- <button data-action="copy" type="button" role="menuitem" tabindex="-1">Copy to clipboard <span class="hint">PNG</span></button>- <hr role="separator">- <button data-format="png" type="button" role="menuitem" tabindex="-1">Download PNG</button>- <button data-format="jpeg" type="button" role="menuitem" tabindex="-1">Download JPEG</button>- <button data-format="webp" type="button" role="menuitem" tabindex="-1">Download WebP</button>- <hr role="separator">- <button data-format="svg" type="button" role="menuitem" tabindex="-1">Download SVG <span class="hint">vector</span></button>- </div>- </div>- </div>-- <div class="container">- <!-- Header -->- <div class="header">- <div class="header-row">- <div class="pulse-dot"></div>- <h1>Agent Tool Call Workflow</h1>- </div>- <p class="subtitle">Renderer-driven workflow prototype with lanes, anchored nodes, and orthogonal edges</p>- </div>-- <!-- Main Diagram -->- <div class="diagram-container">- <svg viewBox="0 0 720 900" role="img" aria-label="Agent Tool Call Workflow — Renderer-driven workflow prototype with lanes, anchored nodes, and orthogonal edges (workflow diagram)">- <!-- Definitions -->- <defs>- <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">- <polygon points="0 0, 10 3.5, 0 7" class="m-default" />- </marker>- <marker id="arrowhead-emphasis" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">- <polygon points="0 0, 10 3.5, 0 7" class="m-emphasis" />- </marker>- <marker id="arrowhead-security" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">- <polygon points="0 0, 10 3.5, 0 7" class="m-security" />- </marker>- <marker id="arrowhead-dashed" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">- <polygon points="0 0, 10 3.5, 0 7" class="m-dashed" />- </marker>- <pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">- <path d="M 40 0 L 0 0 0 40" class="c-grid" stroke-width="0.5"/>- </pattern>- </defs>-- <!-- Background Grid -->- <rect width="100%" height="100%" fill="url(#grid)" />-- <!-- Swimlanes -->- <rect x="40" y="52" width="640" height="104" rx="10" class="c-lane" stroke-width="1"/>- <text x="54" y="74" class="t-dim" font-size="10" font-weight="600">01 / User Interface</text>-- <rect x="40" y="176" width="640" height="104" rx="10" class="c-lane" stroke-width="1"/>- <text x="54" y="198" class="t-dim" font-size="10" font-weight="600">02 / Agent Runtime</text>-- <rect x="40" y="300" width="640" height="104" rx="10" class="c-lane" stroke-width="1"/>- <text x="54" y="322" class="t-dim" font-size="10" font-weight="600">03 / Policy Boundary</text>-- <rect x="40" y="424" width="640" height="104" rx="10" class="c-lane" stroke-width="1"/>- <rect x="46" y="430" width="628" height="92" rx="8" class="c-security-group" stroke-width="1"/>- <text x="54" y="446" class="t-security" font-size="10" font-weight="600">EX / Exception Handling</text>-- <rect x="40" y="548" width="640" height="104" rx="10" class="c-lane" stroke-width="1"/>- <text x="54" y="570" class="t-dim" font-size="10" font-weight="600">05 / Tool Execution</text>-- <rect x="40" y="672" width="640" height="104" rx="10" class="c-lane" stroke-width="1"/>- <text x="54" y="694" class="t-dim" font-size="10" font-weight="600">06 / Observability</text>-- <!-- Phase headers -->- <line x1="42" y1="35" x2="266" y2="35" class="a-default" stroke-width="1.1"/>- <rect x="42" y="27" width="224" height="16" rx="4" class="c-mask"/>- <text x="154" y="39" class="t-muted" font-size="8" font-weight="600" text-anchor="middle">Intake</text>- <line x1="254" y1="35" x2="476" y2="35" class="a-emphasis" stroke-width="1.1"/>- <rect x="254" y="27" width="222" height="16" rx="4" class="c-mask"/>- <text x="365" y="39" class="t-backend" font-size="8" font-weight="600" text-anchor="middle">Plan + route</text>- <line x1="454" y1="35" x2="671" y2="35" class="a-dashed" stroke-width="1.1"/>- <rect x="454" y="27" width="217" height="16" rx="4" class="c-mask"/>- <text x="562.5" y="39" class="t-messagebus" font-size="8" font-weight="600" text-anchor="middle">Execute + report</text>-- <!-- Workflow groups -->- <rect x="250" y="214" width="230" height="58" rx="9" class="c-lane" stroke-width="1"/>- <text x="260" y="228" class="t-backend" font-size="7" font-weight="600">Planning loop</text>- <rect x="450" y="586" width="225" height="58" rx="9" class="c-lane" stroke-width="1"/>- <text x="460" y="600" class="t-messagebus" font-size="7" font-weight="600">Tool work</text>- <rect x="380" y="462" width="295" height="58" rx="9" class="c-security-group" stroke-width="1"/>- <text x="390" y="476" class="t-security" font-size="7" font-weight="600">Human or policy stop</text>-- <!-- Edge paths -->- <path d="M 134 119 L 174 119" class="a-default" stroke-width="1.4" marker-end="url(#arrowhead)"/>- <path d="M 220 145 L 220 166 L 300 166 L 300 209" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>- <path d="M 346 243 L 384 243" class="a-default" stroke-width="1.4" marker-end="url(#arrowhead)"/>- <path d="M 430 269 L 430 290 L 430 290 L 430 333" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>- <path d="M 384 367 L 356 367 L 356 615 L 454 615" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>- <path d="M 430 401 L 430 414 L 500 414 L 500 465" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>- <path d="M 546 491 L 579 491" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>- <path d="M 546 615 L 579 615" class="a-default" stroke-width="1.4" marker-end="url(#arrowhead)"/>- <path d="M 671 615 L 692 615 L 692 119 L 671 119" class="a-emphasis" stroke-width="1.2" marker-end="url(#arrowhead-emphasis)"/>- <path d="M 625 641 L 625 797 L 500 797 L 500 765" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>- <path d="M 266 739 L 454 739" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>-- <!-- Nodes -->- <rect x="42" y="93" width="92" height="52" rx="6" class="c-mask"/>- <rect x="42" y="93" width="92" height="52" rx="6" class="c-external" stroke-width="1.5"/>- <text x="88" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">User</text>- <text x="88" y="131" class="t-muted" font-size="8" text-anchor="middle">asks for work</text>-- <rect x="174" y="93" width="92" height="52" rx="6" class="c-mask"/>- <rect x="174" y="93" width="92" height="52" rx="6" class="c-frontend" stroke-width="1.5"/>- <text x="220" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Chat Surface</text>- <text x="220" y="131" class="t-muted" font-size="8" text-anchor="middle">thread + files</text>-- <rect x="579" y="93" width="92" height="52" rx="6" class="c-mask"/>- <rect x="579" y="93" width="92" height="52" rx="6" class="c-backend" stroke-width="1.5"/>- <text x="625" y="114" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Final Reply</text>- <text x="625" y="131" class="t-muted" font-size="8" text-anchor="middle">answer + changes</text>-- <rect x="254" y="209" width="92" height="68" rx="6" class="c-mask"/>- <rect x="254" y="209" width="92" height="68" rx="6" class="c-backend" stroke-width="1.5"/>- <text x="300" y="230" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Agent Planner</text>- <text x="300" y="247" class="t-muted" font-size="8" text-anchor="middle">plan next step</text>- <text x="300" y="265" class="t-backend" font-size="7" text-anchor="middle">context aware</text>-- <rect x="384" y="217" width="92" height="52" rx="6" class="c-mask"/>- <rect x="384" y="217" width="92" height="52" rx="6" class="c-backend" stroke-width="1.5"/>- <text x="430" y="238" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Router</text>- <text x="430" y="255" class="t-muted" font-size="8" text-anchor="middle">choose capability</text>-- <rect x="384" y="333" width="92" height="68" rx="6" class="c-mask"/>- <rect x="384" y="333" width="92" height="68" rx="6" class="c-security" stroke-width="1.5"/>- <text x="430" y="354" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Approval Gate</text>- <text x="430" y="371" class="t-muted" font-size="8" text-anchor="middle">scope + consent</text>- <text x="430" y="389" class="t-security" font-size="7" text-anchor="middle">block risky ops</text>-- <rect x="454" y="465" width="92" height="52" rx="6" class="c-mask"/>- <rect x="454" y="465" width="92" height="52" rx="6" class="c-security" stroke-width="1.5"/>- <text x="500" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Blocked</text>- <text x="500" y="503" class="t-muted" font-size="8" text-anchor="middle">wait or reject</text>-- <rect x="579" y="465" width="92" height="52" rx="6" class="c-mask"/>- <rect x="579" y="465" width="92" height="52" rx="6" class="c-messagebus" stroke-width="1.5"/>- <text x="625" y="486" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Retry Path</text>- <text x="625" y="503" class="t-muted" font-size="8" text-anchor="middle">revise request</text>-- <rect x="454" y="581" width="92" height="68" rx="6" class="c-mask"/>- <rect x="454" y="581" width="92" height="68" rx="6" class="c-messagebus" stroke-width="1.5"/>- <text x="500" y="602" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Tool Call</text>- <text x="500" y="619" class="t-muted" font-size="8" text-anchor="middle">shell / browser / MCP</text>- <text x="500" y="637" class="t-messagebus" font-size="7" text-anchor="middle">structured result</text>-- <rect x="579" y="589" width="92" height="52" rx="6" class="c-mask"/>- <rect x="579" y="589" width="92" height="52" rx="6" class="c-cloud" stroke-width="1.5"/>- <text x="625" y="610" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">External API</text>- <text x="625" y="627" class="t-muted" font-size="8" text-anchor="middle">network service</text>-- <rect x="174" y="713" width="92" height="52" rx="6" class="c-mask"/>- <rect x="174" y="713" width="92" height="52" rx="6" class="c-database" stroke-width="1.5"/>- <text x="220" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Context Store</text>- <text x="220" y="751" class="t-muted" font-size="8" text-anchor="middle">repo + memory</text>-- <rect x="454" y="713" width="92" height="52" rx="6" class="c-mask"/>- <rect x="454" y="713" width="92" height="52" rx="6" class="c-database" stroke-width="1.5"/>- <text x="500" y="734" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Trace Log</text>- <text x="500" y="751" class="t-muted" font-size="8" text-anchor="middle">events + output</text>-- <!-- Edge labels -->-- <rect x="245" y="146" width="30" height="14" rx="3" class="c-mask"/>- <text x="260" y="156" class="t-backend" font-size="8" text-anchor="middle">plan</text>-- <rect x="423" y="277.5" width="82" height="14" rx="3" class="c-mask"/>- <text x="464" y="287.5" class="t-security" font-size="8" text-anchor="middle">needs approval?</text>-- <rect x="445.6" y="406" width="38.8" height="14" rx="3" class="c-mask"/>- <text x="465" y="416" class="t-security" font-size="8" text-anchor="middle">denied</text>---- <rect x="526.3" y="777" width="72.4" height="14" rx="3" class="c-mask"/>- <text x="562.5" y="787" class="t-database" font-size="8" text-anchor="middle">record result</text>- <rect x="326.4" y="725" width="77.2" height="14" rx="3" class="c-mask"/>- <text x="365" y="735" class="t-database" font-size="8" text-anchor="middle">trace + memory</text>-- <!-- Legend -->- <text x="175" y="800" class="t-primary" font-size="10" font-weight="600">Legend</text>- <rect x="175" y="812" width="14" height="9" rx="2" class="c-frontend" stroke-width="1"/>- <text x="195" y="820" class="t-muted" font-size="7">User UI</text>- <rect x="260" y="812" width="14" height="9" rx="2" class="c-backend" stroke-width="1"/>- <text x="280" y="820" class="t-muted" font-size="7">Agent logic</text>- <rect x="370" y="812" width="14" height="9" rx="2" class="c-security" stroke-width="1"/>- <text x="390" y="820" class="t-muted" font-size="7">Policy</text>- <rect x="455" y="812" width="14" height="9" rx="2" class="c-messagebus" stroke-width="1"/>- <text x="475" y="820" class="t-muted" font-size="7">Tool action</text>- <rect x="565" y="812" width="14" height="9" rx="2" class="c-database" stroke-width="1"/>- <text x="585" y="820" class="t-muted" font-size="7">Context / trace</text>- </svg>- </div>-- <!-- Info Cards -->- <div class="cards">- <div class="card">- <div class="card-header">- <div class="card-dot cyan"></div>- <h3>Renderer Rules</h3>- </div>- <ul>- <li>• Lanes and columns determine node placement</li>- <li>• Edges attach to explicit node anchors</li>- <li>• Cross-lane paths use orthogonal routing</li>- <li>• Short adjacent links stay unlabeled</li>- </ul>- </div>-- <div class="card">- <div class="card-header">- <div class="card-dot rose"></div>- <h3>Workflow Semantics</h3>- </div>- <ul>- <li>• Approval is a first-class policy step</li>- <li>• Consent gates are visible in the main path</li>- <li>• External calls stay inside the tool lane</li>- <li>• Trace writes are separate from the hot path</li>- </ul>- </div>-- <div class="card">- <div class="card-header">- <div class="card-dot emerald"></div>- <h3>Why It Matters</h3>- </div>- <ul>- <li>• This is closer to a diagram_type renderer</li>- <li>• The graph can be edited without SVG surgery</li>- <li>• Layout rules can be tested and improved</li>- <li>• A future IR can reuse this shape directly</li>- </ul>- </div>- </div>-- </div>-- <script>- /* ============================================================- Theme toggle — persists to localStorage, respects system pref- ============================================================ */- var Archify = {};-- Archify.theme = (function () {- var STORAGE_KEY = 'archify-theme';- var html = document.documentElement;- var btn = document.getElementById('btn-theme');- var icon = document.getElementById('theme-icon');- var label = document.getElementById('theme-label');-- // localStorage can throw (blocked cookies, sandboxed iframes); the whole- // script element dies on an uncaught error, so guard every access.- function readStored() {- try { return localStorage.getItem(STORAGE_KEY); } catch (_) { return null; }- }- function writeStored(value) {- try { localStorage.setItem(STORAGE_KEY, value); } catch (_) {}- }- function urlOverride() {- // URL param wins (useful for deterministic screenshots / share links)- try {- var param = new URLSearchParams(window.location.search).get('theme');- if (param === 'light' || param === 'dark') return param;- } catch (_) {}- return null;- }-- function resolveInitial() {- var fromUrl = urlOverride();- if (fromUrl) return fromUrl;- var saved = readStored();- if (saved === 'light' || saved === 'dark') return saved;- return window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';- }-- function apply(theme) {- html.setAttribute('data-theme', theme);- icon.textContent = theme === 'dark' ? '\u263E' : '\u263C';- label.textContent = theme === 'dark' ? 'Dark' : 'Light';- btn.setAttribute('aria-pressed', theme === 'light' ? 'true' : 'false');- }-- function toggle() {- var next = html.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';- apply(next);- writeStored(next);- }-- apply(resolveInitial());- btn.addEventListener('click', toggle);-- // Follow live OS theme changes while the user has no explicit preference.- try {- var media = window.matchMedia('(prefers-color-scheme: light)');- var onChange = function (e) {- var saved = readStored();- if (urlOverride() || saved === 'light' || saved === 'dark') return;- apply(e.matches ? 'light' : 'dark');- };- if (media.addEventListener) media.addEventListener('change', onChange);- else if (media.addListener) media.addListener(onChange);- } catch (_) {}-- return { toggle: toggle };- })();-- /* ============================================================- Export — PNG / JPEG / WebP / SVG (download) and Copy PNG (clipboard)-- Raster exports are always rendered at 4x source resolution for- maximum sharpness. The trick: we set the serialized SVG's- `width`/`height` to viewBox * 4 so the browser rasterizes the- vectors at that resolution natively. drawImage then draws at- the image's natural size (no upscaling = no blur).-- JPEG/WebP paint the current theme's background explicitly since- those formats have no alpha channel.- ============================================================ */- (function () {- var RASTER_SCALE = 4;-- function diagramFilename() {- var title = (document.title || 'diagram')- .replace(/\s+Architecture(\s+Diagram)?$/i, '')- .replace(/\s+Diagram$/i, '')- .trim();- return title.replace(/[^a-z0-9_\-]+/gi, '-')- .toLowerCase()- .replace(/^-+|-+$/g, '') || 'diagram';- }-- function currentBg() {- return getComputedStyle(document.body).backgroundColor || '#ffffff';- }-- /**- * Serialize the main SVG into a standalone document.- *- * Two modes:- * - Default (opts.autoTheme=false) — locks the serialized SVG to the- * viewer's current theme. Used by the raster pipeline- * (PNG/JPEG/WebP/clipboard) because canvas rasterization needs- * deterministic colors; a raster cannot react to- * prefers-color-scheme after encoding.- * - autoTheme=true — emits BOTH dark and light variable sets plus a- * `@media (prefers-color-scheme)` rule so the resulting SVG- * self-themes when embedded in GitHub READMEs or other hosts that- * expose a color scheme. Used for "Download SVG".- */- function serializeSvg(scale, opts) {- // scale: integer multiplier for intrinsic SVG pixel dimensions used by- // the raster path. Defaults to 1 (natural size) for SVG download.- scale = scale || 1;- opts = opts || {};- var autoTheme = opts.autoTheme === true;-- var svg = document.querySelector('.diagram-container svg');- var clone = svg.cloneNode(true);-- var vb = svg.viewBox.baseVal;- // Scale width/height so the browser rasterizes the vectors at target- // resolution directly. viewBox stays unchanged so coordinates don't- // shift. This is the key to sharp rasters — do NOT scale later via- // canvas upscaling.- clone.setAttribute('width', vb.width * scale);- clone.setAttribute('height', vb.height * scale);- clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');-- // Only the SVG-relevant rules: semantic classes, markers, and the- // theme variable blocks. Toolbar/cards/print CSS can never apply- // inside a standalone SVG and would only bloat the export.- var hostStyle = (function () {- var out = [];- Array.prototype.forEach.call(document.styleSheets, function (sheet) {- var rules;- try { rules = sheet.cssRules; } catch (_) { return; } // cross-origin- if (!rules) return;- Array.prototype.forEach.call(rules, function (rule) {- if (rule.type !== 1) return; // plain style rules only- var sel = rule.selectorText || '';- if (/(^|,)\s*(svg|:root|\[data-theme|\.c-|\.t-|\.a-|\.m-)/.test(sel)) {- out.push(rule.cssText);- }- });- });- return out.join('\n');- })();-- // Derive the variable list from the stylesheet so newly added theme- // variables can never be missed by the export pipeline again- // (--lane-fill/--lane-stroke once were).- var varNames = (function () {- var seen = {};- var names = [];- (hostStyle.match(/--[a-zA-Z0-9-]+(?=\s*:)/g) || []).forEach(function (n) {- if (!seen[n]) { seen[n] = true; names.push(n); }- });- return names;- })();-- // Resolve the full variable set for a given data-theme via an- // off-DOM probe, independent of what the viewer is currently set to.- function resolveVars(themeAttr) {- var probe = document.createElement('div');- probe.setAttribute('data-theme', themeAttr);- probe.style.cssText = 'position:absolute;width:0;height:0;visibility:hidden;';- document.body.appendChild(probe);- try {- var c = getComputedStyle(probe);- return varNames.map(function (n) {- return n + ': ' + c.getPropertyValue(n).trim() + ';';- }).join(' ');- } finally {- document.body.removeChild(probe);- }- }-- // Prepend a local()-only @font-face block for each weight so that the- // sandboxed image-rendering context used during PNG/JPEG/WebP export- // can find JetBrains Mono if the user has it installed locally, and- // falls through cleanly to the monospace stack otherwise. The usual- // Google-Fonts <link> in the host document is unreachable from the- // serialized SVG, so url()-sourced faces would just hang.- var fontFallback = [400, 500, 600, 700].map(function (w) {- return "@font-face { font-family: 'JetBrains Mono'; font-weight: " + w +- "; src: local('JetBrains Mono'), local('JetBrainsMono-Regular'); }";- }).join('\n');-- var style = document.createElementNS('http://www.w3.org/2000/svg', 'style');- var bgRect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');- bgRect.setAttribute('width', '100%');- bgRect.setAttribute('height', '100%');-- if (autoTheme) {- // Dual-theme SVG. Dark is the default (so hosts without- // prefers-color-scheme still render), light swaps in via media- // query, and svg[data-theme="..."] still lets downstream- // consumers force a specific theme.- var darkVars = resolveVars('dark');- var lightVars = resolveVars('light');-- style.textContent =- fontFallback + "\n" +- "svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +- hostStyle + "\n" +- ":root, svg { " + darkVars + " }\n" +- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +- "rect.c-bg-rect { fill: var(--bg); }\n";-- // Don't lock the serialized SVG to the viewer's current theme.- clone.removeAttribute('data-theme');- // Background follows the CSS variable, not a fixed color, so it- // swaps with the media query.- bgRect.setAttribute('class', 'c-bg-rect');- } else {- // Raster path: lock to the viewer's current theme.- var theme = document.documentElement.getAttribute('data-theme') || 'dark';- var themeHost = document.querySelector('[data-theme="' + theme + '"]') || document.documentElement;- var computed = getComputedStyle(themeHost);- var vars = varNames.map(function (n) {- return n + ': ' + computed.getPropertyValue(n).trim() + ';';- }).join(' ');-- // IMPORTANT: inject the resolved variables AFTER hostStyle,- // otherwise hostStyle's ":root, [data-theme=\"dark\"] { ... }" rule- // overrides our chosen theme via later-in-cascade equal-specificity.- // Keep this order.- style.textContent =- fontFallback + "\n" +- "svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +- hostStyle + "\n" +- ":root, svg { " + vars + " }\n";-- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');- }-- clone.insertBefore(style, clone.firstChild);- clone.insertBefore(bgRect, style.nextSibling);-- return {- svgString: new XMLSerializer().serializeToString(clone),- width: vb.width * scale,- height: vb.height * scale- };- }-- function download(blob, filename) {- var url = URL.createObjectURL(blob);- var a = document.createElement('a');- a.href = url;- a.download = filename;- document.body.appendChild(a);- a.click();- a.remove();- setTimeout(function () { URL.revokeObjectURL(url); }, 1000);- }-- // Conservative upper bound on total canvas pixels. Older Safari on iOS- // silently produces a blank canvas above ~16 Mpx; Chrome / Firefox /- // desktop Safari are far higher but start failing on memory-constrained- // devices. We pick the largest integer scale in {4,3,2,1} whose target- // pixel count fits under this cap.- var MAX_CANVAS_PIXELS = 16 * 1024 * 1024;-- function pickSafeScale(vbW, vbH) {- for (var s = RASTER_SCALE; s >= 1; s--) {- if (vbW * s * vbH * s <= MAX_CANVAS_PIXELS) return s;- }- return 1;- }-- function rasterize(format) {- // Serialize at a safe scale (RASTER_SCALE=4 by default, reduced if the- // resulting canvas would exceed MAX_CANVAS_PIXELS). The SVG itself is- // rasterized at target resolution natively; drawImage draws at natural- // size — no upsampling blur.- var svg = document.querySelector('.diagram-container svg');- var vb = svg.viewBox.baseVal;- var scale = pickSafeScale(vb.width, vb.height);- var data = serializeSvg(scale);- var svgBlob = new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' });- var svgUrl = URL.createObjectURL(svgBlob);-- return new Promise(function (resolve, reject) {- var img = new Image();- img.onload = function () {- var canvas = document.createElement('canvas');- canvas.width = data.width;- canvas.height = data.height;- var ctx = canvas.getContext('2d');- if (format === 'jpeg') {- ctx.fillStyle = currentBg();- ctx.fillRect(0, 0, canvas.width, canvas.height);- }- // Draw at natural size — SVG was already rasterized at target res.- ctx.drawImage(img, 0, 0);- URL.revokeObjectURL(svgUrl);- var mime = format === 'jpeg' ? 'image/jpeg' :- format === 'webp' ? 'image/webp' : 'image/png';- var quality = format === 'png' ? undefined : 0.95;- canvas.toBlob(function (blob) {- if (!blob) reject(new Error('toBlob returned null for ' + format));- else resolve(blob);- }, mime, quality);- };- img.onerror = function (e) {- URL.revokeObjectURL(svgUrl);- reject(e);- };- img.src = svgUrl;- });- }-- var menu = document.getElementById('export-menu');- var btn = document.getElementById('btn-export');- var items = function () {- return Array.prototype.slice.call(menu.querySelectorAll('button[role="menuitem"]'));- };-- // ---- Clipboard support ----------------------------------------------- function canCopyImage() {- return typeof ClipboardItem !== 'undefined' &&- navigator.clipboard &&- typeof navigator.clipboard.write === 'function';- }-- // ---- Raster format detection ----------------------------------------- // canvas.toBlob('image/webp') silently returns a PNG on browsers without- // WebP encoding (older Safari), so detect explicitly.- function supports(format) {- if (format === 'svg' || format === 'png') return true;- var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';- try {- var c = document.createElement('canvas');- c.width = c.height = 2;- return c.toDataURL(mime).indexOf('data:' + mime) === 0;- } catch (_) { return false; }- }-- // Gray out unsupported items.- items().forEach(function (it) {- if (it.dataset.format && !supports(it.dataset.format)) {- it.disabled = true;- it.title = 'Not supported by this browser';- it.style.opacity = '0.5';- }- if (it.dataset.action === 'copy' && !canCopyImage()) {- it.disabled = true;- it.title = 'Clipboard image write not supported by this browser';- it.style.opacity = '0.5';- }- });-- // ---- Toast ----------------------------------------------------------- // A live region only announces CHANGES to an existing node, so the toast- // element is created once up front and updated in place.- var toastEl = document.createElement('div');- toastEl.className = 'archify-toast';- toastEl.setAttribute('role', 'status');- document.body.appendChild(toastEl);- var toastTimer = null;-- function toast(msg) {- toastEl.textContent = '';- requestAnimationFrame(function () {- toastEl.textContent = msg;- toastEl.classList.add('show');- });- clearTimeout(toastTimer);- toastTimer = setTimeout(function () { toastEl.classList.remove('show'); }, 1500);- }-- function open(focusLast) {- menu.classList.add('open');- btn.setAttribute('aria-expanded', 'true');- var available = items().filter(function (i) { return !i.disabled; });- var target = focusLast ? available[available.length - 1] : available[0];- if (target) target.focus();- }- function close(focusTrigger) {- menu.classList.remove('open');- btn.setAttribute('aria-expanded', 'false');- if (focusTrigger) btn.focus();- }- function isOpen() { return menu.classList.contains('open'); }-- btn.addEventListener('click', function (e) {- e.stopPropagation();- if (isOpen()) close(false);- else open();- });- // APG menu-button pattern: ArrowDown/ArrowUp on the trigger opens the menu.- btn.addEventListener('keydown', function (e) {- if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {- e.preventDefault();- if (!isOpen()) open(e.key === 'ArrowUp');- }- });- document.addEventListener('click', function (e) {- if (!menu.contains(e.target) && e.target !== btn) close(false);- });-- // Keyboard navigation inside the menu.- // Menu items: Up/Down, Home/End.- // Esc closes + returns focus to trigger; Tab closes.- menu.addEventListener('keydown', function (e) {- if (e.key === 'Escape') { e.preventDefault(); close(true); return; }- if (e.key === 'Tab') { close(false); return; }-- var available = items().filter(function (i) { return !i.disabled; });- var current = available.indexOf(document.activeElement);- switch (e.key) {- case 'ArrowDown':- e.preventDefault();- if (available.length) available[(current + 1 + available.length) % available.length].focus();- break;- case 'ArrowUp':- e.preventDefault();- if (available.length) available[(current - 1 + available.length) % available.length].focus();- break;- case 'Home':- e.preventDefault();- if (available[0]) available[0].focus();- break;- case 'End':- e.preventDefault();- if (available.length) available[available.length - 1].focus();- break;- }- });-- function runExport(format) {- var base = diagramFilename();- close(true);- return (format === 'svg'- ? Promise.resolve(serializeSvg(1, { autoTheme: true })).then(function (d) {- download(new Blob([d.svgString], { type: 'image/svg+xml;charset=utf-8' }), base + '.svg');- })- : rasterize(format).then(function (blob) {- download(blob, base + '.' + format);- })- ).catch(function (err) {- console.error(err);- alert('Export failed: ' + (err && err.message ? err.message : format));- });- }-- function runCopy() {- close(true);- if (!canCopyImage()) {- alert('Clipboard image write not supported in this browser.');- return;- }- // WebKit requires ClipboardItem to be constructed synchronously inside- // the user gesture — pass the pending Promise<Blob> as the item value.- // Browsers that reject promise values throw synchronously; fall back- // to awaiting the blob first (works in Chromium/Firefox).- var blobPromise = rasterize('png');- var writePromise;- try {- writePromise = navigator.clipboard.write([new ClipboardItem({ 'image/png': blobPromise })]);- } catch (_) {- writePromise = blobPromise.then(function (blob) {- return navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })]);- });- }- return writePromise.then(function () {- toast('Copied PNG to clipboard');- }).catch(function (err) {- console.error(err);- alert('Copy failed: ' + (err && err.message ? err.message : 'unknown'));- });- }-- menu.addEventListener('click', function (e) {- var copyBtn = e.target.closest('button[data-action="copy"]');- if (copyBtn && !copyBtn.disabled) { runCopy(); return; }-- var formatBtn = e.target.closest('button[data-format]');- if (formatBtn && !formatBtn.disabled) { runExport(formatBtn.dataset.format); }- });-- Archify.exportMenu = { open: open, close: close, isOpen: isOpen, run: runExport };-- // Auto-open on page load for demo/screenshot purposes: ?openExport=1- // Wait for fonts (so the menu doesn't flash before typography lands)- // and paint before opening. Fallback timeout for browsers without the- // Font Loading API.- try {- if (new URLSearchParams(window.location.search).get('openExport') === '1') {- var openWhenReady = function () {- requestAnimationFrame(function () { requestAnimationFrame(open); });- };- if (document.fonts && document.fonts.ready) {- document.fonts.ready.then(openWhenReady);- } else {- setTimeout(openWhenReady, 200);- }- }- } catch (_) {}- })();-- /* ============================================================- Global keyboard shortcuts- T -> toggle theme- E -> open export menu- Ignored when focus is inside an input/textarea/contenteditable.- ============================================================ */- document.addEventListener('keydown', function (e) {- if (e.metaKey || e.ctrlKey || e.altKey) return;- var t = e.target;- if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return;- if (e.key === 't' || e.key === 'T') {- e.preventDefault();- Archify.theme.toggle();- } else if (e.key === 'e' || e.key === 'E') {- e.preventDefault();- if (!Archify.exportMenu.isOpen()) Archify.exportMenu.open();- }- });- </script>+ <p>This legacy example moved to <a href="workflow-agent-tool-call-rendered.html">workflow-agent-tool-call-rendered.html</a>.</p></body></html>diff --git a/integrations/deepseek-harness/README.md b/integrations/deepseek-harness/README.mdindex fac64050..9ea4469e 100644--- a/integrations/deepseek-harness/README.md+++ b/integrations/deepseek-harness/README.md@@ -4,7 +4,9 @@ Community DeepSeek Harness integration for [Archify](https://github.com/tt-a1i/av0.1.0 is experimental compatibility with developer-preview **`@deepseek-ai/[email protected]`** on Node.js **`^22.19.0 || >=24.0.0`**. It is not a stable cross-version guarantee.-The package is a Skill-only bundle: it inserts one filesystem Skill provider named `archify-plugin` and exposes a clean copy of the existing Archify Skill. It does not register native render/validate/deliver tools, a custom Web client, Produced Files chips, telemetry, network access, credentials handling, background services, or `prepare` / `install` / `postinstall` hooks.+The package is a Skill-only bundle: it inserts one filesystem Skill provider named `archify-plugin` and exposes the Archify 2.14 snapshot released with this package. It does not register native render/validate/deliver tools, a custom Web client, Produced Files chips, telemetry, network access, credentials handling, background services, or `prepare` / `install` / `postinstall` hooks.++Release maintenance is immutable: rebuilding `0.1.0` reads its payload from the `archify-dsh-v0.1.0` tag. Later Archify changes, including the embedded update notifier, are intentionally excluded until a separately authorized DSH release receives a new version.## Installdiff --git a/integrations/deepseek-harness/scripts/distribution-acceptance.mjs b/integrations/deepseek-harness/scripts/distribution-acceptance.mjsindex 7691954e..bd83445c 100644--- a/integrations/deepseek-harness/scripts/distribution-acceptance.mjs+++ b/integrations/deepseek-harness/scripts/distribution-acceptance.mjs@@ -12,6 +12,7 @@ const integrationRoot = path.resolve(here, '..');const repoRoot = path.resolve(integrationRoot, '..', '..');const PACKAGE_NAME = '@tt-a1i/archify-dsh';const PACKAGE_VERSION = '0.1.0';+const DSH_RELEASE_REF = 'archify-dsh-v0.1.0';const DSH_SPEC = '@deepseek-ai/[email protected]';const PROFILE = 'archify-dsh-acceptance';const DSH_RUNTIME_INSTALL_TIMEOUT = process.platform === 'win32' ? 600_000 : 300_000;@@ -70,39 +71,6 @@ function listRelativeFiles(root) {return files.sort();}-const CHECKOUT_TEXT_EXTENSIONS = new Set(['.html', '.json', '.md', '.mjs']);--function checkoutContentsEqual(file, left, right, normalizeTextEol) {- if (left.equals(right)) return true;- if (!normalizeTextEol) return false;- const isCheckoutText = path.basename(file) === 'LICENSE'- || CHECKOUT_TEXT_EXTENSIONS.has(path.extname(file).toLowerCase());- if (!isCheckoutText) return false;- return left.toString('utf8').replaceAll('\r\n', '\n')- === right.toString('utf8').replaceAll('\r\n', '\n');-}--function treesMatch(left, right, { normalizeTextEol = false } = {}) {- const leftFiles = listRelativeFiles(left);- const rightFiles = listRelativeFiles(right);- if (leftFiles.join('\n') !== rightFiles.join('\n')) {- return { ok: false, leftFiles, rightFiles };- }- for (const file of leftFiles) {- const leftPath = path.join(left, ...file.split('/'));- const rightPath = path.join(right, ...file.split('/'));- if (!checkoutContentsEqual(- file,- fs.readFileSync(leftPath),- fs.readFileSync(rightPath),- normalizeTextEol,- )) {- return { ok: false, file };- }- }- return { ok: true };-}-function parseDump(yaml) {const layers = [];const rows = [];@@ -399,12 +367,18 @@ pass('resource-base', { resourcePath: resourceReal });const skillRoot = fs.existsSync(path.join(resourceReal, 'SKILL.md'))? resourceReal: path.join(resourceReal, 'archify');-const smoke = run(process.execPath, [path.join(repoRoot, 'scripts', 'package-smoke.mjs'), skillRoot], {+const taggedSmoke = run('git', ['show', `${DSH_RELEASE_REF}:scripts/package-smoke.mjs`], {+ cwd: repoRoot,+});+requireStatus('package-smoke', taggedSmoke, { command: `git show ${DSH_RELEASE_REF}:scripts/package-smoke.mjs` });+const taggedSmokePath = path.join(scratch, 'package-smoke-v0.1.0.mjs');+fs.writeFileSync(taggedSmokePath, taggedSmoke.stdout);+const smoke = run(process.execPath, [taggedSmokePath, skillRoot], {cwd: repoRoot,timeout: 120_000,});-requireStatus('package-smoke', smoke, { command: 'package-smoke.mjs <installed-skill-root>' });-pass('package-smoke', { skillRoot, output: smoke.stdout.trim() });+requireStatus('package-smoke', smoke, { command: `${DSH_RELEASE_REF} package-smoke.mjs <installed-skill-root>` });+pass('package-smoke', { skillRoot, source: DSH_RELEASE_REF, output: smoke.stdout.trim() });const remove = dsh(['plugin', '--profile', PROFILE, 'remove', PACKAGE_NAME], { timeout: PLUGIN_MUTATION_TIMEOUT });requireStatus('uninstall', remove, { command: `dsh plugin --profile ${PROFILE} remove ${PACKAGE_NAME}` });@@ -429,20 +403,20 @@ const zipBlob = run('git', ['hash-object', 'archify.zip'], { cwd: repoRoot });const pkgBlob = run('git', ['hash-object', 'archify/package.json'], { cwd: repoRoot });const skipFreshZipRebuild = process.platform === 'win32';const committedZip = path.join(repoRoot, 'archify.zip');-const packedSkill = path.join(inspectRoot, 'package', 'skills', 'archify');-let unzipContentsIdentical = false;+let unzipContentsIdentical = 'not-asserted';let canonicalZipBytes = 'not-asserted';if (skipFreshZipRebuild) {- receipt.zipContainerNote = 'Windows validates committed ZIP contents with checkout text EOL normalization; canonical container-byte reproduction is owned by Linux CI.';+ receipt.zipContainerNote = 'Windows extracts and smokes the committed ZIP; canonical rebuild and fresh-vs-committed equality are owned by Linux CI.';const checkedDir = path.join(scratch, 'checked');fs.mkdirSync(checkedDir);fs.copyFileSync(committedZip, path.join(checkedDir, 'committed.zip'));requireStatus('zero-regression', run('tar', ['-xf', 'committed.zip'], { cwd: checkedDir }));- const compared = treesMatch(packedSkill, path.join(checkedDir, 'archify'), { normalizeTextEol: true });- if (!compared.ok) {- fail('zero-regression', 'packed skill drifted from the committed ZIP', compared);- }- unzipContentsIdentical = true;+ const currentSmoke = run(process.execPath, [+ path.join(repoRoot, 'scripts', 'package-smoke.mjs'),+ path.join(checkedDir, 'archify'),+ ], { cwd: repoRoot, timeout: 120_000 });+ requireStatus('zero-regression', currentSmoke, { command: 'current package-smoke.mjs <committed-zip-skill-root>' });+ unzipContentsIdentical = 'not-asserted-on-windows';} else {const freshZip = path.join(scratch, 'fresh.zip');const freshDir = path.join(scratch, 'fresh');diff --git a/integrations/deepseek-harness/scripts/pack.mjs b/integrations/deepseek-harness/scripts/pack.mjsindex aa4c0706..477bab22 100644--- a/integrations/deepseek-harness/scripts/pack.mjs+++ b/integrations/deepseek-harness/scripts/pack.mjs@@ -9,15 +9,14 @@ import { spawnCliSync } from './resolve-cli.mjs';const here = path.dirname(fileURLToPath(import.meta.url));const integrationRoot = path.resolve(here, '..');const repoRoot = path.resolve(integrationRoot, '..', '..');-const archifySource = path.join(repoRoot, 'archify');+const DSH_RELEASE_REF = 'archify-dsh-v0.1.0';function argValue(flag) {const index = process.argv.indexOf(flag);return index === -1 ? undefined : process.argv[index + 1];}-function excludeFromCleanSkill(sourceRoot, src) {- const relative = path.relative(sourceRoot, src);+function excludeFromCleanSkill(relative) {if (!relative || relative === '.') return false;const parts = relative.split(path.sep);if (parts.includes('node_modules')) return true;@@ -31,28 +30,51 @@ function excludeFromCleanSkill(sourceRoot, src) {return false;}-function trackedArchifyFiles() {- const tracked = spawnCliSync('git', ['ls-files', '-z', '--', 'archify'], {+function releaseSnapshot(destination) {+ const archive = spawnCliSync('git', ['archive', '--format=tar', DSH_RELEASE_REF], {cwd: repoRoot,+ encoding: null,+ maxBuffer: 128 * 1024 * 1024,+ });+ if (archive.status !== 0) {+ throw new Error(`unable to read immutable DSH source ${DSH_RELEASE_REF}: ${archive.stderr?.toString('utf8') || archive.error?.message}`);+ }+ const extracted = spawnCliSync('tar', ['-xf', '-', '-C', destination], {+ cwd: repoRoot,+ input: archive.stdout,encoding: 'utf8',+ maxBuffer: 16 * 1024 * 1024,});- if (tracked.status !== 0) {- throw new Error(`unable to enumerate tracked Archify files: ${tracked.stderr || tracked.error?.message}`);+ if (extracted.status !== 0) {+ throw new Error(`unable to extract immutable DSH source ${DSH_RELEASE_REF}: ${extracted.stderr || extracted.error?.message}`);+ }+}++function regularFiles(root, directory = root) {+ const files = [];+ for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {+ const source = path.join(directory, entry.name);+ if (entry.isDirectory()) {+ files.push(...regularFiles(root, source));+ } else if (entry.isFile()) {+ files.push({ source, relative: path.relative(root, source) });+ } else {+ throw new Error(`immutable DSH source contains unsupported entry: ${path.relative(root, source)}`);+ }}- return tracked.stdout.split('\0').filter(Boolean);+ return files;}-function stageCleanArchify(dest) {- const validators = path.join(archifySource, 'renderers/shared/generated-validators.mjs');+function stageCleanArchify(sourceRoot, dest) {+ const validators = path.join(sourceRoot, 'renderers/shared/generated-validators.mjs');if (!fs.existsSync(validators)) {- throw new Error('generated validators are missing — run npm run generate:validators in archify/');+ throw new Error(`generated validators are missing from ${DSH_RELEASE_REF}`);}- for (const repoRelative of trackedArchifyFiles()) {- const src = path.join(repoRoot, ...repoRelative.split('/'));- if (excludeFromCleanSkill(archifySource, src)) continue;- const destination = path.join(dest, path.relative(archifySource, src));+ for (const { source, relative } of regularFiles(sourceRoot)) {+ if (excludeFromCleanSkill(relative)) continue;+ const destination = path.join(dest, relative);fs.mkdirSync(path.dirname(destination), { recursive: true });- fs.copyFileSync(src, destination);+ fs.copyFileSync(source, destination);}const packagePath = path.join(dest, 'package.json');const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8'));@@ -65,14 +87,17 @@ function stageCleanArchify(dest) {const json = process.argv.includes('--json');const out = argValue('--out');const stage = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-dsh-pack-'));+const snapshot = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-dsh-source-'));try {- stageCleanArchify(path.join(stage, 'skills', 'archify'));- fs.copyFileSync(path.join(integrationRoot, 'package.json'), path.join(stage, 'package.json'));- fs.copyFileSync(path.join(integrationRoot, 'cordis.patch.yml'), path.join(stage, 'cordis.patch.yml'));- fs.cpSync(path.join(integrationRoot, 'lib'), path.join(stage, 'lib'), { recursive: true });- fs.copyFileSync(path.join(integrationRoot, 'README.md'), path.join(stage, 'README.md'));- fs.copyFileSync(path.join(repoRoot, 'LICENSE'), path.join(stage, 'LICENSE'));+ releaseSnapshot(snapshot);+ const releaseIntegration = path.join(snapshot, 'integrations', 'deepseek-harness');+ stageCleanArchify(path.join(snapshot, 'archify'), path.join(stage, 'skills', 'archify'));+ fs.copyFileSync(path.join(releaseIntegration, 'package.json'), path.join(stage, 'package.json'));+ fs.copyFileSync(path.join(releaseIntegration, 'cordis.patch.yml'), path.join(stage, 'cordis.patch.yml'));+ fs.cpSync(path.join(releaseIntegration, 'lib'), path.join(stage, 'lib'), { recursive: true });+ fs.copyFileSync(path.join(releaseIntegration, 'README.md'), path.join(stage, 'README.md'));+ fs.copyFileSync(path.join(snapshot, 'LICENSE'), path.join(stage, 'LICENSE'));const packed = spawnCliSync('npm', ['pack', '--json', '--pack-destination', stage], {cwd: stage,@@ -122,4 +147,5 @@ try {else process.stdout.write(`${destination}\n`);} finally {fs.rmSync(stage, { recursive: true, force: true });+ fs.rmSync(snapshot, { recursive: true, force: true });}diff --git a/integrations/deepseek-harness/test/docs-contract.test.mjs b/integrations/deepseek-harness/test/docs-contract.test.mjsindex a3febfff..49231baa 100644--- a/integrations/deepseek-harness/test/docs-contract.test.mjs+++ b/integrations/deepseek-harness/test/docs-contract.test.mjs@@ -15,6 +15,13 @@ test('README.md and README_EN.md stay byte-identical after the DSH docs', () =>assert.equal(read('README.md'), read('README_EN.md'));});+test('DSH 0.1.0 documentation keeps its released Skill snapshot immutable', () => {+ const integration = read('integrations/deepseek-harness/README.md');+ assert.match(integration, /Archify 2\.14 snapshot/);+ assert.match(integration, /archify-dsh-v0\.1\.0/);+ assert.match(integration, /update notifier[\s\S]*intentionally excluded/);+});+test('English and Chinese docs cover install, invoke, uninstall, community wording, and Produced Files', () => {const english = [read('README.md'), read('integrations/deepseek-harness/README.md')].join('\n');const chinese = [read('README_ZH.md'), read('integrations/deepseek-harness/README.md')].join('\n');diff --git a/integrations/deepseek-harness/test/tarball-contract.test.mjs b/integrations/deepseek-harness/test/tarball-contract.test.mjsindex 37cf7b14..70996010 100644--- a/integrations/deepseek-harness/test/tarball-contract.test.mjs+++ b/integrations/deepseek-harness/test/tarball-contract.test.mjs@@ -10,6 +10,7 @@ const here = path.dirname(fileURLToPath(import.meta.url));const integrationRoot = path.resolve(here, '..');const repoRoot = path.resolve(integrationRoot, '..', '..');const packScript = path.join(integrationRoot, 'scripts', 'pack.mjs');+const DSH_RELEASE_REF = 'archify-dsh-v0.1.0';const FORBIDDEN = ['/test/',@@ -55,6 +56,13 @@ test('pack command emits a real npm tarball with the expected identity and file}const skillEntries = files.filter((file) => file === 'skills/archify/SKILL.md' || file.endsWith('/SKILL.md'));assert.deepEqual(skillEntries, ['skills/archify/SKILL.md']);+ for (const notifierFile of [+ 'skills/archify/skill-release.json',+ 'skills/archify/scripts/check-update.mjs',+ 'skills/archify/scripts/update-contract.mjs',+ ]) {+ assert.equal(files.includes(notifierFile), false, `DSH 0.1.0 must not contain ${notifierFile}`);+ }for (const file of files) {for (const forbidden of FORBIDDEN) {assert.equal(file.includes(forbidden), false, `tarball contains forbidden ${file}`);@@ -66,11 +74,11 @@ test('pack command emits a real npm tarball with the expected identity and file}});-test('packed Skill payload matches the existing ZIP clean-staging contract', () => {+test('packed Skill payload remains byte-identical to the DSH 0.1.0 release tag', () => {const { scratch, out, result } = packTarball();- const zipScratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-dsh-zip-stage-'));try {assert.equal(result.status, 0, result.stderr || result.stdout);+ const receipt = JSON.parse(result.stdout);const packedRoot = path.join(scratch, 'packed');fs.mkdirSync(packedRoot);const tar = spawnSync('tar', ['-xzf', path.basename(out), '-C', packedRoot], {@@ -78,24 +86,31 @@ test('packed Skill payload matches the existing ZIP clean-staging contract', ()encoding: 'utf8',});assert.equal(tar.status, 0, tar.stderr);- const zipPath = path.join(zipScratch, 'archify.zip');- const zip = spawnSync('bash', [path.join(repoRoot, 'scripts', 'build-zip.sh'), zipPath], {- cwd: repoRoot,- encoding: 'utf8',- });- assert.equal(zip.status, 0, zip.stderr);- const zipRoot = path.join(zipScratch, 'unzipped');- fs.mkdirSync(zipRoot);- const unzip = spawnSync('unzip', ['-q', zipPath, '-d', zipRoot], { encoding: 'utf8' });- assert.equal(unzip.status, 0, unzip.stderr);- const diff = spawnSync('diff', [- '-r',- path.join(packedRoot, 'package', 'skills', 'archify'),- path.join(zipRoot, 'archify'),- ], { encoding: 'utf8' });- assert.equal(diff.status, 0, diff.stdout || diff.stderr);+ const skillRoot = path.join(packedRoot, 'package', 'skills', 'archify');+ const skillFiles = receipt.files+ .map((file) => file.path.replace(/^package\//, ''))+ .filter((file) => file.startsWith('skills/archify/'))+ .filter((file) => file !== 'skills/archify/package.json');+ for (const packagedPath of skillFiles) {+ const relative = packagedPath.slice('skills/archify/'.length);+ const tagged = spawnSync('git', [+ 'show',+ `${DSH_RELEASE_REF}:archify/${relative}`,+ ], {+ cwd: repoRoot,+ encoding: null,+ });+ assert.equal(tagged.status, 0, tagged.stderr?.toString('utf8'));+ assert.deepEqual(+ fs.readFileSync(path.join(skillRoot, ...relative.split('/'))),+ tagged.stdout,+ `${packagedPath} differs from ${DSH_RELEASE_REF}`,+ );+ }+ const skillPackage = JSON.parse(fs.readFileSync(path.join(skillRoot, 'package.json'), 'utf8'));+ assert.equal(skillPackage.version, '2.14.0');+ assert.doesNotMatch(fs.readFileSync(path.join(skillRoot, 'SKILL.md'), 'utf8'), /## Update awareness/);} finally {fs.rmSync(scratch, { recursive: true, force: true });- fs.rmSync(zipScratch, { recursive: true, force: true });}});diff --git a/scripts/build-zip.sh b/scripts/build-zip.shindex ec903697..c6c863e5 100755--- a/scripts/build-zip.sh+++ b/scripts/build-zip.sh@@ -21,71 +21,14 @@ if [[ "$node_major" != "$canonical_node_major" ]]; thenexit 1fi-# Stage only files tracked by Git. Paths and modes come from the index, while-# bytes intentionally come from the working tree so contributors can package-# tracked edits before committing them. A conflicted index is never publishable.-# Rejecting tracked paths that are symlinks prevents an archive build from-# reading through links to content outside the repository.-# test/ is repo-only (the golden harness compares against ../examples at the-# repo root, which does not exist in an installed skill). The npm scripts and-# build-only dependencies are stripped from the shipped package.json. Runtime-# schema validation is provided by the committed standalone validators, so-# installing the skill never requires npm install.+# The shared stager owns tracked-only selection, index modes, conflict and+# symlink rejection, repository-only exclusions, and package.json cleanup for+# both the ZIP and DeepSeek Harness tarball.stage="$(mktemp -d)"trap 'rm -rf "$stage"' EXIT-if [[ ! -f "$repo_root/archify/renderers/shared/generated-validators.mjs" ]]; then- echo 'generated validators are missing — run npm run generate:validators in archify/' >&2- exit 1-fi-while IFS= read -r -d '' record; do- metadata="${record%%$'\t'*}"- tracked="${record#*$'\t'}"- tracked_mode="${metadata%% *}"- tracked_stage="${metadata##* }"- if [[ "$tracked_stage" != 0 ]]; then- echo "refusing to package unmerged index entry (stage $tracked_stage): $tracked" >&2- exit 1- fi- case "$tracked" in- archify/test | archify/test/* | \- archify/package-lock.json | \- archify/scripts/generate-brand-marks.mjs | \- archify/scripts/generate-validators.mjs)- continue- ;;- esac-- source="$repo_root/$tracked"- if [[ -L "$source" ]]; then- echo "refusing to package tracked symlink: $tracked" >&2- exit 1- fi- if [[ ! -f "$source" ]]; then- echo "tracked package input is missing or not a regular file: $tracked" >&2- exit 1- fi-- target="$stage/$tracked"- mkdir -p "$(dirname "$target")"- cp "$source" "$target"- case "$tracked_mode" in- 100755) chmod 0755 "$target" ;;- 100644) chmod 0644 "$target" ;;- *)- echo "unsupported tracked package mode $tracked_mode: $tracked" >&2- exit 1- ;;- esac-done < <(git -C "$repo_root" ls-files --stage -z -- archify)-node -e "- const fs = require('fs');- const p = '$stage/archify/package.json';- const pkg = JSON.parse(fs.readFileSync(p, 'utf8'));- delete pkg.scripts;- delete pkg.devDependencies;- fs.writeFileSync(p, JSON.stringify(pkg, null, 2) + '\n');-"-rm -f "$stage/archify/package-lock.json"+node "$repo_root/scripts/stage-clean-skill.mjs" \+ --root "$repo_root" \+ --dest "$stage/archify" >/dev/nullnode "$repo_root/scripts/write-deterministic-zip.mjs" "$stage/archify" "$out"diff --git a/scripts/check-release-identity.mjs b/scripts/check-release-identity.mjsindex b2d3bc8f..013346f8 100644--- a/scripts/check-release-identity.mjs+++ b/scripts/check-release-identity.mjs@@ -4,6 +4,14 @@ import fs from 'node:fs';import path from 'node:path';import { fileURLToPath } from 'node:url';+import {+ compareSemver,+ isStableCoreVersion,+ parseSemver,+ validateLocalRelease,+ validateStableUpdateManifest,+} from '../archify/scripts/update-contract.mjs';+const scriptRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');const rootFlag = process.argv.indexOf('--root');const repoRoot = rootFlag === -1 ? scriptRoot : path.resolve(process.argv[rootFlag + 1] || '');@@ -33,11 +41,32 @@ function readJson(relativePath) {}}-function compareCore(left, right) {- for (let index = 0; index < 3; index += 1) {- if (left[index] !== right[index]) return left[index] - right[index];+function checkSkillRelease(value, version, isDevelopment) {+ const expectedChannel = isDevelopment ? 'development' : 'stable';+ try {+ const release = validateLocalRelease(value);+ if (release.version === version && release.channel === expectedChannel) return;+ } catch {+ // Report the repository-specific cross-artifact requirement below.+ }+ fail(`archify/skill-release.json must identify archify ${version} as ${expectedChannel}, use the official repository, and pin the trusted update manifest URL.`);+}++function checkStableUpdateManifest(value, expectedVersion, previousVersion, packageVersion, isDevelopment) {+ try {+ const manifest = validateStableUpdateManifest(value);+ const allowedVersions = isDevelopment+ ? [expectedVersion]+ : [expectedVersion, previousVersion].filter(Boolean);+ if (expectedVersion && allowedVersions.includes(manifest.version)+ && (isDevelopment || packageVersion === expectedVersion)) return;+ } catch {+ // Report the repository-specific cross-artifact requirement below.}- return 0;+ const releaseWindow = !isDevelopment && previousVersion+ ? `newest stable v${expectedVersion} or immediate prior v${previousVersion} during the enforced post-Release publication window`+ : `newest published stable v${expectedVersion || '(missing)'}`;+ fail(`docs/skill-updates/archify/stable.json must describe the ${releaseWindow} with the fixed repository, immutable tree/archive digests, and official release-notes URL.`);}function shieldEscape(value) {@@ -145,29 +174,53 @@ const nextRelease = afterUnreleased.search(/^## \[/m);const unreleased = nextRelease === -1 ? afterUnreleased : afterUnreleased.slice(0, nextRelease);const hasRealUnreleasedChanges = /^\s*-\s+\S/m.test(unreleased);const version = packageJson.version;-const semver = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(version);-const isDevelopment = Boolean(semver?.[4]);+let parsedVersion = null;+try {+ parsedVersion = parseSemver(version);+} catch {+ // The consolidated error below owns package-version policy reporting.+}+const supportedPrerelease = parsedVersion?.prerelease === null+ || (parsedVersion?.prerelease?.length === 2+ && parsedVersion.prerelease[0] === 'dev'+ && /^\d+$/.test(parsedVersion.prerelease[1]));+const hasSupportedVersion = Boolean(parsedVersion && parsedVersion.build === null && supportedPrerelease);+const isDevelopment = Boolean(hasSupportedVersion && parsedVersion.prerelease);+const publishedLabels = [...changelog.matchAll(/^## \[([^\]]+)\]/gm)]+ .map((match) => match[1])+ .filter((label) => label !== 'Unreleased');+for (const label of publishedLabels) {+ if (!isStableCoreVersion(label)) fail(`CHANGELOG published version is not stable SemVer: ${label}.`);+}+const stableLabels = publishedLabels+ .filter(isStableCoreVersion)+ .sort((left, right) => compareSemver(right, left));+const newestStableLabel = stableLabels[0] ?? null;+const previousStableLabel = stableLabels[1] ?? null;-if (!semver) {+if (!hasSupportedVersion) {fail(`package version is not a supported SemVer identity: ${JSON.stringify(version)}`);-} else if (hasRealUnreleasedChanges && !semver[4]) {+} else if (hasRealUnreleasedChanges && !isDevelopment) {fail(`Unreleased changes require a prerelease package version; found stable ${version}.`);}-if (semver && hasRealUnreleasedChanges) {- if (semver[4] && !/^dev\.\d+$/.test(semver[4])) {- fail(`Unreleased development identity must use a dev.N prerelease; found ${version}.`);- }- const published = [...changelog.matchAll(/^## \[(\d+)\.(\d+)\.(\d+)\]/gm)]- .map((match) => match.slice(1, 4).map(Number));- const newestPublished = published.sort((left, right) => compareCore(right, left))[0];- const currentCore = semver.slice(1, 4).map(Number);- if (newestPublished && compareCore(currentCore, newestPublished) <= 0) {- fail(`Unreleased package core ${currentCore.join('.')} must be newer than published ${newestPublished.join('.')}.`);+if (hasSupportedVersion && hasRealUnreleasedChanges) {+ const currentCore = parsedVersion.core.join('.');+ if (newestStableLabel && compareSemver(currentCore, newestStableLabel) <= 0) {+ fail(`Unreleased package core ${currentCore} must be newer than published ${newestStableLabel}.`);}}-if (semver) {+if (hasSupportedVersion) {+ checkSkillRelease(readJson('archify/skill-release.json'), version, isDevelopment);+ checkStableUpdateManifest(+ readJson('docs/skill-updates/archify/stable.json'),+ newestStableLabel,+ previousStableLabel,+ version,+ isDevelopment,+ );+const lock = readJson('archify/package-lock.json');if (lock.version !== version || lock.packages?.['']?.version !== version) {fail(`archify/package-lock.json must match ${version} at the root and packages[""].`);@@ -175,7 +228,7 @@ if (semver) {const skill = read('archify/SKILL.md');const skillVersion = skill.match(/^\s*version:\s*["']?([^"'\s]+)["']?\s*$/m)?.[1];- const expectedSkillVersion = `${semver[1]}.${semver[2]}`;+ const expectedSkillVersion = `${parsedVersion.core[0]}.${parsedVersion.core[1]}`;if (skillVersion !== expectedSkillVersion) {fail(`archify/SKILL.md metadata version ${skillVersion || '(missing)'} must map to package ${version} as ${expectedSkillVersion}.`);}@@ -198,7 +251,6 @@ if (semver) {checkRavenBoundary('README_ZH.md', chinese, 'zh');if (english !== englishMirror) fail('README_EN.md must remain byte-identical to README.md.');- const newestStableLabel = [...changelog.matchAll(/^## \[(\d+\.\d+\.\d+)\]/gm)][0]?.[1];if (newestStableLabel && isDevelopment) {const stableMinor = newestStableLabel.split('.').slice(0, 2).join('\\.');if (new RegExp(`Archify ${stableMinor} includes\\b`).test(english)diff --git a/scripts/check-stable-update-manifest.mjs b/scripts/check-stable-update-manifest.mjsnew file mode 100644index 00000000..88f2bdf5--- /dev/null+++ b/scripts/check-stable-update-manifest.mjs@@ -0,0 +1,125 @@+#!/usr/bin/env node++import crypto from 'node:crypto';+import { execFileSync } from 'node:child_process';+import fs from 'node:fs';+import path from 'node:path';+import { fileURLToPath } from 'node:url';++import { validateStableUpdateManifest } from '../archify/scripts/update-contract.mjs';++const scriptRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');++function argument(name, fallback = null) {+ const index = process.argv.indexOf(name);+ return index === -1 ? fallback : process.argv[index + 1] || null;+}++const repoRoot = path.resolve(argument('--root', scriptRoot));+const archivePath = argument('--archive');+const tag = argument('--tag', process.env.GITHUB_REF_NAME || null);+const sourceRef = argument('--source-ref', 'HEAD');+const failures = [];++function fail(message) {+ failures.push(message);+}++function readJson(relativePath) {+ try {+ return JSON.parse(fs.readFileSync(path.join(repoRoot, relativePath), 'utf8'));+ } catch {+ fail(`${relativePath} is missing or invalid JSON.`);+ return {};+ }+}++if (!archivePath) fail('--archive is required.');+const version = /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.exec(tag || '')+ ?.slice(1, 4).join('.') ?? null;+if (!version) fail(`--tag must be a stable vMAJOR.MINOR.PATCH tag; found ${JSON.stringify(tag)}.`);+if (sourceRef !== 'HEAD' && sourceRef !== tag) {+ fail(`--source-ref must be HEAD or the exact release tag ${JSON.stringify(tag)}; found ${JSON.stringify(sourceRef)}.`);+}++const packageJson = readJson('archify/package.json');+const manifest = readJson('docs/skill-updates/archify/stable.json');+if (version && sourceRef === 'HEAD' && packageJson?.version !== version) {+ fail(`archify/package.json ${packageJson?.version || '(missing)'} does not match ${tag}.`);+}++if (version) {+ try {+ const validated = validateStableUpdateManifest(manifest);+ if (validated.version !== version || validated.source.ref !== tag) {+ fail(`stable update manifest identity does not match ${tag}.`);+ }+ } catch {+ fail(`stable update manifest identity does not match ${tag}.`);+ }+}++let taggerTime = null;+if (version) {+ const tagRef = `refs/tags/${tag}`;+ try {+ const objectType = execFileSync('git', ['-C', repoRoot, 'cat-file', '-t', tagRef], {+ encoding: 'utf8',+ stdio: ['ignore', 'pipe', 'pipe'],+ }).trim();+ if (objectType !== 'tag') {+ fail(`${tag} must be an annotated tag; found Git object type ${objectType || '(missing)'}.`);+ } else {+ const epochSource = execFileSync('git', [+ '-C', repoRoot,+ 'for-each-ref',+ '--format=%(taggerdate:unix)',+ tagRef,+ ], {+ encoding: 'utf8',+ stdio: ['ignore', 'pipe', 'pipe'],+ }).trim();+ if (!/^\d+$/.test(epochSource)) throw new Error('tagger time is missing');+ const epochSeconds = Number(epochSource);+ if (!Number.isSafeInteger(epochSeconds)) throw new Error('tagger time is out of range');+ taggerTime = new Date(epochSeconds * 1_000).toISOString().replace('.000Z', 'Z');+ }+ } catch {+ fail(`could not resolve annotated tag metadata for ${tag}.`);+ }+}+if (taggerTime && manifest?.publishedAt !== taggerTime) {+ fail(`stable update manifest publishedAt ${manifest?.publishedAt || '(missing)'} does not match annotated tagger time ${taggerTime}.`);+}++let treeSha = null;+try {+ treeSha = execFileSync('git', ['-C', repoRoot, 'rev-parse', `${sourceRef}:archify`], {+ encoding: 'utf8',+ stdio: ['ignore', 'pipe', 'pipe'],+ }).trim();+} catch {+ fail(`could not resolve the release Skill tree at ${sourceRef}.`);+}+if (treeSha && manifest?.source?.treeSha !== treeSha) {+ fail(`stable update manifest treeSha ${manifest?.source?.treeSha || '(missing)'} does not match ${sourceRef}:archify ${treeSha}.`);+}++let archiveSha = null;+if (archivePath) {+ try {+ archiveSha = crypto.createHash('sha256').update(fs.readFileSync(path.resolve(archivePath))).digest('hex');+ } catch {+ fail(`release archive is missing or unreadable: ${archivePath}.`);+ }+}+if (archiveSha && manifest?.artifact?.sha256 !== archiveSha) {+ fail(`stable update manifest archive sha256 ${manifest?.artifact?.sha256 || '(missing)'} does not match ${archiveSha}.`);+}++if (failures.length > 0) {+ for (const message of failures) console.error(`stable update manifest: ${message}`);+ process.exit(1);+}++console.log(`stable update manifest ok: ${tag} tree ${treeSha} archive ${archiveSha}`);diff --git a/scripts/package-smoke.mjs b/scripts/package-smoke.mjsindex bd82b7f8..76847d03 100644--- a/scripts/package-smoke.mjs+++ b/scripts/package-smoke.mjs@@ -4,7 +4,7 @@ import { spawnSync } from 'node:child_process';import fs from 'node:fs';import os from 'node:os';import path from 'node:path';-import { fileURLToPath } from 'node:url';+import { fileURLToPath, pathToFileURL } from 'node:url';const __dirname = path.dirname(fileURLToPath(import.meta.url));const repoRoot = path.resolve(__dirname, '..');@@ -13,6 +13,8 @@ const defaultPackageRoot = process.env.RUNNER_TEMP: path.join(repoRoot, 'archify');const skillRoot = path.resolve(process.argv[2] || defaultPackageRoot);const cli = path.join(skillRoot, 'bin', 'archify.mjs');+const updateChecker = path.join(skillRoot, 'scripts', 'check-update.mjs');+const updateContract = path.join(skillRoot, 'scripts', 'update-contract.mjs');const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-package-smoke-'));function requireAbsent(relative) {@@ -57,6 +59,13 @@ try {requireAbsent('.hive');requireAbsent('.workbuddy');+ if (!fs.existsSync(updateChecker)) {+ throw new Error(`packaged update checker not found at ${updateChecker}`);+ }+ if (!fs.existsSync(updateContract)) {+ throw new Error(`packaged update contract not found at ${updateContract}`);+ }+const packageJson = JSON.parse(fs.readFileSync(path.join(skillRoot, 'package.json'), 'utf8'));const dependencyFields = ['dependencies',@@ -73,6 +82,79 @@ try {throw new Error(`packaged skill must not declare dependency metadata: ${declaredDependencyField}`);}+ const skillRelease = JSON.parse(fs.readFileSync(path.join(skillRoot, 'skill-release.json'), 'utf8'));+ const contract = await import(pathToFileURL(updateContract).href);+ let validatedRelease;+ try {+ validatedRelease = contract.validateLocalRelease(skillRelease);+ } catch {+ throw new Error('packaged skill-release.json violates the shared update contract');+ }+ if (validatedRelease.version !== packageJson.version) {+ throw new Error('packaged skill-release.json does not match the package release identity');+ }++ const updateCheck = spawnSync(process.execPath, [updateChecker], {+ cwd: skillRoot,+ encoding: 'utf8',+ env: { ...process.env, ARCHIFY_UPDATE_CHECK_DISABLED: '1' },+ });+ if (updateCheck.status !== 0) {+ throw new Error(`packaged update checker failed with ${updateCheck.status}\n${updateCheck.stderr}`);+ }+ let updateReceipt;+ try {+ updateReceipt = JSON.parse(updateCheck.stdout);+ } catch {+ throw new Error('packaged update checker did not return valid JSON');+ }+ if (updateReceipt.status !== 'silent' || updateReceipt.reason !== 'disabled') {+ throw new Error('packaged update checker did not honor the local disable switch');+ }++ const checker = await import(pathToFileURL(updateChecker).href);+ const versionCore = /^(\d+)\.(\d+)\.(\d+)/.exec(packageJson.version);+ if (!versionCore) throw new Error('package version cannot produce an update-check smoke candidate');+ const candidateVersion = `${versionCore[1]}.${versionCore[2]}.${BigInt(versionCore[3]) + 1n}`;+ const candidate = {+ schemaVersion: 1,+ skillId: 'archify',+ channel: 'stable',+ version: candidateVersion,+ publishedAt: '2026-08-28T00:00:00Z',+ source: {+ repository: 'https://github.com/tt-a1i/archify',+ ref: `v${candidateVersion}`,+ treeSha: 'a'.repeat(40),+ },+ artifact: { sha256: 'b'.repeat(64) },+ summary: 'Package smoke candidate.',+ releaseNotes: `https://github.com/tt-a1i/archify/releases/tag/v${candidateVersion}`,+ severity: 'normal',+ };+ const notifierCache = path.join(scratch, 'update-cache');+ const notifierReceipt = await checker.checkForUpdate({+ cacheDirectory: notifierCache,+ fetchImpl: async () => new Response(JSON.stringify(candidate), {+ status: 200,+ headers: { 'content-type': 'application/json', etag: '"package-smoke"' },+ }),+ now: () => Date.parse('2026-08-28T00:00:00Z'),+ random: () => 0.5,+ });+ if (notifierReceipt.status !== 'update_available') {+ throw new Error(`packaged update checker did not return an update candidate: ${JSON.stringify(notifierReceipt)}`);+ }+ const notifierAcknowledgement = await checker.acknowledgeUpdate({+ releasePath: path.join(skillRoot, 'skill-release.json'),+ cacheDirectory: notifierCache,+ eventKey: notifierReceipt.eventKey,+ now: () => Date.parse('2026-08-28T00:00:01Z'),+ });+ if (notifierAcknowledgement.status !== 'acknowledged') {+ throw new Error('packaged update checker did not persist a visible-notice acknowledgement');+ }+const skill = fs.readFileSync(path.join(skillRoot, 'SKILL.md'), 'utf8');const skillReferences = [...skill.matchAll(/`((?:assets|bin|examples|recipes|references|renderers|schemas|scripts)\/[^`\s]+)`/g,diff --git a/scripts/stage-clean-skill.mjs b/scripts/stage-clean-skill.mjsnew file mode 100644index 00000000..4bbf93c6--- /dev/null+++ b/scripts/stage-clean-skill.mjs@@ -0,0 +1,246 @@+#!/usr/bin/env node++import { spawnSync } from 'node:child_process';+import fs from 'node:fs';+import path from 'node:path';+import { fileURLToPath } from 'node:url';++const scriptRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const REQUIRED_INPUTS = new Set([+ 'archify/renderers/shared/generated-validators.mjs',+ 'archify/scripts/check-update.mjs',+ 'archify/scripts/update-contract.mjs',+ 'archify/skill-release.json',+]);+const EXCLUDED_FILES = new Set([+ 'archify/package-lock.json',+ 'archify/scripts/generate-brand-marks.mjs',+ 'archify/scripts/generate-validators.mjs',+]);+const EXCLUDED_SEGMENTS = new Set([+ '.DS_Store',+ '.hive',+ '.workbuddy',+ 'node_modules',+]);++function argument(name, fallback = null) {+ const index = process.argv.indexOf(name);+ return index === -1 ? fallback : process.argv[index + 1] || null;+}++function decodeGitOutput(value) {+ try {+ return new TextDecoder('utf-8', { fatal: true }).decode(value);+ } catch {+ throw new Error('tracked Archify paths must be valid UTF-8');+ }+}++function gitFailureDetail(result) {+ if (result.stderr?.length) return decodeGitOutput(result.stderr).trim();+ if (result.error?.message) return result.error.message;+ return `exit status ${result.status ?? 'unknown'}`;+}++function trackedEntries(repoRoot) {+ const result = spawnSync('git', ['ls-files', '--stage', '-z', '--', 'archify'], {+ cwd: repoRoot,+ encoding: 'buffer',+ });+ if (result.status !== 0) {+ throw new Error(`unable to enumerate tracked Archify files: ${gitFailureDetail(result)}`);+ }+ return decodeGitOutput(result.stdout).split('\0').filter(Boolean).map((record) => {+ const separator = record.indexOf('\t');+ const metadata = separator === -1 ? [] : record.slice(0, separator).split(' ');+ const relative = separator === -1 ? '' : record.slice(separator + 1);+ if (metadata.length !== 3 || !relative.startsWith('archify/')) {+ throw new Error(`invalid tracked package record: ${JSON.stringify(record)}`);+ }+ return {+ mode: metadata[0],+ stage: metadata[2],+ relative,+ };+ });+}++function excluded(relative) {+ if (EXCLUDED_FILES.has(relative)) return true;+ const insideSkill = relative.slice('archify/'.length);+ if (insideSkill === 'test' || insideSkill.startsWith('test/')) return true;+ return insideSkill.split('/').some((segment) => (+ EXCLUDED_SEGMENTS.has(segment) || segment.startsWith('.validator-check-')+ ));+}++function preflightSourceEntry(repoRoot, entry) {+ const segments = entry.relative.split('/');+ let current = repoRoot;+ let sourceMetadata;+ const sourcePath = [];+ for (const [index, segment] of segments.entries()) {+ current = path.join(current, segment);+ let metadata;+ try {+ metadata = fs.lstatSync(current, { bigint: true });+ } catch {+ throw new Error(`tracked package input is missing or unreadable: ${entry.relative}`);+ }+ const traversed = segments.slice(0, index + 1).join('/');+ const isLeaf = index === segments.length - 1;+ if (metadata.isSymbolicLink()) {+ if (isLeaf) throw new Error(`refusing to package tracked symlink: ${entry.relative}`);+ throw new Error(`refusing to package path through symlink: ${traversed} (for ${entry.relative})`);+ }+ if (!isLeaf && !metadata.isDirectory()) {+ throw new Error(`tracked package path has a non-directory ancestor: ${traversed}`);+ }+ if (isLeaf && !metadata.isFile()) {+ throw new Error(`tracked package input is not a regular file: ${entry.relative}`);+ }+ sourcePath.push({ absolute: current, metadata });+ if (isLeaf) sourceMetadata = metadata;+ }+ if (!['100644', '100755'].includes(entry.mode)) {+ throw new Error(`unsupported tracked package mode ${entry.mode}: ${entry.relative}`);+ }+ return { ...entry, source: current, sourceMetadata, sourcePath };+}++function sameFileIdentity(left, right) {+ return left.dev === right.dev && left.ino === right.ino;+}++function sameSnapshotState(left, right) {+ return sameFileIdentity(left, right)+ && left.mode === right.mode+ && left.size === right.size+ && left.mtimeNs === right.mtimeNs+ && left.ctimeNs === right.ctimeNs;+}++function sourcePathUnchanged(entry) {+ return entry.sourcePath.every(({ absolute, metadata }, index) => {+ let current;+ try {+ current = fs.lstatSync(absolute, { bigint: true });+ } catch {+ return false;+ }+ const isLeaf = index === entry.sourcePath.length - 1;+ return !current.isSymbolicLink()+ && (isLeaf ? current.isFile() : current.isDirectory())+ && sameSnapshotState(metadata, current);+ });+}++function snapshotSourceEntry(entry) {+ const flags = fs.constants.O_RDONLY+ | (fs.constants.O_NOFOLLOW ?? 0)+ | (fs.constants.O_NONBLOCK ?? 0);+ let descriptor;+ try {+ descriptor = fs.openSync(entry.source, flags);+ } catch {+ throw new Error(`tracked package input changed or became unreadable: ${entry.relative}`);+ }++ try {+ const before = fs.fstatSync(descriptor, { bigint: true });+ if (!before.isFile()+ || !sameFileIdentity(entry.sourceMetadata, before)+ || !sourcePathUnchanged(entry)) {+ throw new Error(`tracked package path changed before it could be read: ${entry.relative}`);+ }+ const content = fs.readFileSync(descriptor);+ const after = fs.fstatSync(descriptor, { bigint: true });+ if (!after.isFile()+ || !sameSnapshotState(before, after)+ || !sourcePathUnchanged(entry)) {+ throw new Error(`tracked package path changed while being read: ${entry.relative}`);+ }+ return { ...entry, content };+ } finally {+ fs.closeSync(descriptor);+ }+}++function cleanPackageManifest(destination) {+ const packagePath = path.join(destination, 'package.json');+ const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));+ delete packageJson.scripts;+ delete packageJson.devDependencies;+ fs.writeFileSync(packagePath, `${JSON.stringify(packageJson, null, 2)}\n`);+}++export function stageCleanSkill({ repoRoot = scriptRoot, destination }) {+ const resolvedRoot = fs.realpathSync(path.resolve(repoRoot));+ if (!destination) throw new Error('clean Skill staging requires a destination');+ const resolvedDestination = path.resolve(destination);+ if (fs.existsSync(resolvedDestination)) {+ throw new Error(`clean Skill staging destination already exists: ${resolvedDestination}`);+ }++ const entries = trackedEntries(resolvedRoot);+ for (const entry of entries) {+ if (entry.stage !== '0') {+ throw new Error(`refusing to package unmerged index entry (stage ${entry.stage}): ${entry.relative}`);+ }+ }+ const tracked = new Set(entries.map((entry) => entry.relative));+ for (const required of REQUIRED_INPUTS) {+ if (!tracked.has(required)) {+ throw new Error(`required package input is not tracked by Git: ${required}`);+ }+ }++ const packageEntries = entries+ .filter((entry) => !excluded(entry.relative))+ .map((entry) => preflightSourceEntry(resolvedRoot, entry))+ .map((entry) => snapshotSourceEntry(entry));++ fs.mkdirSync(resolvedDestination, { recursive: true, mode: 0o755 });+ let fileCount = 0;+ try {+ for (const entry of packageEntries) {+ const relativeInsideSkill = entry.relative.slice('archify/'.length);+ const target = path.join(resolvedDestination, ...relativeInsideSkill.split('/'));+ fs.mkdirSync(path.dirname(target), { recursive: true });+ fs.writeFileSync(target, entry.content);+ if (entry.mode === '100755') fs.chmodSync(target, 0o755);+ else fs.chmodSync(target, 0o644);+ fileCount += 1;+ }+ cleanPackageManifest(resolvedDestination);+ } catch (error) {+ fs.rmSync(resolvedDestination, { recursive: true, force: true });+ throw error;+ }++ return { destination: resolvedDestination, fileCount };+}++function isMainModule() {+ if (!process.argv[1]) return false;+ try {+ return fs.realpathSync(path.resolve(process.argv[1]))+ === fs.realpathSync(fileURLToPath(import.meta.url));+ } catch {+ return path.resolve(process.argv[1]) === path.resolve(fileURLToPath(import.meta.url));+ }+}++if (isMainModule()) {+ try {+ const result = stageCleanSkill({+ repoRoot: argument('--root', scriptRoot),+ destination: argument('--dest'),+ });+ process.stdout.write(`${JSON.stringify(result)}\n`);+ } catch (error) {+ process.stderr.write(`${error.message}\n`);+ process.exitCode = 1;+ }+}