Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1a0460521 | ||
|
|
6c91e983be | ||
|
|
43d24cdedc | ||
|
|
c0404167a5 | ||
|
|
608afb0bc6 | ||
|
|
438a718c88 | ||
|
|
d91e9f2a71 | ||
|
|
aacdf73f9a | ||
|
|
9546935513 | ||
|
|
fdd8bebaa2 | ||
|
|
f7240d8cec | ||
|
|
f53b6e16c8 | ||
|
|
84dd18c7eb | ||
|
|
8b00ec0afb | ||
|
|
c6a7f3171c | ||
|
|
8f4c21cd7f | ||
|
|
44c177bfda | ||
|
|
4c2903bef2 | ||
|
|
8abd02f581 | ||
|
|
646b099cc1 | ||
|
|
97eb379088 | ||
|
|
1cc0d4930a |
@@ -2,10 +2,13 @@ name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
# IMPORTANT: dev runs CI before a release reaches main; a version change pushed to
|
||||
# main publishes to the Comfy Registry (publish.yml stays main/master only).
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 3 * * *' # nightly 03:00 UTC for adversarial-extended
|
||||
@@ -135,6 +138,9 @@ jobs:
|
||||
python -m pip install -r requirements.txt
|
||||
python -m pip install -r requirements-quality.txt
|
||||
python -m pip install numpy pillow aiohttp "coverage[toml]"
|
||||
# IMPORTANT: install every pyproject optional extra (wechat-aes); a missing
|
||||
# extra makes its tests skip here and exceed the shared skip budget.
|
||||
python -m pip install "pycryptodomex>=3.20"
|
||||
- name: R120 preflight
|
||||
run: |
|
||||
python scripts/preflight_check.py --strict
|
||||
@@ -393,6 +399,8 @@ jobs:
|
||||
python -m pip install -r requirements.txt
|
||||
python -m pip install -r requirements-quality.txt
|
||||
python -m pip install numpy pillow aiohttp "coverage[toml]"
|
||||
# IMPORTANT: same optional extras as unit-tests; this job enforces the skip policy too.
|
||||
python -m pip install "pycryptodomex>=3.20"
|
||||
- name: R120 preflight
|
||||
run: python scripts/preflight_check.py --strict
|
||||
- name: Run exact-version backend suite
|
||||
|
||||
+9
-5
@@ -38,11 +38,15 @@
|
||||
],
|
||||
"results": {
|
||||
"docs/release/compatibility_matrix.md": [
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "2c3b7e285594991c88a1eab4b4ca58a4c57a32c6", "is_verified": false, "line_number": 60},
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "367b65a549be19534ddd21a2d0641a8e0b9059c1", "is_verified": false, "line_number": 62},
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "bfe85376869c131e118c00ba16909d666b155183", "is_verified": false, "line_number": 67},
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "5e3f5c77f7c13463381d448ebcf690cfbc1a8ec0", "is_verified": false, "line_number": 70}
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "2c3b7e285594991c88a1eab4b4ca58a4c57a32c6", "is_verified": false, "line_number": 58},
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "367b65a549be19534ddd21a2d0641a8e0b9059c1", "is_verified": false, "line_number": 60},
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "bfe85376869c131e118c00ba16909d666b155183", "is_verified": false, "line_number": 65},
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "5e3f5c77f7c13463381d448ebcf690cfbc1a8ec0", "is_verified": false, "line_number": 68},
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "769a167f977a1273d5c0c59dd640676c451b9a28", "is_verified": false, "line_number": 100, "is_secret": false},
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "9eff0a7cf92a753773bc7c993debdd51d8502b72", "is_verified": false, "line_number": 102, "is_secret": false},
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "d6a58318141486d7b255c3085d944369d38ea447", "is_verified": false, "line_number": 107, "is_secret": false},
|
||||
{"type": "Hex High Entropy String", "filename": "docs/release/compatibility_matrix.md", "hashed_secret": "71f731a901eca7e0118916f7809e3d834348e892", "is_verified": false, "line_number": 110, "is_secret": false}
|
||||
]
|
||||
},
|
||||
"generated_at": "2026-09-22T07:50:31Z"
|
||||
"generated_at": "2026-11-01T05:23:27Z"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024-2026 rookiestar (GitHub: rooiestar28)
|
||||
Copyright (c) 2024-2026 rookiestar (GitHub: rookiestar28)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -91,6 +91,24 @@ Deployment profiles and hardening references:
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>Host compatibility updated in v1.3.2</strong></summary>
|
||||
|
||||
- ComfyUI `0.43.0` at `7c4390a6`, with bundled frontend `1.57.6` or standalone
|
||||
frontend release `1.60.0`, passed fifteen browser checks per frontend in an isolated
|
||||
CPU host on 2026-11-01. Desktop and the later frontend source checkout remain unverified.
|
||||
- The sidebar follows the host's native width controls and keeps the selected width when
|
||||
switching tabs. Settings model controls wrap and remain usable in narrow panels; older
|
||||
sidebar hosts retain their existing layout fallback.
|
||||
- Parameter Lab preserves complete node IDs, including IDs containing colons, and resolves
|
||||
shared subgraphs through their instance paths. Ambiguous targets stop before any values
|
||||
are changed, preventing edits or replays from reaching the wrong node.
|
||||
- Development and test commands now check the locked tools' Node.js requirement
|
||||
(`^20.19.0 || ^22.12.0 || >=24.0.0`) before starting. Node.js 24 is recommended.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>Trigger callbacks and scheduled chat results are now delivered</strong></summary>
|
||||
|
||||
- Trigger requests and approval-gated runs that name a callback now deliver their result to
|
||||
@@ -132,26 +150,6 @@ Deployment profiles and hardening references:
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>Host qualification refreshed for ComfyUI 0.39.0 and frontend 1.57.0</strong></summary>
|
||||
|
||||
- Reference anchors now follow ComfyUI `0.39.0` (source head `8010b48d`, bundled frontend
|
||||
`1.55.14`) and the standalone frontend release `1.57.0`.
|
||||
- Both frontend subjects passed the real-host browser checks with no skipped cases, and the
|
||||
compatibility matrix records them as validated. The later frontend source checkout and both
|
||||
Desktop surfaces remain unexecuted.
|
||||
- Switching from OpenClaw to another sidebar tab no longer snaps the sidebar back to its
|
||||
earlier width: OpenClaw releases only the sizing it applied and keeps widths the host
|
||||
splitter wrote, now covered by a real-host check.
|
||||
- Current 3D output shapes (`3d` items with camera and model information, Preview3D's legacy
|
||||
`result` item, and optional per-file metadata) are pinned in both the Python and browser
|
||||
parsers.
|
||||
- The backend test gate now also runs the suites kept in test subdirectories, including the
|
||||
connector, security, and contract suites.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>Refreshed host alignment and output handling verified</strong></summary>
|
||||
|
||||
- A saved 3D output exposed through both `3d` and legacy `result` now appears once in
|
||||
@@ -490,13 +488,17 @@ Canonical DOM/class ownership is now centered on `openclaw-*`; legacy `moltbot-*
|
||||
|
||||
The sidebar now also resolves and stamps its active host surface (`standalone_frontend`, legacy
|
||||
`desktop`, or current managed-install `comfy_desktop`) and reference metadata at mount time, so
|
||||
Desktop `0.9.4` embedded-frontend lag against standalone frontend release `1.57.0` is explicit and
|
||||
Desktop `0.9.4` embedded-frontend lag against standalone frontend release `1.60.0` is explicit and
|
||||
testable. The current Comfy-Desktop `1.0.32-rc.1` reference keeps hosted component versions
|
||||
installation-specific and recognizes `window.__comfyDesktop2` as presence metadata only; bridge
|
||||
detection does not authorize privileged capability calls.
|
||||
|
||||
Sidebar registration prefers ComfyUI's current sidebar store API and falls back to the deprecated frontend facade when running on older host bundles. Hosts without either sidebar API use the legacy menu fallback instead of failing extension setup.
|
||||
|
||||
On current native sidebar hosts, ComfyUI owns panel sizing and splitter behavior. OpenClaw
|
||||
adapts to that width, keeps the host's chosen width when switching tabs, and wraps Settings
|
||||
model controls for narrow panels. Older sidebar hosts retain the legacy sizing fallback.
|
||||
|
||||
### Sidebar Modules
|
||||
|
||||

|
||||
@@ -555,7 +557,9 @@ Parameter Lab now supports experiment history and run replay:
|
||||
|
||||
- `History` lists saved experiments from local state.
|
||||
- `Load` opens stored experiment details and run statuses.
|
||||
- `Replay` applies a selected run's parameter values back into the active workflow graph without coercing string or non-numeric host node IDs.
|
||||
- `Replay` applies a selected run's parameter values back into the active workflow graph while
|
||||
preserving complete node IDs, including IDs containing colons. Shared subgraph definitions
|
||||
are resolved through their instance paths; ambiguous IDs or targets fail before any write.
|
||||
- Sweep and compare inputs accept bounded strings, booleans, and finite numbers; structured values
|
||||
and unsupported sweep strategies fail validation instead of being guessed or silently coerced.
|
||||
- Queued runs use request-ID-correlated receipts to bind the exact host prompt ID. Unsupported,
|
||||
@@ -814,6 +818,8 @@ runtime package without them.
|
||||
|
||||
Quick entry points:
|
||||
|
||||
- frontend development/test runtime: Node.js `^20.19.0 || ^22.12.0 || >=24.0.0`
|
||||
(Node.js 24 recommended); this tooling requirement does not apply to using the installed nodes
|
||||
- full acceptance workflow: [tests/TEST_SOP.md](tests/TEST_SOP.md)
|
||||
- E2E-specific procedure: [tests/E2E_TESTING_SOP.md](tests/E2E_TESTING_SOP.md)
|
||||
- verification-governance policy/details: [docs/release/verification_governance.md](docs/release/verification_governance.md)
|
||||
|
||||
@@ -108,6 +108,18 @@ If staged/manual execution is required, follow the explicit command order in
|
||||
|
||||
---
|
||||
|
||||
## Publication Order
|
||||
|
||||
A push to `main` that changes the `pyproject.toml` version publishes that version to the Comfy
|
||||
Registry, and a later push cannot replace that published version. Hosted CI also runs on platforms
|
||||
and dependency sets that a local gate may not cover.
|
||||
|
||||
- [ ] Push the release commit to `dev` first and wait for its CI run on `dev` to pass.
|
||||
- [ ] Only then fast-forward `main` to the same commit and push it.
|
||||
- [ ] Push the release tag after `main`.
|
||||
|
||||
---
|
||||
|
||||
## Sign-off
|
||||
|
||||
- [ ] **Gate A Passed**: (Date/Initials)
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
# ComfyUI Asset API Adoption Decision (2026-04-16)
|
||||
|
||||
## 2026-10-13 source review
|
||||
## 2026-11-01 source review
|
||||
|
||||
- Current source is `7c4390a6` (`v0.43.0-21-g7c4390a6f`, project `0.43.0`), bundle `1.57.6`. Tag `v0.43.0` instead pins `1.57.4`.
|
||||
- Additive `preview_id` is ignored by the bounded output-ref contract. Host-only `asset_preview` is stripped before client/history/cache output; it never authorizes a URL fetch or a new directory type.
|
||||
- The no-go decision stays in effect: OpenClaw continues to use `/history` and bounded
|
||||
`/view` refs rather than direct `/api/assets` access. The core source with bundled frontend
|
||||
`1.57.6` and standalone frontend release `1.60.0` passed paired isolated CPU host browser
|
||||
qualification on 2026-11-01. This does not qualify direct Asset API adoption, either Desktop
|
||||
surface, or the later frontend source checkout.
|
||||
|
||||
## Historical 2026-10-13 source review
|
||||
|
||||
- The supplied ComfyUI source is `8010b48d` (`v0.39.0-49-g8010b48d2`, project version `0.39.0`) and pins bundled frontend `1.55.14`. The `v0.39.0` tag instead pins `1.53.10`; these are distinct subjects.
|
||||
- The asset system stays off unless `--enable-assets` is given, and `--disable-assets` overrides it. The Windows standalone build (`--windows-standalone-build`) now turns the asset system on, so hash-backed output metadata is more likely on those installs.
|
||||
@@ -49,7 +59,7 @@
|
||||
- optional asset-hash-backed refs that still resolve through `/view?filename=blake3:...` when host metadata is present
|
||||
- media-aware output groups (`images`, `video`, `audio`, `3d`, and bounded `text`)
|
||||
- HDR `.exr` / `.hdr` image refs as explicit `/view` source-preview fallback links, not normal thumbnails
|
||||
- Current ComfyUI `8010b48d` / `v0.39.0-49-g8010b48d2` / pyproject `0.39.0` reference facts:
|
||||
- Current ComfyUI `7c4390a6` / `v0.43.0-21-g7c4390a6f` / pyproject `0.43.0` reference facts:
|
||||
- `/api/assets*` routes exist, but the asset system is off unless `--enable-assets` is given or the Windows standalone build turns it on; `--disable-assets` always wins
|
||||
- content hashing is opt-in through `--enable-asset-hashing`, so normal filename-backed refs may omit `asset_hash` / `hash`
|
||||
- `/features` exposes the `assets` capability flag so hosts can report whether the asset system is enabled
|
||||
|
||||
@@ -24,6 +24,10 @@ This document summarizes the current OpenClaw sidebar UI structure and how to ve
|
||||
- Host surface: `web/openclaw_host_surface.js` resolves standalone frontend, legacy fixed-bundle
|
||||
Desktop, and current managed-install Comfy-Desktop separately, then stamps explicit metadata so
|
||||
generation-specific behavior stays testable.
|
||||
- Sidebar layout: `web/openclaw_sidebar_layout.js` recognizes the complete native host panel
|
||||
contract and leaves its sizing to ComfyUI. Legacy hosts retain the owned sizing fallback.
|
||||
Native panel styles let headers, tabs, Parameter Lab, and Settings model controls wrap at
|
||||
narrow widths without imposing the legacy width floor.
|
||||
- Output refs: `web/openclaw_asset_refs.js` normalizes classic history refs, optional `asset_hash`/`hash` refs and top-level output-entry `id` metadata when the host provides them, and current previewable media groups (`images`, `video`, `audio`, `3d`, bounded inline or file-backed `text`) onto one media-aware contract. A saved 3D output represented by both `3d` and legacy `result` appears once, while distinct outputs stay separate. Allowlisted text files under the host `files` key stay on same-origin `/view` and use a 5-second, 64-KiB streaming, strict textual-MIME/UTF-8 reader with a 4,096-character display cap. HDR `.exr` / `.hdr` image refs show source-preview fallback links instead of normal thumbnails, text reaches the DOM only as literal text, and asset-service-only refs remain explicit fallback states instead of silently auto-fetching `/api/assets`.
|
||||
- Styles: `web/openclaw.css` provides shared design tokens and component classes.
|
||||
- Errors and compatibility helpers: `web/openclaw_utils.js` provides `showError()` / `clearError()` plus runtime legacy-class alias helpers used to keep canonical `openclaw-*` markup compatible with existing `moltbot-*` selectors.
|
||||
@@ -38,7 +42,10 @@ Refactor note:
|
||||
- New tab markup should use canonical `openclaw-*` classes; legacy `moltbot-*` aliases are generated centrally at runtime instead of being duplicated in each template.
|
||||
- New host sidebar registration changes should stay in `web/openclaw_sidebar_registration.js` rather than duplicating ComfyUI frontend API detection inside the extension entrypoint.
|
||||
- Host-sensitive behaviors should consume the shared host-surface helper rather than inferring desktop vs standalone frontend from ad-hoc globals.
|
||||
- Graph/widget flows should preserve host-shaped promoted-widget source metadata and non-numeric node IDs, including Parameter Lab replay/apply paths.
|
||||
- Graph/widget flows preserve complete host node IDs, including colons, and promoted-widget
|
||||
source metadata. Exact IDs take precedence over path interpretation. Shared subgraph
|
||||
definitions require an instance path; duplicate IDs or unresolved instance collisions must
|
||||
fail before an edit or replay writes any widget values.
|
||||
- Parameter Lab flows should keep scalar/count/byte validation aligned with the backend policy and
|
||||
use exact request-ID queue receipts; they must not infer prompt ownership from a globally recent
|
||||
prompt when the host request boundary is unsupported or ambiguous.
|
||||
@@ -67,7 +74,7 @@ If `assist_streaming` is unavailable or the stream transport degrades, Planner/R
|
||||
- The sidebar stamps its resolved host surface and refreshed host-reference metadata at mount time so desktop bundle drift is explicit in diagnostics and regression tests.
|
||||
- The standalone Remote Admin Console stamps the same host-surface metadata on its document root,
|
||||
including legacy Desktop `0.9.4`, fixed core `0.22.3`, embedded frontend `1.43.18`, and lagging
|
||||
parity relative to standalone frontend `1.57.0`. It also exposes current Comfy-Desktop
|
||||
parity relative to standalone frontend `1.60.0`. It also exposes current Comfy-Desktop
|
||||
`1.0.32-rc.1` with `installation_specific` hosted versions. Presence of
|
||||
`window.__comfyDesktop2` identifies that host generation only; it does not authorize privileged
|
||||
capability calls or inspect bridge members.
|
||||
@@ -103,14 +110,16 @@ If `assist_streaming` is unavailable or the stream transport degrades, Planner/R
|
||||
## Quick Manual Checks
|
||||
|
||||
1. Open ComfyUI and confirm OpenClaw appears in the sidebar.
|
||||
2. Switch between all visible tabs multiple times (and reopen the sidebar if possible) and ensure panes do not go blank. Drag the host sidebar splitter wider while OpenClaw is open, switch to another sidebar tab, and confirm the width is kept.
|
||||
2. Switch between all visible tabs multiple times (and reopen the sidebar if possible) and ensure panes do not go blank. Drag the host sidebar splitter wider while OpenClaw is open, switch to another sidebar tab, and confirm the width is kept. On native panel hosts, also check Settings at narrow widths: the model selector and refresh button wrap, custom-model input stays editable, and switching between a listed model and a custom value keeps the controls synchronized.
|
||||
3. Confirm the sidebar host-surface metadata resolves correctly for the current environment instead of defaulting silently.
|
||||
4. Planner: click **Plan Generation** with minimal input and confirm either live preview/stage updates appear (when streaming is supported) or a readable fallback result/error appears.
|
||||
5. Refiner: click **Refine Prompts** (with or without image) and confirm either live preview/stage updates appear (when streaming is supported) or a readable fallback result/error appears.
|
||||
6. Jobs: verify output previews still resolve for classic history refs, optional hash-backed refs when host metadata is present, and supported media-aware refs (`images`, `video`, `audio`, `3d`, bounded inline/file-backed `text`); current hosts report Load3D-family and Save3D outputs as `3d` items and Preview3D as a legacy `result` item, and on older hosts a saved 3D file exposed in both `3d` and `result` should appear once; allowlisted text files should show literal bounded content or a deterministic source-link fallback, HDR `.exr` / `.hdr` image refs should render as explicit source-preview fallback links, asset-service-only refs should stay explicit as a bounded fallback state, and repeated polls should not duplicate rows after reconnect/resume.
|
||||
7. Parameter Lab: verify bounded scalar sweep/compare values queue with an exact request receipt,
|
||||
and verify unsupported structured values or unknown host queue-event shapes fail visibly without
|
||||
assigning another prompt's lifecycle.
|
||||
assigning another prompt's lifecycle. With colon-containing IDs and repeated instances of a
|
||||
shared subgraph, verify edits and replay affect only the selected instance; ambiguous targets
|
||||
must leave all widget values unchanged.
|
||||
8. Explorer: verify preflight inventory can show `refreshing` / `stale` / `error` state without freezing the tab while deep scan work continues, and verify inactive-branch suppressed findings render separately from actionable failures.
|
||||
9. Library/Approvals: if backend endpoints are not enabled, confirm the UI shows a clear error state (no crashes).
|
||||
10. If you simulate/fake a stream failure in dev tools, confirm Planner/Refiner retry through the classic non-stream path without duplicate submits or broken loading state.
|
||||
|
||||
@@ -4,32 +4,72 @@
|
||||
{
|
||||
"anchors": {
|
||||
"comfy_desktop": "1.0.32-rc.1 (85e28b7a / v1.0.32-rc.1-3-g85e28b7)",
|
||||
"comfyui": "8010b48d (v0.39.0-49-g8010b48d2 / pyproject 0.39.0)",
|
||||
"comfyui_frontend": "1.57.0 (0e1a2fbbe4 / v1.57.0-309-g0e1a2fbbe4)",
|
||||
"comfyui": "7c4390a6 (v0.43.0-21-g7c4390a6f / pyproject 0.43.0)",
|
||||
"comfyui_frontend": "1.60.0 (aa4e48c08d / v1.60.0-209-gaa4e48c08d)",
|
||||
"desktop": "0.9.4 (core 0.22.3 / frontend 1.43.18)"
|
||||
},
|
||||
"evidence": {
|
||||
"evidence_id": "compat-matrix-host-qualification-20261013",
|
||||
"updated_at": "2026-10-13T22:20:00+08:00",
|
||||
"updated_by": "pinned-two-subject-host-qualification"
|
||||
"evidence_id": "host-evidence-20261101-isolated-01",
|
||||
"updated_at": "2026-11-01T16:39:15+08:00",
|
||||
"updated_by": "paired-isolated-host-validation"
|
||||
},
|
||||
"evidence_states": {
|
||||
"real_host": {
|
||||
"evidence_id": "host-evidence-20261013-01",
|
||||
"run_id": "host-pair-20261013-01",
|
||||
"evidence_id": "host-evidence-20261101-isolated-01",
|
||||
"run_id": "host-pair-20261101-isolated-01",
|
||||
"state": "validated"
|
||||
},
|
||||
"repository_validation": {
|
||||
"evidence_id": "repo-validation-20261013-host-requalification",
|
||||
"run_id": "windows-full-gate-20261013-host-requalification",
|
||||
"evidence_id": "repo-validation-20261101-host-alignment",
|
||||
"run_id": "windows-full-gate-20261101-host-alignment",
|
||||
"state": "validated"
|
||||
},
|
||||
"source_review": {
|
||||
"evidence_id": "source-review-20261013",
|
||||
"evidence_id": "source-review-20261101",
|
||||
"run_id": null,
|
||||
"state": "reviewed"
|
||||
}
|
||||
},
|
||||
"historical_evidence": [
|
||||
{
|
||||
"evidence_states": {
|
||||
"real_host": {
|
||||
"evidence_id": "host-evidence-20261013-01",
|
||||
"run_id": "host-pair-20261013-01",
|
||||
"state": "validated"
|
||||
},
|
||||
"repository_validation": {
|
||||
"evidence_id": "repo-validation-20261013-host-requalification",
|
||||
"run_id": "windows-full-gate-20261013-host-requalification",
|
||||
"state": "validated"
|
||||
},
|
||||
"source_review": {
|
||||
"evidence_id": "source-review-20261013",
|
||||
"run_id": null,
|
||||
"state": "reviewed"
|
||||
}
|
||||
},
|
||||
"last_validated_date": "2026-10-13",
|
||||
"reference_baselines": {
|
||||
"comfyui": {
|
||||
"bundled_frontend_version": "1.55.14",
|
||||
"project_version": "0.39.0",
|
||||
"source_describe": "v0.39.0-49-g8010b48d2",
|
||||
"source_head": "8010b48d2c1be986613f8e8c761527d205bd756f",
|
||||
"tag": "v0.39.0",
|
||||
"tag_commit": "b0b743566f65daafc423b4fea8a2fbda94b3384a"
|
||||
},
|
||||
"comfyui_frontend": {
|
||||
"package_version": "1.57.0",
|
||||
"release_tag": "v1.57.0",
|
||||
"release_tag_commit": "cdc18a92d227a965810b08928963124959951908",
|
||||
"release_version": "1.57.0",
|
||||
"source_describe": "v1.57.0-309-g0e1a2fbbe4",
|
||||
"source_head": "0e1a2fbbe4d5ed1eeefb70a3fd6f0d805331d3e8"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"host_surfaces": {
|
||||
"comfy_desktop": {
|
||||
"anchor_key": "comfy_desktop",
|
||||
@@ -46,28 +86,28 @@
|
||||
"hosted_version_mode": "fixed"
|
||||
}
|
||||
},
|
||||
"last_validated_date": "2026-10-13",
|
||||
"matrix_version": "v0.3.0",
|
||||
"last_validated_date": "2026-11-01",
|
||||
"matrix_version": "v0.3.1",
|
||||
"policy": {
|
||||
"max_age_days": 45,
|
||||
"warn_age_days": 30
|
||||
},
|
||||
"reference_baselines": {
|
||||
"comfyui": {
|
||||
"bundled_frontend_version": "1.55.14",
|
||||
"project_version": "0.39.0",
|
||||
"source_describe": "v0.39.0-49-g8010b48d2",
|
||||
"source_head": "8010b48d2c1be986613f8e8c761527d205bd756f",
|
||||
"tag": "v0.39.0",
|
||||
"tag_commit": "b0b743566f65daafc423b4fea8a2fbda94b3384a"
|
||||
"bundled_frontend_version": "1.57.6",
|
||||
"project_version": "0.43.0",
|
||||
"source_describe": "v0.43.0-21-g7c4390a6f",
|
||||
"source_head": "7c4390a6f70cd8eb41014d6af52969397a752fc4",
|
||||
"tag": "v0.43.0",
|
||||
"tag_commit": "426f5eea52a7ece1dd599fff4cb6cd1f352ddd24"
|
||||
},
|
||||
"comfyui_frontend": {
|
||||
"package_version": "1.57.0",
|
||||
"release_tag": "v1.57.0",
|
||||
"release_tag_commit": "cdc18a92d227a965810b08928963124959951908",
|
||||
"release_version": "1.57.0",
|
||||
"source_describe": "v1.57.0-309-g0e1a2fbbe4",
|
||||
"source_head": "0e1a2fbbe4d5ed1eeefb70a3fd6f0d805331d3e8"
|
||||
"package_version": "1.60.0",
|
||||
"release_tag": "v1.60.0",
|
||||
"release_tag_commit": "5cb2899fc4bc5034513fbafae72b39265c4a213e",
|
||||
"release_version": "1.60.0",
|
||||
"source_describe": "v1.60.0-209-gaa4e48c08d",
|
||||
"source_head": "aa4e48c08d364dcd36071131455a7aec40b852ac"
|
||||
}
|
||||
},
|
||||
"schema_version": 3
|
||||
@@ -80,34 +120,39 @@ This document tracks current reference anchors and separately records source, re
|
||||
|
||||
| Component | Reference Subject | Best Effort / Experimental | Notes |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| **ComfyUI** | `8010b48d` source-review anchor (`v0.39.0-49-g8010b48d2`; `pyproject.toml` version `0.39.0`) | Older tagged snapshots | Tag baseline `v0.39.0` is commit `b0b74356`, 49 commits behind this source head. That tag pins bundled frontend `1.53.10`, while the supplied source head pins `1.55.14`; the smoke subject uses the source head. Neither source review nor tag identity is runtime proof. |
|
||||
| **ComfyUI Frontend** | `1.57.0` release `v1.57.0` at commit `cdc18a92` (reproducible release subject) | Source-review head `0e1a2fbbe4` (`v1.57.0-309-g0e1a2fbbe4`, package `1.57.0`), 309 commits beyond the release tag | The release and later source head are distinct subjects. The release lane pins the publisher-reported `dist.zip` size and SHA256 and must verify downloaded bytes before host execution; the later source head, which carries unreleased sidebar splitter and extension-loader changes, has not run. Sidebar extension contract remains compatible; prefer the current sidebar store API with deprecated facade fallback. |
|
||||
| **ComfyUI** | `7c4390a6` source-review anchor (`v0.43.0-21-g7c4390a6f`; project `0.43.0`) | Older tagged snapshots | Tag `v0.43.0` is `426f5eea`, 21 commits behind source, and pins frontend `1.57.4`; source pins `1.57.6`. The source core with bundle `1.57.6` and standalone release `1.60.0` passed paired isolated CPU host qualification; the older tag/bundle was not executed. |
|
||||
| **ComfyUI Frontend** | Release `1.60.0`, tag `v1.60.0` at `5cb2899f` | Source `aa4e48c08d` (`v1.60.0-209-gaa4e48c08d`), package `1.60.0` | Release and source are distinct. Publisher-reported `dist.zip` size/SHA256 are pinned; downloaded bytes and served files must be verified before live claims. Source-only queue UI refresh, status retries and extension-loader changes are not release behavior. |
|
||||
| **Legacy Desktop** | `0.9.4 (core 0.22.3 / frontend 1.43.18)` reference anchor | Legacy fixed bundle may lag standalone frontend | Preserve the recorded fixed-bundle contract for existing parity coverage |
|
||||
| **Current Comfy-Desktop** | `1.0.32-rc.1` reference anchor (`85e28b7a`; `v1.0.32-rc.1-3-g85e28b7`) | Hosted component versions vary by installation | Treat the managed-install generation separately; do not infer fixed core/frontend versions from the application release |
|
||||
| **Python** | 3.13 | 3.10-3.12 compatibility targets; 3.14 best effort | Current executed baseline is the local Windows Full Gate on Python 3.13. 3.10-3.12 are exercised by the scheduled exact-version matrix, and 3.10 also by the routine per-push backend job, so they are compatibility targets by support commitment rather than for want of testing. Only the matrix emits the dated, commit-bound artifact the 14-day currency rule reads, so its artifacts remain the sole promotion evidence; a passing push corroborates but does not promote. 3.10 requires reassessment on 2026-10-31; below 3.10 is unsupported |
|
||||
| **Torch** | 2.1.2+ | 1.13+ | CUDA 11.8/12.1 verified |
|
||||
| **Torch** | `2.10.0+cpu` in the isolated host campaign | Other CPU/CUDA combinations | Both frontend subjects were exercised without a GPU; this campaign makes no CUDA compatibility claim. |
|
||||
|
||||
## Host-Surface Notes
|
||||
|
||||
- **ComfyUI host runtime**: current bootstrap assumptions remain aligned with upstream `PromptServer` startup and route registration flow, including `/api`-prefixed canonical API routing.
|
||||
- **Frontend host surface**: current sidebar integration contract remains compatible with the standalone frontend reference anchor, while inactive subgraph diagnostics and promoted-widget behavior remain regression-sensitive seams.
|
||||
- **Promoted-widget evidence scope**: early real-host runs exercised an ordinary widget with constructed source fields. The paired runs on the previous core `0.37.0` subjects and on the refreshed core `0.39.0` subjects exercised a host-created subgraph binding, an OpenClaw Parameter Lab edit, projected value readback and serialized inner prompt value on both frontend subjects of each pair. The raw inner widget seed need not change when the promoted host value owns execution.
|
||||
- **Evidence states**: the metadata block records source review, repository validation, and real-host validation independently. The refreshed core `0.39.0` and frontend `1.57.0` source identities have been reviewed; repository validation passed the local Windows Full Gate on 2026-10-13. The paired real-host campaign on core `0.39.0` reports `validated` for bundled frontend `1.55.14` and standalone release `1.57.0`, with a campaign run identifier. This does not validate the later frontend source head or either Desktop surface.
|
||||
- **Real-host lane execution status**: earlier manual and workflow runs exercised historical core/frontend subjects, and the paired campaign on core `0.37.0` (bundled frontend `1.53.6`, standalone release `1.55.11`) remains historical evidence. The refreshed paired campaign used core `0.39.0` with its bundled frontend `1.55.14`, and the same core with standalone release `1.57.0`, whose served files matched a release archive with the pinned size and SHA256. Both subjects passed the eleven-case real-host browser spec with zero skipped cases, including a check that a sidebar width the host splitter writes while OpenClaw is mounted survives a tab switch. The host listened on loopback only, and its custom nodes were limited to OpenClaw, the spec's peer fixture and ComfyUI-Manager.
|
||||
- **Legacy Desktop host surface**: Desktop `0.9.4` embeds frontend `1.43.18`, which lags the standalone frontend `1.57.0` release reference. Validate this fixed bundle against its own anchor.
|
||||
- **Promoted-widget evidence scope**: early real-host runs exercised an ordinary widget with constructed source fields. The historical core `0.37.0` and `0.39.0` pairs, and the current core `0.43.0` pair, exercised a host-created subgraph binding, an OpenClaw Parameter Lab edit, projected value readback and serialized inner prompt value on both frontend subjects. The current pair additionally verifies colon-containing IDs, shared subgraph instances, target-only edits/replay and collision rejection without writes. The raw inner widget seed need not change when the promoted host value owns execution.
|
||||
- **Evidence states**: new source subjects were reviewed on 2026-11-01. The Windows repository gate and paired isolated real-host campaign are recorded separately, dated 2026-11-01. Campaign `host-pair-20261101-isolated-01` / `host-evidence-20261101-isolated-01` passed all fifteen browser cases on each frontend subject, with no skips or retries. The actual served index and entry module matched verified artifact files. The isolated host used Python `3.11.2` and CPU-only PyTorch `2.10.0+cpu`; this does not replace the exact-version backend matrix. No GPU or provider jobs were run. Source review and target-authored simulations do not establish live compatibility.
|
||||
- **Historical real-host evidence**: the 2026-10-13 campaign `host-pair-20261013-01` / `host-evidence-20261013-01` validated core `0.39.0` at `8010b48d`, bundled frontend `1.55.14` and standalone release `1.57.0`. Both passed eleven browser cases, including sidebar splitter width survival, on loopback with the bounded custom-node set. Its repository gate and date are scoped to those old subjects in `historical_evidence`; they do not qualify the new pins. The earlier core `0.37.0` pair remains historical too. Neither Desktop nor the later frontend source head has live qualification.
|
||||
- **Legacy Desktop host surface**: Desktop `0.9.4` embeds frontend `1.43.18`, which lags the standalone frontend `1.60.0` release reference. Validate this fixed bundle against its own anchor.
|
||||
- **Current Comfy-Desktop host surface**: application `1.0.32-rc.1` is a managed-install generation. Its hosted ComfyUI and frontend versions are `installation_specific`; the application anchor must not be cross-wired into fixed hosted-version claims.
|
||||
|
||||
## Residual Host-Contract Decisions
|
||||
|
||||
- **Additive preview metadata**: `preview_id` does not alter filename-backed `/view` refs. The host strips `asset_preview` before client/history/cache output; OpenClaw does not fetch that URL or introduce a `previews` directory type.
|
||||
- **SaveImage output refs**: OpenClaw consumes runtime `/history` output refs and does not infer graph-rewrite behavior from output-node socket shape. `SaveImage` output sockets are allowed to exist without changing the normalized output-ref contract.
|
||||
- **3D output refs**: 3D refs remain media-aware output refs. Current Load3D-family and Save3D nodes report only the standard `3d` item, with `camera_info` and `model_3d_info` alongside it; Load3D-family refs use the `temp` directory. The Preview3D node still reports the legacy `result` item. Older hosts can report one saved file in both `3d` and legacy `result` for the same node; Python history parsing and browser output normalization emit one canonical ref for it, while distinct files, host directory types, and nodes remain separate. Optional per-file `metadata` (kind, dimensions, duration) does not change the normalized ref. File-like refs and optional hash-backed 3D refs stay on the bounded `/view` preview contract; clients without a 3D renderer should show an explicit fallback/link surface.
|
||||
- **HDR image output refs**: `.exr` and `.hdr` image refs stay on the bounded `/view` source-preview contract but render as explicit fallback/link surfaces unless a client implements a safe HDR-specific viewer.
|
||||
- **File-backed text output refs**: allowlisted text files under the host `files` output key normalize to text refs on the existing `/view` route. Job Monitor uses same-origin, redirect-free, strict MIME/UTF-8 streaming with fixed 5-second, 64-KiB transfer, and 4,096-character display limits; failures remain source-link fallbacks and content is never interpreted as HTML or Markdown.
|
||||
- **Promoted widget source scope and structured widgets**: OpenClaw graph helpers preserve host-shaped promoted-widget source metadata and keep non-numeric node IDs stable. Backend preflight remains a conservative model-key whitelist; structured `COLORS` / `BOUNDING_BOXES` inputs and frontend source metadata are not treated as model references, and OpenClaw does not claim full host frontend active-scope parity without a richer graph-instance contract.
|
||||
- **Promoted widget source scope and structured widgets**: OpenClaw graph helpers preserve complete node IDs and host-shaped promoted-widget source metadata. Exact colon-containing IDs take precedence over path interpretation; shared definitions require an instance path, and ambiguous edits/replays fail before writes. Backend preflight remains a conservative model-key whitelist; structured `COLORS` / `BOUNDING_BOXES` inputs and frontend source metadata are not treated as model references. This does not claim full host frontend active-scope parity.
|
||||
- **Asset dimensions and grouped assets**: typed width/height metadata and grouped multi-download behavior are host-frontend display/download concerns. They do not change OpenClaw fetch routing, and asset-service-only identifiers remain explicit `asset_api_required` states rather than implicit `/api/assets` fetches.
|
||||
- **Asset loader paths and model tags**: current host asset metadata may expose `loader_path`; model uploads require `model_type:<folder_name>` tags, advertised by `/features.supports_model_type_tags`. OpenClaw does not upload through or directly consume `/api/assets`, so these schema facts do not change the existing `/history` + `/view` contract.
|
||||
- **Sidebar registration**: prefer the current `sidebarTab.registerSidebarTab` host API and retain the deprecated `extensionManager.registerSidebarTab` fallback for older or desktop-embedded frontend hosts.
|
||||
- **Node runtime policy**: the standalone ComfyUI frontend development workspace currently declares `node >=26.8.2 <27`, but OpenClaw keeps its package engine at `>=18.0.0` because this custom-node package runs its own Playwright/Vitest harness and does not build the host frontend workspace. OpenClaw acceptance remains governed by `tests/TEST_SOP.md` and `tests/E2E_TESTING_SOP.md`, which require Node.js 18+ and CI-parity validation on the project test harness.
|
||||
- **Sidebar sizing**: both qualified frontend releases use native panels. OpenClaw recognizes
|
||||
the complete host panel contract, leaves ancestor sizing to the host, and preserves splitter
|
||||
changes across tab switches. Native layouts wrap model controls at narrow widths; the legacy
|
||||
width fallback applies only to older panel hosts.
|
||||
- **Node runtime policy**: the locked OpenClaw Vite/Vitest harness requires `^20.19.0 || ^22.12.0 || >=24.0.0`. A dependency-free shared guard reads package.json and checks preflight, Windows/Linux full scripts, pre-push and direct npm test entries before dependency/bootstrap/browser work. Select a stable Node 24 runtime when remediation is needed. The reviewed host frontend development workspace declares `node >=26.8.2 <27`, a separate contract; OpenClaw does not build the host frontend workspace. CI uses the compatible Node 20 line. See `tests/TEST_SOP.md` and `tests/E2E_TESTING_SOP.md` for the project procedure.
|
||||
|
||||
## Operating Systems
|
||||
|
||||
|
||||
@@ -151,7 +151,12 @@ Contracts for bounded parameter sweeps and experiment orchestration.
|
||||
|
||||
Contract notes:
|
||||
|
||||
- `node_id` is a string-preserving host graph identifier. It may be numeric text such as `"10"` or a non-numeric host ID, and clients must not coerce it to a number when storing, comparing, or replaying experiment parameters.
|
||||
- `node_id` preserves the complete host graph identifier. Numeric text such as `"10"`,
|
||||
non-numeric IDs, and IDs containing colons must not be coerced or split when an exact node
|
||||
exists. Path interpretation is used only after exact-ID resolution.
|
||||
- Shared subgraph definitions require an unambiguous instance path. Definition-object identity
|
||||
alone cannot select an execution instance. Duplicate IDs or unresolved target collisions
|
||||
reject an edit or replay before widget values are written.
|
||||
- Experiment parameter keys such as `"10.cfg"` are display/storage keys derived from the original `node_id` plus `widget_name`; they are not a separate numeric node contract.
|
||||
- Sweep values are limited to bounded strings, booleans, integers, and finite numbers. Null,
|
||||
arrays, objects, non-finite numbers, overlong strings, presentation-ambiguous duplicates, and
|
||||
|
||||
@@ -5,7 +5,29 @@ The README now keeps only the most recent 3-5 update summaries and links here fo
|
||||
|
||||
Newest entries appear first.
|
||||
|
||||
Current release notes: [v1.3.0](v1.3.0.md). Previous: [v1.2.0](v1.2.0.md), [v1.1.0](v1.1.0.md).
|
||||
Current release notes: [v1.3.2](v1.3.2.md). Previous: [v1.3.0](v1.3.0.md),
|
||||
[v1.2.0](v1.2.0.md), [v1.1.0](v1.1.0.md).
|
||||
|
||||
These entries describe behavior at the time of each update. For current runtime requirements
|
||||
and host qualification, use the [compatibility matrix](compatibility_matrix.md).
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>Host compatibility updated in v1.3.2</strong></summary>
|
||||
|
||||
- ComfyUI `0.43.0` at `7c4390a6`, with bundled frontend `1.57.6` or standalone
|
||||
frontend release `1.60.0`, passed fifteen browser checks per frontend in an isolated
|
||||
CPU host on 2026-11-01. Desktop and the later frontend source checkout remain unverified.
|
||||
- The sidebar follows the host's native width controls and keeps the selected width when
|
||||
switching tabs. Settings model controls wrap and remain usable in narrow panels; older
|
||||
sidebar hosts retain their existing layout fallback.
|
||||
- Parameter Lab preserves complete node IDs, including IDs containing colons, and resolves
|
||||
shared subgraphs through their instance paths. Ambiguous targets stop before any values
|
||||
are changed, preventing edits or replays from reaching the wrong node.
|
||||
- Development and test commands now check the locked tools' Node.js requirement
|
||||
(`^20.19.0 || ^22.12.0 || >=24.0.0`) before starting. Node.js 24 is recommended.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# ComfyUI-OpenClaw v1.3.2
|
||||
|
||||
This maintenance release aligns graph editing, sidebar layout, and development tooling with
|
||||
the refreshed ComfyUI host contracts.
|
||||
|
||||
## Host compatibility
|
||||
|
||||
- ComfyUI source `7c4390a6` (project `0.43.0`) was qualified with its bundled frontend
|
||||
`1.57.6` and standalone frontend release `1.60.0` in an isolated CPU host on 2026-11-01.
|
||||
- Each frontend passed all fifteen browser cases without skips or retries, including native
|
||||
sidebar resizing, tab handoff, model-control interactions, promoted widgets, and graph replay.
|
||||
- The later frontend source checkout, either Desktop surface, and the older ComfyUI tag with
|
||||
a different bundle remain separate, unexecuted subjects. No GPU or provider generation was
|
||||
part of this host campaign.
|
||||
|
||||
See the [compatibility matrix](compatibility_matrix.md) for exact anchors and evidence scope.
|
||||
|
||||
## Graph editing and replay
|
||||
|
||||
- Complete node IDs, including IDs containing colons, take precedence over subgraph-path
|
||||
interpretation. Numeric and ordinary nested-graph compatibility paths remain supported.
|
||||
- Shared subgraph definitions are resolved through their instance paths instead of choosing
|
||||
an arbitrary instance. Ambiguous IDs or targets fail before any widget values are written.
|
||||
- Parameter Lab edits and replay preserve the intended promoted-widget and execution context.
|
||||
|
||||
## Sidebar and Settings
|
||||
|
||||
- Native panels retain host-owned width allocation and splitter behavior. Switching to another
|
||||
sidebar tab preserves the host's current width.
|
||||
- Headers, tabs, Parameter Lab, and Settings model controls adapt to narrow native panels.
|
||||
Model selectors, refresh controls, and custom-model inputs remain usable and synchronized.
|
||||
- Older sidebar hosts retain the legacy layout fallback.
|
||||
|
||||
## Development tooling
|
||||
|
||||
- Node.js must satisfy `^20.19.0 || ^22.12.0 || >=24.0.0`, matching the locked Vite/Vitest
|
||||
requirements. Node.js 24 is recommended for local development.
|
||||
- Preflight, full-test scripts, pre-push, and direct npm test commands check the shared policy
|
||||
before starting dependency, bootstrap, or browser work. Dependency versions are unchanged.
|
||||
- This is a development/test requirement; using the installed custom nodes does not require
|
||||
installing Node.js.
|
||||
|
||||
## Upgrade notes
|
||||
|
||||
Update the custom-node pack through ComfyUI-Manager or Git, restart ComfyUI, and reload the
|
||||
browser. No configuration or storage-schema migration is required. Previously saved targets
|
||||
that are ambiguous in a shared subgraph must be selected again from the intended instance.
|
||||
|
||||
OpenClaw continues to use bounded `/history` and `/view` output access; direct Asset API
|
||||
adoption remains deferred. Desktop runtime qualification is tracked separately.
|
||||
|
||||
Previous release notes: [v1.3.0](v1.3.0.md).
|
||||
|
||||
[Compare v1.3.0...v1.3.2](https://github.com/rookiestar28/ComfyUI-OpenClaw/compare/v1.3.0...v1.3.2)
|
||||
@@ -47,6 +47,26 @@ Notes:
|
||||
- Muted or bypassed root nodes and subgraph branches are separated into suppressed diagnostics when the workflow payload includes enough frontend metadata. Plain API prompt JSON remains deterministic, but it may not contain frontend ancestry needed to identify inactive subgraph context.
|
||||
- If no portability guidance is present and the pack itself is loaded correctly, treat that as a real contract gap rather than assuming the workflow can be repaired by arbitrary JSON edits.
|
||||
|
||||
## Sidebar width or Settings controls look wrong
|
||||
|
||||
On current native sidebar hosts, use ComfyUI's splitter to set the panel width. OpenClaw
|
||||
follows that width and keeps it when switching sidebar tabs. Settings model controls wrap
|
||||
in narrow panels, and selecting a custom model keeps the custom input available.
|
||||
|
||||
If a native panel remains unusually wide or its controls overlap, update OpenClaw, restart
|
||||
ComfyUI, and reload the browser to replace cached scripts and styles. Older sidebar hosts
|
||||
use the legacy sizing fallback. Check the [compatibility matrix](release/compatibility_matrix.md)
|
||||
for the exact qualified frontend versions; Desktop has separate, unexecuted runtime anchors.
|
||||
|
||||
## Parameter Lab rejects an ambiguous replay target
|
||||
|
||||
Complete node IDs are preserved, including IDs containing colons. A shared subgraph
|
||||
definition may occur in multiple workflow instances, so its definition alone cannot identify
|
||||
which instance should receive a value. Ambiguous edits and replays stop before changing
|
||||
widget values. Select the intended instance from the current graph and create a new run
|
||||
when an older saved target no longer identifies one instance; do not shorten or numerically
|
||||
coerce its node ID to force a match.
|
||||
|
||||
## Operator Doctor
|
||||
|
||||
Run the built-in diagnostic tool to verify environment readiness (libraries, permissions, contract files):
|
||||
|
||||
Generated
+133
-133
@@ -8,10 +8,10 @@
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.50.0",
|
||||
"jsdom": "^26.0.0",
|
||||
"vitest": "^4.1.11"
|
||||
"vitest": "^4.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@asamuzakjp/css-color": {
|
||||
@@ -151,9 +151,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@oxc-project/types": {
|
||||
"version": "0.149.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.149.0.tgz",
|
||||
"integrity": "sha512-Efcc+iF0j3Bf67YjEqIqWXbX5XddXoK/Mw4K1/JuXwRCZ8N16VR7iT23nlCc9XrveFVh/E5Rqs2StT0V8v9LdA==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.155.0.tgz",
|
||||
"integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -176,9 +176,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm-eabi": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.8.tgz",
|
||||
"integrity": "sha512-tN5aztYkKCte4i5SIrrz5yK/HMjEuCqCSCJa418jOV8tZ1cBY3YF2otxB1ktPxzsLA1BeTqwapK0bfjxNvHJVw==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.15.tgz",
|
||||
"integrity": "sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -193,9 +193,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm64": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.8.tgz",
|
||||
"integrity": "sha512-dIYTWl9XprMUiQFoc55KUyk/oS8SKYH3zFl0LTR7RT0Xj4hgSVyuJcroH8JUu8RcpF8fTB6E0aOwCkZoYPcDSQ==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.15.tgz",
|
||||
"integrity": "sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -210,9 +210,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-arm64": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.8.tgz",
|
||||
"integrity": "sha512-PCSDQGXD2IyTEFrcgPyBM8jJuGmrbCMuoIOXdbEGVemruKACXoLQJrb+A45Z0L5t1RQkdfJprAYPkikbh7dzdA==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.15.tgz",
|
||||
"integrity": "sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -227,9 +227,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-x64": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.8.tgz",
|
||||
"integrity": "sha512-Uk7lRsGhPFHVX/sAUC6D5H9Ol30dFHd6iquokll2th3LpdJ3F5CzQB+7DHn0Ri2mG+U7k2zXiPHDrwZenXhwSA==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.15.tgz",
|
||||
"integrity": "sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -244,9 +244,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-freebsd-x64": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.8.tgz",
|
||||
"integrity": "sha512-DjszaTEVogPqA5bYzsEeqDCQxbcp2fexQwKcRspYji2yzR68fCf+e4fx6kBSRDwX5/brZaHw/hWS9+A/+/w9sQ==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.15.tgz",
|
||||
"integrity": "sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -261,9 +261,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.8.tgz",
|
||||
"integrity": "sha512-zmwa7FTmdzB6aaEEuuls18H6Ap5JmJPSoPTuXixeJZV6tG40SyLkApQtz1g8ptZtiEKqj9OM0oNLPh1AgvE31Q==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.15.tgz",
|
||||
"integrity": "sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -278,9 +278,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-gnu": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.8.tgz",
|
||||
"integrity": "sha512-KdYQDPHwJVnbFwdTGMgxsI9SqblBlz6STGM+w1We/d5B8OWWidYH0MwkU/uA1wM5fIpO2MkOVxXrNzzuZhw9ew==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.15.tgz",
|
||||
"integrity": "sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -298,9 +298,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-musl": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.8.tgz",
|
||||
"integrity": "sha512-jFJTifHnNPY+yzOoNZQfSIysrVyXzEQPhPnOUjmD1bcQGHH6s7c8cViKWar8YplQImE5N9JRqMCLrM2CdxOrZA==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.15.tgz",
|
||||
"integrity": "sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -318,9 +318,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.8.tgz",
|
||||
"integrity": "sha512-FhiOziBDWPBjbcmRzfLyIJnaP7AVMFXT7YCXPjXxj7wKU3vx24RjrCNN/zjvVa+N2vVoHJwCoUBvsrN/DG3zIA==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.15.tgz",
|
||||
"integrity": "sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -338,9 +338,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-s390x-gnu": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.8.tgz",
|
||||
"integrity": "sha512-WnHfADMzOV2Y55wlx1hzzQnar/wDt/VdvWSD99r18Mz9ylNieIGOkRx3UV21h7m/eJvjySYJkO26VvGNFkwsIQ==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.15.tgz",
|
||||
"integrity": "sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -358,9 +358,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-gnu": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.8.tgz",
|
||||
"integrity": "sha512-H9tRr5ibfXFVLxbPOseVewewFpl28zcEdjRDt2FTUZU7odxP0gEv1ki4/kGmcGOh78oRwZuuQllGLZ9zTJp84g==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.15.tgz",
|
||||
"integrity": "sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -378,9 +378,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-musl": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.8.tgz",
|
||||
"integrity": "sha512-UefiqfM3D6IVNlZ8tSGs9+Ejjud2T+oxO0IHADU45Y+lyEjD2dVFyZHbkfX0LUb5Zugo/oIv1eCO/KVYhgYJYA==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.15.tgz",
|
||||
"integrity": "sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -398,9 +398,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-openharmony-arm64": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.8.tgz",
|
||||
"integrity": "sha512-637Ke4kWSy6rp9cxQ9gMOXlxPgIw/c1beASV4M//3+9I4uwBVOOl74G+e3zyU3u19U7RkRl/HuewixZ/Z6+Rjg==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.15.tgz",
|
||||
"integrity": "sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -415,9 +415,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-arm64-msvc": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.8.tgz",
|
||||
"integrity": "sha512-xWBkPOF1Q9k/Gv1nQXnVdLxKu74jXppuOM4Z3mnypVUJJJwLsMl7hNJGRAUJoG8A5MgOI1ACKM+wBFxSJzKy4A==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.15.tgz",
|
||||
"integrity": "sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -432,9 +432,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-x64-msvc": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.8.tgz",
|
||||
"integrity": "sha512-uz2ZvfgXbxqNwijjjbxrnvALwpyODDcgc1T1N8N3rf/DXKQmaFwmB4LX4yyjggpwN2obdQLb2rgirX5ffCWYng==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.15.tgz",
|
||||
"integrity": "sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -488,16 +488,16 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@vitest/expect": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.11.tgz",
|
||||
"integrity": "sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==",
|
||||
"version": "4.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.12.tgz",
|
||||
"integrity": "sha512-vFlTt+YEu9WBpNjdGayNmlMVzrWPi1+sv853/7t2FU7hpO5gAFBKHzQmkCq5Xjpr+evegF2994LQT3hF3mRlqQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@standard-schema/spec": "^1.1.0",
|
||||
"@types/chai": "^5.2.2",
|
||||
"@vitest/spy": "4.1.11",
|
||||
"@vitest/utils": "4.1.11",
|
||||
"@vitest/spy": "4.1.12",
|
||||
"@vitest/utils": "4.1.12",
|
||||
"chai": "^6.2.2",
|
||||
"tinyrainbow": "^3.1.0"
|
||||
},
|
||||
@@ -506,13 +506,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/mocker": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.11.tgz",
|
||||
"integrity": "sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==",
|
||||
"version": "4.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.12.tgz",
|
||||
"integrity": "sha512-fKShNpKZzupWZuY0z7egydvL0sqW4INEZBEExMBMAa6izlENEVHwoXgdaTCaBZ5fwlr4xf2o1wXC83n9RpO+NA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitest/spy": "4.1.11",
|
||||
"@vitest/spy": "4.1.12",
|
||||
"estree-walker": "^3.0.3",
|
||||
"magic-string": "^0.30.21"
|
||||
},
|
||||
@@ -533,9 +533,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/pretty-format": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.11.tgz",
|
||||
"integrity": "sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==",
|
||||
"version": "4.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.12.tgz",
|
||||
"integrity": "sha512-XW9O8+Mxx4VpCtkYdMJLZQQwsVryP9wk7cPKDxtXFfwSak6yRh5+2fep/Y0XF/ElBvJHq8bcYdi6aeuai0opZA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -546,13 +546,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/runner": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.11.tgz",
|
||||
"integrity": "sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==",
|
||||
"version": "4.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.12.tgz",
|
||||
"integrity": "sha512-NKlVKCr5QnCe8jijdMnmkpHHU+WTqiLFR6G0pHji9uRjXK9xJl1k1nTw6F3pOOj2PDcsDt2GKQMI7wIsaT491w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitest/utils": "4.1.11",
|
||||
"@vitest/utils": "4.1.12",
|
||||
"pathe": "^2.0.3"
|
||||
},
|
||||
"funding": {
|
||||
@@ -560,14 +560,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/snapshot": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.11.tgz",
|
||||
"integrity": "sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==",
|
||||
"version": "4.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.12.tgz",
|
||||
"integrity": "sha512-ko1y1Qgb/slzQ9mr+b89Cuqud8WG1TKtsPD8r7ZUBdvVOGt85Af2HwCqHujrhwJq95hs/9RM7fcAPg57o1vlzw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitest/pretty-format": "4.1.11",
|
||||
"@vitest/utils": "4.1.11",
|
||||
"@vitest/pretty-format": "4.1.12",
|
||||
"@vitest/utils": "4.1.12",
|
||||
"magic-string": "^0.30.21",
|
||||
"pathe": "^2.0.3"
|
||||
},
|
||||
@@ -576,9 +576,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/spy": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.11.tgz",
|
||||
"integrity": "sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==",
|
||||
"version": "4.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.12.tgz",
|
||||
"integrity": "sha512-RGq9x4JNGNTZHEJxvN0oSiJjeSCExm0n2gZKKJZHY9cX5AVA6M7VJILBT3ZJ/tJ/0J9uWT7fETV9/btoi//vSg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -586,13 +586,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/utils": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.11.tgz",
|
||||
"integrity": "sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==",
|
||||
"version": "4.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.12.tgz",
|
||||
"integrity": "sha512-Q3awXrwOfEV+qc3WmO5ONyE0yO7Q1gQ9/oyHxGLZ/pl7N3NO/ZztqQwKLuwMkV+CA1JYSIeO3gkHnRDIo4AVaA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitest/pretty-format": "4.1.11",
|
||||
"@vitest/pretty-format": "4.1.12",
|
||||
"convert-source-map": "^2.0.0",
|
||||
"tinyrainbow": "^3.1.0"
|
||||
},
|
||||
@@ -621,9 +621,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/chai": {
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz",
|
||||
"integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==",
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz",
|
||||
"integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1171,9 +1171,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.19",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.19.tgz",
|
||||
"integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==",
|
||||
"version": "3.3.20",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
||||
"integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -1278,9 +1278,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.28",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz",
|
||||
"integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==",
|
||||
"version": "8.5.31",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.31.tgz",
|
||||
"integrity": "sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -1298,9 +1298,9 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.18",
|
||||
"nanoid": "^3.3.20",
|
||||
"picocolors": "^1.1.1",
|
||||
"source-map-js": "^1.2.1"
|
||||
"source-map-js": "^1.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
@@ -1317,13 +1317,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rolldown": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.8.tgz",
|
||||
"integrity": "sha512-Z67nTmhZe7anqnM/EjI392w5i/ANUinjip7QYsOyN37oayduxt3ksdX0hf5OOamkAd53BiIHfbfSzfUmzKFQqQ==",
|
||||
"version": "1.2.15",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.15.tgz",
|
||||
"integrity": "sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "=0.149.0",
|
||||
"@oxc-project/types": "=0.155.0",
|
||||
"@rolldown/pluginutils": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
@@ -1333,21 +1333,21 @@
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rolldown/binding-android-arm-eabi": "1.2.8",
|
||||
"@rolldown/binding-android-arm64": "1.2.8",
|
||||
"@rolldown/binding-darwin-arm64": "1.2.8",
|
||||
"@rolldown/binding-darwin-x64": "1.2.8",
|
||||
"@rolldown/binding-freebsd-x64": "1.2.8",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.2.8",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.2.8",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.2.8",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.2.8",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.2.8",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.2.8",
|
||||
"@rolldown/binding-linux-x64-musl": "1.2.8",
|
||||
"@rolldown/binding-openharmony-arm64": "1.2.8",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.2.8",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.8"
|
||||
"@rolldown/binding-android-arm-eabi": "1.2.15",
|
||||
"@rolldown/binding-android-arm64": "1.2.15",
|
||||
"@rolldown/binding-darwin-arm64": "1.2.15",
|
||||
"@rolldown/binding-darwin-x64": "1.2.15",
|
||||
"@rolldown/binding-freebsd-x64": "1.2.15",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.2.15",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.2.15",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.2.15",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.2.15",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.2.15",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.2.15",
|
||||
"@rolldown/binding-linux-x64-musl": "1.2.15",
|
||||
"@rolldown/binding-openharmony-arm64": "1.2.15",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.2.15",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.15"
|
||||
}
|
||||
},
|
||||
"node_modules/rrweb-cssom": {
|
||||
@@ -1450,9 +1450,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tinyrainbow": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.1.tgz",
|
||||
"integrity": "sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==",
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.2.0.tgz",
|
||||
"integrity": "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1506,16 +1506,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.0.tgz",
|
||||
"integrity": "sha512-lhZBVvEHefgE+HQZC9O7EBJgCU/nVzFNl7vkS4RE0APtWLP02/8QVIkQtzBxPquh7lq5/78NHipTj7ODQ6XuyQ==",
|
||||
"version": "8.3.5",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.5.tgz",
|
||||
"integrity": "sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"lightningcss": "^1.33.0",
|
||||
"picomatch": "^4.0.7",
|
||||
"postcss": "^8.5.28",
|
||||
"rolldown": "~1.2.6",
|
||||
"postcss": "^8.5.30",
|
||||
"rolldown": "~1.2.14",
|
||||
"tinyglobby": "^0.2.17"
|
||||
},
|
||||
"bin": {
|
||||
@@ -1532,7 +1532,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": "^20.19.0 || >=22.12.0",
|
||||
"@vitejs/devtools": "^0.7.1",
|
||||
"@vitejs/devtools": "^0.7.1 || ^0.8.0",
|
||||
"esbuild": "^0.27.0 || ^0.28.0",
|
||||
"jiti": ">=1.21.0",
|
||||
"less": "^4.0.0",
|
||||
@@ -1599,19 +1599,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitest": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.11.tgz",
|
||||
"integrity": "sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==",
|
||||
"version": "4.1.12",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.12.tgz",
|
||||
"integrity": "sha512-5eWdz2yb3ajxWF3C8C4TjkXl7FGm3n2E/VlazALrQHzK7nYMSGFnCZto0bbPNl77AwkOZVLk0YnBAejUu0NiWA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitest/expect": "4.1.11",
|
||||
"@vitest/mocker": "4.1.11",
|
||||
"@vitest/pretty-format": "4.1.11",
|
||||
"@vitest/runner": "4.1.11",
|
||||
"@vitest/snapshot": "4.1.11",
|
||||
"@vitest/spy": "4.1.11",
|
||||
"@vitest/utils": "4.1.11",
|
||||
"@vitest/expect": "4.1.12",
|
||||
"@vitest/mocker": "4.1.12",
|
||||
"@vitest/pretty-format": "4.1.12",
|
||||
"@vitest/runner": "4.1.12",
|
||||
"@vitest/snapshot": "4.1.12",
|
||||
"@vitest/spy": "4.1.12",
|
||||
"@vitest/utils": "4.1.12",
|
||||
"es-module-lexer": "^2.0.0",
|
||||
"expect-type": "^1.3.0",
|
||||
"magic-string": "^0.30.21",
|
||||
@@ -1639,12 +1639,12 @@
|
||||
"@edge-runtime/vm": "*",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
|
||||
"@vitest/browser-playwright": "4.1.11",
|
||||
"@vitest/browser-preview": "4.1.11",
|
||||
"@vitest/browser-webdriverio": "4.1.11",
|
||||
"@vitest/coverage-istanbul": "4.1.11",
|
||||
"@vitest/coverage-v8": "4.1.11",
|
||||
"@vitest/ui": "4.1.11",
|
||||
"@vitest/browser-playwright": "4.1.12",
|
||||
"@vitest/browser-preview": "4.1.12",
|
||||
"@vitest/browser-webdriverio": "^4.1.11",
|
||||
"@vitest/coverage-istanbul": "4.1.12",
|
||||
"@vitest/coverage-v8": "4.1.12",
|
||||
"@vitest/ui": "4.1.12",
|
||||
"happy-dom": "*",
|
||||
"jsdom": "*",
|
||||
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||
|
||||
+8
-8
@@ -2,21 +2,21 @@
|
||||
"name": "comfyui-openclaw",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.50.0",
|
||||
"jsdom": "^26.0.0",
|
||||
"vitest": "^4.1.11"
|
||||
"vitest": "^4.1.12"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node scripts/run-playwright.mjs",
|
||||
"test:stress": "node scripts/run-playwright.mjs --stress",
|
||||
"test:unit": "vitest run",
|
||||
"test:unit:watch": "vitest",
|
||||
"test:ui": "npx playwright test --ui",
|
||||
"test:headed": "npx playwright test --headed",
|
||||
"test:debug": "npx playwright test --debug",
|
||||
"test:report": "npx playwright show-report"
|
||||
"test:unit": "node scripts/check-node-runtime.mjs && vitest run",
|
||||
"test:unit:watch": "node scripts/check-node-runtime.mjs && vitest",
|
||||
"test:ui": "node scripts/check-node-runtime.mjs && npx playwright test --ui",
|
||||
"test:headed": "node scripts/check-node-runtime.mjs && npx playwright test --headed",
|
||||
"test:debug": "node scripts/check-node-runtime.mjs && npx playwright test --debug",
|
||||
"test:report": "node scripts/check-node-runtime.mjs && npx playwright show-report"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-openclaw"
|
||||
description = "Your own personal AIGC Factory. Any picture. Any reel. The Comfy way.©️"
|
||||
version = "1.3.0"
|
||||
version = "1.3.2"
|
||||
license = {text = "MIT"}
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const REMEDIATION = 'Select a stable Node 24 runtime with your version manager, verify node -v, then retry.';
|
||||
|
||||
function parseVersion(value) {
|
||||
const match = typeof value === 'string' && /^(?:v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.exec(value);
|
||||
if (!match) return null;
|
||||
const parts = match.slice(1).map(Number);
|
||||
return parts.every(Number.isSafeInteger) ? parts : null;
|
||||
}
|
||||
|
||||
function compare(left, right) {
|
||||
for (let index = 0; index < 3; index += 1) {
|
||||
if (left[index] !== right[index]) return left[index] > right[index] ? 1 : -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function parsePolicy(policy) {
|
||||
if (typeof policy !== 'string' || policy.length > 256 || !policy.trim()) {
|
||||
throw new Error(`Invalid package.json engines.node policy. ${REMEDIATION}`);
|
||||
}
|
||||
return policy.split('||').map((branch) => {
|
||||
const match = /^(\^|>=)(\d+\.\d+\.\d+)$/.exec(branch.trim());
|
||||
const minimum = match && parseVersion(match[2]);
|
||||
if (!minimum || (match[1] === '^' && minimum[0] === 0)) {
|
||||
throw new Error(`Unsupported package.json engines.node policy format. ${REMEDIATION}`);
|
||||
}
|
||||
return { operator: match[1], minimum };
|
||||
});
|
||||
}
|
||||
|
||||
export function readNodePolicy() {
|
||||
return JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf8')).engines?.node;
|
||||
}
|
||||
|
||||
export function isSupportedNodeVersion(version, policy = readNodePolicy()) {
|
||||
const branches = parsePolicy(policy);
|
||||
const parsed = parseVersion(version);
|
||||
if (!parsed) return false;
|
||||
// IMPORTANT: the locked Vite/Vitest intersection excludes older minors and
|
||||
// entire major lines. A major-only floor silently accepts incompatible tools.
|
||||
return branches.some(({ operator, minimum }) => compare(parsed, minimum) >= 0 &&
|
||||
(operator === '>=' || parsed[0] === minimum[0]));
|
||||
}
|
||||
|
||||
export function ensureSupportedNode(version = process.versions.node, policy = readNodePolicy()) {
|
||||
if (!isSupportedNodeVersion(version, policy)) {
|
||||
throw new Error(`Unsupported Node ${version || '(unknown)'}. Required: ${policy}. ${REMEDIATION}`);
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
||||
try {
|
||||
const version = ensureSupportedNode();
|
||||
console.log(`[OpenClaw] Node ${version}; supported policy: ${readNodePolicy()}`);
|
||||
} catch (error) {
|
||||
console.error(`[OpenClaw] ${error.message}`);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
}
|
||||
+12
-30
@@ -98,6 +98,12 @@ assert_clean_public_worktree() {
|
||||
|
||||
assert_clean_public_worktree
|
||||
|
||||
if ! command -v node >/dev/null 2>&1; then
|
||||
echo "[pre-push] ERROR: Node.js missing. Select a stable Node 24 runtime, verify node -v, then retry." >&2
|
||||
exit 1
|
||||
fi
|
||||
node scripts/check-node-runtime.mjs
|
||||
|
||||
is_wsl() {
|
||||
grep -qiE "(microsoft|wsl)" /proc/version 2>/dev/null
|
||||
}
|
||||
@@ -236,6 +242,12 @@ if ! "$VENV_PY" -c "import defusedxml" >/dev/null 2>&1; then
|
||||
echo "[pre-push] INFO: installing defusedxml into project venv ($VENV_DIR) ..." >&2
|
||||
pip_install_or_fail "required for S85 fail-closed XML parsing paths/tests" defusedxml
|
||||
fi
|
||||
if ! "$VENV_PY" -c "import Cryptodome" >/dev/null 2>&1; then
|
||||
# IMPORTANT: skip-policy lanes install every pyproject optional extra; without it the
|
||||
# WeChat AES tests skip here and spend skip budget the Windows gate never sees.
|
||||
echo "[pre-push] INFO: installing pycryptodomex into project venv ($VENV_DIR) ..." >&2
|
||||
pip_install_or_fail "required for WeChat AES tests (wechat-aes extra)" "pycryptodomex>=3.20"
|
||||
fi
|
||||
if ! "$VENV_PY" -c "import sys, importlib.util; has_coverage = importlib.util.find_spec('coverage') is not None; has_toml = sys.version_info >= (3, 11) or importlib.util.find_spec('tomli') is not None; sys.exit(0 if has_coverage and has_toml else 1)" >/dev/null 2>&1; then
|
||||
# CRITICAL: Python 3.10 coverage cannot read pyproject.toml without TOML
|
||||
# support; plain coverage here causes local pass/CI fail drift.
|
||||
@@ -308,36 +320,6 @@ run_pre_commit_safe() {
|
||||
return 1
|
||||
}
|
||||
|
||||
# Ensure Node 18+ for Playwright/E2E.
|
||||
# CI uses Node 20; local baseline is Node 18.
|
||||
if [ -n "${NVM_DIR:-}" ] && [ -s "${NVM_DIR}/nvm.sh" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "${NVM_DIR}/nvm.sh"
|
||||
elif [ -s "${HOME}/.nvm/nvm.sh" ]; then
|
||||
# shellcheck disable=SC1091
|
||||
. "${HOME}/.nvm/nvm.sh"
|
||||
fi
|
||||
|
||||
if command -v nvm >/dev/null 2>&1; then
|
||||
if [ -f ".nvmrc" ]; then
|
||||
if ! nvm use >/dev/null 2>&1; then
|
||||
echo "[pre-push] WARN: nvm use (.nvmrc) failed; using current node in PATH." >&2
|
||||
fi
|
||||
else
|
||||
if ! nvm use 18 >/dev/null 2>&1; then
|
||||
echo "[pre-push] WARN: nvm use 18 failed; using current node in PATH." >&2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
require_cmd node
|
||||
NODE_MAJOR="$(node -p "process.versions.node.split('.')[0]")"
|
||||
if [ "$NODE_MAJOR" -lt 18 ]; then
|
||||
echo "[pre-push] ERROR: Node >=18 required, current=$(node -v)" >&2
|
||||
echo "[pre-push] Hint: install nvm and run 'nvm use 18'." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
can_bind_local_port() {
|
||||
local port="$1"
|
||||
node -e "const net=require('net'); const port=Number(process.argv[1]); const server=net.createServer(); server.unref(); server.once('error', ()=>process.exit(1)); server.listen({host:'127.0.0.1', port, exclusive:true}, ()=>server.close(()=>process.exit(0)));" "$port" >/dev/null 2>&1
|
||||
|
||||
+16
-20
@@ -5,7 +5,7 @@ R120: Dependency parity preflight check.
|
||||
Validates the build environment before deployment or test execution.
|
||||
Checks:
|
||||
1. Python version (>=3.10)
|
||||
2. Node.js version (>=18.0.0, per package.json + TEST_SOP)
|
||||
2. Node.js version (shared package.json engine policy)
|
||||
3. Essential Python dependencies (cryptography, defusedxml)
|
||||
|
||||
Usage:
|
||||
@@ -13,13 +13,13 @@ Usage:
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Minimum requirements
|
||||
MIN_PYTHON_VERSION = (3, 10)
|
||||
MIN_NODE_VERSION = (18, 0, 0)
|
||||
NODE_RUNTIME_GUARD = Path(__file__).resolve().with_name("check-node-runtime.mjs")
|
||||
|
||||
REQUIRED_PYTHON_PACKAGES = [
|
||||
("cryptography", "41.0"),
|
||||
@@ -58,30 +58,26 @@ def check_python_version() -> bool:
|
||||
|
||||
|
||||
def check_node_version() -> bool:
|
||||
"""Validate Node.js version."""
|
||||
"""Delegate to the dependency-free guard used by npm and both full scripts."""
|
||||
try:
|
||||
output = (
|
||||
subprocess.check_output(["node", "--version"], stderr=subprocess.STDOUT)
|
||||
subprocess.check_output(
|
||||
["node", str(NODE_RUNTIME_GUARD)],
|
||||
stderr=subprocess.STDOUT,
|
||||
timeout=10,
|
||||
)
|
||||
.decode("utf-8")
|
||||
.strip()
|
||||
)
|
||||
# Output is usually vX.Y.Z
|
||||
match = re.search(r"v(\d+)\.(\d+)\.(\d+)", output)
|
||||
if not match:
|
||||
log_warn(f"Could not parse Node version from '{output}'.")
|
||||
return False
|
||||
|
||||
major, minor, patch = map(int, match.groups())
|
||||
if (major, minor, patch) < MIN_NODE_VERSION:
|
||||
log_fail(
|
||||
f"Node version {output} is too old. Required: >={'.'.join(map(str, MIN_NODE_VERSION))}"
|
||||
)
|
||||
return False
|
||||
|
||||
log_ok(f"Node version: {output}")
|
||||
log_ok(output)
|
||||
return True
|
||||
except FileNotFoundError:
|
||||
log_fail("Node.js not found in PATH.")
|
||||
log_fail(
|
||||
"Node.js not found in PATH. Select a stable Node 24 runtime, then retry."
|
||||
)
|
||||
return False
|
||||
except subprocess.CalledProcessError as exc:
|
||||
log_fail(exc.output.decode("utf-8", errors="replace").strip())
|
||||
return False
|
||||
except Exception as e:
|
||||
log_warn(f"Failed to check Node version: {e}")
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { ensureSupportedNode } from './check-node-runtime.mjs';
|
||||
|
||||
try {
|
||||
ensureSupportedNode();
|
||||
} catch (error) {
|
||||
console.error(`[OpenClaw] ${error.message}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function parsePositiveInt(value, label) {
|
||||
const parsed = Number.parseInt(value, 10);
|
||||
|
||||
@@ -101,7 +101,11 @@ assert_clean_public_worktree() {
|
||||
|
||||
assert_clean_public_worktree
|
||||
|
||||
require_cmd node
|
||||
if ! command -v node >/dev/null 2>&1; then
|
||||
echo "[tests] ERROR: Node.js missing. Select a stable Node 24 runtime, verify node -v, then retry." >&2
|
||||
exit 1
|
||||
fi
|
||||
node scripts/check-node-runtime.mjs
|
||||
require_cmd npm
|
||||
|
||||
ensure_npm_deps() {
|
||||
@@ -152,26 +156,11 @@ if ! "$VENV_PY" -c "import defusedxml" >/dev/null 2>&1; then
|
||||
pip_install_or_fail "required for S85 fail-closed XML parsing tests" defusedxml
|
||||
fi
|
||||
|
||||
NODE_MAJOR="$(node -p "process.versions.node.split('.')[0]")"
|
||||
if [ "$NODE_MAJOR" -lt 18 ]; then
|
||||
# Best-effort: try to use nvm if available
|
||||
if [ -n "${NVM_DIR:-}" ] && [ -s "${NVM_DIR}/nvm.sh" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "${NVM_DIR}/nvm.sh"
|
||||
elif [ -s "${HOME}/.nvm/nvm.sh" ]; then
|
||||
# shellcheck disable=SC1091
|
||||
. "${HOME}/.nvm/nvm.sh"
|
||||
fi
|
||||
if command -v nvm >/dev/null 2>&1; then
|
||||
nvm use 18 >/dev/null 2>&1 || true
|
||||
fi
|
||||
NODE_MAJOR="$(node -p "process.versions.node.split('.')[0]")"
|
||||
fi
|
||||
|
||||
if [ "$NODE_MAJOR" -lt 18 ]; then
|
||||
echo "[tests] ERROR: Node >=18 required, current=$(node -v)" >&2
|
||||
echo "[tests] Hint: source ~/.nvm/nvm.sh && nvm use 18" >&2
|
||||
exit 1
|
||||
if ! "$VENV_PY" -c "import Cryptodome" >/dev/null 2>&1; then
|
||||
# IMPORTANT: skip-policy lanes install every pyproject optional extra; without it the
|
||||
# WeChat AES tests skip here and spend skip budget the Windows gate never sees.
|
||||
echo "[tests] Installing pycryptodomex into project venv ($VENV_DIR) ..."
|
||||
pip_install_or_fail "required for WeChat AES tests (wechat-aes extra)" "pycryptodomex>=3.20"
|
||||
fi
|
||||
|
||||
can_bind_local_port() {
|
||||
|
||||
@@ -68,7 +68,10 @@ function Assert-CleanPublicWorktree {
|
||||
|
||||
Assert-CleanPublicWorktree
|
||||
|
||||
Require-Cmd node
|
||||
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
|
||||
throw "[tests] ERROR: Node.js missing. Select a stable Node 24 runtime, verify node -v, then retry."
|
||||
}
|
||||
Invoke-Checked "Node runtime policy" { & node scripts/check-node-runtime.mjs }
|
||||
Require-Cmd npm
|
||||
|
||||
function Ensure-NpmDeps {
|
||||
@@ -216,19 +219,6 @@ if (-not $qualityToolsReady) {
|
||||
Invoke-Checked "pip install quality tools" { & $venvPython -m pip install -r requirements-quality.txt }
|
||||
}
|
||||
|
||||
# Ensure Node >= 18
|
||||
$nodeMajor = [int]((& node -p "process.versions.node.split('.')[0]").Trim())
|
||||
if ($nodeMajor -lt 18) {
|
||||
Write-Host "[tests] WARN: Node < 18 detected. Trying nvm use 18..."
|
||||
if (Get-Command nvm -ErrorAction SilentlyContinue) {
|
||||
nvm use 18 | Out-Null
|
||||
$nodeMajor = [int]((& node -p "process.versions.node.split('.')[0]").Trim())
|
||||
}
|
||||
}
|
||||
if ($nodeMajor -lt 18) {
|
||||
throw "[tests] ERROR: Node >=18 required, current=$(node -v)"
|
||||
}
|
||||
|
||||
function Test-PortBindable {
|
||||
param([Parameter(Mandatory = $true)][int]$Port)
|
||||
|
||||
|
||||
+128
-10
@@ -17,12 +17,14 @@ import time
|
||||
import traceback
|
||||
import types
|
||||
import unittest
|
||||
from collections.abc import Iterable
|
||||
from collections.abc import Iterable, Mapping
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
_PRUNED_DIRS = frozenset({"__pycache__", "node_modules"})
|
||||
# sys.platform values a platform-exclusive skip declaration may name.
|
||||
SKIP_POLICY_PLATFORMS = frozenset({"darwin", "linux", "win32"})
|
||||
|
||||
|
||||
def _build_suite(args: argparse.Namespace) -> unittest.TestSuite:
|
||||
@@ -141,18 +143,98 @@ def _load_skip_policy(path: str) -> dict[str, Any]:
|
||||
return {
|
||||
"max_skipped": max_skipped,
|
||||
"no_skip_modules": [item.strip() for item in no_skip_modules],
|
||||
"platform_exclusive_tests": _load_platform_exclusive_tests(
|
||||
data.get("platform_exclusive_tests")
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _load_platform_exclusive_tests(raw: Any) -> dict[str, frozenset[str]]:
|
||||
"""Return ``{canonical test id: platforms it can run on}`` from the skip policy."""
|
||||
if raw is None:
|
||||
return {}
|
||||
if not isinstance(raw, dict):
|
||||
raise ValueError("platform_exclusive_tests must be an object keyed by test id")
|
||||
declarations: dict[str, frozenset[str]] = {}
|
||||
for test_id, entry in raw.items():
|
||||
label = f"platform_exclusive_tests[{test_id}]"
|
||||
parts = test_id.split(".")
|
||||
if parts[0] != "tests" or len(parts) < 4 or not all(parts):
|
||||
raise ValueError(f"{label}: id must be tests.<module>.<Class>.<method>")
|
||||
if not isinstance(entry, dict):
|
||||
raise ValueError(f"{label}: entry must be an object")
|
||||
platforms = entry.get("platforms")
|
||||
if (
|
||||
not isinstance(platforms, list)
|
||||
or not platforms
|
||||
or any(
|
||||
not isinstance(item, str) or item not in SKIP_POLICY_PLATFORMS
|
||||
for item in platforms
|
||||
)
|
||||
):
|
||||
raise ValueError(
|
||||
f"{label}: platforms must be a non-empty list drawn from "
|
||||
f"{sorted(SKIP_POLICY_PLATFORMS)}"
|
||||
)
|
||||
reason = entry.get("reason")
|
||||
if not isinstance(reason, str) or not reason.strip():
|
||||
raise ValueError(f"{label}: reason must be a non-empty string")
|
||||
declarations[test_id] = frozenset(platforms)
|
||||
return declarations
|
||||
|
||||
|
||||
def _canonical_test_id(test_case: Any) -> str:
|
||||
"""Name a test after its repository-relative module path (``tests.<module>...``)."""
|
||||
test_id = test_case.id() if hasattr(test_case, "id") else str(test_case)
|
||||
# A skipped subTest is reported as its own object; its module is the parent test's.
|
||||
owner = getattr(test_case, "test_case", None)
|
||||
if not isinstance(owner, unittest.TestCase):
|
||||
owner = test_case
|
||||
module_name = type(owner).__module__
|
||||
module_file = getattr(sys.modules.get(module_name), "__file__", None)
|
||||
if not module_file or not test_id.startswith(module_name + "."):
|
||||
return test_id
|
||||
try:
|
||||
relative = Path(module_file).resolve().relative_to(REPO_ROOT)
|
||||
except ValueError:
|
||||
return test_id
|
||||
parts = relative.with_suffix("").parts
|
||||
if parts and parts[-1] == "__init__":
|
||||
parts = parts[:-1]
|
||||
return ".".join(parts) + test_id[len(module_name) :]
|
||||
|
||||
|
||||
def _collect_skips(result: unittest.TestResult) -> list[tuple[str, str]]:
|
||||
skips: list[tuple[str, str]] = []
|
||||
for test_case, reason in result.skipped:
|
||||
if hasattr(test_case, "id"):
|
||||
test_id = test_case.id()
|
||||
# CRITICAL: discovery from the non-package "tests" directory names top-level modules
|
||||
# "test_x", while subdirectory and --module runs name them "tests.test_x". Policy
|
||||
# entries use the "tests." form, so raw ids would never match top-level modules.
|
||||
return [
|
||||
(_canonical_test_id(test_case), str(reason))
|
||||
for test_case, reason in result.skipped
|
||||
]
|
||||
|
||||
|
||||
def _partition_skips(
|
||||
skips: Iterable[tuple[str, str]],
|
||||
*,
|
||||
platform_exclusive_tests: Mapping[str, frozenset[str]] | None,
|
||||
platform: str,
|
||||
) -> tuple[list[tuple[str, str]], list[tuple[str, str]]]:
|
||||
"""Split skips into (counted, excused).
|
||||
|
||||
Only a declared platform-exclusive test that skips on a platform it cannot run on is
|
||||
excused; the same test skipping on one of its own platforms still counts.
|
||||
"""
|
||||
declared = platform_exclusive_tests or {}
|
||||
counted: list[tuple[str, str]] = []
|
||||
excused: list[tuple[str, str]] = []
|
||||
for skip in skips:
|
||||
platforms = declared.get(skip[0])
|
||||
if platforms is not None and platform not in platforms:
|
||||
excused.append(skip)
|
||||
else:
|
||||
test_id = str(test_case)
|
||||
skips.append((test_id, str(reason)))
|
||||
return skips
|
||||
counted.append(skip)
|
||||
return counted, excused
|
||||
|
||||
|
||||
def _evaluate_skip_policy(
|
||||
@@ -160,14 +242,22 @@ def _evaluate_skip_policy(
|
||||
skips: Iterable[tuple[str, str]],
|
||||
max_skipped: int | None,
|
||||
no_skip_modules: Iterable[str],
|
||||
platform_exclusive_tests: Mapping[str, frozenset[str]] | None = None,
|
||||
platform: str | None = None,
|
||||
) -> list[str]:
|
||||
violations: list[str] = []
|
||||
skip_list = list(skips)
|
||||
if max_skipped is not None and len(skip_list) > max_skipped:
|
||||
counted, _ = _partition_skips(
|
||||
skip_list,
|
||||
platform_exclusive_tests=platform_exclusive_tests,
|
||||
platform=sys.platform if platform is None else platform,
|
||||
)
|
||||
if max_skipped is not None and len(counted) > max_skipped:
|
||||
violations.append(
|
||||
f"skip budget exceeded: skipped={len(skip_list)} > max_skipped={max_skipped}"
|
||||
f"skip budget exceeded: skipped={len(counted)} > max_skipped={max_skipped}"
|
||||
)
|
||||
|
||||
# IMPORTANT: no-skip modules apply to every skip, including platform-excused ones.
|
||||
prefixes = [p.strip() for p in no_skip_modules if p and p.strip()]
|
||||
for test_id, reason in skip_list:
|
||||
for prefix in prefixes:
|
||||
@@ -188,19 +278,33 @@ def _write_skip_report(
|
||||
max_skipped: int | None,
|
||||
no_skip_modules: list[str],
|
||||
violations: list[str],
|
||||
platform_exclusive_tests: Mapping[str, frozenset[str]] | None = None,
|
||||
platform: str | None = None,
|
||||
) -> None:
|
||||
report_path = Path(path)
|
||||
report_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
current_platform = sys.platform if platform is None else platform
|
||||
counted, excused = _partition_skips(
|
||||
skips,
|
||||
platform_exclusive_tests=platform_exclusive_tests,
|
||||
platform=current_platform,
|
||||
)
|
||||
payload = {
|
||||
"tests_run": tests_run,
|
||||
"duration_sec": round(duration_sec, 3),
|
||||
"platform": current_platform,
|
||||
"skipped_count": len(skips),
|
||||
"counted_skipped_count": len(counted),
|
||||
"skipped": [
|
||||
{"test_id": test_id, "reason": reason} for test_id, reason in skips
|
||||
],
|
||||
"platform_excused": [
|
||||
{"test_id": test_id, "reason": reason} for test_id, reason in excused
|
||||
],
|
||||
"policy": {
|
||||
"max_skipped": max_skipped,
|
||||
"no_skip_modules": no_skip_modules,
|
||||
"platform_exclusive_tests": sorted(platform_exclusive_tests or {}),
|
||||
},
|
||||
"violations": violations,
|
||||
}
|
||||
@@ -276,6 +380,7 @@ def main() -> int:
|
||||
|
||||
policy_max_skipped: int | None = None
|
||||
policy_no_skip_modules: list[str] = []
|
||||
policy_platform_exclusive: dict[str, frozenset[str]] = {}
|
||||
skip_policy_active = bool(
|
||||
args.enforce_skip_policy or args.max_skipped is not None or args.no_skip_module
|
||||
)
|
||||
@@ -287,6 +392,7 @@ def main() -> int:
|
||||
return 2
|
||||
policy_max_skipped = policy["max_skipped"]
|
||||
policy_no_skip_modules = policy["no_skip_modules"]
|
||||
policy_platform_exclusive = policy["platform_exclusive_tests"]
|
||||
|
||||
if args.max_skipped is not None:
|
||||
if args.max_skipped < 0:
|
||||
@@ -305,6 +411,7 @@ def main() -> int:
|
||||
skips=skips,
|
||||
max_skipped=policy_max_skipped,
|
||||
no_skip_modules=policy_no_skip_modules,
|
||||
platform_exclusive_tests=policy_platform_exclusive,
|
||||
)
|
||||
|
||||
skip_report_path = args.skip_report
|
||||
@@ -319,9 +426,20 @@ def main() -> int:
|
||||
max_skipped=policy_max_skipped,
|
||||
no_skip_modules=policy_no_skip_modules,
|
||||
violations=policy_violations,
|
||||
platform_exclusive_tests=policy_platform_exclusive,
|
||||
)
|
||||
print(f"Skip report: {skip_report_path}", file=sys.stdout)
|
||||
|
||||
_, excused_skips = _partition_skips(
|
||||
skips, platform_exclusive_tests=policy_platform_exclusive, platform=sys.platform
|
||||
)
|
||||
if excused_skips:
|
||||
print(
|
||||
f"Platform-excused skips: {len(excused_skips)} of {len(skips)} "
|
||||
f"(declared platform-exclusive tests; not counted on {sys.platform})",
|
||||
file=sys.stdout,
|
||||
)
|
||||
|
||||
summary = f"Ran {result.testsRun} tests in {duration:.3f}s"
|
||||
if result.wasSuccessful() and not policy_violations:
|
||||
if result.skipped:
|
||||
|
||||
@@ -9,11 +9,29 @@ gates before optional dependencies are installed.
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import ast
|
||||
import json
|
||||
from datetime import date
|
||||
from pathlib import Path, PurePosixPath
|
||||
from typing import Any
|
||||
|
||||
# Keep equal to SKIP_POLICY_PLATFORMS in scripts/run_unittests.py (pinned by a test).
|
||||
SKIP_POLICY_PLATFORMS = frozenset({"darwin", "linux", "win32"})
|
||||
# Platform probes a test can condition a skip on: os.name, sys.platform, platform.*().
|
||||
_PLATFORM_PROBES = frozenset(
|
||||
{
|
||||
("os", "name"),
|
||||
("sys", "platform"),
|
||||
("platform", "system"),
|
||||
("platform", "platform"),
|
||||
("platform", "win32_ver"),
|
||||
("platform", "mac_ver"),
|
||||
}
|
||||
)
|
||||
_SKIP_DECORATORS = frozenset({"skipIf", "skipUnless"})
|
||||
_CLASS_SETUP_METHODS = frozenset({"setUp", "setUpClass"})
|
||||
_PRUNED_TEST_DIRS = frozenset({"__pycache__", "node_modules"})
|
||||
|
||||
|
||||
def _read_json_object(path: Path) -> dict[str, Any]:
|
||||
payload = json.loads(path.read_text(encoding="utf-8-sig"))
|
||||
@@ -48,6 +66,191 @@ def _resolve_test_module_path(repo_root: Path, module_name: str) -> Path:
|
||||
return repo_root / Path(module_name.replace(".", "/")).with_suffix(".py")
|
||||
|
||||
|
||||
def _test_definition_problem(
|
||||
module_path: Path, class_name: str, method_name: str
|
||||
) -> str | None:
|
||||
"""Return why ``class_name.method_name`` is not defined in the module, or None."""
|
||||
tree = ast.parse(module_path.read_text(encoding="utf-8-sig"), str(module_path))
|
||||
for node in tree.body:
|
||||
if isinstance(node, ast.ClassDef) and node.name == class_name:
|
||||
for item in node.body:
|
||||
if (
|
||||
isinstance(item, (ast.FunctionDef, ast.AsyncFunctionDef))
|
||||
and item.name == method_name
|
||||
):
|
||||
return None
|
||||
return f"class {class_name} does not define {method_name}"
|
||||
return f"module does not define class {class_name}"
|
||||
|
||||
|
||||
def _references_platform(node: ast.AST, platform_names: set[str]) -> bool:
|
||||
for sub in ast.walk(node):
|
||||
if isinstance(sub, ast.Attribute) and isinstance(sub.value, ast.Name):
|
||||
if (sub.value.id, sub.attr) in _PLATFORM_PROBES:
|
||||
return True
|
||||
elif isinstance(sub, ast.Name) and sub.id in platform_names:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _module_platform_names(tree: ast.Module) -> set[str]:
|
||||
"""Module-level names assigned from a platform probe, such as IS_WINDOWS."""
|
||||
names: set[str] = set()
|
||||
for node in tree.body:
|
||||
if isinstance(node, ast.Assign):
|
||||
targets, value = node.targets, node.value
|
||||
elif isinstance(node, ast.AnnAssign) and node.value is not None:
|
||||
targets, value = [node.target], node.value
|
||||
else:
|
||||
continue
|
||||
if _references_platform(value, names):
|
||||
names.update(
|
||||
target.id for target in targets if isinstance(target, ast.Name)
|
||||
)
|
||||
return names
|
||||
|
||||
|
||||
def _is_platform_skip_decorator(node: ast.expr, platform_names: set[str]) -> bool:
|
||||
if not isinstance(node, ast.Call) or not node.args:
|
||||
return False
|
||||
func = node.func
|
||||
if isinstance(func, ast.Attribute):
|
||||
name = func.attr
|
||||
elif isinstance(func, ast.Name):
|
||||
name = func.id
|
||||
else:
|
||||
return False
|
||||
return name in _SKIP_DECORATORS and _references_platform(
|
||||
node.args[0], platform_names
|
||||
)
|
||||
|
||||
|
||||
def _skips_under_platform_check(function: ast.AST, platform_names: set[str]) -> bool:
|
||||
for node in ast.walk(function):
|
||||
if isinstance(node, ast.If) and _references_platform(node.test, platform_names):
|
||||
for inner in ast.walk(node):
|
||||
if (
|
||||
isinstance(inner, ast.Call)
|
||||
and isinstance(inner.func, ast.Attribute)
|
||||
and inner.func.attr == "skipTest"
|
||||
):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _platform_conditional_skips(repo_root: Path) -> dict[str, str]:
|
||||
"""Return ``{canonical test id: form}`` for each platform-conditional skip in tests/."""
|
||||
tests_root = repo_root / "tests"
|
||||
found: dict[str, str] = {}
|
||||
if not tests_root.is_dir():
|
||||
return found
|
||||
for path in sorted(tests_root.rglob("test_*.py")):
|
||||
relative = path.relative_to(repo_root)
|
||||
if any(
|
||||
part.startswith(".") or part in _PRUNED_TEST_DIRS for part in relative.parts
|
||||
):
|
||||
continue
|
||||
tree = ast.parse(path.read_text(encoding="utf-8-sig"), str(path))
|
||||
names = _module_platform_names(tree)
|
||||
module = ".".join(relative.with_suffix("").parts)
|
||||
for node in tree.body:
|
||||
if not isinstance(node, ast.ClassDef):
|
||||
continue
|
||||
methods = [
|
||||
item
|
||||
for item in node.body
|
||||
if isinstance(item, (ast.FunctionDef, ast.AsyncFunctionDef))
|
||||
]
|
||||
class_form = None
|
||||
if any(_is_platform_skip_decorator(d, names) for d in node.decorator_list):
|
||||
class_form = "class decorator"
|
||||
elif any(
|
||||
method.name in _CLASS_SETUP_METHODS
|
||||
and _skips_under_platform_check(method, names)
|
||||
for method in methods
|
||||
):
|
||||
class_form = "setUp skipTest under a platform check"
|
||||
for method in methods:
|
||||
if not method.name.startswith("test"):
|
||||
continue
|
||||
form = class_form
|
||||
if form is None and any(
|
||||
_is_platform_skip_decorator(d, names) for d in method.decorator_list
|
||||
):
|
||||
form = "method decorator"
|
||||
if form is None and _skips_under_platform_check(method, names):
|
||||
form = "skipTest under a platform check"
|
||||
if form is not None:
|
||||
found[f"{module}.{node.name}.{method.name}"] = form
|
||||
return found
|
||||
|
||||
|
||||
def _validate_platform_skip_inventory(repo_root: Path, raw: Any) -> list[str]:
|
||||
# CRITICAL: the Windows gate runs Windows-only tests, so an undeclared platform skip
|
||||
# passes here and only spends skip budget on Linux CI (v1.3.0 failed that way). Both
|
||||
# directions are checked so the declarations cannot drift from the code.
|
||||
declared = set(raw) if isinstance(raw, dict) else set()
|
||||
found = _platform_conditional_skips(repo_root)
|
||||
failures = [
|
||||
"skip policy: platform-conditional skip not declared in "
|
||||
f"platform_exclusive_tests: {test_id} ({found[test_id]})"
|
||||
for test_id in sorted(set(found) - declared)
|
||||
]
|
||||
failures.extend(
|
||||
f"skip policy platform_exclusive_tests[{test_id}]: no platform-conditional skip "
|
||||
"found (skip decorator or skipTest under a platform check)"
|
||||
for test_id in sorted(declared - set(found))
|
||||
)
|
||||
return failures
|
||||
|
||||
|
||||
def _validate_platform_exclusive_tests(repo_root: Path, raw: Any) -> list[str]:
|
||||
"""Each declared platform-exclusive test must exist and carry current metadata."""
|
||||
if raw is None:
|
||||
return []
|
||||
if not isinstance(raw, dict):
|
||||
return [
|
||||
"skip policy: platform_exclusive_tests must be an object keyed by test id"
|
||||
]
|
||||
failures: list[str] = []
|
||||
for test_id, entry in sorted(raw.items()):
|
||||
label = f"skip policy platform_exclusive_tests[{test_id}]"
|
||||
parts = test_id.split(".")
|
||||
if parts[0] != "tests" or len(parts) < 4 or not all(parts):
|
||||
failures.append(f"{label}: id must be tests.<module>.<Class>.<method>")
|
||||
continue
|
||||
if not isinstance(entry, dict):
|
||||
failures.append(f"{label}: entry must be an object")
|
||||
continue
|
||||
module_path = _resolve_test_module_path(repo_root, ".".join(parts[:-2]))
|
||||
if not module_path.is_file():
|
||||
failures.append(
|
||||
f"{label}: module path does not exist -> "
|
||||
f"{module_path.relative_to(repo_root).as_posix()}"
|
||||
)
|
||||
else:
|
||||
problem = _test_definition_problem(module_path, parts[-2], parts[-1])
|
||||
if problem:
|
||||
failures.append(f"{label}: {problem}")
|
||||
platforms = entry.get("platforms")
|
||||
if (
|
||||
not isinstance(platforms, list)
|
||||
or not platforms
|
||||
or any(
|
||||
not isinstance(item, str) or item not in SKIP_POLICY_PLATFORMS
|
||||
for item in platforms
|
||||
)
|
||||
or len(set(platforms)) != len(platforms)
|
||||
):
|
||||
failures.append(
|
||||
f"{label}: platforms must be a non-empty list of distinct values from "
|
||||
f"{sorted(SKIP_POLICY_PLATFORMS)}"
|
||||
)
|
||||
_validate_reason(entry.get("reason"), label=label, failures=failures)
|
||||
_parse_review_after(entry.get("review_after"), label=label, failures=failures)
|
||||
return failures
|
||||
|
||||
|
||||
def _validate_skip_policy(repo_root: Path, path: Path) -> list[str]:
|
||||
failures: list[str] = []
|
||||
payload = _read_json_object(path)
|
||||
@@ -56,6 +259,17 @@ def _validate_skip_policy(repo_root: Path, path: Path) -> list[str]:
|
||||
if not isinstance(max_skipped, int) or max_skipped < 0:
|
||||
failures.append("skip policy: max_skipped must be a non-negative integer")
|
||||
|
||||
failures.extend(
|
||||
_validate_platform_exclusive_tests(
|
||||
repo_root, payload.get("platform_exclusive_tests")
|
||||
)
|
||||
)
|
||||
failures.extend(
|
||||
_validate_platform_skip_inventory(
|
||||
repo_root, payload.get("platform_exclusive_tests")
|
||||
)
|
||||
)
|
||||
|
||||
modules = payload.get("no_skip_modules", [])
|
||||
if not isinstance(modules, list) or any(
|
||||
not isinstance(item, str) or not item.strip() for item in modules
|
||||
|
||||
@@ -503,7 +503,19 @@ def validate_metadata(
|
||||
parsed_last = (
|
||||
_parse_date(last_validated) if isinstance(last_validated, str) else None
|
||||
)
|
||||
if parsed_last is None:
|
||||
# IMPORTANT: refreshed subjects have no validation date until a host run.
|
||||
# Only an explicit schema-3 null with pending host evidence is unknown;
|
||||
# missing/invalid dates and validated evidence must still fail validation.
|
||||
pending_date = (
|
||||
schema_version == 3
|
||||
and "last_validated_date" in metadata
|
||||
and last_validated is None
|
||||
and _mapping_field(
|
||||
_mapping_field(metadata, "evidence_states"), "real_host"
|
||||
).get("state")
|
||||
== "pending"
|
||||
)
|
||||
if parsed_last is None and not pending_date:
|
||||
violations.append(
|
||||
{
|
||||
"code": "R90_META_LAST_VALIDATED_DATE",
|
||||
@@ -668,6 +680,9 @@ def validate_metadata(
|
||||
if violations:
|
||||
status = "invalid"
|
||||
code = "R90_META_INVALID"
|
||||
elif pending_date:
|
||||
status = "pending"
|
||||
code = "R90_MATRIX_PENDING"
|
||||
else:
|
||||
assert age_days is not None
|
||||
if age_days > max_age_days:
|
||||
@@ -999,7 +1014,9 @@ def run_refresh_workflow(
|
||||
metadata_after.setdefault("anchors", {})
|
||||
metadata_after.setdefault("evidence", {})
|
||||
metadata_after["host_surfaces"] = copy.deepcopy(DEFAULT_HOST_SURFACES)
|
||||
metadata_after["last_validated_date"] = today.isoformat()
|
||||
# A metadata refresh is not a host validation; retain an explicitly unknown date.
|
||||
if metadata.get("last_validated_date", "missing") is not None:
|
||||
metadata_after["last_validated_date"] = today.isoformat()
|
||||
for key in ANCHOR_KEYS:
|
||||
metadata_after["anchors"][key] = observed.get(key, "unknown")
|
||||
metadata_after["evidence"]["updated_by"] = updated_by
|
||||
|
||||
@@ -423,15 +423,19 @@ def check_compatibility_matrix_governance(
|
||||
|
||||
age_days = validation.get("age_days")
|
||||
status = validation.get("status")
|
||||
if status in ("warning", "stale"):
|
||||
if status in ("pending", "warning", "stale"):
|
||||
report.add(
|
||||
CheckResult(
|
||||
name="compatibility_matrix_governance",
|
||||
severity=Severity.WARN.value,
|
||||
message=(
|
||||
"Compatibility matrix age exceeds warning policy"
|
||||
if status == "warning"
|
||||
else "Compatibility matrix is stale"
|
||||
"Compatibility matrix host validation is pending"
|
||||
if status == "pending"
|
||||
else (
|
||||
"Compatibility matrix age exceeds warning policy"
|
||||
if status == "warning"
|
||||
else "Compatibility matrix is stale"
|
||||
)
|
||||
),
|
||||
detail=json.dumps(
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ Boundary:
|
||||
|
||||
## 1. Requirements
|
||||
|
||||
- Node.js 18+
|
||||
- Node.js matching `^20.19.0 || ^22.12.0 || >=24.0.0` (from package.json)
|
||||
- npm 9+
|
||||
- Python 3.10+ from the project-local environment (the repository floor also applies to the Playwright web server: `python -m http.server 3000`)
|
||||
- Playwright browsers installed (`npx playwright install chromium`)
|
||||
@@ -49,6 +49,7 @@ Notes:
|
||||
|
||||
```powershell
|
||||
node -v
|
||||
node scripts/check-node-runtime.mjs
|
||||
npm -v
|
||||
python --version
|
||||
|
||||
@@ -69,8 +70,9 @@ npm test
|
||||
|
||||
```bash
|
||||
source ~/.nvm/nvm.sh
|
||||
nvm use 18
|
||||
nvm use 24
|
||||
node -v
|
||||
node scripts/check-node-runtime.mjs
|
||||
python3 --version
|
||||
|
||||
# Provide `python` if only python3 exists
|
||||
@@ -151,7 +153,7 @@ When adding or reviewing E2E coverage, prefer assertions that prove final user-v
|
||||
|
||||
### Requirements
|
||||
|
||||
- Node.js 18+
|
||||
- Node.js matching `^20.19.0 || ^22.12.0 || >=24.0.0` (from package.json)
|
||||
- npm 9+ when the repo uses npm
|
||||
- Python command available (`python` or a local shim to `python3`) when the harness serves files through Python
|
||||
- Playwright Chromium installed with `npx playwright install chromium` when Playwright is used
|
||||
@@ -160,6 +162,7 @@ When adding or reviewing E2E coverage, prefer assertions that prove final user-v
|
||||
|
||||
```powershell
|
||||
node -v
|
||||
node scripts/check-node-runtime.mjs
|
||||
npm -v
|
||||
python --version
|
||||
|
||||
@@ -172,8 +175,9 @@ npm test
|
||||
|
||||
```bash
|
||||
source ~/.nvm/nvm.sh
|
||||
nvm use 18
|
||||
nvm use 24
|
||||
node -v
|
||||
node scripts/check-node-runtime.mjs
|
||||
python3 --version
|
||||
|
||||
mkdir -p .tmp/bin
|
||||
|
||||
+15
-8
@@ -75,7 +75,7 @@ Required guardrails:
|
||||
## Prerequisites
|
||||
|
||||
- Python 3.10+ package floor (the current local Windows acceptance baseline uses 3.13)
|
||||
- Node.js 18+ (CI uses 20)
|
||||
- Node.js matching `^20.19.0 || ^22.12.0 || >=24.0.0` (CI uses the compatible Node 20 line)
|
||||
- `pre-commit` installed: `python -m pip install pre-commit`
|
||||
- Backend test deps available in the same interpreter (`numpy`, `pillow`, `aiohttp`)
|
||||
- Frontend deps installed: `npm ci`
|
||||
@@ -95,9 +95,9 @@ Required guardrails:
|
||||
- In GitHub Actions, `actions/setup-python` is bootstrap authority only. Every install,
|
||||
check, and test after it must resolve through repository-local `.venv`.
|
||||
- If tests fail due to missing deps in CI parity, rerun in the project venv used by scripts and record that in the implementation record.
|
||||
- **Node version must be 18+** before E2E:
|
||||
- **Node must satisfy package.json engines.node (`^20.19.0 || ^22.12.0 || >=24.0.0`)** before E2E:
|
||||
- Verify: `node -v`
|
||||
- If mismatch in WSL, use the Node 18 path specified below.
|
||||
- If mismatch in WSL, select a stable Node 24 runtime using the path below.
|
||||
|
||||
## Environment Parity Guardrails (CI Safety)
|
||||
|
||||
@@ -120,7 +120,7 @@ Before running tests or deploying, validation of the build environment is requir
|
||||
|
||||
- **Checks performed**:
|
||||
- Python version (>=3.10)
|
||||
- Node.js version (>=18.0.0)
|
||||
- Node.js version (the shared package.json engine policy)
|
||||
- Essential Python dependencies (cryptography, defusedxml)
|
||||
- Optional: Use `--strict` to fail on warnings.
|
||||
|
||||
@@ -176,6 +176,10 @@ landed on kept displaying the pre-fix failure until someone re-triaged a closed
|
||||
- `--enforce-skip-policy tests/skip_policy.json`
|
||||
- Skip report artifact is expected at `.tmp/unit_skip_report.json` (or custom `--skip-report` path).
|
||||
- A pass result with skip-policy violations is invalid; treat as failure.
|
||||
- Skip ids are matched in their `tests.`-qualified form (`tests.<module>.<Class>.<method>`) in every run shape.
|
||||
- A test that can only run on some platforms may be declared under `platform_exclusive_tests` with its `platforms` (`sys.platform` values: `win32`, `linux`, `darwin`), `reason` and `review_after`. Its skip is reported as platform-excused and not counted toward `max_skipped` only on other platforms; on a declared platform it counts like any skip, and no-skip modules still fail on it.
|
||||
- Every platform-conditional skip must be declared: `scripts/verify_test_debt_governance.py` fails on a `skipIf`/`skipUnless` decorator or a `self.skipTest(...)` under an `if` whose condition uses `os.name`, `sys.platform`, `platform.system()` (or a module-level name derived from them) when the test is not declared, and on a declaration with no such skip. Write platform skips in one of these forms.
|
||||
- Every lane that runs the full suite under the skip policy (Windows and Linux wrappers, pre-push hook, CI `unit-tests` and `python-compatibility`) installs every `[project.optional-dependencies]` package from `pyproject.toml`, so dependency skips are the same on every lane.
|
||||
- Public MAE hard-guarantee suites must be no-skip in both local SOP runs and CI:
|
||||
- `tests.test_s60_mae_route_segmentation`
|
||||
- `tests.test_s60_routes_startup_gate`
|
||||
@@ -297,7 +301,7 @@ python scripts/check_workspace_hygiene.py check --root . --snapshot .tmp/workspa
|
||||
|
||||
### Optional: One-Command Full Test Scripts (Fastest)
|
||||
|
||||
Use these if you want a single command that runs **all required steps** (detect-secrets, pre-commit, backend unit tests, frontend unit tests, E2E). These scripts also handle the most common environment issues (Windows cache locks, Black cache, Node 18).
|
||||
Use these if you want a single command that runs **all required steps** (detect-secrets, pre-commit, backend unit tests, frontend unit tests, E2E). These scripts also handle the most common environment issues (Windows cache locks, Black cache, early Node policy validation).
|
||||
Stage `10/11` runs `npm run test:unit`. Do not remove it: the Vitest suite owns the frozen frontend decomposition contract and the frontend render-safety ratchet, and no other gate, workflow, or hook executes it.
|
||||
Scripts enforce a project-local venv and will bootstrap missing test tooling (`pre-commit`, and `aiohttp` where needed for imports).
|
||||
R118 adversarial stage uses adaptive profile selection (`--profile auto`) and escalates to `extended` on high-risk diffs.
|
||||
@@ -409,6 +413,7 @@ python scripts/verify_test_debt_governance.py
|
||||
- No-skip modules in `tests/skip_policy.json` must keep explicit metadata:
|
||||
- `reason`
|
||||
- `review_after`
|
||||
- Platform-exclusive test declarations in `tests/skip_policy.json` must name an existing module, class and method, list only known platforms, and keep `reason` and `review_after`.
|
||||
- Mutation survivor allowlist entries in `tests/mutation_survivor_allowlist.json` must keep:
|
||||
- `reason`
|
||||
- `review_after`
|
||||
@@ -468,15 +473,17 @@ OPENCLAW_STATE_DIR="$(pwd)/.tmp/test-state/manual/backend-e2e-real" python scrip
|
||||
1) Frontend E2E (Playwright; CI enforces)
|
||||
|
||||
```bash
|
||||
# Ensure you are using Node.js 18+ (CI uses 20).
|
||||
# Ensure you are using Node.js matching `^20.19.0 || ^22.12.0 || >=24.0.0` (CI uses the compatible Node 20 line).
|
||||
node -v
|
||||
node scripts/check-node-runtime.mjs
|
||||
|
||||
# If you're on WSL and `node -v` is < 18, your shell may be picking up the distro Node
|
||||
# (e.g. `/usr/bin/node`) instead of your user-installed Node. If you use `nvm`, do:
|
||||
# source ~/.nvm/nvm.sh
|
||||
# nvm use 18.20.8
|
||||
# nvm use 24
|
||||
# Then re-check:
|
||||
# node -v
|
||||
node scripts/check-node-runtime.mjs
|
||||
#
|
||||
# IMPORTANT: run `npm ci` with the same Node version you use for `npm test`.
|
||||
npm ci
|
||||
@@ -922,7 +929,7 @@ If all touched files are documentation/planning text only and no code, tests, sc
|
||||
- Keep the Python interpreter consistent across all commands.
|
||||
- Require a project-local virtual environment: `.venv` on Windows/native Linux/Hosted CI and `.venv-wsl` on WSL when the repo supports dual-OS validation.
|
||||
- Do not mix global and venv-installed `pre-commit` accidentally.
|
||||
- Node.js must be 18+ before running frontend/E2E tests.
|
||||
- Node.js must satisfy `^20.19.0 || ^22.12.0 || >=24.0.0` before frontend/E2E tests.
|
||||
- On Windows, prefer repo-local `PRE_COMMIT_HOME` to avoid cache lock issues.
|
||||
- On WSL, if `python` is missing but `python3` exists, create a local shim before running Playwright or harness commands.
|
||||
- If pre-commit modifies files, review/stage/commit those changes and rerun hooks until clean.
|
||||
|
||||
@@ -40,14 +40,14 @@ test.describe('Desktop host parity lane', () => {
|
||||
const host = page.locator('#sidebar-tab-comfyui-openclaw');
|
||||
// R254: the reviewed core/frontend source heads, the reproducible release,
|
||||
// and the bundled frontend pin are four separate published facts.
|
||||
await expect(host).toHaveAttribute('data-openclaw-core-source-revision', '8010b48d');
|
||||
await expect(host).toHaveAttribute('data-openclaw-core-version', '0.39.0');
|
||||
await expect(host).toHaveAttribute('data-openclaw-core-tag-revision', 'b0b74356');
|
||||
await expect(host).toHaveAttribute('data-openclaw-core-bundled-frontend', '1.55.14');
|
||||
await expect(host).toHaveAttribute('data-openclaw-frontend-source-revision', '0e1a2fbbe4');
|
||||
await expect(host).toHaveAttribute('data-openclaw-frontend-release-version', '1.57.0');
|
||||
await expect(host).toHaveAttribute('data-openclaw-frontend-release-revision', 'cdc18a92');
|
||||
// The paired real-host campaign qualifies the refreshed release subjects.
|
||||
await expect(host).toHaveAttribute('data-openclaw-core-source-revision', '7c4390a6');
|
||||
await expect(host).toHaveAttribute('data-openclaw-core-version', '0.43.0');
|
||||
await expect(host).toHaveAttribute('data-openclaw-core-tag-revision', '426f5eea');
|
||||
await expect(host).toHaveAttribute('data-openclaw-core-bundled-frontend', '1.57.6');
|
||||
await expect(host).toHaveAttribute('data-openclaw-frontend-source-revision', 'aa4e48c08d');
|
||||
await expect(host).toHaveAttribute('data-openclaw-frontend-release-version', '1.60.0');
|
||||
await expect(host).toHaveAttribute('data-openclaw-frontend-release-revision', '5cb2899f');
|
||||
// The standalone pair is qualified; Desktop surfaces retain their separate pending state.
|
||||
await expect(host).toHaveAttribute('data-openclaw-real-host-validation', 'validated');
|
||||
|
||||
const stamped = await host.evaluate((node) => JSON.stringify({ ...node.dataset }));
|
||||
@@ -63,7 +63,7 @@ test.describe('Desktop host parity lane', () => {
|
||||
const host = page.locator('#sidebar-tab-comfyui-openclaw');
|
||||
await expect(host).toHaveAttribute('data-openclaw-host-surface', 'standalone_frontend');
|
||||
await expect(host).toHaveAttribute('data-openclaw-desktop-host', 'false');
|
||||
await expect(host).toHaveAttribute('data-openclaw-reference-frontend', '1.57.0');
|
||||
await expect(host).toHaveAttribute('data-openclaw-reference-frontend', '1.60.0');
|
||||
await expect(host).toHaveAttribute('data-openclaw-current-desktop-version', '1.0.32-rc.1');
|
||||
await expect(host).toHaveAttribute('data-openclaw-current-desktop-generation', 'managed_install');
|
||||
await expect(host).toHaveAttribute(
|
||||
@@ -81,7 +81,7 @@ test.describe('Desktop host parity lane', () => {
|
||||
const host = page.locator('#sidebar-tab-comfyui-openclaw');
|
||||
await expect(host).toHaveAttribute('data-openclaw-host-surface', 'desktop');
|
||||
await expect(host).toHaveAttribute('data-openclaw-desktop-host', 'true');
|
||||
await expect(host).toHaveAttribute('data-openclaw-reference-frontend', '1.57.0');
|
||||
await expect(host).toHaveAttribute('data-openclaw-reference-frontend', '1.60.0');
|
||||
await expect(host).toHaveAttribute('data-openclaw-current-desktop-version', '1.0.32-rc.1');
|
||||
await expect(host).toHaveAttribute('data-openclaw-current-desktop-generation', 'managed_install');
|
||||
await expect(host).toHaveAttribute(
|
||||
@@ -147,7 +147,7 @@ test.describe('Desktop host parity lane', () => {
|
||||
|
||||
await expect(page.locator('body')).toHaveAttribute('data-openclaw-host-surface', 'desktop');
|
||||
await expect(page.locator('body')).toHaveAttribute('data-openclaw-desktop-host', 'true');
|
||||
await expect(page.locator('body')).toHaveAttribute('data-openclaw-reference-frontend', '1.57.0');
|
||||
await expect(page.locator('body')).toHaveAttribute('data-openclaw-reference-frontend', '1.60.0');
|
||||
await expect(page.locator('body')).toHaveAttribute(
|
||||
'data-openclaw-current-desktop-version',
|
||||
'1.0.32-rc.1',
|
||||
|
||||
@@ -593,3 +593,95 @@ test.describe('Parameter Lab - Dynamic Dimensions', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
test.describe('Parameter Lab - Opaque Identities', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await mockComfyUiCore(page);
|
||||
await page.goto('test-harness.html');
|
||||
await waitForOpenClawReady(page);
|
||||
await clickTab(page, 'Parameter Lab');
|
||||
});
|
||||
|
||||
for (const placement of ['root', 'nested', 'shared']) {
|
||||
const nested = placement !== 'root';
|
||||
const shared = placement === 'shared';
|
||||
test(`selects, compares and replays ${placement} colon IDs`, async ({ page }) => {
|
||||
const executionId = nested ? 'pack:root:child:opaque' : 'insert:operation-1:root:node:7';
|
||||
await page.evaluate(async ({ nested, shared, executionId }) => {
|
||||
const loader = { id: nested ? 'child:opaque' : executionId, type: 'CheckpointLoaderSimple', title: 'Opaque Loader',
|
||||
widgets: [{ name: 'ckpt_name', type: 'combo', value: 'base.ckpt', options: { values: ['base.ckpt', 'xl.ckpt'] } }] };
|
||||
const direct = { _nodes: [loader] };
|
||||
window.app.graph = { _nodes: nested ? [{ id: 'pack:root', type: 'SubgraphNode', widgets: [], subgraph: direct }] : [loader],
|
||||
serialize: () => ({ synthetic: true }), getNodeById(id) { return this._nodes.find((node) => String(node.id) === String(id)); } };
|
||||
if (shared) window.app.graph._nodes.unshift({ id: 'earlier', type: 'SubgraphNode', widgets: [], subgraph: direct });
|
||||
window.__identityTarget = loader;
|
||||
window.confirm = () => true;
|
||||
const { openclawApi } = await import('/web/openclaw_api.js');
|
||||
const original = openclawApi.fetch.bind(openclawApi);
|
||||
openclawApi.fetch = async (url, options = {}) => {
|
||||
if (String(url).endsWith('/lab/sweep')) {
|
||||
const payload = JSON.parse(options.body);
|
||||
window.__identityPayload = payload;
|
||||
return { ok: true, data: { plan: { experiment_id: 'identity-plan', dimensions: payload.params, runs: [{ [`${executionId}.ckpt_name`]: 'xl.ckpt' }] } } };
|
||||
}
|
||||
return original(url, options);
|
||||
};
|
||||
}, { nested, shared, executionId });
|
||||
await page.click('#lab-add-dim');
|
||||
await expect(page.locator(`.dim-node-select option[value="${executionId}"]`)).toHaveCount(1);
|
||||
await page.selectOption('.dim-node-select', executionId);
|
||||
await expect(page.locator('.dim-widget-select option[value="ckpt_name"]')).toHaveCount(1);
|
||||
await page.selectOption('.dim-widget-select', 'ckpt_name');
|
||||
await page.selectOption('.dim-candidate-select', 'xl.ckpt');
|
||||
await page.click('#lab-generate');
|
||||
await expect(page.locator('.replay-run')).toBeVisible();
|
||||
expect(await page.evaluate(() => window.__identityPayload.params[0])).toMatchObject({ node_id: executionId, widget_name: 'ckpt_name', values: ['xl.ckpt'] });
|
||||
await page.click('.replay-run');
|
||||
await expect.poll(() => page.evaluate(() => window.__identityTarget.widgets[0].value)).toBe('xl.ckpt');
|
||||
await expect(page.locator('.openclaw-banner')).toContainText('Values applied');
|
||||
await page.click('#lab-compare-models');
|
||||
await expect(page.locator('.dim-node-select')).toHaveValue(shared ? 'earlier:child:opaque' : executionId);
|
||||
await expect(page.locator('.dim-widget-select')).toHaveValue('ckpt_name');
|
||||
if (shared) {
|
||||
await page.evaluate(async () => {
|
||||
const { tabManager } = await import('/web/openclaw_tabs.js');
|
||||
tabManager.tabs.find((entry) => entry.id === 'parameter-lab').showCompareWizard(window.__identityTarget);
|
||||
});
|
||||
await expect(page.locator('.openclaw-banner')).toContainText('Select a unique loader');
|
||||
await expect(page.locator('.dim-node-select')).toHaveValue('earlier:child:opaque');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (const failure of ['ambiguous', 'missing', 'invalid', 'shared-collision', 'shared-alias']) {
|
||||
test(`rejects ${failure} replay before any override or direct lookup`, async ({ page }) => {
|
||||
await page.evaluate(async (failure) => {
|
||||
const make = (id) => ({ id, widgets: [{ name: 'seed', value: 1 }] });
|
||||
const control = make('control');
|
||||
const direct = make('a:b');
|
||||
const child = make('b');
|
||||
window.__identityNodes = [control, direct, child];
|
||||
window.__directLookups = 0;
|
||||
window.app.graph = { _nodes: [control, direct, { id: 'a', widgets: [], subgraph: { _nodes: [child] } }],
|
||||
getNodeById(id) { window.__directLookups += 1; return this._nodes.find((node) => node.id === id); } };
|
||||
if (failure.startsWith('shared-')) {
|
||||
const shared = window.app.graph._nodes[2].subgraph;
|
||||
window.app.graph._nodes.splice(2, 0, { id: 'earlier', widgets: [], subgraph: shared });
|
||||
}
|
||||
const bad = failure === 'ambiguous' || failure === 'shared-collision' ? 'a:b.seed' : failure === 'shared-alias' ? 'b.seed' : failure === 'missing' ? 'absent.seed' : 'malformed';
|
||||
const { tabManager } = await import('/web/openclaw_tabs.js');
|
||||
const tab = tabManager.tabs.find((entry) => entry.id === 'parameter-lab');
|
||||
tab.experimentId = 'identity-reject';
|
||||
tab.plan = { dimensions: [], runs: [{ 'control.seed': 99, [bad]: 77 }] };
|
||||
tab.renderPlan();
|
||||
window.confirm = () => true;
|
||||
}, failure);
|
||||
await page.click('.replay-run');
|
||||
await expect(page.locator('.openclaw-banner')).toContainText('Cannot apply values');
|
||||
await expect(page.locator('.openclaw-banner')).not.toContainText('Values applied');
|
||||
expect(await page.evaluate(() => window.__identityNodes.map((node) => node.widgets[0].value))).toEqual([1, 1, 1]);
|
||||
expect(await page.evaluate(() => window.__directLookups)).toBe(0);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -36,6 +36,33 @@ async function readSidebarGeometry(page) {
|
||||
});
|
||||
}
|
||||
|
||||
async function mountNativeSidebar(page, width) {
|
||||
return page.evaluate(async (width) => {
|
||||
const panel = document.querySelector('.side-bar-panel');
|
||||
const mount = document.querySelector('#sidebar-tab-comfyui-openclaw');
|
||||
const tab = window.__openclawMockSidebarTab;
|
||||
tab.destroy();
|
||||
mount.replaceChildren();
|
||||
const parent = panel.parentElement;
|
||||
// Use native host allocation without the legacy harness important min-width overrides.
|
||||
parent.id = 'native-sidebar-panels';
|
||||
parent.style.cssText = 'display:flex; width:1200px; height:720px';
|
||||
panel.style.cssText = `flex:${width} 1 0px; min-width:0; overflow:hidden`;
|
||||
panel.querySelector('.sidebar-content-container').style.cssText = 'width:100%; height:100%; min-width:0; overflow:hidden';
|
||||
panel.setAttribute('data-panel', '');
|
||||
panel.setAttribute('data-panel-id', 'sidebar');
|
||||
panel.setAttribute('data-panel-group-id', 'canvas');
|
||||
const canvas = document.createElement('div');
|
||||
canvas.id = 'native-canvas';
|
||||
canvas.style.cssText = `flex:${1200 - width} 1 0px; min-width:0`;
|
||||
parent.appendChild(canvas);
|
||||
const baseline = panel.getBoundingClientRect().width;
|
||||
tab.render();
|
||||
await new Promise((resolve) => requestAnimationFrame(resolve));
|
||||
return { baseline, mounted: panel.getBoundingClientRect().width, marker: mount.getAttribute('data-openclaw-layout') };
|
||||
}, width);
|
||||
}
|
||||
|
||||
test.describe('OpenClaw sidebar layout ownership', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1280, height: 720 });
|
||||
@@ -438,4 +465,97 @@ test.describe('OpenClaw sidebar layout ownership', () => {
|
||||
});
|
||||
}
|
||||
});
|
||||
test('preserves native flex allocation and the latest host resize on peer handoff', async ({ page }, testInfo) => {
|
||||
const widths = await mountNativeSidebar(page, 336);
|
||||
await captureSidebarEvidence(page, testInfo, 'native-sidebar-mounted');
|
||||
expect(widths.baseline).toBeCloseTo(336, 0);
|
||||
expect(widths.marker).toBe('host');
|
||||
expect(Math.abs(widths.mounted - widths.baseline)).toBeLessThanOrEqual(2);
|
||||
const resized = await page.evaluate(async () => {
|
||||
const panel = document.querySelector('.side-bar-panel');
|
||||
panel.style.flexGrow = '480';
|
||||
document.querySelector('#native-canvas').style.flexGrow = '720';
|
||||
await new Promise((resolve) => requestAnimationFrame(resolve));
|
||||
const dragged = panel.getBoundingClientRect().width;
|
||||
window.__openclawMockSidebarTab.destroy();
|
||||
const mount = document.querySelector('#sidebar-tab-comfyui-openclaw');
|
||||
const peer = document.createElement('section');
|
||||
peer.id = 'native-peer';
|
||||
mount.replaceChildren(peer);
|
||||
await new Promise((resolve) => requestAnimationFrame(resolve));
|
||||
return { dragged, released: panel.getBoundingClientRect().width, basis: panel.style.flexBasis,
|
||||
peerPreserved: mount.firstElementChild === peer, rootRemoved: !mount.querySelector('.openclaw-sidebar-container'),
|
||||
marker: mount.getAttribute('data-openclaw-layout') };
|
||||
});
|
||||
expect(resized.dragged).toBeCloseTo(480, 0);
|
||||
expect(resized.released).toBeCloseTo(resized.dragged, 0);
|
||||
expect(resized.basis).toBe('0px');
|
||||
expect(resized.peerPreserved).toBe(true);
|
||||
expect(resized.rootRemoved).toBe(true);
|
||||
expect(resized.marker).toBeNull();
|
||||
});
|
||||
|
||||
for (const width of [312, 400, 560]) {
|
||||
test(`keeps native controls contained and keyboard-operable at ${width}px`, async ({ page }, testInfo) => {
|
||||
const allocation = await mountNativeSidebar(page, width);
|
||||
await captureSidebarEvidence(page, testInfo, `native-sidebar-${width}-shell`);
|
||||
expect(allocation.baseline).toBeCloseTo(width, 0);
|
||||
expect(allocation.mounted).toBeCloseTo(width, 0);
|
||||
expect(Math.abs(allocation.mounted - allocation.baseline)).toBeLessThanOrEqual(2);
|
||||
const modelInput = page.locator('input[list="openclaw-model-list"]');
|
||||
const modelSelect = modelInput.locator('..').locator('select');
|
||||
expect((await modelInput.boundingBox()).width).toBeGreaterThanOrEqual(120);
|
||||
await page.route('**/llm/models**', (route) => route.fulfill({
|
||||
status: 200, contentType: 'application/json', body: JSON.stringify({ models: ['native-model', 'native-model-2'] }),
|
||||
}));
|
||||
await modelInput.fill('native-model');
|
||||
await page.getByRole('button', { name: 'Load Models', exact: true }).click();
|
||||
await expect(modelSelect).toBeVisible();
|
||||
await expect(modelSelect).toHaveValue('native-model');
|
||||
await expect(modelInput).toBeHidden();
|
||||
await modelSelect.selectOption('native-model-2');
|
||||
await expect(modelInput).toHaveValue('native-model-2');
|
||||
await modelSelect.selectOption('__custom__');
|
||||
await expect(modelInput).toBeVisible();
|
||||
expect((await modelInput.boundingBox()).width).toBeGreaterThanOrEqual(120);
|
||||
expect((await modelSelect.boundingBox()).width).toBeGreaterThanOrEqual(120);
|
||||
await modelInput.fill('custom-native-model');
|
||||
await expect(modelInput).toHaveValue('custom-native-model');
|
||||
await expect(modelInput.locator('..')).toContainText('2 models');
|
||||
const modelOverflow = await modelInput.locator('..').evaluate((row) => {
|
||||
const panel = row.closest('.side-bar-panel').getBoundingClientRect();
|
||||
return [...row.children].filter((node) => node.getClientRects().length).some((node) => {
|
||||
const box = node.getBoundingClientRect(); return box.left < panel.left - 1 || box.right > panel.right + 1;
|
||||
});
|
||||
});
|
||||
expect(modelOverflow).toBe(false);
|
||||
await captureSidebarEvidence(page, testInfo, `native-sidebar-${width}-model-controls`);
|
||||
await page.evaluate(() => {
|
||||
window.app.graph = {
|
||||
_nodes: [{ id: 10, type: 'KSampler', title: 'Sampler', widgets: [{ name: 'seed', type: 'number', value: 1, options: {} }] }],
|
||||
getNodeById(id) { return this._nodes.find((node) => String(node.id) === String(id)); },
|
||||
serialize() { return { version: 0.4, nodes: [] }; },
|
||||
};
|
||||
});
|
||||
await page.locator('.openclaw-tab').filter({ hasText: 'Parameter Lab' }).click();
|
||||
await page.locator('#lab-add-dim').focus();
|
||||
await page.keyboard.press('Enter');
|
||||
await expect(page.locator('.openclaw-lab-dim-row.dynamic')).toHaveCount(1);
|
||||
await page.selectOption('.dim-node-select', '10');
|
||||
await page.selectOption('.dim-widget-select', 'seed');
|
||||
await page.locator('.dim-manual-input').fill('7');
|
||||
await page.locator('.dim-manual-input').press('Enter');
|
||||
await expect(page.locator('.openclaw-chip')).toContainText('7');
|
||||
const overflow = await page.evaluate(() => {
|
||||
const panel = document.querySelector('.side-bar-panel').getBoundingClientRect();
|
||||
return [...document.querySelectorAll('.openclaw-header button, .openclaw-tab, .openclaw-lab-actions button, .openclaw-lab-dim-row input, .openclaw-lab-dim-row select, .openclaw-lab-dim-row button')]
|
||||
.filter((element) => element.getClientRects().length && getComputedStyle(element).visibility !== 'hidden')
|
||||
.filter((element) => { const rect = element.getBoundingClientRect(); return rect.left < panel.left - 1 || rect.right > panel.right + 1; })
|
||||
.map((element) => element.id || element.className);
|
||||
});
|
||||
await captureSidebarEvidence(page, testInfo, `native-sidebar-${width}-lab`);
|
||||
expect(overflow).toEqual([]);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -152,6 +152,7 @@
|
||||
"openclaw-modal-body",
|
||||
"openclaw-modal-header",
|
||||
"openclaw-modal-overlay",
|
||||
"openclaw-model-controls",
|
||||
"openclaw-model-list",
|
||||
"openclaw-note",
|
||||
"openclaw-panel",
|
||||
|
||||
@@ -28,6 +28,29 @@ function untilAbort(_route, options) {
|
||||
}
|
||||
|
||||
describe("OpenClawAPI host deadline contract", () => {
|
||||
it("bounds mixed host status attempts and product network retry by one deadline", async () => {
|
||||
vi.useFakeTimers();
|
||||
const wireStatuses = [];
|
||||
hostFetch.mockImplementationOnce(async (_route, options) => {
|
||||
// Target-authored boundary simulation: source-only host GET status
|
||||
// retries can precede a network exception. No reference code runs.
|
||||
for (const status of [503, 502, 429]) {
|
||||
expect(options.signal.aborted).toBe(false);
|
||||
wireStatuses.push(status);
|
||||
}
|
||||
throw new TypeError("network failure after host status attempts");
|
||||
}).mockImplementation(untilAbort);
|
||||
const resultPromise = new OpenClawAPI().fetch("/openclaw/health", { timeout: 1000 });
|
||||
await vi.advanceTimersByTimeAsync(1000);
|
||||
expect((await resultPromise).error).toBe("timeout");
|
||||
expect(wireStatuses).toEqual([503, 502, 429]);
|
||||
expect(hostFetch).toHaveBeenCalledTimes(2);
|
||||
expect(hostFetch.mock.calls[0][1].signal).toBe(hostFetch.mock.calls[1][1].signal);
|
||||
expect(hostFetch.mock.calls.every(([, options]) => options.timeoutMs === null)).toBe(true);
|
||||
expect(nativeFetch).not.toHaveBeenCalled();
|
||||
expect(vi.getTimerCount()).toBe(0);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
nativeFetch = vi.fn();
|
||||
vi.stubGlobal("fetch", nativeFetch);
|
||||
|
||||
@@ -9,6 +9,21 @@ import {
|
||||
} from "../../../web/openclaw_asset_refs.js";
|
||||
|
||||
describe("openclaw asset refs", () => {
|
||||
it("keeps additive preview IDs and stripped host previews outside the view contract", () => {
|
||||
const base = { filename: "result.png", subfolder: "session", type: "temp" };
|
||||
const expected = normalizeComfyOutputRef(base);
|
||||
for (const metadata of [
|
||||
{ preview_id: "preview-7" },
|
||||
{ preview_id: "preview-7", asset_preview: "https://example.invalid/preview" },
|
||||
]) {
|
||||
const actual = normalizeComfyOutputRef({ ...base, ...metadata });
|
||||
expect(actual).toEqual(expected);
|
||||
expect(actual).not.toHaveProperty("asset_preview");
|
||||
expect(actual).not.toHaveProperty("preview_id");
|
||||
expect(actual.viewParams).toEqual(base);
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps classic history refs on the /view filename+type contract", () => {
|
||||
expect(
|
||||
normalizeComfyOutputRef({
|
||||
|
||||
@@ -8,6 +8,13 @@ import {
|
||||
} from "../../../web/openclaw_fetch_wrappers.js";
|
||||
|
||||
describe("openclaw_fetch_wrappers", () => {
|
||||
it.each([429, 502, 503, 504])("does not add a product retry to a host HTTP %i response", async (status) => {
|
||||
const fetchFn = vi.fn().mockResolvedValue({ ok: false, status });
|
||||
const wrapped = composeFetchWrappersOnce(fetchFn, [withGetRetry({ retries: 1 })]);
|
||||
expect(await wrapped("/health", { method: "GET" })).toEqual({ ok: false, status });
|
||||
expect(fetchFn).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
document.head.innerHTML = "";
|
||||
});
|
||||
|
||||
@@ -1,12 +1,33 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
findComparableWidget,
|
||||
getGraphNodeEntry,
|
||||
getGraphNodeEntryByObject,
|
||||
getGraphNodeCatalog,
|
||||
getGraphWidgetCatalog,
|
||||
getGraphWidgetValueCandidates,
|
||||
resolveGraphWidget,
|
||||
} from "../../../web/openclaw_graph_host.js";
|
||||
|
||||
describe("host store-backed widget values", () => {
|
||||
it("reads and writes a prototype accessor without copying an obsolete own value", () => {
|
||||
const store = new Map([["value", "base.ckpt"]]);
|
||||
class StoreWidget {
|
||||
get value() { return store.get("value"); }
|
||||
set value(value) { store.set("value", value); }
|
||||
}
|
||||
const widget = Object.assign(new StoreWidget(), { name: "ckpt_name", type: "combo" });
|
||||
const graph = { _nodes: [{ id: 7, widgets: [widget] }] };
|
||||
const resolved = resolveGraphWidget(graph, "7", "ckpt_name");
|
||||
expect(Object.hasOwn(widget, "value")).toBe(false);
|
||||
expect(resolved.widget.value).toBe("base.ckpt");
|
||||
store.set("value", "updated.ckpt");
|
||||
expect(resolved.widget.value).toBe("updated.ckpt");
|
||||
resolved.widget.value = "selected.ckpt";
|
||||
expect(store.get("value")).toBe("selected.ckpt");
|
||||
});
|
||||
});
|
||||
|
||||
function createGraphFixture() {
|
||||
const nestedLoader = {
|
||||
id: 7,
|
||||
@@ -289,3 +310,172 @@ describe("openclaw_graph_host", () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe("opaque graph execution identities", () => {
|
||||
function fixture(id, parent = null) {
|
||||
const widget = { name: "ckpt_name", type: "combo", value: "base.ckpt", options: { values: ["base.ckpt", "xl.ckpt"] } };
|
||||
const node = { id, type: "CheckpointLoaderSimple", widgets: [widget] };
|
||||
const inner = { _nodes: [node] };
|
||||
return { node, widget, graph: parent === null ? inner : { _nodes: [{ id: parent, subgraph: inner, widgets: [] }] },
|
||||
executionId: parent === null ? id : `${parent}:${id}` };
|
||||
}
|
||||
|
||||
it.each([
|
||||
["insert:operation-1:root:node:7", null],
|
||||
["child:operation:7", "pack:root"],
|
||||
[7, null],
|
||||
["loader-alpha", null],
|
||||
[7, "pack"],
|
||||
])("resolves actual catalog identity %s under %s across all consumers", (id, parent) => {
|
||||
const { graph, node, widget, executionId } = fixture(id, parent);
|
||||
const key = String(executionId);
|
||||
expect(getGraphNodeCatalog(graph).some((entry) => entry.id === key)).toBe(true);
|
||||
expect(getGraphNodeEntry(graph, key)?.node).toBe(node);
|
||||
expect(resolveGraphWidget(graph, key, "ckpt_name")?.widget).toBe(widget);
|
||||
expect(getGraphWidgetCatalog(graph, key).map((entry) => entry.name)).toEqual(["ckpt_name"]);
|
||||
expect(getGraphWidgetValueCandidates(graph, key, "ckpt_name")).toEqual(["base.ckpt", "xl.ckpt"]);
|
||||
expect(findComparableWidget(graph, key)?.nodeId).toBe(key);
|
||||
});
|
||||
|
||||
it("keeps a unique raw colon ID fallback and rejects duplicate raw IDs", () => {
|
||||
const { graph, node } = fixture("child:opaque", "pack");
|
||||
expect(getGraphNodeEntry(graph, "child:opaque")?.node).toBe(node);
|
||||
const other = fixture("child:opaque", "other");
|
||||
graph._nodes.push(...other.graph._nodes);
|
||||
expect(getGraphNodeEntry(graph, "child:opaque")).toBeNull();
|
||||
expect(getGraphNodeEntry(graph, "pack:child:opaque")?.node).toBe(node);
|
||||
expect(getGraphNodeEntry(graph, "other:child:opaque")?.node).toBe(other.node);
|
||||
});
|
||||
|
||||
it("prefers a unique complete identity over nested raw aliases", () => {
|
||||
const root = fixture("loader:opaque");
|
||||
const nested = fixture("loader:opaque", "pack");
|
||||
const graph = { _nodes: [...root.graph._nodes, ...nested.graph._nodes] };
|
||||
expect(getGraphNodeEntry(graph, "loader:opaque")?.node).toBe(root.node);
|
||||
expect(getGraphNodeEntry(graph, "pack:loader:opaque")?.node).toBe(nested.node);
|
||||
});
|
||||
|
||||
it("preserves multilevel colon paths and disambiguated promoted sources", () => {
|
||||
const first = fixture("source:A");
|
||||
const selected = fixture("source:B");
|
||||
const inner = { id: "inner:opaque", subgraph: { _nodes: [first.node, selected.node] }, widgets: [
|
||||
{ name: "ckpt_name", sourceNodeId: "source:A", sourceWidgetName: "ckpt_name" },
|
||||
{ name: "ckpt_name", sourceNodeId: "source:B", sourceWidgetName: "ckpt_name" },
|
||||
] };
|
||||
const graph = { _nodes: [{ id: "pack:root", subgraph: { _nodes: [inner] }, widgets: [
|
||||
{ name: "ckpt_name", sourceNodeId: "inner:opaque", sourceWidgetName: "ckpt_name", disambiguatingSourceNodeId: "source:B" },
|
||||
] }] };
|
||||
const executionId = "pack:root:inner:opaque:source:B";
|
||||
expect(getGraphNodeEntry(graph, executionId)?.node).toBe(selected.node);
|
||||
expect(resolveGraphWidget(graph, "pack:root", "ckpt_name")?.widget).toBe(selected.widget);
|
||||
expect(findComparableWidget(graph, "pack:root")?.nodeId).toBe(executionId);
|
||||
expect(getGraphWidgetValueCandidates(graph, "pack:root", "ckpt_name")).toEqual(["base.ckpt", "xl.ckpt"]);
|
||||
expect(first.widget.value).toBe("base.ckpt");
|
||||
});
|
||||
|
||||
it("rejects root versus nested execution collisions including object lookups", () => {
|
||||
const direct = fixture("a:b");
|
||||
const nested = fixture("b", "a");
|
||||
const graph = { _nodes: [...direct.graph._nodes, ...nested.graph._nodes] };
|
||||
expect(getGraphNodeCatalog(graph).filter((entry) => entry.id === "a:b")).toHaveLength(2);
|
||||
expect(getGraphNodeEntry(graph, "a:b")).toBeNull();
|
||||
expect(resolveGraphWidget(graph, "a:b", "ckpt_name")).toBeNull();
|
||||
expect(resolveGraphWidget(graph, direct.node, "ckpt_name")).toBeNull();
|
||||
expect(getGraphWidgetCatalog(graph, "a:b")).toEqual([]);
|
||||
expect(getGraphWidgetValueCandidates(graph, "a:b", "ckpt_name")).toEqual([]);
|
||||
expect(findComparableWidget(graph, direct.node)).toBeNull();
|
||||
expect(direct.widget.value).toBe("base.ckpt");
|
||||
expect(nested.widget.value).toBe("base.ckpt");
|
||||
});
|
||||
|
||||
it("rejects duplicate direct IDs and missing targets", () => {
|
||||
const first = fixture("duplicate");
|
||||
const second = fixture("duplicate");
|
||||
const graph = { _nodes: [first.node, second.node] };
|
||||
expect(getGraphNodeEntry(graph, "duplicate")).toBeNull();
|
||||
expect(getGraphNodeEntry(graph, "missing")).toBeNull();
|
||||
expect(resolveGraphWidget(graph, "missing", "ckpt_name")).toBeNull();
|
||||
});
|
||||
|
||||
function sharedDefinitionFixture() {
|
||||
const target = fixture("leaf:part");
|
||||
const shared = target.graph;
|
||||
const graph = { _nodes: [
|
||||
{ id: "first", subgraph: shared, widgets: [] },
|
||||
{ id: "second", subgraph: shared, widgets: [] },
|
||||
] };
|
||||
return { ...target, graph, shared };
|
||||
}
|
||||
|
||||
it("catalogs every shared-definition instance with its complete identity", () => {
|
||||
const { graph, node, widget } = sharedDefinitionFixture();
|
||||
expect(getGraphNodeCatalog(graph).map((entry) => entry.id)).toEqual([
|
||||
"first", "first:leaf:part", "second", "second:leaf:part",
|
||||
]);
|
||||
for (const id of ["first:leaf:part", "second:leaf:part"]) {
|
||||
expect(getGraphNodeEntry(graph, id)?.node).toBe(node);
|
||||
expect(resolveGraphWidget(graph, id, "ckpt_name")?.widget).toBe(widget);
|
||||
expect(getGraphWidgetValueCandidates(graph, id, "ckpt_name")).toEqual(["base.ckpt", "xl.ckpt"]);
|
||||
expect(findComparableWidget(graph, id)?.nodeId).toBe(id);
|
||||
}
|
||||
});
|
||||
|
||||
it("rejects shared-definition raw aliases and context-free object lookups", () => {
|
||||
const { graph, node } = sharedDefinitionFixture();
|
||||
expect(getGraphNodeEntry(graph, "leaf:part")).toBeNull();
|
||||
expect(getGraphNodeEntryByObject(graph, node)).toBeNull();
|
||||
expect(resolveGraphWidget(graph, node, "ckpt_name")).toBeNull();
|
||||
expect(findComparableWidget(graph, node)).toBeNull();
|
||||
});
|
||||
|
||||
it("detects root collisions with a later shared-definition instance", () => {
|
||||
const { graph, widget } = sharedDefinitionFixture();
|
||||
const direct = fixture("second:leaf:part");
|
||||
graph._nodes.push(direct.node);
|
||||
expect(getGraphNodeCatalog(graph).filter((entry) => entry.id === "second:leaf:part")).toHaveLength(2);
|
||||
expect(getGraphNodeEntry(graph, "second:leaf:part")).toBeNull();
|
||||
expect(resolveGraphWidget(graph, direct.node, "ckpt_name")).toBeNull();
|
||||
expect(direct.widget.value).toBe("base.ckpt");
|
||||
expect(widget.value).toBe("base.ckpt");
|
||||
});
|
||||
|
||||
it("stops ancestor cycles while retaining later instances of a reused definition", () => {
|
||||
const { graph, shared } = sharedDefinitionFixture();
|
||||
shared._nodes.push({ id: "loop", subgraph: graph, widgets: [] });
|
||||
expect(getGraphNodeCatalog(graph).map((entry) => entry.id)).toEqual([
|
||||
"first", "first:leaf:part", "first:loop",
|
||||
"second", "second:leaf:part", "second:loop",
|
||||
]);
|
||||
});
|
||||
|
||||
it("resolves promoted child colon IDs, but never falls back from a broken binding", () => {
|
||||
const target = fixture("child:opaque", "pack");
|
||||
const host = target.graph._nodes[0];
|
||||
host.widgets = [{ name: "ckpt_name", value: "outer-view", sourceNodeId: "child:opaque", sourceWidgetName: "ckpt_name" }];
|
||||
expect(resolveGraphWidget(target.graph, "pack", "ckpt_name")?.widget).toBe(target.widget);
|
||||
host.subgraph._nodes.push({ ...target.node });
|
||||
expect(resolveGraphWidget(target.graph, "pack", "ckpt_name")).toBeNull();
|
||||
host.subgraph._nodes = [];
|
||||
expect(resolveGraphWidget(target.graph, "pack", "ckpt_name")).toBeNull();
|
||||
expect(host.widgets[0].value).toBe("outer-view");
|
||||
});
|
||||
|
||||
it("fails closed for cyclic and over-depth promoted bindings", () => {
|
||||
const widget = { name: "ckpt_name", value: "untouched", sourceNodeId: "loop", sourceWidgetName: "ckpt_name" };
|
||||
const node = { id: "loop", widgets: [widget] };
|
||||
const cycle = { _nodes: [node] };
|
||||
node.subgraph = cycle;
|
||||
expect(getGraphNodeCatalog(cycle)).toHaveLength(1);
|
||||
expect(resolveGraphWidget(cycle, "loop", "ckpt_name")).toBeNull();
|
||||
let graph = { _nodes: [{ id: "leaf", widgets: [{ name: "ckpt_name", value: "leaf-value" }] }] };
|
||||
let childId = "leaf";
|
||||
for (let index = 0; index < 25; index += 1) {
|
||||
const id = `parent${index}`;
|
||||
graph = { _nodes: [{ id, subgraph: graph, widgets: [{ name: "ckpt_name", value: "outer-view", sourceNodeId: childId, sourceWidgetName: "ckpt_name" }] }] };
|
||||
childId = id;
|
||||
}
|
||||
expect(resolveGraphWidget(graph, childId, "ckpt_name")).toBeNull();
|
||||
expect(widget.value).toBe("untouched");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,18 +14,18 @@ import {
|
||||
describe("openclaw_host_surface", () => {
|
||||
it("publishes exact standalone and two-generation desktop references", () => {
|
||||
expect(HOST_SURFACE_REFERENCES[HOST_SURFACES.standaloneFrontend]).toEqual({
|
||||
frontendVersion: "1.57.0",
|
||||
sourceRevision: "0e1a2fbbe4",
|
||||
sourceDescribe: "v1.57.0-309-g0e1a2fbbe4",
|
||||
releaseVersion: "1.57.0",
|
||||
releaseTag: "v1.57.0",
|
||||
releaseRevision: "cdc18a92",
|
||||
frontendVersion: "1.60.0",
|
||||
sourceRevision: "aa4e48c08d",
|
||||
sourceDescribe: "v1.60.0-209-gaa4e48c08d",
|
||||
releaseVersion: "1.60.0",
|
||||
releaseTag: "v1.60.0",
|
||||
releaseRevision: "5cb2899f",
|
||||
});
|
||||
expect(HOST_SURFACE_REFERENCES[HOST_SURFACES.desktop]).toEqual({
|
||||
desktopVersion: "0.9.4",
|
||||
coreVersion: "0.22.3",
|
||||
embeddedFrontendVersion: "1.43.18",
|
||||
standaloneFrontendVersion: "1.57.0",
|
||||
standaloneFrontendVersion: "1.60.0",
|
||||
frontendParity: "lagging",
|
||||
generation: "legacy_fixed_bundle",
|
||||
hostedVersionMode: "fixed",
|
||||
@@ -271,7 +271,7 @@ describe("openclaw_host_surface", () => {
|
||||
});
|
||||
expect(container.dataset.openclawHostSurface).toBe("desktop");
|
||||
expect(container.dataset.openclawDesktopHost).toBe("true");
|
||||
expect(container.dataset.openclawReferenceFrontend).toBe("1.57.0");
|
||||
expect(container.dataset.openclawReferenceFrontend).toBe("1.60.0");
|
||||
expect(container.dataset.openclawCurrentDesktopVersion).toBe("1.0.32-rc.1");
|
||||
expect(container.dataset.openclawCurrentDesktopGeneration).toBe("managed_install");
|
||||
expect(container.dataset.openclawCurrentDesktopHostedVersionMode).toBe(
|
||||
@@ -381,12 +381,12 @@ describe("openclaw_host_surface", () => {
|
||||
describe("R254 host reference baseline separation", () => {
|
||||
it("publishes core source, tag and bundled-frontend facts as distinct values", () => {
|
||||
expect(HOST_CORE_REFERENCE).toEqual({
|
||||
sourceRevision: "8010b48d",
|
||||
sourceDescribe: "v0.39.0-49-g8010b48d2",
|
||||
version: "0.39.0",
|
||||
tag: "v0.39.0",
|
||||
tagRevision: "b0b74356",
|
||||
bundledFrontendVersion: "1.55.14",
|
||||
sourceRevision: "7c4390a6",
|
||||
sourceDescribe: "v0.43.0-21-g7c4390a6f",
|
||||
version: "0.43.0",
|
||||
tag: "v0.43.0",
|
||||
tagRevision: "426f5eea",
|
||||
bundledFrontendVersion: "1.57.6",
|
||||
});
|
||||
expect(HOST_CORE_REFERENCE.sourceRevision).not.toBe(HOST_CORE_REFERENCE.tagRevision);
|
||||
});
|
||||
@@ -408,15 +408,17 @@ describe("R254 host reference baseline separation", () => {
|
||||
const container = document.createElement("div");
|
||||
stampHostSurfaceMetadata(container, { app: { hostSurface: surface }, win: {} });
|
||||
|
||||
expect(container.dataset.openclawCoreSourceRevision, surface).toBe("8010b48d");
|
||||
expect(container.dataset.openclawCoreVersion, surface).toBe("0.39.0");
|
||||
expect(container.dataset.openclawCoreTagRevision, surface).toBe("b0b74356");
|
||||
expect(container.dataset.openclawCoreBundledFrontend, surface).toBe("1.55.14");
|
||||
expect(container.dataset.openclawFrontendSourceRevision, surface).toBe("0e1a2fbbe4");
|
||||
expect(container.dataset.openclawFrontendReleaseVersion, surface).toBe("1.57.0");
|
||||
expect(container.dataset.openclawFrontendReleaseRevision, surface).toBe("cdc18a92");
|
||||
expect(container.dataset.openclawCoreSourceRevision, surface).toBe("7c4390a6");
|
||||
expect(container.dataset.openclawCoreVersion, surface).toBe("0.43.0");
|
||||
expect(container.dataset.openclawCoreTagRevision, surface).toBe("426f5eea");
|
||||
expect(container.dataset.openclawCoreBundledFrontend, surface).toBe("1.57.6");
|
||||
expect(container.dataset.openclawFrontendSourceRevision, surface).toBe("aa4e48c08d");
|
||||
expect(container.dataset.openclawFrontendReleaseVersion, surface).toBe("1.60.0");
|
||||
expect(container.dataset.openclawFrontendReleaseRevision, surface).toBe("5cb2899f");
|
||||
expect(container.dataset.openclawRealHostValidation, surface).toBe(
|
||||
surface === HOST_SURFACES.standaloneFrontend ? "validated" : "pending",
|
||||
surface === HOST_SURFACES.desktop || surface === HOST_SURFACES.comfyDesktop
|
||||
? "pending"
|
||||
: "validated",
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ class FakeApi extends EventTarget {
|
||||
}
|
||||
}
|
||||
|
||||
function createHostFixture() {
|
||||
function createHostFixture({ updateUi = () => Promise.resolve() } = {}) {
|
||||
const api = new FakeApi();
|
||||
const submissions = [];
|
||||
const beforeQueuedSpy = vi.fn();
|
||||
@@ -59,6 +59,7 @@ function createHostFixture() {
|
||||
marker: marker || null,
|
||||
});
|
||||
widget.afterQueued?.({ isPartialExecution: false });
|
||||
void updateUi();
|
||||
queuedCount += 1;
|
||||
}
|
||||
api.emit("promptQueued", {
|
||||
@@ -85,6 +86,30 @@ function createHostFixture() {
|
||||
}
|
||||
|
||||
describe("Parameter Lab authoritative queue receipt", () => {
|
||||
it("settles the matching native receipt while a detached host queue UI refresh remains pending", async () => {
|
||||
let uiSettled = false;
|
||||
let finishUi;
|
||||
const uiRefresh = new Promise((resolve) => { finishUi = resolve; })
|
||||
.then(() => { uiSettled = true; });
|
||||
const updateUi = vi.fn(() => uiRefresh);
|
||||
const fixture = createHostFixture({ updateUi });
|
||||
const id = "44444444-4444-4444-8444-444444444444";
|
||||
const coordinator = createParameterLabReceiptCoordinator({
|
||||
app: fixture.app, api: fixture.api, uuidFactory: () => id, timeoutMs: 1000,
|
||||
});
|
||||
const receipt = await coordinator.queue({ experimentId: "exp-delayed-ui", runId: "0", widget: fixture.widget });
|
||||
expect(receipt.promptId).toBe(id);
|
||||
expect(fixture.submissions).toHaveLength(1);
|
||||
expect(fixture.beforeQueuedSpy).toHaveBeenCalledTimes(1);
|
||||
expect(fixture.afterQueuedSpy).toHaveBeenCalledTimes(1);
|
||||
expect(updateUi).toHaveBeenCalledTimes(1);
|
||||
expect(uiSettled).toBe(false);
|
||||
receipt.release();
|
||||
coordinator.dispose();
|
||||
finishUi();
|
||||
await uiRefresh;
|
||||
});
|
||||
|
||||
it("correlates two overlapping runs across LIFO host work without tagging unrelated submission", async () => {
|
||||
const fixture = createHostFixture();
|
||||
const ids = [
|
||||
|
||||
@@ -233,6 +233,68 @@ describe("OpenClaw sidebar layout ownership", () => {
|
||||
expect([panel.style.cssText, content.style.cssText, mount.style.cssText]).toEqual(["", "", ""]);
|
||||
});
|
||||
|
||||
it("leaves complete native percentage allocation untouched throughout mount and release", () => {
|
||||
const { content, mount, panel } = buildHost({ panelWidth: 312 });
|
||||
panel.setAttribute("data-panel", "");
|
||||
panel.setAttribute("data-panel-id", "sidebar");
|
||||
panel.setAttribute("data-panel-group-id", "canvas");
|
||||
panel.style.cssText = "flex: 28 1 0px; overflow: hidden";
|
||||
const originals = [panel, content, mount].map((node) => node.style.cssText);
|
||||
const writes = [panel, content, mount].map((node) => vi.spyOn(node.style, "setProperty"));
|
||||
const dispose = acquireOpenClawSidebarLayout(mount);
|
||||
expect(mount.getAttribute("data-openclaw-layout")).toBe("host");
|
||||
expect([panel, content, mount].map((node) => node.style.cssText)).toEqual(originals);
|
||||
expect(deferred.size).toBe(0);
|
||||
for (const write of writes) expect(write).not.toHaveBeenCalled();
|
||||
panel.style.flexGrow = "40";
|
||||
dispose();
|
||||
dispose();
|
||||
expect(panel.style.flexGrow).toBe("40");
|
||||
expect(panel.style.flexBasis).toBe("0px");
|
||||
expect(mount.hasAttribute("data-openclaw-layout")).toBe(false);
|
||||
});
|
||||
|
||||
it.each([null, "", "previous"])("restores the exact previous native marker %s", (previous) => {
|
||||
const { mount, panel } = buildHost();
|
||||
panel.setAttribute("data-panel", "");
|
||||
panel.setAttribute("data-panel-id", "sidebar");
|
||||
panel.setAttribute("data-panel-group-id", "canvas");
|
||||
if (previous !== null) mount.setAttribute("data-openclaw-layout", previous);
|
||||
const dispose = acquireOpenClawSidebarLayout(mount);
|
||||
expect(mount.getAttribute("data-openclaw-layout")).toBe("host");
|
||||
dispose();
|
||||
expect(mount.getAttribute("data-openclaw-layout")).toBe(previous);
|
||||
});
|
||||
|
||||
it("preserves a native marker overwritten by the incoming owner", () => {
|
||||
const { mount, panel } = buildHost();
|
||||
panel.setAttribute("data-panel", "");
|
||||
panel.setAttribute("data-panel-id", "sidebar");
|
||||
panel.setAttribute("data-panel-group-id", "canvas");
|
||||
const dispose = acquireOpenClawSidebarLayout(mount);
|
||||
mount.setAttribute("data-openclaw-layout", "next-owner");
|
||||
dispose();
|
||||
expect(mount.getAttribute("data-openclaw-layout")).toBe("next-owner");
|
||||
});
|
||||
|
||||
it.each(["data-panel", "data-panel-id", "data-panel-group-id"])("keeps legacy allocation when %s is absent or empty", (missing) => {
|
||||
const { mount, panel } = buildHost();
|
||||
panel.setAttribute("data-panel", "");
|
||||
panel.setAttribute("data-panel-id", "sidebar");
|
||||
panel.setAttribute("data-panel-group-id", "canvas");
|
||||
panel.removeAttribute(missing);
|
||||
const dispose = acquireOpenClawSidebarLayout(mount);
|
||||
expect(panel.style.flexBasis).toBe("560px");
|
||||
expect(mount.hasAttribute("data-openclaw-layout")).toBe(false);
|
||||
dispose();
|
||||
if (missing !== "data-panel") {
|
||||
panel.setAttribute(missing, "");
|
||||
const release = acquireOpenClawSidebarLayout(mount);
|
||||
expect(panel.style.flexBasis).toBe("560px");
|
||||
release();
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps the JavaScript floor aligned with canonical and legacy CSS", () => {
|
||||
const webRoot = resolve(process.cwd(), "web");
|
||||
const canonical = readFileSync(`${webRoot}/styles/openclaw_core.css`, "utf8");
|
||||
|
||||
@@ -31,8 +31,8 @@ const POLICY = JSON.parse(
|
||||
|
||||
describe("real host frontend subjects", () => {
|
||||
it("resolves the two pinned subjects and rejects anything else", () => {
|
||||
expect(resolveSubject(POLICY, BUNDLED_SUBJECT).frontend_version).toBe("1.55.14");
|
||||
expect(resolveSubject(POLICY, STANDALONE_RELEASE_SUBJECT).frontend_version).toBe("1.57.0");
|
||||
expect(resolveSubject(POLICY, BUNDLED_SUBJECT).frontend_version).toBe("1.57.6");
|
||||
expect(resolveSubject(POLICY, STANDALONE_RELEASE_SUBJECT).frontend_version).toBe("1.60.0");
|
||||
expect(() => resolveSubject(POLICY, "nightly")).toThrow(SubjectError);
|
||||
});
|
||||
|
||||
@@ -94,7 +94,7 @@ describe("real host startup arguments", () => {
|
||||
expect(bundled).not.toContain("--front-end-version");
|
||||
expect(release.slice(-2)).toEqual([
|
||||
"--front-end-version",
|
||||
"Comfy-Org/ComfyUI_frontend@v1.57.0",
|
||||
"Comfy-Org/ComfyUI_frontend@v1.60.0",
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -133,9 +133,9 @@ describe("real host subject identity", () => {
|
||||
expect(
|
||||
detectSubjectMismatch({
|
||||
subject: release(),
|
||||
reportedFrontendVersion: "1.57.0",
|
||||
reportedFrontendVersion: "1.60.0",
|
||||
hostLogText: "Using existing copy of specific frontend version tag",
|
||||
resolvedWebRoot: "/tmp/comfy/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.57.0",
|
||||
resolvedWebRoot: "/tmp/comfy/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.60.0",
|
||||
}),
|
||||
).toEqual([]);
|
||||
});
|
||||
@@ -143,33 +143,33 @@ describe("real host subject identity", () => {
|
||||
it("fails the release subject when the host silently served the bundled frontend", () => {
|
||||
const failures = detectSubjectMismatch({
|
||||
subject: release(),
|
||||
reportedFrontendVersion: "1.55.14",
|
||||
reportedFrontendVersion: "1.57.6",
|
||||
hostLogText: `Failed to initialize frontend: timeout\n${FRONTEND_FALLBACK_LOG_MARKER}`,
|
||||
resolvedWebRoot: "/tmp/comfy/comfyui_frontend_package/static",
|
||||
});
|
||||
|
||||
expect(failures).toHaveLength(3);
|
||||
expect(failures.join("\n")).toMatch(/browser reported frontend 1\.55\.14/);
|
||||
expect(failures.join("\n")).toMatch(/browser reported frontend 1\.57\.6/);
|
||||
expect(failures.join("\n")).toMatch(/fell back to its bundled frontend/);
|
||||
expect(failures.join("\n")).toMatch(/expected one ending in/);
|
||||
});
|
||||
|
||||
it("still fails when only one signal trips, which is the case that matters", () => {
|
||||
const goodRoot = "/tmp/comfy/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.57.0";
|
||||
const goodRoot = "/tmp/comfy/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.60.0";
|
||||
|
||||
expect(
|
||||
detectSubjectMismatch({
|
||||
subject: release(),
|
||||
reportedFrontendVersion: "1.57.0",
|
||||
reportedFrontendVersion: "1.60.0",
|
||||
hostLogText: FRONTEND_FALLBACK_LOG_MARKER,
|
||||
resolvedWebRoot: goodRoot,
|
||||
}),
|
||||
).toEqual([`host fell back to its bundled frontend instead of serving 1.57.0`]);
|
||||
).toEqual([`host fell back to its bundled frontend instead of serving 1.60.0`]);
|
||||
|
||||
expect(
|
||||
detectSubjectMismatch({
|
||||
subject: release(),
|
||||
reportedFrontendVersion: "1.57.0",
|
||||
reportedFrontendVersion: "1.60.0",
|
||||
hostLogText: "",
|
||||
resolvedWebRoot: "/tmp/comfy/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.54.2",
|
||||
}),
|
||||
@@ -180,9 +180,9 @@ describe("real host subject identity", () => {
|
||||
expect(
|
||||
detectSubjectMismatch({
|
||||
subject: release(),
|
||||
reportedFrontendVersion: "1.57.0",
|
||||
reportedFrontendVersion: "1.60.0",
|
||||
hostLogText: "",
|
||||
resolvedWebRoot: "C:\\r\\web_custom_versions\\Comfy-Org_ComfyUI_frontend\\1.57.0",
|
||||
resolvedWebRoot: "C:\\r\\web_custom_versions\\Comfy-Org_ComfyUI_frontend\\1.60.0",
|
||||
}),
|
||||
).toEqual([]);
|
||||
|
||||
@@ -191,16 +191,16 @@ describe("real host subject identity", () => {
|
||||
subject: release(),
|
||||
reportedFrontendVersion: null,
|
||||
hostLogText: "",
|
||||
resolvedWebRoot: "/tmp/comfy/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.57.0",
|
||||
resolvedWebRoot: "/tmp/comfy/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.60.0",
|
||||
}),
|
||||
).toEqual(["browser reported frontend (none), expected 1.57.0"]);
|
||||
).toEqual(["browser reported frontend (none), expected 1.60.0"]);
|
||||
});
|
||||
|
||||
it("does not apply release-only checks to the bundled subject", () => {
|
||||
expect(
|
||||
detectSubjectMismatch({
|
||||
subject: POLICY.subjects.bundled,
|
||||
reportedFrontendVersion: "1.55.14",
|
||||
reportedFrontendVersion: "1.57.6",
|
||||
hostLogText: FRONTEND_FALLBACK_LOG_MARKER,
|
||||
resolvedWebRoot: null,
|
||||
}),
|
||||
@@ -255,12 +255,12 @@ describe("real host web root observation", () => {
|
||||
it("reads the web root the host actually reported", () => {
|
||||
const log = [
|
||||
"[Prompt Server] some earlier line",
|
||||
"[Prompt Server] web root: /tmp/c/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.57.0",
|
||||
"[Prompt Server] web root: /tmp/c/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.60.0",
|
||||
"later noise",
|
||||
].join("\n");
|
||||
|
||||
expect(parseHostWebRoot(log)).toBe(
|
||||
"/tmp/c/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.57.0",
|
||||
"/tmp/c/web_custom_versions/Comfy-Org_ComfyUI_frontend/1.60.0",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -280,7 +280,7 @@ describe("real host web root observation", () => {
|
||||
const release = JSON.parse(JSON.stringify(POLICY.subjects.standalone_release));
|
||||
const failures = detectSubjectMismatch({
|
||||
subject: release,
|
||||
reportedFrontendVersion: "1.57.0",
|
||||
reportedFrontendVersion: "1.60.0",
|
||||
hostLogText: "",
|
||||
resolvedWebRoot: parseHostWebRoot(""),
|
||||
});
|
||||
@@ -311,6 +311,18 @@ describe("real host sidebar geometry", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("applies an explicit native rounding tolerance without relaxing legacy floors", () => {
|
||||
const nativeFloor = POLICY.geometry.native_sidebar_min_width_px;
|
||||
expect(nativeFloor).toBe(312);
|
||||
const geometry = {
|
||||
panel: box(0, 311.859375), content: box(0, 311.859375),
|
||||
mount: box(0, 311.859375), rightmostControl: box(0, 300),
|
||||
};
|
||||
expect(evaluateSidebarGeometry(geometry, nativeFloor, 2)).toEqual([]);
|
||||
expect(evaluateSidebarGeometry(geometry, nativeFloor)).toHaveLength(3);
|
||||
expect(evaluateSidebarGeometry({ ...geometry, panel: box(0, 309) }, nativeFloor, 2)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("fails each element that falls below the floor", () => {
|
||||
const failures = evaluateSidebarGeometry(
|
||||
{
|
||||
@@ -402,6 +414,17 @@ describe("real host sidebar width ownership", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("keeps real drag and release requirements in native mode with fractional rounding", () => {
|
||||
const evidence = kept();
|
||||
evidence.mounted.width = 311.859375;
|
||||
evidence.dragged.width = 431.71875;
|
||||
evidence.released.width = 431.71875;
|
||||
expect(evaluateHostWidthOwnership(evidence, 312, 2)).toEqual([]);
|
||||
expect(evaluateHostWidthOwnership(evidence, 312)).toHaveLength(1);
|
||||
evidence.dragged.width = evidence.mounted.width;
|
||||
expect(evaluateHostWidthOwnership(evidence, 312, 2)[0]).toContain("did not widen");
|
||||
});
|
||||
|
||||
it("fails a mounted width below the floor", () => {
|
||||
const evidence = kept();
|
||||
evidence.mounted.width = floor - 1;
|
||||
@@ -563,8 +586,8 @@ describe("real host evidence gating", () => {
|
||||
}).allowed,
|
||||
).toBe(true);
|
||||
expect(POLICY.evidence.current_state).toBe("validated");
|
||||
expect(POLICY.evidence.run_id).toBe("host-pair-20261013-01");
|
||||
expect(POLICY.evidence.evidence_id).toBe("host-evidence-20261013-01");
|
||||
expect(POLICY.evidence.run_id).toBe("host-pair-20261101-isolated-01");
|
||||
expect(POLICY.evidence.evidence_id).toBe("host-evidence-20261101-isolated-01");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
"file": "services/access_control.py",
|
||||
"mutation_index": 9,
|
||||
"reason": "Equivalent guard: compare_digest still fails when client token is empty.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
{
|
||||
"file": "services/access_control.py",
|
||||
"mutation_index": 11,
|
||||
"reason": "Equivalent guard: compare_digest still fails when client token is empty.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ export function detectSubjectMismatch({
|
||||
* boundary. A host or user width already wider than the floor must be preserved,
|
||||
* never reduced to it, so the check is a lower bound rather than an equality.
|
||||
*/
|
||||
export function evaluateSidebarGeometry(geometry, minWidthPx) {
|
||||
export function evaluateSidebarGeometry(geometry, minWidthPx, tolerancePx = 0) {
|
||||
const failures = [];
|
||||
for (const part of ["panel", "content", "mount"]) {
|
||||
const box = geometry?.[part];
|
||||
@@ -218,7 +218,7 @@ export function evaluateSidebarGeometry(geometry, minWidthPx) {
|
||||
failures.push(`sidebar ${part} geometry was not measurable`);
|
||||
continue;
|
||||
}
|
||||
if (box.width < minWidthPx) {
|
||||
if (box.width < minWidthPx - tolerancePx) {
|
||||
failures.push(`sidebar ${part} measured ${box.width}px, below the ${minWidthPx}px floor`);
|
||||
}
|
||||
}
|
||||
@@ -248,7 +248,7 @@ export const HOST_WIDTH_TOLERANCE_PX = 2;
|
||||
* to its pre-OpenClaw width, so the release has to be compared against the
|
||||
* host's own write, not against the captured value.
|
||||
*/
|
||||
export function evaluateHostWidthOwnership(evidence, minWidthPx) {
|
||||
export function evaluateHostWidthOwnership(evidence, minWidthPx, tolerancePx = 0) {
|
||||
const failures = [];
|
||||
const widthOf = (stage) => evidence?.[stage]?.width;
|
||||
for (const stage of ["hostOnly", "mounted", "dragged", "released"]) {
|
||||
@@ -260,7 +260,7 @@ export function evaluateHostWidthOwnership(evidence, minWidthPx) {
|
||||
return failures;
|
||||
}
|
||||
|
||||
if (widthOf("mounted") < minWidthPx) {
|
||||
if (widthOf("mounted") < minWidthPx - tolerancePx) {
|
||||
failures.push(
|
||||
`sidebar measured ${widthOf("mounted")}px while OpenClaw was mounted, below the ` +
|
||||
`${minWidthPx}px floor`,
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
* already up at the configured loopback origin.
|
||||
*/
|
||||
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { readFileSync, writeFileSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
import { expect, test } from '@playwright/test';
|
||||
@@ -35,6 +36,7 @@ import {
|
||||
evaluateHostWidthOwnership,
|
||||
evaluatePromotedWidget,
|
||||
evaluateSidebarGeometry,
|
||||
HOST_WIDTH_TOLERANCE_PX,
|
||||
parseHostBindOrigin,
|
||||
parseHostWebRoot,
|
||||
partitionBrowserErrors,
|
||||
@@ -164,6 +166,9 @@ async function readSidebarPanel(page) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
native: panel.matches('[data-panel][data-panel-id][data-panel-group-id]') &&
|
||||
Boolean(panel.getAttribute('data-panel-id')) && Boolean(panel.getAttribute('data-panel-group-id')),
|
||||
layoutMode: document.querySelector('[data-openclaw-host-surface]')?.getAttribute('data-openclaw-layout') ?? null,
|
||||
width: panel.getBoundingClientRect().width,
|
||||
inlineMinWidth: panel.style.getPropertyValue('min-width'),
|
||||
inlineFlexBasis: panel.style.getPropertyValue('flex-basis'),
|
||||
@@ -191,6 +196,88 @@ async function openOpenClawSidebar(page) {
|
||||
await page.waitForSelector(OPENCLAW_ROOT, { timeout: 60_000 });
|
||||
}
|
||||
|
||||
async function loadIdentityFixture(page, mode) {
|
||||
const base = await resolveOpenClawExtensionBase(page);
|
||||
return page.evaluate(async ({ base, mode }) => {
|
||||
const app = window.app;
|
||||
const previous = app.graph.serialize();
|
||||
window.__openclawIdentity = { previous };
|
||||
const leafId = mode === 'root' ? 'insert:operation-1:root:node:7' : 'child:opaque';
|
||||
const workflow = {
|
||||
last_node_id: 2, last_link_id: 0,
|
||||
nodes: [
|
||||
{ id: leafId, type: 'CheckpointLoaderSimple', pos: [100, 100], size: [300, 120],
|
||||
flags: {}, order: 0, mode: 0, inputs: [],
|
||||
outputs: ['MODEL', 'CLIP', 'VAE'].map((type, slot_index) => ({ name: type, type, links: null, slot_index })),
|
||||
properties: {}, widgets_values: ['base.ckpt'] },
|
||||
{ id: 'control', type: 'EmptyLatentImage', pos: [500, 100], size: [300, 120],
|
||||
flags: {}, order: 1, mode: 0, inputs: [],
|
||||
outputs: [{ name: 'LATENT', type: 'LATENT', links: null, slot_index: 0 }],
|
||||
properties: {}, widgets_values: [512, 512, 1] },
|
||||
], links: [], groups: [], config: {}, extra: {}, version: 0.4,
|
||||
};
|
||||
if (await app.loadGraphData(workflow, true, true, null, { skipAssetScans: true }) === false) {
|
||||
throw new Error('host refused the synthetic identity workflow');
|
||||
}
|
||||
const graph = app.graph;
|
||||
let leaf = graph._nodes.find((node) => node.type === 'CheckpointLoaderSimple');
|
||||
let widget = leaf?.widgets?.find((item) => item.name === 'ckpt_name');
|
||||
const control = graph._nodes.find((node) => String(node.id) === 'control').widgets.find((item) => item.name === 'width');
|
||||
if (!widget || String(leaf.id) !== leafId) throw new Error('host did not preserve the colon-bearing node ID');
|
||||
// Only the fixture choices are synthetic; the graph, nodes and widgets stay host-owned.
|
||||
widget.options.values = ['base.ckpt', 'xl.ckpt'];
|
||||
widget.value = 'base.ckpt';
|
||||
let executionId = leafId;
|
||||
let firstId = null;
|
||||
let collision = null;
|
||||
if (mode !== 'root') {
|
||||
const { subgraph, node: first } = graph.convertToSubgraph(new Set([leaf]));
|
||||
// HOTSPOT: conversion reconstructs nodes; stale pre-conversion widgets never reach the prompt.
|
||||
const matches = subgraph._nodes.filter((node) => String(node.id) === leafId);
|
||||
if (matches.length !== 1) throw new Error('host conversion lost the unique fixture leaf ID');
|
||||
[leaf] = matches;
|
||||
widget = leaf.widgets?.find((item) => item.name === 'ckpt_name');
|
||||
if (!widget) throw new Error('host conversion lost the fixture widget');
|
||||
widget.options.values = ['base.ckpt', 'xl.ckpt'];
|
||||
widget.value = 'base.ckpt';
|
||||
const second = first.clone();
|
||||
if (!second || second.subgraph !== subgraph) throw new Error('host clone did not reuse the real definition');
|
||||
second.id = 'later:instance';
|
||||
graph.add(second);
|
||||
firstId = `${first.id}:${leaf.id}`;
|
||||
executionId = `${second.id}:${leaf.id}`;
|
||||
if (mode === 'collision') {
|
||||
collision = leaf.clone();
|
||||
if (!collision) throw new Error('host could not clone the collision control');
|
||||
collision.id = executionId;
|
||||
graph.add(collision);
|
||||
}
|
||||
}
|
||||
const { tabManager } = await import(`${base}/openclaw_tabs.js`);
|
||||
const tab = tabManager.tabs.find((item) => item.id === 'parameter-lab');
|
||||
const graphHost = await import(`${base}/openclaw_graph_host.js`);
|
||||
Object.assign(window.__openclawIdentity, { leaf, widget, control, collision, executionId, firstId, tab, graphHost });
|
||||
tab.dimensions = [];
|
||||
tab.renderDimensions();
|
||||
return { executionId, firstId,
|
||||
catalogCount: graphHost.getGraphNodeCatalog(graph).filter((entry) => entry.node === leaf).length,
|
||||
objectAmbiguous: graphHost.getGraphNodeEntryByObject(graph, leaf) === null,
|
||||
rawAmbiguous: graphHost.getGraphNodeEntry(graph, leaf.id) === null };
|
||||
}, { base, mode });
|
||||
}
|
||||
|
||||
async function restoreIdentityFixture(page) {
|
||||
return page.evaluate(async () => {
|
||||
const previous = window.__openclawIdentity?.previous;
|
||||
if (!previous) throw new Error('identity fixture has no restoration snapshot');
|
||||
const loaded = await window.app.loadGraphData(previous, true, true, null, { skipAssetScans: true });
|
||||
const comparable = (graph) => ({ nodes: graph.nodes, links: graph.links, groups: graph.groups });
|
||||
const restored = loaded !== false && JSON.stringify(comparable(window.app.graph.serialize())) === JSON.stringify(comparable(previous));
|
||||
delete window.__openclawIdentity;
|
||||
return restored;
|
||||
});
|
||||
}
|
||||
|
||||
test.describe(`real host frontend smoke (${SUBJECT.id})`, () => {
|
||||
const consoleErrors = [];
|
||||
const pageErrors = [];
|
||||
@@ -204,6 +291,25 @@ test.describe(`real host frontend smoke (${SUBJECT.id})`, () => {
|
||||
const declaredProbes = [];
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// Restore an empty real workflow instead of probing models from the host's default example.
|
||||
await page.addInitScript(() => {
|
||||
const workflowPath = 'workflows/OpenClaw smoke.json';
|
||||
const clientId = 'openclaw-smoke-fixture';
|
||||
let hash = 2166136261;
|
||||
for (const character of workflowPath) hash = Math.imul(hash ^ character.charCodeAt(0), 16777619);
|
||||
const key = (hash >>> 0).toString(16).padStart(8, '0');
|
||||
const updatedAt = Date.now();
|
||||
const blank = { last_node_id: 0, last_link_id: 0, nodes: [], links: [], groups: [], config: {}, extra: {}, version: 0.4 };
|
||||
localStorage.setItem('Comfy.Workflow.DraftIndex.v2:personal', JSON.stringify({
|
||||
v: 2, updatedAt, order: [key], entries: {
|
||||
[key]: { path: workflowPath, name: 'OpenClaw smoke', isTemporary: true, updatedAt },
|
||||
},
|
||||
}));
|
||||
localStorage.setItem(`Comfy.Workflow.Draft.v2:personal:${key}`, JSON.stringify({ data: JSON.stringify(blank), updatedAt }));
|
||||
sessionStorage.setItem('clientId', clientId);
|
||||
sessionStorage.setItem(`Comfy.Workflow.ActivePath:${clientId}`, JSON.stringify({ workspaceId: 'personal', path: workflowPath }));
|
||||
sessionStorage.setItem(`Comfy.Workflow.OpenPaths:${clientId}`, JSON.stringify({ workspaceId: 'personal', paths: [workflowPath], activeIndex: 0 }));
|
||||
});
|
||||
consoleErrors.length = 0;
|
||||
pageErrors.length = 0;
|
||||
failedRequests.length = 0;
|
||||
@@ -235,7 +341,7 @@ test.describe(`real host frontend smoke (${SUBJECT.id})`, () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('the host served the requested frontend subject and not a fallback', async ({ page }) => {
|
||||
test('the host served the requested frontend subject and not a fallback', async ({ page, request }, testInfo) => {
|
||||
await page.goto('/');
|
||||
const reportedFrontendVersion = await page.evaluate(async (budgetMs) => {
|
||||
// The frontend assigns this global when its Vue application mounts, which
|
||||
@@ -265,6 +371,23 @@ test.describe(`real host frontend smoke (${SUBJECT.id})`, () => {
|
||||
});
|
||||
|
||||
expect(failures, failures.join('\n')).toEqual([]);
|
||||
const webRoot = parseHostWebRoot(hostLogText);
|
||||
expect(webRoot).toBeTruthy();
|
||||
const index = await request.get('/');
|
||||
expect(index.ok()).toBe(true);
|
||||
const bytes = await index.body();
|
||||
const digest = (value) => createHash('sha256').update(value).digest('hex');
|
||||
expect(digest(bytes)).toBe(digest(readFileSync(path.join(webRoot, 'index.html'))));
|
||||
const script = bytes.toString('utf8').match(/<script[^>]+src="([^"]+\.js)"/);
|
||||
expect(script, 'served index has no JavaScript entry').not.toBeNull();
|
||||
const url = new URL(script[1], 'http://127.0.0.1');
|
||||
expect(url.hostname).toBe('127.0.0.1');
|
||||
const asset = await request.get(url.pathname);
|
||||
expect(asset.ok()).toBe(true);
|
||||
const assetBytes = await asset.body();
|
||||
expect(digest(assetBytes)).toBe(digest(readFileSync(path.join(webRoot, url.pathname.replace(/^\//, '')))));
|
||||
await testInfo.attach('served-identity', { body: JSON.stringify({ frontend: reportedFrontendVersion,
|
||||
indexSha256: digest(bytes), entryPath: url.pathname, entrySha256: digest(assetBytes) }), contentType: 'application/json' });
|
||||
});
|
||||
|
||||
test('evidence never names the reviewed frontend source head as executed', async () => {
|
||||
@@ -310,7 +433,18 @@ test.describe(`real host frontend smoke (${SUBJECT.id})`, () => {
|
||||
test('the sidebar reaches its floor and keeps every control inside the boundary', async ({
|
||||
page,
|
||||
}) => {
|
||||
await openOpenClawSidebar(page);
|
||||
await page.goto('/');
|
||||
await activateSidebarTab(page, PEER_TAB_ID);
|
||||
await page.waitForSelector(PEER_CONTENT);
|
||||
await settleFrames(page);
|
||||
const baseline = await readSidebarPanel(page);
|
||||
await activateSidebarTab(page, OPENCLAW_TAB_ID);
|
||||
await page.waitForSelector(OPENCLAW_ROOT);
|
||||
await settleFrames(page);
|
||||
const mounted = await readSidebarPanel(page);
|
||||
expect(mounted.native).toBe(true);
|
||||
expect(mounted.layoutMode).toBe('host');
|
||||
expect(Math.abs(mounted.width - baseline.width)).toBeLessThanOrEqual(HOST_WIDTH_TOLERANCE_PX);
|
||||
|
||||
const geometry = await page.evaluate(() => {
|
||||
const rect = (element) => {
|
||||
@@ -342,7 +476,7 @@ test.describe(`real host frontend smoke (${SUBJECT.id})`, () => {
|
||||
});
|
||||
|
||||
expect(geometry.tabCount).toBeGreaterThan(0);
|
||||
const failures = evaluateSidebarGeometry(geometry, POLICY.geometry.sidebar_min_width_px);
|
||||
const failures = evaluateSidebarGeometry(geometry, POLICY.geometry.native_sidebar_min_width_px, HOST_WIDTH_TOLERANCE_PX);
|
||||
expect(failures, failures.join('\n')).toEqual([]);
|
||||
});
|
||||
|
||||
@@ -375,6 +509,9 @@ test.describe(`real host frontend smoke (${SUBJECT.id})`, () => {
|
||||
await page.waitForSelector(OPENCLAW_ROOT, { timeout: 60_000 });
|
||||
await settleFrames(page);
|
||||
const mounted = await readSidebarPanel(page);
|
||||
expect(mounted.native).toBe(true);
|
||||
expect(mounted.layoutMode).toBe('host');
|
||||
expect(Math.abs(mounted.width - hostOnly.width)).toBeLessThanOrEqual(HOST_WIDTH_TOLERANCE_PX);
|
||||
|
||||
// Drag the host's own gutter, so the width is written by the host's splitter
|
||||
// code rather than by this test assigning a style.
|
||||
@@ -382,7 +519,7 @@ test.describe(`real host frontend smoke (${SUBJECT.id})`, () => {
|
||||
const panel = document.querySelector('.side-bar-panel');
|
||||
const sibling =
|
||||
location === 'right' ? panel?.previousElementSibling : panel?.nextElementSibling;
|
||||
if (!sibling?.classList.contains('p-splitter-gutter')) {
|
||||
if (!sibling?.matches('[role="separator"][data-orientation="horizontal"]')) {
|
||||
return null;
|
||||
}
|
||||
const box = sibling.getBoundingClientRect();
|
||||
@@ -421,7 +558,7 @@ test.describe(`real host frontend smoke (${SUBJECT.id})`, () => {
|
||||
dragged,
|
||||
released,
|
||||
};
|
||||
const failures = evaluateHostWidthOwnership(evidence, POLICY.geometry.sidebar_min_width_px);
|
||||
const failures = evaluateHostWidthOwnership(evidence, POLICY.geometry.native_sidebar_min_width_px, HOST_WIDTH_TOLERANCE_PX);
|
||||
expect(failures, `${failures.join('\n')}\n${JSON.stringify(evidence)}`).toEqual([]);
|
||||
});
|
||||
|
||||
@@ -509,6 +646,147 @@ test.describe(`real host frontend smoke (${SUBJECT.id})`, () => {
|
||||
expect(widget.restored).toBe(true);
|
||||
});
|
||||
|
||||
for (const placement of ['root', 'shared-nested']) {
|
||||
test(`colon-bearing ${placement} IDs select, compare and replay on the real graph`, async ({ page }) => {
|
||||
await openOpenClawSidebar(page);
|
||||
await page.click('.openclaw-tabs .openclaw-tab:has-text("Parameter Lab")');
|
||||
page.on('dialog', (dialog) => dialog.accept());
|
||||
try {
|
||||
const fixture = await loadIdentityFixture(page, placement);
|
||||
expect(fixture.catalogCount).toBe(placement === 'root' ? 1 : 2);
|
||||
if (placement !== 'root') {
|
||||
expect(fixture.objectAmbiguous).toBe(true);
|
||||
expect(fixture.rawAmbiguous).toBe(true);
|
||||
await expect.poll(() => page.evaluate(() => {
|
||||
const { graphHost, firstId } = window.__openclawIdentity;
|
||||
return graphHost.getGraphNodeEntry(window.app.graph, firstId)?.node === window.__openclawIdentity.leaf;
|
||||
})).toBe(true);
|
||||
}
|
||||
await page.click('#lab-add-dim');
|
||||
await expect(page.locator(`.dim-node-select option[value="${fixture.executionId}"]`)).toHaveCount(1);
|
||||
await page.selectOption('.dim-node-select', fixture.executionId);
|
||||
await page.selectOption('.dim-widget-select', 'ckpt_name');
|
||||
await page.selectOption('.dim-candidate-select', 'xl.ckpt');
|
||||
await page.evaluate(() => {
|
||||
const { tab, executionId } = window.__openclawIdentity;
|
||||
tab.showCompareWizard(executionId);
|
||||
});
|
||||
await expect(page.locator('.dim-node-select')).toHaveValue(fixture.executionId);
|
||||
await expect(page.locator('.dim-widget-select')).toHaveValue('ckpt_name');
|
||||
if (placement !== 'root') {
|
||||
await page.evaluate(() => {
|
||||
const { tab, leaf } = window.__openclawIdentity;
|
||||
tab.showCompareWizard(leaf);
|
||||
});
|
||||
await expect(page.locator('.openclaw-banner')).toContainText('Select a unique loader');
|
||||
await expect(page.locator('.dim-node-select')).toHaveValue(fixture.executionId);
|
||||
}
|
||||
await page.evaluate(() => {
|
||||
const { tab, executionId } = window.__openclawIdentity;
|
||||
tab.experimentId = 'host-identity';
|
||||
tab.plan = { dimensions: [], runs: [{ [`${executionId}.ckpt_name`]: 'xl.ckpt' }] };
|
||||
tab.renderPlan();
|
||||
});
|
||||
await page.click('.replay-run');
|
||||
await expect(page.locator('.openclaw-banner')).toContainText('Values applied');
|
||||
const edited = await page.evaluate(async () => {
|
||||
const { widget, control, executionId, firstId } = window.__openclawIdentity;
|
||||
const prompt = await window.app.graphToPrompt();
|
||||
return { value: widget.value, control: control.value,
|
||||
promptValue: prompt.output?.[executionId]?.inputs?.ckpt_name,
|
||||
firstPromptValue: firstId ? prompt.output?.[firstId]?.inputs?.ckpt_name : null };
|
||||
});
|
||||
expect(edited).toMatchObject({ value: 'xl.ckpt', control: 512, promptValue: 'xl.ckpt' });
|
||||
if (placement !== 'root') expect(edited.firstPromptValue).toBe('xl.ckpt');
|
||||
} finally {
|
||||
expect(await restoreIdentityFixture(page), 'host workflow restoration failed').toBe(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
test('a collision with a later shared instance rejects replay before every write', async ({ page }) => {
|
||||
page.on('dialog', (dialog) => dialog.accept());
|
||||
await openOpenClawSidebar(page);
|
||||
await page.click('.openclaw-tabs .openclaw-tab:has-text("Parameter Lab")');
|
||||
try {
|
||||
await loadIdentityFixture(page, 'collision');
|
||||
const before = await page.evaluate(() => {
|
||||
const { tab, executionId, widget, control, collision, graphHost } = window.__openclawIdentity;
|
||||
const values = [widget.value, control.value, collision.widgets.find((entry) => entry.name === 'ckpt_name').value];
|
||||
tab.experimentId = 'host-collision';
|
||||
tab.plan = { dimensions: [], runs: [{ 'control.width': 513, [`${executionId}.ckpt_name`]: 'xl.ckpt' }] };
|
||||
tab.renderPlan();
|
||||
return { values, ambiguous: graphHost.getGraphNodeEntry(window.app.graph, executionId) === null };
|
||||
});
|
||||
expect(before.ambiguous).toBe(true);
|
||||
await page.click('.replay-run');
|
||||
await expect(page.locator('.openclaw-banner')).toContainText('Cannot apply values');
|
||||
await expect(page.locator('.openclaw-banner')).not.toContainText('Values applied');
|
||||
expect(await page.evaluate(() => {
|
||||
const { widget, control, collision } = window.__openclawIdentity;
|
||||
return [widget.value, control.value, collision.widgets.find((entry) => entry.name === 'ckpt_name').value];
|
||||
})).toEqual(before.values);
|
||||
} finally {
|
||||
expect(await restoreIdentityFixture(page), 'host workflow restoration failed').toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
test('left and right sidebars contain controls at both desktop viewports', async ({ page }, testInfo) => {
|
||||
await openOpenClawSidebar(page);
|
||||
const originalViewport = page.viewportSize();
|
||||
const originalLocation = await page.evaluate(() => window.app.ui.settings.getSettingValue('Comfy.Sidebar.Location'));
|
||||
const measurements = [];
|
||||
try {
|
||||
for (const viewport of [{ width: 1440, height: 1000 }, { width: 1920, height: 1080 }]) {
|
||||
await page.setViewportSize(viewport);
|
||||
for (const location of ['left', 'right']) {
|
||||
await page.evaluate(async (value) => {
|
||||
const settings = window.app.ui.settings;
|
||||
if (typeof settings.setSettingValueAsync !== 'function') throw new Error('host has no async setting setter');
|
||||
await settings.setSettingValueAsync('Comfy.Sidebar.Location', value);
|
||||
}, location);
|
||||
await activateSidebarTab(page, PEER_TAB_ID);
|
||||
await page.waitForSelector(PEER_CONTENT);
|
||||
await settleFrames(page);
|
||||
const baseline = await readSidebarPanel(page);
|
||||
await page.screenshot({ path: testInfo.outputPath(`${location}-${viewport.width}-peer.png`) });
|
||||
await activateSidebarTab(page, OPENCLAW_TAB_ID);
|
||||
await page.waitForSelector(OPENCLAW_ROOT);
|
||||
await settleFrames(page);
|
||||
const mounted = await readSidebarPanel(page);
|
||||
expect(mounted.native).toBe(true);
|
||||
expect(mounted.layoutMode).toBe('host');
|
||||
expect(Math.abs(mounted.width - baseline.width)).toBeLessThanOrEqual(HOST_WIDTH_TOLERANCE_PX);
|
||||
const geometry = await page.evaluate(() => {
|
||||
const rect = (selector) => {
|
||||
const box = document.querySelector(selector)?.getBoundingClientRect();
|
||||
return box ? { left: box.left, right: box.right, width: box.width } : null;
|
||||
};
|
||||
const controls = [...document.querySelectorAll('.openclaw-tabs .openclaw-tab')].map((node) => node.getBoundingClientRect());
|
||||
return { panel: rect('.side-bar-panel'), content: rect('.sidebar-content-container'),
|
||||
mount: rect('[data-openclaw-host-surface]'),
|
||||
rightmostControl: controls.length ? { right: Math.max(...controls.map((box) => box.right)) } : null };
|
||||
});
|
||||
expect(evaluateSidebarGeometry(geometry, POLICY.geometry.native_sidebar_min_width_px, HOST_WIDTH_TOLERANCE_PX)).toEqual([]);
|
||||
expect(geometry.panel.left).toBeGreaterThanOrEqual(0);
|
||||
expect(geometry.panel.right).toBeLessThanOrEqual(viewport.width);
|
||||
expect((geometry.panel.left + geometry.panel.right) / 2 < viewport.width / 2).toBe(location === 'left');
|
||||
await page.screenshot({ path: testInfo.outputPath(`${location}-${viewport.width}-openclaw.png`) });
|
||||
await activateSidebarTab(page, PEER_TAB_ID);
|
||||
await page.waitForSelector(PEER_CONTENT);
|
||||
await expect(page.locator(OPENCLAW_ROOT)).toHaveCount(0);
|
||||
await activateSidebarTab(page, OPENCLAW_TAB_ID);
|
||||
await expect(page.locator(OPENCLAW_ROOT)).toBeVisible();
|
||||
measurements.push({ location, viewport, baseline, mounted, geometry });
|
||||
}
|
||||
}
|
||||
writeFileSync(testInfo.outputPath('sidebar-geometry.json'), JSON.stringify(measurements, null, 2));
|
||||
} finally {
|
||||
await page.evaluate(async (value) => window.app.ui.settings.setSettingValueAsync('Comfy.Sidebar.Location', value), originalLocation);
|
||||
await page.setViewportSize(originalViewport);
|
||||
}
|
||||
});
|
||||
|
||||
test('an annotated temporary result stays visible and is fetched from the temp directory', async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
@@ -15,35 +15,35 @@
|
||||
},
|
||||
"core": {
|
||||
"repository": "https://github.com/comfyanonymous/ComfyUI.git",
|
||||
"source_head": "8010b48d2c1be986613f8e8c761527d205bd756f",
|
||||
"project_version": "0.39.0",
|
||||
"bundled_frontend_version": "1.55.14"
|
||||
"source_head": "7c4390a6f70cd8eb41014d6af52969397a752fc4",
|
||||
"project_version": "0.43.0",
|
||||
"bundled_frontend_version": "1.57.6"
|
||||
},
|
||||
"subjects": {
|
||||
"bundled": {
|
||||
"id": "bundled",
|
||||
"frontend_version": "1.55.14",
|
||||
"frontend_version": "1.57.6",
|
||||
"front_end_version_arg": null,
|
||||
"summary": "The frontend package the core manifest pins. The host serves it when no frontend version is requested."
|
||||
},
|
||||
"standalone_release": {
|
||||
"id": "standalone_release",
|
||||
"frontend_version": "1.57.0",
|
||||
"front_end_version_arg": "Comfy-Org/ComfyUI_frontend@v1.57.0",
|
||||
"release_tag": "v1.57.0",
|
||||
"release_tag_commit": "cdc18a92d227a965810b08928963124959951908",
|
||||
"frontend_version": "1.60.0",
|
||||
"front_end_version_arg": "Comfy-Org/ComfyUI_frontend@v1.60.0",
|
||||
"release_tag": "v1.60.0",
|
||||
"release_tag_commit": "5cb2899fc4bc5034513fbafae72b39265c4a213e",
|
||||
"release_asset_name": "dist.zip",
|
||||
"release_asset_sha256": "1dfa438ea71cf322a6a1342f8d5fdf75c7d83fe37f600ca5b0262cb9907e2d82",
|
||||
"release_asset_size_bytes": 25610537,
|
||||
"release_asset_digest_source": "GitHub release API, tag v1.57.0, asset dist.zip; publisher-reported on 2026-10-13 and not independently downloaded here. The lane hashes downloaded bytes and refuses a mismatch.",
|
||||
"web_root_relative": "web_custom_versions/Comfy-Org_ComfyUI_frontend/1.57.0",
|
||||
"release_asset_sha256": "3b802ce095609a80e62e2557a5a18551070ba51f614839eb89c7314bed4dd5a2",
|
||||
"release_asset_size_bytes": 29336742,
|
||||
"release_asset_digest_source": "GitHub release API, tag v1.60.0, asset dist.zip; publisher-reported and independently downloaded and hashed on 2026-11-01. The lane hashes downloaded bytes and refuses a mismatch.",
|
||||
"web_root_relative": "web_custom_versions/Comfy-Org_ComfyUI_frontend/1.60.0",
|
||||
"summary": "The reproducible standalone release. Its asset digest is pinned from published release metadata, so the lane verifies the artifact before the host sees it; the subject still refuses to run without explicit authorization."
|
||||
}
|
||||
},
|
||||
"not_executed": {
|
||||
"frontend_source_head": "0e1a2fbbe4d5ed1eeefb70a3fd6f0d805331d3e8",
|
||||
"frontend_source_describe": "v1.57.0-309-g0e1a2fbbe4",
|
||||
"reason": "A reviewed checkout 309 commits ahead of the release, with package version 1.57.0 and unreleased splitter and extension-loader changes. The host can reproduce release 1.57.0, not this commit, so no runtime evidence may name it."
|
||||
"frontend_source_head": "aa4e48c08d364dcd36071131455a7aec40b852ac",
|
||||
"frontend_source_describe": "v1.60.0-209-gaa4e48c08d",
|
||||
"reason": "A reviewed checkout 209 commits ahead of release v1.60.0 despite sharing package version 1.60.0. Its queue UI refresh, status retries and extension-loader changes are source-only, not evidence for the release. No runtime evidence may name this source commit."
|
||||
},
|
||||
"deadlines_seconds": {
|
||||
"fetch": 900,
|
||||
@@ -71,15 +71,16 @@
|
||||
"health_path": "/openclaw/health"
|
||||
},
|
||||
"geometry": {
|
||||
"sidebar_min_width_px": 560
|
||||
"sidebar_min_width_px": 560,
|
||||
"native_sidebar_min_width_px": 312
|
||||
},
|
||||
"evidence": {
|
||||
"matrix_path": "docs/release/compatibility_matrix.md",
|
||||
"surface_module": "web/openclaw_host_surface.js",
|
||||
"evidence_key": "real_host",
|
||||
"current_state": "validated",
|
||||
"run_id": "host-pair-20261013-01",
|
||||
"evidence_id": "host-evidence-20261013-01",
|
||||
"run_id": "host-pair-20261101-isolated-01",
|
||||
"evidence_id": "host-evidence-20261101-isolated-01",
|
||||
"states_requiring_run_id": [
|
||||
"validated",
|
||||
"failed"
|
||||
|
||||
+45
-23
@@ -31,95 +31,95 @@
|
||||
"no_skip_module_metadata": {
|
||||
"tests.test_s58_bridge_token_lifecycle": {
|
||||
"reason": "Bridge token lifecycle coverage is a hard regression seam for token expiry and revoke behavior.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_s59_webhook_mapping_clamp": {
|
||||
"reason": "Webhook mapping clamp must stay no-skip because route/mapping drift can silently reopen unsafe ingress paths.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_s60_mae_route_segmentation": {
|
||||
"reason": "Public MAE route segmentation is a published hard-guarantee suite and cannot degrade to skip-only coverage.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_s60_routes_startup_gate": {
|
||||
"reason": "Startup gate coverage must stay active to catch route registration drift before public deployment.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_s61_registry_signature": {
|
||||
"reason": "Registry signature enforcement is part of the release-safety boundary for extension metadata.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.security.test_endpoint_drift": {
|
||||
"reason": "Endpoint drift detection guards the published endpoint manifest and must remain non-skippable.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_r122_real_backend_lane": {
|
||||
"reason": "Real backend lane is the low-mock parity seam for LLM/backend integration and cannot silently skip.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_r123_real_backend_model_list_lane": {
|
||||
"reason": "Model-list real backend lane protects loopback SSRF and provider-model discovery parity.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_r121_retry_partition_contract": {
|
||||
"reason": "Retry partition contract is an explicit robustness gate for failure-domain isolation.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_r124_slack_ingress_contract": {
|
||||
"reason": "Slack ingress contract must stay enforced because connector auth and callback parsing are production paths.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_r125_slack_real_backend_lane": {
|
||||
"reason": "Slack real-backend lane protects connector-to-backend parity across approval and run flows.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_r117_observability_redaction_e2e": {
|
||||
"reason": "Observability redaction E2E covers production-facing data minimization and cannot be treated as optional.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_r117_observability_redaction_endpoints": {
|
||||
"reason": "Endpoint-level redaction assertions are part of the audit/privacy boundary and must remain live.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_f57_slack_transport_parity": {
|
||||
"reason": "Slack transport parity catches protocol drift between connector routing and HTTP contract handling.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_f57_slack_socket_mode_startup": {
|
||||
"reason": "Slack socket mode startup coverage protects bootstrap compatibility for a supported deployment mode.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_connector_installation_registry": {
|
||||
"reason": "Connector installation registry governs multi-platform connector ownership and must stay no-skip.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_connector_callback_contract": {
|
||||
"reason": "Connector callback contract protects external ingress normalization and approval wiring.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_workspace_isolation": {
|
||||
"reason": "Workspace isolation guards connector paths and full-gate artifact hygiene from silently regressing.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_s100_jobs_security_contract": {
|
||||
"reason": "Jobs authorization, tenant isolation, and privacy projection are security-critical and must remain non-skippable.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_jobs_endpoint_contract": {
|
||||
"reason": "The authoritative jobs read model protects tenant-filtered bounded job metadata and must remain non-skippable.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.connector.test_r214_jobs_command": {
|
||||
"reason": "Connector jobs summaries protect the Admin jobs boundary from raw payload and fallback leakage and must remain non-skippable.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_s70_ssrf_pinning_regression": {
|
||||
"reason": "SSRF pinning regression is a security-critical boundary test and must never degrade to skip coverage.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.test_r216_file_backed_text_output": {
|
||||
"reason": "File-backed text output coverage guards untrusted file refs, bounded retrieval, and inert rendering and must remain non-skippable.",
|
||||
"review_after": "2026-10-31"
|
||||
"review_after": "2026-12-01"
|
||||
},
|
||||
"tests.connector.test_ingress_transactions": {
|
||||
"reason": "Connector trust-boundary transactions pin real HTTP and protocol-shaped signature, replay, parsing, visibility, polling, and registry decisions.",
|
||||
@@ -133,5 +133,27 @@
|
||||
"reason": "Import-resolution regressions protect canonical error identity and prevent same-name top-level modules from replacing repository-owned package imports.",
|
||||
"review_after": "2026-12-31"
|
||||
}
|
||||
},
|
||||
"platform_exclusive_tests": {
|
||||
"tests.test_runtime_process_spawn_hardening.ToolRunnerExecutableResolutionTests.test_windows_batch_target_is_refused": {
|
||||
"platforms": ["win32"],
|
||||
"reason": "Only Windows dispatches .bat/.cmd programs through cmd.exe; the refusal is Windows-only behavior.",
|
||||
"review_after": "2027-04-30"
|
||||
},
|
||||
"tests.test_runtime_process_spawn_hardening.ToolRunnerPathBoundaryTests.test_case_variant_of_allowed_directory_is_inside_on_windows": {
|
||||
"platforms": ["win32"],
|
||||
"reason": "Case-insensitive path comparison through os.path.normcase exists only on Windows.",
|
||||
"review_after": "2027-04-30"
|
||||
},
|
||||
"tests.test_runtime_process_spawn_hardening.ToolRunnerPathBoundaryTests.test_junction_inside_allowed_directory_pointing_outside_is_rejected": {
|
||||
"platforms": ["win32"],
|
||||
"reason": "Directory junctions are an NTFS feature created through _winapi.",
|
||||
"review_after": "2027-04-30"
|
||||
},
|
||||
"tests.test_runtime_process_spawn_hardening.ToolRunnerPathBoundaryTests.test_other_drive_is_outside_on_windows": {
|
||||
"platforms": ["win32"],
|
||||
"reason": "Drive letters and cross-drive commonpath errors exist only on Windows.",
|
||||
"review_after": "2027-04-30"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3843,13 +3843,6 @@
|
||||
"message": "Loop control variable `test` not used within loop body",
|
||||
"count": 2
|
||||
},
|
||||
{
|
||||
"tool": "ruff",
|
||||
"path": "scripts/run_unittests.py",
|
||||
"code": "SIM108",
|
||||
"message": "Use ternary operator `test_id = test_case.id() if hasattr(test_case, \"id\") else str(test_case)` instead of `if`-`else`-block",
|
||||
"count": 1
|
||||
},
|
||||
{
|
||||
"tool": "ruff",
|
||||
"path": "scripts/start_sidecar.py",
|
||||
|
||||
@@ -26,6 +26,17 @@ def _job_block(text: str, job_id: str) -> str:
|
||||
return match.group("body")
|
||||
|
||||
|
||||
def _push_branches(text: str) -> list[str]:
|
||||
match = re.search(
|
||||
r"^ push:\n branches:\n(?P<items>(?: - .+\n)+)",
|
||||
text,
|
||||
flags=re.MULTILINE,
|
||||
)
|
||||
if match is None:
|
||||
raise AssertionError("missing push branch filter")
|
||||
return [line.strip()[2:] for line in match.group("items").splitlines()]
|
||||
|
||||
|
||||
def _load_evidence_helper():
|
||||
if not EVIDENCE_HELPER_PATH.is_file():
|
||||
raise AssertionError(
|
||||
@@ -59,6 +70,16 @@ class HostedValidationWorkflowContractTests(unittest.TestCase):
|
||||
),
|
||||
)
|
||||
|
||||
def test_dev_pushes_run_ci_but_only_release_branches_publish(self):
|
||||
# A version change pushed to main publishes to the Comfy Registry, so dev needs
|
||||
# its own CI run first; dev must never trigger the publish workflow.
|
||||
self.assertEqual(_push_branches(self.workflow), ["main", "master", "dev"])
|
||||
publish = (CI_PATH.parent / "publish.yml").read_text(encoding="utf-8")
|
||||
self.assertEqual(_push_branches(publish), ["main", "master"])
|
||||
checklist = (ROOT / "docs" / "RELEASE_CHECKLIST.md").read_text(encoding="utf-8")
|
||||
self.assertIn("## Publication Order", checklist)
|
||||
self.assertIn("CI run on `dev`", checklist)
|
||||
|
||||
def test_every_job_has_a_measured_finite_timeout(self):
|
||||
expected = {
|
||||
"import-smoke": 15,
|
||||
|
||||
@@ -12,6 +12,29 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
class TestComfyUIHistoryParsing(unittest.TestCase):
|
||||
"""Test extract_images parses history correctly."""
|
||||
|
||||
def test_additive_preview_metadata_does_not_change_client_or_cached_refs(self):
|
||||
from services.comfyui_history import extract_output_refs
|
||||
|
||||
base = {"filename": "result.png", "subfolder": "session", "type": "temp"}
|
||||
expected = extract_output_refs({"outputs": {"7": {"images": [base]}}})
|
||||
# Client/cache output has asset_preview stripped by the host. Incoming
|
||||
# metadata is still untrusted if an older adapter happens to retain it.
|
||||
for extra in (
|
||||
{"preview_id": "preview-7"},
|
||||
{
|
||||
"preview_id": "preview-7",
|
||||
"asset_preview": "https://example.invalid/preview",
|
||||
},
|
||||
):
|
||||
with self.subTest(extra=extra):
|
||||
actual = extract_output_refs(
|
||||
{"outputs": {"7": {"images": [{**base, **extra}]}}}
|
||||
)
|
||||
self.assertEqual(actual, expected)
|
||||
self.assertNotIn("asset_preview", actual[0])
|
||||
self.assertNotIn("preview_id", actual[0])
|
||||
self.assertIn("type=temp", actual[0]["view_url"])
|
||||
|
||||
def test_extract_images_basic(self):
|
||||
from services.comfyui_history import extract_images
|
||||
|
||||
|
||||
@@ -39,23 +39,23 @@ STALE_MARKERS = (
|
||||
"v1.52.1-3-g569e65b30f",
|
||||
"standalone frontend `1.52.1`",
|
||||
"`1.49.6`",
|
||||
# Superseded by the 2026-10-13 source-review baseline.
|
||||
# Superseded by the 2026-11-01 source-review baseline.
|
||||
"23559a8f86",
|
||||
"v1.55.11-104-g23559a8f86",
|
||||
)
|
||||
|
||||
CURRENT_MARKERS = (
|
||||
# Core tag and reviewed HEAD pin different bundled frontend versions.
|
||||
"8010b48d",
|
||||
"v0.39.0-49-g8010b48d2",
|
||||
"b0b74356",
|
||||
"1.53.10",
|
||||
"1.55.14",
|
||||
"7c4390a6",
|
||||
"v0.43.0-21-g7c4390a6f",
|
||||
"426f5eea",
|
||||
"1.57.4",
|
||||
"1.57.6",
|
||||
# Standalone frontend source head versus reproducible release.
|
||||
"0e1a2fbbe4",
|
||||
"v1.57.0-309-g0e1a2fbbe4",
|
||||
"cdc18a92",
|
||||
"1.57.0",
|
||||
"aa4e48c08d",
|
||||
"v1.60.0-209-gaa4e48c08d",
|
||||
"5cb2899f",
|
||||
"1.60.0",
|
||||
# Desktop generations are unchanged and must stay published.
|
||||
"85e28b7a",
|
||||
"installation_specific",
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
from scripts import preflight_check
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
GUARD = ROOT / "scripts" / "check-node-runtime.mjs"
|
||||
POLICY = "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||
BOUNDARIES = {
|
||||
"18.20.8": False,
|
||||
"20.18.0": False,
|
||||
"20.19.0": True,
|
||||
"20.20.1": True,
|
||||
"21.7.0": False,
|
||||
"22.11.0": False,
|
||||
"22.12.0": True,
|
||||
"23.9.0": False,
|
||||
"24.13.1": True,
|
||||
"25.0.0": True,
|
||||
"24.0.0-rc.1": False,
|
||||
"unexpected v24.13.1 output": False,
|
||||
"": False,
|
||||
}
|
||||
|
||||
|
||||
class NodeRuntimePolicyTests(unittest.TestCase):
|
||||
def _guard_probe(self, version, policy=POLICY):
|
||||
code = (
|
||||
f"import {{ ensureSupportedNode }} from {json.dumps(GUARD.as_uri())};"
|
||||
"try { ensureSupportedNode(process.argv[1], process.argv[2]); }"
|
||||
"catch (error) { console.error(error.message); process.exitCode = 1; }"
|
||||
)
|
||||
return subprocess.run(
|
||||
["node", "--input-type=module", "--eval", code, version, policy],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=10,
|
||||
)
|
||||
|
||||
def test_declared_and_lock_root_policy_match_locked_tools(self):
|
||||
package = json.loads((ROOT / "package.json").read_text(encoding="utf-8"))
|
||||
lock = json.loads((ROOT / "package-lock.json").read_text(encoding="utf-8"))
|
||||
self.assertEqual(package["engines"]["node"], POLICY)
|
||||
self.assertEqual(lock["packages"][""]["engines"]["node"], POLICY)
|
||||
|
||||
def test_shared_guard_enforces_boundaries_and_rejects_unknown_policy(self):
|
||||
for version, supported in BOUNDARIES.items():
|
||||
with self.subTest(version=version):
|
||||
result = self._guard_probe(version)
|
||||
self.assertEqual(result.returncode == 0, supported, result.stderr)
|
||||
if not supported:
|
||||
self.assertIn("Required:", result.stderr)
|
||||
self.assertIn("Node 24", result.stderr)
|
||||
for policy in (">=20", "*", "^0.2.0", "^20.19.0 || nonsense"):
|
||||
with self.subTest(policy=policy):
|
||||
result = self._guard_probe("24.13.1", policy)
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
|
||||
def test_preflight_rejects_the_same_false_green_versions(self):
|
||||
for version, supported in BOUNDARIES.items():
|
||||
with self.subTest(version=version):
|
||||
|
||||
def check_node(command, **_kwargs):
|
||||
# Keep the old raw-version seam reproducible; the delegated
|
||||
# path executes the real guard against the same observed value.
|
||||
if command == ["node", "--version"]:
|
||||
return f"v{version}".encode()
|
||||
self.assertEqual(command, ["node", str(GUARD)])
|
||||
result = self._guard_probe(version)
|
||||
if result.returncode:
|
||||
raise subprocess.CalledProcessError(
|
||||
result.returncode, command, output=result.stderr.encode()
|
||||
)
|
||||
return result.stdout.encode()
|
||||
|
||||
with (
|
||||
patch.object(
|
||||
preflight_check.subprocess,
|
||||
"check_output",
|
||||
side_effect=check_node,
|
||||
),
|
||||
patch("builtins.print"),
|
||||
):
|
||||
self.assertEqual(preflight_check.check_node_version(), supported)
|
||||
|
||||
def test_missing_node_is_an_actionable_preflight_failure(self):
|
||||
with (
|
||||
patch.object(
|
||||
preflight_check.subprocess,
|
||||
"check_output",
|
||||
side_effect=FileNotFoundError,
|
||||
),
|
||||
patch("builtins.print") as output,
|
||||
):
|
||||
self.assertFalse(preflight_check.check_node_version())
|
||||
self.assertIn("Node 24", str(output.call_args_list))
|
||||
|
||||
def _fixture(self, directory):
|
||||
root = Path(directory)
|
||||
(root / "scripts").mkdir()
|
||||
for name in (
|
||||
"check-node-runtime.mjs",
|
||||
"run-playwright.mjs",
|
||||
"run_full_tests_windows.ps1",
|
||||
"run_full_tests_linux.sh",
|
||||
):
|
||||
source = ROOT / "scripts" / name
|
||||
if source.exists():
|
||||
shutil.copyfile(source, root / "scripts" / name)
|
||||
shutil.copyfile(ROOT / "package.json", root / "package.json")
|
||||
shim = root / "old-node.cjs"
|
||||
shim.write_text(
|
||||
"Object.defineProperty(process.versions, 'node', {value: '18.20.8'});\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
env = os.environ.copy()
|
||||
env.update(
|
||||
NODE_OPTIONS=f'--require "{shim.as_posix()}"',
|
||||
PRE_COMMIT_HOME=str(root / ".tmp" / "pre-commit"),
|
||||
BLACK_CACHE_DIR=str(root / ".tmp" / "black"),
|
||||
OPENCLAW_PLAYWRIGHT_INSTALL="1",
|
||||
)
|
||||
return root, env
|
||||
|
||||
def test_guard_needs_no_dependencies_and_reads_its_own_manifest(self):
|
||||
(ROOT / ".tmp").mkdir(exist_ok=True)
|
||||
with tempfile.TemporaryDirectory(dir=ROOT / ".tmp") as directory:
|
||||
root, env = self._fixture(directory)
|
||||
env.pop("NODE_OPTIONS", None)
|
||||
command = ["node", str(root / "scripts" / "check-node-runtime.mjs")]
|
||||
result = subprocess.run(
|
||||
command, cwd=ROOT, env=env, capture_output=True, text=True, timeout=10
|
||||
)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertFalse((root / "node_modules").exists())
|
||||
package = json.loads((root / "package.json").read_text(encoding="utf-8"))
|
||||
package["engines"]["node"] = ">=99.0.0"
|
||||
(root / "package.json").write_text(json.dumps(package), encoding="utf-8")
|
||||
result = subprocess.run(
|
||||
command, cwd=ROOT, env=env, capture_output=True, text=True, timeout=10
|
||||
)
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertIn("Required: >=99.0.0", result.stderr)
|
||||
|
||||
def test_direct_npm_entries_reject_before_loading_uninstalled_tools(self):
|
||||
(ROOT / ".tmp").mkdir(exist_ok=True)
|
||||
with tempfile.TemporaryDirectory(dir=ROOT / ".tmp") as directory:
|
||||
root, env = self._fixture(directory)
|
||||
for entry in ("test", "test:unit"):
|
||||
with self.subTest(entry=entry):
|
||||
result = subprocess.run(
|
||||
[
|
||||
shutil.which("npm.cmd" if os.name == "nt" else "npm"),
|
||||
"run",
|
||||
entry,
|
||||
],
|
||||
cwd=root,
|
||||
env=env,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=20,
|
||||
)
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertIn(f"Required: {POLICY}", result.stdout + result.stderr)
|
||||
self.assertFalse((root / "node_modules").exists())
|
||||
|
||||
def test_platform_full_script_rejects_before_bootstrap_or_npm(self):
|
||||
(ROOT / ".tmp").mkdir(exist_ok=True)
|
||||
with tempfile.TemporaryDirectory(dir=ROOT / ".tmp") as directory:
|
||||
root, env = self._fixture(directory)
|
||||
if sys.platform == "win32":
|
||||
probe = root / "probe.ps1"
|
||||
probe.write_text(
|
||||
"$ErrorActionPreference = 'Stop'\n"
|
||||
"function git { $global:LASTEXITCODE = 0 }\n"
|
||||
"function npm { throw 'NPM_MUST_NOT_RUN' }\n"
|
||||
"function py { throw 'BOOTSTRAP_MUST_NOT_RUN' }\n"
|
||||
f"& '{str(root / 'scripts' / 'run_full_tests_windows.ps1').replace(chr(39), chr(39) * 2)}'\n",
|
||||
encoding="utf-8-sig",
|
||||
)
|
||||
command = ["powershell.exe", "-NoProfile", "-File", str(probe)]
|
||||
else:
|
||||
probe = root / "probe.sh"
|
||||
probe.write_text(
|
||||
"git() { return 0; }; npm() { echo NPM_MUST_NOT_RUN; return 99; }; "
|
||||
"python3() { echo BOOTSTRAP_MUST_NOT_RUN; return 99; }; "
|
||||
"python() { echo BOOTSTRAP_MUST_NOT_RUN; return 99; }; "
|
||||
"export -f git npm python3 python; bash scripts/run_full_tests_linux.sh\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
command = ["bash", str(probe)]
|
||||
result = subprocess.run(
|
||||
command, cwd=root, env=env, capture_output=True, text=True, timeout=20
|
||||
)
|
||||
combined = result.stdout + result.stderr
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertIn(f"Required: {POLICY}", combined)
|
||||
self.assertNotIn("BOOTSTRAP_MUST_NOT_RUN", combined)
|
||||
self.assertNotIn("NPM_MUST_NOT_RUN", combined)
|
||||
self.assertFalse((root / ".venv").exists())
|
||||
|
||||
def test_both_shells_use_shared_guard_before_runtime_bootstrap(self):
|
||||
for name, bootstrap in (
|
||||
("run_full_tests_windows.ps1", "# Prefer project-local"),
|
||||
("run_full_tests_linux.sh", "# Always use project-local"),
|
||||
("pre_push_checks.sh", 'VENV_DIR="$(select_venv_dir)"'),
|
||||
):
|
||||
text = (ROOT / "scripts" / name).read_text(encoding="utf-8")
|
||||
with self.subTest(name=name):
|
||||
self.assertLess(
|
||||
text.index("check-node-runtime.mjs"),
|
||||
text.index(bootstrap),
|
||||
)
|
||||
self.assertNotIn("nvm use 18", text)
|
||||
@@ -1,4 +1,5 @@
|
||||
import ast
|
||||
import re
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
@@ -10,6 +11,40 @@ FULL_TESTS_WINDOWS = ROOT / "scripts" / "run_full_tests_windows.ps1"
|
||||
PREFLIGHT = ROOT / "scripts" / "preflight_check.py"
|
||||
PYPROJECT = ROOT / "pyproject.toml"
|
||||
CI_WORKFLOW = ROOT / ".github" / "workflows" / "ci.yml"
|
||||
# CI jobs that run full discovery under tests/skip_policy.json.
|
||||
SKIP_POLICY_CI_JOBS = ("unit-tests", "python-compatibility")
|
||||
|
||||
|
||||
def _optional_dependency_packages() -> list[str]:
|
||||
"""Distribution names of every ``[project.optional-dependencies]`` requirement."""
|
||||
text = PYPROJECT.read_text(encoding="utf-8")
|
||||
section = re.search(
|
||||
r"^\[project\.optional-dependencies\]\n(?P<body>.*?)(?=^\[|\Z)",
|
||||
text,
|
||||
flags=re.MULTILINE | re.DOTALL,
|
||||
)
|
||||
if section is None:
|
||||
return []
|
||||
packages = []
|
||||
for match in re.finditer(
|
||||
r"^[A-Za-z0-9_.-]+\s*=\s*(?P<value>\[.*?\])",
|
||||
section.group("body"),
|
||||
flags=re.MULTILINE | re.DOTALL,
|
||||
):
|
||||
for requirement in ast.literal_eval(match.group("value")):
|
||||
packages.append(re.match(r"[A-Za-z0-9_.-]+", requirement).group(0))
|
||||
return packages
|
||||
|
||||
|
||||
def _job_block(text: str, job_id: str) -> str:
|
||||
match = re.search(
|
||||
rf"^ {re.escape(job_id)}:\n(?P<body>.*?)(?=^ [a-z0-9][a-z0-9-]*:\n|\Z)",
|
||||
text,
|
||||
flags=re.MULTILINE | re.DOTALL,
|
||||
)
|
||||
if match is None:
|
||||
raise AssertionError(f"missing CI job: {job_id}")
|
||||
return match.group("body")
|
||||
|
||||
|
||||
def _parse_required_python_packages():
|
||||
@@ -52,6 +87,33 @@ class DependencyParityContractTests(unittest.TestCase):
|
||||
workflow = CI_WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn("python -m pip install -r requirements.txt", workflow)
|
||||
|
||||
def test_skip_policy_lanes_install_every_optional_extra(self):
|
||||
# IMPORTANT: a lane without an optional extra skips its tests and spends skip
|
||||
# budget the Windows gate never sees (v1.3.0 Linux CI failed this way).
|
||||
packages = _optional_dependency_packages()
|
||||
self.assertIn("pycryptodomex", packages)
|
||||
workflow = CI_WORKFLOW.read_text(encoding="utf-8")
|
||||
lanes = {
|
||||
"scripts/run_full_tests_windows.ps1": FULL_TESTS_WINDOWS.read_text(
|
||||
encoding="utf-8"
|
||||
),
|
||||
"scripts/pre_push_checks.sh": PRE_PUSH.read_text(encoding="utf-8"),
|
||||
"scripts/run_full_tests_linux.sh": FULL_TESTS_LINUX.read_text(
|
||||
encoding="utf-8"
|
||||
),
|
||||
}
|
||||
for job in SKIP_POLICY_CI_JOBS:
|
||||
lanes[f"ci.yml {job}"] = _job_block(workflow, job)
|
||||
for lane, text in lanes.items():
|
||||
with self.subTest(lane=lane):
|
||||
self.assertIn("--enforce-skip-policy", text)
|
||||
for package in packages:
|
||||
with self.subTest(lane=lane, package=package):
|
||||
self.assertRegex(
|
||||
text,
|
||||
rf"pip(?:_install_or_fail| install)\b[^\n]*\b{re.escape(package)}\b",
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -3,10 +3,14 @@ import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
from datetime import date, timedelta
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SCRIPT = ROOT / "scripts" / "verify_test_debt_governance.py"
|
||||
# IMPORTANT: valid fixtures need relative future dates; a fixed deadline makes
|
||||
# unrelated governance tests fail as soon as that date expires.
|
||||
VALID_REVIEW_DATE = (date.today() + timedelta(days=30)).isoformat()
|
||||
|
||||
|
||||
def _write_repo_fixture(tmp: Path) -> dict[str, Path]:
|
||||
@@ -29,7 +33,7 @@ def _write_repo_fixture(tmp: Path) -> dict[str, Path]:
|
||||
"no_skip_module_metadata": {
|
||||
"tests.test_guarded_lane": {
|
||||
"reason": "Guarded lane must stay no-skip in CI parity.",
|
||||
"review_after": "2026-10-31",
|
||||
"review_after": VALID_REVIEW_DATE,
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -49,7 +53,7 @@ def _write_repo_fixture(tmp: Path) -> dict[str, Path]:
|
||||
"file": "services/access_control.py",
|
||||
"mutation_index": 9,
|
||||
"reason": "Equivalent compare_digest branch with empty token.",
|
||||
"review_after": "2026-10-31",
|
||||
"review_after": VALID_REVIEW_DATE,
|
||||
}
|
||||
],
|
||||
},
|
||||
@@ -80,6 +84,20 @@ class TestR171TestDebtGovernance(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, 0, msg=result.stdout + result.stderr)
|
||||
self.assertIn("TEST-DEBT-GOVERNANCE-PASS", result.stdout)
|
||||
|
||||
def test_valid_fixture_passes_without_an_absolute_calendar_deadline(self):
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
fixture = _write_repo_fixture(Path(tmpdir))
|
||||
result = self._run_script(
|
||||
"--repo-root",
|
||||
str(fixture["repo_root"]),
|
||||
"--skip-policy",
|
||||
str(fixture["skip_policy"]),
|
||||
"--mutation-survivor-allowlist",
|
||||
str(fixture["mutation_allowlist"]),
|
||||
)
|
||||
self.assertEqual(result.returncode, 0, msg=result.stdout + result.stderr)
|
||||
self.assertIn("TEST-DEBT-GOVERNANCE-PASS", result.stdout)
|
||||
|
||||
def test_duplicate_no_skip_modules_are_rejected(self):
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
fixture = _write_repo_fixture(Path(tmpdir))
|
||||
@@ -94,7 +112,7 @@ class TestR171TestDebtGovernance(unittest.TestCase):
|
||||
"no_skip_module_metadata": {
|
||||
"tests.test_guarded_lane": {
|
||||
"reason": "Guarded lane must stay no-skip in CI parity.",
|
||||
"review_after": "2026-10-31",
|
||||
"review_after": VALID_REVIEW_DATE,
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -152,13 +170,13 @@ class TestR171TestDebtGovernance(unittest.TestCase):
|
||||
"file": "services/access_control.py",
|
||||
"mutation_index": 9,
|
||||
"reason": "Equivalent compare_digest branch with empty token.",
|
||||
"review_after": "2026-10-31",
|
||||
"review_after": VALID_REVIEW_DATE,
|
||||
},
|
||||
{
|
||||
"file": "services/access_control.py",
|
||||
"mutation_index": 9,
|
||||
"reason": "Duplicate entry for regression coverage.",
|
||||
"review_after": "2026-10-31",
|
||||
"review_after": VALID_REVIEW_DATE,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -190,7 +208,7 @@ class TestR171TestDebtGovernance(unittest.TestCase):
|
||||
"file": "services/missing.py",
|
||||
"mutation_index": 9,
|
||||
"reason": "Stale path should fail closed.",
|
||||
"review_after": "2026-10-31",
|
||||
"review_after": VALID_REVIEW_DATE,
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
@@ -19,10 +19,11 @@ class TestR208NodeRuntimePolicy(unittest.TestCase):
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
self.assertEqual(package["engines"]["node"], ">=18.0.0")
|
||||
self.assertIn("Node.js 18+", test_sop)
|
||||
self.assertIn("CI uses 20", test_sop)
|
||||
self.assertIn("Node.js 18+", e2e_sop)
|
||||
policy = "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||
self.assertEqual(package["engines"]["node"], policy)
|
||||
self.assertIn(policy, test_sop)
|
||||
self.assertIn("Node 20 line", test_sop)
|
||||
self.assertIn(policy, e2e_sop)
|
||||
self.assertNotEqual(package["engines"]["node"], ">=26.8.2 <27")
|
||||
|
||||
def test_compatibility_matrix_documents_host_frontend_engine_boundary(self):
|
||||
@@ -32,7 +33,7 @@ class TestR208NodeRuntimePolicy(unittest.TestCase):
|
||||
|
||||
self.assertIn("## Residual Host-Contract Decisions", matrix)
|
||||
self.assertIn("`node >=26.8.2 <27`", matrix)
|
||||
self.assertIn("`>=18.0.0`", matrix)
|
||||
self.assertIn("`^20.19.0 || ^22.12.0 || >=24.0.0`", matrix)
|
||||
self.assertIn("tests/TEST_SOP.md", matrix)
|
||||
self.assertIn("tests/E2E_TESTING_SOP.md", matrix)
|
||||
self.assertIn("does not build the host frontend workspace", matrix)
|
||||
|
||||
@@ -24,8 +24,8 @@ from services.operator_doctor import DoctorReport, check_compatibility_matrix_go
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
EXPECTED_CURRENT_ANCHORS = {
|
||||
"comfyui": "8010b48d (v0.39.0-49-g8010b48d2 / pyproject 0.39.0)",
|
||||
"comfyui_frontend": "1.57.0 (0e1a2fbbe4 / v1.57.0-309-g0e1a2fbbe4)",
|
||||
"comfyui": "7c4390a6 (v0.43.0-21-g7c4390a6f / pyproject 0.43.0)",
|
||||
"comfyui_frontend": "1.60.0 (aa4e48c08d / v1.60.0-209-gaa4e48c08d)",
|
||||
"desktop": "0.9.4 (core 0.22.3 / frontend 1.43.18)",
|
||||
"comfy_desktop": "1.0.32-rc.1 (85e28b7a / v1.0.32-rc.1-3-g85e28b7)",
|
||||
}
|
||||
@@ -68,24 +68,45 @@ STALE_ACTIVE_REFERENCE_TOKENS = (
|
||||
)
|
||||
EXPECTED_REFERENCE_BASELINES = {
|
||||
"comfyui": {
|
||||
"bundled_frontend_version": "1.55.14",
|
||||
"project_version": "0.39.0",
|
||||
"source_describe": "v0.39.0-49-g8010b48d2",
|
||||
"source_head": "8010b48d2c1be986613f8e8c761527d205bd756f",
|
||||
"tag": "v0.39.0",
|
||||
"tag_commit": "b0b743566f65daafc423b4fea8a2fbda94b3384a",
|
||||
"bundled_frontend_version": "1.57.6",
|
||||
"project_version": "0.43.0",
|
||||
"source_describe": "v0.43.0-21-g7c4390a6f",
|
||||
"source_head": "7c4390a6f70cd8eb41014d6af52969397a752fc4",
|
||||
"tag": "v0.43.0",
|
||||
"tag_commit": "426f5eea52a7ece1dd599fff4cb6cd1f352ddd24",
|
||||
},
|
||||
"comfyui_frontend": {
|
||||
"package_version": "1.57.0",
|
||||
"release_tag": "v1.57.0",
|
||||
"release_tag_commit": "cdc18a92d227a965810b08928963124959951908",
|
||||
"release_version": "1.57.0",
|
||||
"source_describe": "v1.57.0-309-g0e1a2fbbe4",
|
||||
"source_head": "0e1a2fbbe4d5ed1eeefb70a3fd6f0d805331d3e8",
|
||||
"package_version": "1.60.0",
|
||||
"release_tag": "v1.60.0",
|
||||
"release_tag_commit": "5cb2899fc4bc5034513fbafae72b39265c4a213e",
|
||||
"release_version": "1.60.0",
|
||||
"source_describe": "v1.60.0-209-gaa4e48c08d",
|
||||
"source_head": "aa4e48c08d364dcd36071131455a7aec40b852ac",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def _write_pending_matrix(path: Path) -> None:
|
||||
# Keep pending cases independent of the repository's current qualification state.
|
||||
metadata = read_matrix_document(
|
||||
REPO_ROOT / "docs" / "release" / "compatibility_matrix.md"
|
||||
)["metadata"]
|
||||
metadata["last_validated_date"] = None
|
||||
for key in ("real_host", "repository_validation"):
|
||||
metadata["evidence_states"][key] = {
|
||||
"state": "pending",
|
||||
"run_id": None,
|
||||
"evidence_id": None,
|
||||
}
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text(
|
||||
"# Pending matrix fixture\n\n```openclaw-compat-matrix-meta\n"
|
||||
+ json.dumps(metadata)
|
||||
+ "\n```\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
|
||||
class TestR90CompatMatrixGovernance(unittest.TestCase):
|
||||
def test_repo_matrix_has_valid_metadata(self):
|
||||
doc = read_matrix_document(
|
||||
@@ -94,7 +115,7 @@ class TestR90CompatMatrixGovernance(unittest.TestCase):
|
||||
self.assertTrue(doc["has_meta"], msg=doc["issues"])
|
||||
validation = validate_metadata(doc["metadata"])
|
||||
self.assertTrue(validation["ok"], msg=validation)
|
||||
self.assertIn(validation["status"], ("fresh", "warning", "stale"))
|
||||
self.assertIn(validation["status"], ("fresh", "warning", "stale", "pending"))
|
||||
|
||||
def test_repo_matrix_tracks_current_reference_anchors(self):
|
||||
doc = read_matrix_document(
|
||||
@@ -108,7 +129,7 @@ class TestR90CompatMatrixGovernance(unittest.TestCase):
|
||||
)
|
||||
|
||||
readme = (REPO_ROOT / "README.md").read_text(encoding="utf-8")
|
||||
self.assertIn("standalone frontend release `1.57.0`", readme)
|
||||
self.assertIn("standalone frontend release `1.60.0`", readme)
|
||||
self.assertIn("Both historical frontend subjects", readme)
|
||||
|
||||
def test_active_current_reference_files_reject_stale_anchors(self):
|
||||
@@ -430,6 +451,22 @@ class TestR90CompatMatrixGovernance(unittest.TestCase):
|
||||
"installation_specific",
|
||||
)
|
||||
|
||||
def test_operator_doctor_warns_for_unknown_current_host_validation(self):
|
||||
report = DoctorReport()
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
_write_pending_matrix(root / "docs" / "release" / "compatibility_matrix.md")
|
||||
check_compatibility_matrix_governance(report, root)
|
||||
check = next(
|
||||
c for c in report.checks if c.name == "compatibility_matrix_governance"
|
||||
)
|
||||
self.assertEqual(check.severity, "warn")
|
||||
self.assertIn("pending", check.message)
|
||||
self.assertNotIn("fresh", check.message)
|
||||
self.assertEqual(
|
||||
report.environment["compat_matrix_validation_code"], "R90_MATRIX_PENDING"
|
||||
)
|
||||
|
||||
def test_r166_desktop_runtime_lane_matches_recorded_desktop_anchor_contract(self):
|
||||
doc = read_matrix_document(
|
||||
REPO_ROOT / "docs" / "release" / "compatibility_matrix.md"
|
||||
@@ -524,32 +561,83 @@ class TestR254ReferenceBaselineEvidence(unittest.TestCase):
|
||||
validation = validate_metadata(metadata, today=date(2026, 9, 6))
|
||||
return validation, {entry["code"] for entry in validation["violations"]}
|
||||
|
||||
def test_repo_matrix_names_the_refreshed_real_host_campaign(self):
|
||||
# CRITICAL: only a campaign on the refreshed subjects may validate them.
|
||||
doc = read_matrix_document(
|
||||
REPO_ROOT / "docs" / "release" / "compatibility_matrix.md"
|
||||
)
|
||||
metadata = doc["metadata"]
|
||||
def test_repo_matrix_keeps_refreshed_pair_validated_and_history_scoped(self):
|
||||
metadata = read_matrix_document(
|
||||
REPO_ROOT / "docs/release/compatibility_matrix.md"
|
||||
)["metadata"]
|
||||
states = metadata["evidence_states"]
|
||||
self.assertEqual(states["source_review"]["state"], "reviewed")
|
||||
self.assertEqual(
|
||||
states["source_review"]["evidence_id"], "source-review-20261013"
|
||||
)
|
||||
self.assertEqual(states["real_host"]["state"], "validated")
|
||||
self.assertEqual(states["real_host"]["run_id"], "host-pair-20261013-01")
|
||||
self.assertEqual(
|
||||
states["real_host"]["evidence_id"], "host-evidence-20261013-01"
|
||||
)
|
||||
self.assertEqual(states["repository_validation"]["state"], "validated")
|
||||
self.assertEqual(
|
||||
states["repository_validation"]["run_id"],
|
||||
"windows-full-gate-20261013-host-requalification",
|
||||
states["source_review"]["evidence_id"], "source-review-20261101"
|
||||
)
|
||||
self.assertEqual(
|
||||
states["repository_validation"]["evidence_id"],
|
||||
"repo-validation-20261013-host-requalification",
|
||||
states["real_host"],
|
||||
{
|
||||
"state": "validated",
|
||||
"run_id": "host-pair-20261101-isolated-01",
|
||||
"evidence_id": "host-evidence-20261101-isolated-01",
|
||||
},
|
||||
)
|
||||
self.assertEqual(metadata["last_validated_date"], "2026-10-13")
|
||||
self.assertEqual(
|
||||
states["repository_validation"],
|
||||
{
|
||||
"state": "validated",
|
||||
"run_id": "windows-full-gate-20261101-host-alignment",
|
||||
"evidence_id": "repo-validation-20261101-host-alignment",
|
||||
},
|
||||
)
|
||||
self.assertEqual(metadata["last_validated_date"], "2026-11-01")
|
||||
historical = metadata["historical_evidence"][0]
|
||||
self.assertEqual(historical["last_validated_date"], "2026-10-13")
|
||||
self.assertEqual(
|
||||
historical["reference_baselines"]["comfyui"]["project_version"], "0.39.0"
|
||||
)
|
||||
self.assertEqual(
|
||||
historical["evidence_states"]["real_host"]["run_id"],
|
||||
"host-pair-20261013-01",
|
||||
)
|
||||
|
||||
def test_explicit_unknown_date_is_pending_only_for_schema3_pending_host(self):
|
||||
metadata = self._schema3(last_validated_date=None)
|
||||
validation, codes = self._codes(metadata)
|
||||
self.assertTrue(validation["ok"], msg=codes)
|
||||
self.assertEqual(validation["status"], "pending")
|
||||
self.assertIsNone(validation["age_days"])
|
||||
for state in ("validated", "failed"):
|
||||
metadata["evidence_states"]["real_host"] = {
|
||||
"state": state,
|
||||
"run_id": "campaign-1",
|
||||
"evidence_id": "evidence-1",
|
||||
}
|
||||
self.assertIn("R90_META_LAST_VALIDATED_DATE", self._codes(metadata)[1])
|
||||
|
||||
def test_missing_invalid_and_legacy_unknown_dates_still_fail(self):
|
||||
for invalid in ("", "unknown", 123):
|
||||
self.assertIn(
|
||||
"R90_META_LAST_VALIDATED_DATE",
|
||||
self._codes(self._schema3(last_validated_date=invalid))[1],
|
||||
)
|
||||
missing = self._schema3()
|
||||
del missing["last_validated_date"]
|
||||
self.assertIn("R90_META_LAST_VALIDATED_DATE", self._codes(missing)[1])
|
||||
self.assertIn(
|
||||
"R90_META_LAST_VALIDATED_DATE",
|
||||
self._codes(self._schema3(schema_version=2, last_validated_date=None))[1],
|
||||
)
|
||||
|
||||
def test_pending_matrix_refresh_cannot_invent_a_validation_date(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
target = Path(directory) / "matrix.md"
|
||||
_write_pending_matrix(target)
|
||||
result = run_refresh_workflow(
|
||||
matrix_path=target,
|
||||
observed_anchors=dict(EXPECTED_CURRENT_ANCHORS),
|
||||
apply=True,
|
||||
)
|
||||
self.assertTrue(result.ok)
|
||||
self.assertIsNone(
|
||||
read_matrix_document(target)["metadata"]["last_validated_date"]
|
||||
)
|
||||
|
||||
def test_repo_matrix_separates_frontend_source_head_from_release(self):
|
||||
doc = read_matrix_document(
|
||||
@@ -557,11 +645,11 @@ class TestR254ReferenceBaselineEvidence(unittest.TestCase):
|
||||
)
|
||||
frontend = doc["metadata"]["reference_baselines"]["comfyui_frontend"]
|
||||
self.assertNotEqual(frontend["source_head"], frontend["release_tag_commit"])
|
||||
self.assertEqual(frontend["release_version"], "1.57.0")
|
||||
self.assertEqual(frontend["package_version"], "1.57.0")
|
||||
self.assertEqual(frontend["release_version"], "1.60.0")
|
||||
self.assertEqual(frontend["package_version"], "1.60.0")
|
||||
core = doc["metadata"]["reference_baselines"]["comfyui"]
|
||||
self.assertNotEqual(core["source_head"], core["tag_commit"])
|
||||
self.assertEqual(core["bundled_frontend_version"], "1.55.14")
|
||||
self.assertEqual(core["bundled_frontend_version"], "1.57.6")
|
||||
|
||||
def test_schema_v3_metadata_validates(self):
|
||||
validation, codes = self._codes(self._schema3())
|
||||
|
||||
@@ -120,6 +120,19 @@ class TestPinsAgreeWithTrackedAnchors(unittest.TestCase):
|
||||
layout,
|
||||
)
|
||||
|
||||
def test_native_sidebar_floor_is_distinct_and_requires_host_owned_allocation(self):
|
||||
self.assertEqual(POLICY["geometry"]["native_sidebar_min_width_px"], 312)
|
||||
spec = (REPO_ROOT / "tests/real_host/specs/real_host_smoke.spec.js").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
self.assertIn("expect(mounted.native).toBe(true)", spec)
|
||||
self.assertIn("expect(mounted.layoutMode).toBe('host')", spec)
|
||||
self.assertIn("Math.abs(mounted.width - baseline.width)", spec)
|
||||
self.assertIn("Math.abs(mounted.width - hostOnly.width)", spec)
|
||||
self.assertIn(
|
||||
"POLICY.geometry.native_sidebar_min_width_px, HOST_WIDTH_TOLERANCE_PX", spec
|
||||
)
|
||||
|
||||
|
||||
class TestUnverifiedReleaseArtifactCannotRun(unittest.TestCase):
|
||||
"""An artifact nobody verified must never be able to produce release evidence."""
|
||||
@@ -229,7 +242,7 @@ class TestHostStartupIsBoundedAndLoopbackOnly(unittest.TestCase):
|
||||
self.assertNotIn("--listen", release)
|
||||
self.assertNotIn("--front-end-version", bundled)
|
||||
self.assertEqual(
|
||||
release[-2:], ["--front-end-version", "Comfy-Org/ComfyUI_frontend@v1.57.0"]
|
||||
release[-2:], ["--front-end-version", "Comfy-Org/ComfyUI_frontend@v1.60.0"]
|
||||
)
|
||||
for args in (bundled, release):
|
||||
for forbidden in POLICY["runtime"]["forbidden_args"]:
|
||||
@@ -292,7 +305,8 @@ class TestEvidenceCannotAdvanceWithoutARun(unittest.TestCase):
|
||||
self.assertEqual(states["state"], "validated")
|
||||
self.assertEqual(states["run_id"], POLICY["evidence"]["run_id"])
|
||||
self.assertEqual(states["evidence_id"], POLICY["evidence"]["evidence_id"])
|
||||
self.assertEqual(states["run_id"], "host-pair-20261013-01")
|
||||
self.assertEqual(states["run_id"], "host-pair-20261101-isolated-01")
|
||||
self.assertEqual(states["evidence_id"], "host-evidence-20261101-isolated-01")
|
||||
self.assertEqual(
|
||||
evidence_update_is_allowed(
|
||||
POLICY, states["state"], states["run_id"], states["evidence_id"]
|
||||
@@ -557,7 +571,7 @@ class TestSpecUsesSurfacesThatExistOutsideTheMock(unittest.TestCase):
|
||||
# drags the host gutter and never assigns a sizing style itself.
|
||||
for marker in (
|
||||
"survives a tab switch",
|
||||
"p-splitter-gutter",
|
||||
'[role="separator"][data-orientation="horizontal"]',
|
||||
"page.mouse.down()",
|
||||
"page.mouse.up()",
|
||||
"evaluateHostWidthOwnership(",
|
||||
|
||||
@@ -0,0 +1,575 @@
|
||||
"""Skip budget scoped to declared platform-exclusive tests, with canonical skip ids.
|
||||
|
||||
A Windows-only case cannot run on Linux, so its skip there is a platform fact rather than
|
||||
missing coverage. Such tests are declared per test id in ``tests/skip_policy.json`` and are
|
||||
excused only off their declared platforms; every other skip still counts.
|
||||
"""
|
||||
|
||||
import importlib
|
||||
import importlib.util
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import types
|
||||
import unittest
|
||||
from datetime import date, timedelta
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
POLICY_PATH = ROOT / "tests" / "skip_policy.json"
|
||||
GOVERNANCE_SCRIPT = ROOT / "scripts" / "verify_test_debt_governance.py"
|
||||
|
||||
HARDENING = "tests.test_runtime_process_spawn_hardening"
|
||||
WINDOWS_ONLY_HARDENING_CASES = frozenset(
|
||||
{
|
||||
f"{HARDENING}.ToolRunnerPathBoundaryTests.test_junction_inside_allowed_directory_pointing_outside_is_rejected",
|
||||
f"{HARDENING}.ToolRunnerPathBoundaryTests.test_case_variant_of_allowed_directory_is_inside_on_windows",
|
||||
f"{HARDENING}.ToolRunnerPathBoundaryTests.test_other_drive_is_outside_on_windows",
|
||||
f"{HARDENING}.ToolRunnerExecutableResolutionTests.test_windows_batch_target_is_refused",
|
||||
}
|
||||
)
|
||||
WECHAT_AES = "tests.connector.platforms.test_r82_wechat_parity.TestAESDecrypt"
|
||||
# Canonical form of the six skips in the Linux unit-tests job of the v1.3.0 CI run.
|
||||
LINUX_CI_SKIPS = sorted(WINDOWS_ONLY_HARDENING_CASES) + [
|
||||
f"{WECHAT_AES}.test_round_trip_decrypt",
|
||||
f"{WECHAT_AES}.test_wrong_app_id_raises",
|
||||
]
|
||||
|
||||
DECLARED = "tests.test_example.ExampleTests.test_windows_only"
|
||||
FAKE_MODULE = "test_fake_platform_scope_module"
|
||||
|
||||
|
||||
def _load_runner() -> types.ModuleType:
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
"run_unittests_platform_scope", ROOT / "scripts" / "run_unittests.py"
|
||||
)
|
||||
if spec is None or spec.loader is None:
|
||||
raise RuntimeError("Failed to load run_unittests.py")
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
def _skipping_case(module_name: str) -> type:
|
||||
class Case(unittest.TestCase):
|
||||
def test_skipped(self) -> None:
|
||||
self.skipTest("not on this platform")
|
||||
|
||||
def test_subtest_skipped(self) -> None:
|
||||
with self.subTest(variant="a"):
|
||||
self.skipTest("not on this platform either")
|
||||
|
||||
Case.__module__ = module_name
|
||||
Case.__qualname__ = "Case"
|
||||
return Case
|
||||
|
||||
|
||||
def _fake_module(name: str, file_path: Path) -> types.ModuleType:
|
||||
module = types.ModuleType(name)
|
||||
module.__file__ = str(file_path)
|
||||
return module
|
||||
|
||||
|
||||
def _run_case(case_class: type, method: str) -> unittest.TestResult:
|
||||
result = unittest.TestResult()
|
||||
case_class(method).run(result)
|
||||
return result
|
||||
|
||||
|
||||
class PlatformExclusiveBudgetTests(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
self.runner = _load_runner()
|
||||
self.exclusive = {DECLARED: frozenset({"win32"})}
|
||||
|
||||
def evaluate(self, skips, *, platform, max_skipped=0, no_skip_modules=()):
|
||||
return self.runner._evaluate_skip_policy(
|
||||
skips=skips,
|
||||
max_skipped=max_skipped,
|
||||
no_skip_modules=list(no_skip_modules),
|
||||
platform_exclusive_tests=self.exclusive,
|
||||
platform=platform,
|
||||
)
|
||||
|
||||
def test_off_platform_skip_of_a_declared_test_is_excused(self) -> None:
|
||||
self.assertEqual(self.evaluate([(DECLARED, "windows")], platform="linux"), [])
|
||||
|
||||
def test_on_platform_skip_of_a_declared_test_counts(self) -> None:
|
||||
violations = self.evaluate(
|
||||
[(DECLARED, "junctions unavailable")], platform="win32"
|
||||
)
|
||||
|
||||
self.assertEqual(len(violations), 1)
|
||||
self.assertIn("skip budget exceeded: skipped=1 > max_skipped=0", violations[0])
|
||||
|
||||
def test_undeclared_skip_counts(self) -> None:
|
||||
violations = self.evaluate(
|
||||
[
|
||||
(DECLARED, "windows"),
|
||||
("tests.test_example.ExampleTests.test_other", "dep"),
|
||||
],
|
||||
platform="linux",
|
||||
)
|
||||
|
||||
self.assertEqual(len(violations), 1)
|
||||
self.assertIn("skipped=1 > max_skipped=0", violations[0])
|
||||
|
||||
def test_an_excused_skip_in_a_no_skip_module_still_fails(self) -> None:
|
||||
violations = self.evaluate(
|
||||
[(DECLARED, "windows")],
|
||||
platform="linux",
|
||||
max_skipped=5,
|
||||
no_skip_modules=["tests.test_example"],
|
||||
)
|
||||
|
||||
self.assertEqual(len(violations), 1)
|
||||
self.assertIn("no-skip suite skipped", violations[0])
|
||||
|
||||
def test_partition_separates_counted_and_excused_skips(self) -> None:
|
||||
other = ("tests.test_example.ExampleTests.test_other", "dep")
|
||||
|
||||
counted, excused = self.runner._partition_skips(
|
||||
[(DECLARED, "windows"), other],
|
||||
platform_exclusive_tests=self.exclusive,
|
||||
platform="linux",
|
||||
)
|
||||
|
||||
self.assertEqual(counted, [other])
|
||||
self.assertEqual(excused, [(DECLARED, "windows")])
|
||||
|
||||
def test_report_lists_counted_and_excused_skips(self) -> None:
|
||||
other = ("tests.test_example.ExampleTests.test_other", "dep")
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
report_path = Path(tmp) / "report.json"
|
||||
self.runner._write_skip_report(
|
||||
str(report_path),
|
||||
tests_run=3,
|
||||
duration_sec=0.5,
|
||||
skips=[(DECLARED, "windows"), other],
|
||||
max_skipped=4,
|
||||
no_skip_modules=[],
|
||||
violations=[],
|
||||
platform_exclusive_tests=self.exclusive,
|
||||
platform="linux",
|
||||
)
|
||||
report = json.loads(report_path.read_text(encoding="utf-8"))
|
||||
|
||||
self.assertEqual(report["platform"], "linux")
|
||||
self.assertEqual(report["skipped_count"], 2)
|
||||
self.assertEqual(report["counted_skipped_count"], 1)
|
||||
self.assertEqual(
|
||||
report["platform_excused"], [{"test_id": DECLARED, "reason": "windows"}]
|
||||
)
|
||||
self.assertEqual(report["policy"]["platform_exclusive_tests"], [DECLARED])
|
||||
|
||||
|
||||
class CanonicalSkipIdTests(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
self.runner = _load_runner()
|
||||
|
||||
def collect(self, module: types.ModuleType, method: str):
|
||||
result = _run_case(_skipping_case(module.__name__), method)
|
||||
with patch.dict(sys.modules, {module.__name__: module}):
|
||||
return self.runner._collect_skips(result)
|
||||
|
||||
def test_top_level_discovery_ids_gain_the_tests_prefix(self) -> None:
|
||||
module = _fake_module(FAKE_MODULE, ROOT / "tests" / f"{FAKE_MODULE}.py")
|
||||
|
||||
skips = self.collect(module, "test_skipped")
|
||||
|
||||
self.assertEqual(
|
||||
skips, [(f"tests.{FAKE_MODULE}.Case.test_skipped", "not on this platform")]
|
||||
)
|
||||
|
||||
def test_dotted_subdirectory_ids_are_unchanged(self) -> None:
|
||||
name = f"tests.connector.{FAKE_MODULE}"
|
||||
module = _fake_module(name, ROOT / "tests" / "connector" / f"{FAKE_MODULE}.py")
|
||||
|
||||
skips = self.collect(module, "test_skipped")
|
||||
|
||||
self.assertEqual(skips[0][0], f"{name}.Case.test_skipped")
|
||||
|
||||
def test_a_subtest_skip_is_named_after_its_parent_test(self) -> None:
|
||||
module = _fake_module(FAKE_MODULE, ROOT / "tests" / f"{FAKE_MODULE}.py")
|
||||
|
||||
skips = self.collect(module, "test_subtest_skipped")
|
||||
|
||||
self.assertEqual(len(skips), 1)
|
||||
self.assertTrue(
|
||||
skips[0][0].startswith(f"tests.{FAKE_MODULE}.Case.test_subtest_skipped "),
|
||||
skips[0][0],
|
||||
)
|
||||
|
||||
def test_a_module_outside_the_repository_keeps_its_raw_id(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
module = _fake_module(FAKE_MODULE, Path(tmp) / f"{FAKE_MODULE}.py")
|
||||
|
||||
skips = self.collect(module, "test_skipped")
|
||||
|
||||
self.assertEqual(skips[0][0], f"{FAKE_MODULE}.Case.test_skipped")
|
||||
|
||||
def test_the_full_run_no_skip_check_matches_a_top_level_module(self) -> None:
|
||||
module = _fake_module(FAKE_MODULE, ROOT / "tests" / f"{FAKE_MODULE}.py")
|
||||
|
||||
violations = self.runner._evaluate_skip_policy(
|
||||
skips=self.collect(module, "test_skipped"),
|
||||
max_skipped=10,
|
||||
no_skip_modules=[f"tests.{FAKE_MODULE}"],
|
||||
)
|
||||
|
||||
self.assertEqual(len(violations), 1)
|
||||
self.assertIn("no-skip suite skipped", violations[0])
|
||||
|
||||
|
||||
class DeclarationLoadingTests(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
self.runner = _load_runner()
|
||||
|
||||
def load(self, declarations):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
path = Path(tmp) / "skip_policy.json"
|
||||
path.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"max_skipped": 4,
|
||||
"no_skip_modules": [],
|
||||
"platform_exclusive_tests": declarations,
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
return self.runner._load_skip_policy(str(path))
|
||||
|
||||
def test_valid_declarations_load_as_platform_sets(self) -> None:
|
||||
policy = self.load(
|
||||
{DECLARED: {"platforms": ["win32"], "reason": "NTFS junctions"}}
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
policy["platform_exclusive_tests"], {DECLARED: frozenset({"win32"})}
|
||||
)
|
||||
|
||||
def test_a_policy_without_declarations_loads_an_empty_mapping(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
path = Path(tmp) / "skip_policy.json"
|
||||
path.write_text(json.dumps({"max_skipped": 4}), encoding="utf-8")
|
||||
|
||||
policy = self.runner._load_skip_policy(str(path))
|
||||
|
||||
self.assertEqual(policy["platform_exclusive_tests"], {})
|
||||
|
||||
def test_malformed_declarations_are_rejected(self) -> None:
|
||||
cases = {
|
||||
"not an object": [DECLARED],
|
||||
"unknown platform": {DECLARED: {"platforms": ["windows"], "reason": "x"}},
|
||||
"empty platforms": {DECLARED: {"platforms": [], "reason": "x"}},
|
||||
"platforms not a list": {DECLARED: {"platforms": "win32", "reason": "x"}},
|
||||
"missing reason": {DECLARED: {"platforms": ["win32"]}},
|
||||
"blank reason": {DECLARED: {"platforms": ["win32"], "reason": " "}},
|
||||
"entry not an object": {DECLARED: "win32"},
|
||||
"id not tests-qualified": {
|
||||
"test_example.ExampleTests.test_windows_only": {
|
||||
"platforms": ["win32"],
|
||||
"reason": "x",
|
||||
}
|
||||
},
|
||||
"id without class and method": {
|
||||
"tests.test_example": {"platforms": ["win32"], "reason": "x"}
|
||||
},
|
||||
}
|
||||
for label, declarations in cases.items():
|
||||
with self.subTest(label), self.assertRaises(ValueError):
|
||||
self.load(declarations)
|
||||
|
||||
|
||||
class RepositoryPolicyTests(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
self.runner = _load_runner()
|
||||
self.policy = self.runner._load_skip_policy(str(POLICY_PATH))
|
||||
|
||||
def test_the_windows_only_hardening_cases_are_declared_for_windows(self) -> None:
|
||||
declared = self.policy["platform_exclusive_tests"]
|
||||
|
||||
for test_id in WINDOWS_ONLY_HARDENING_CASES:
|
||||
self.assertEqual(declared.get(test_id), frozenset({"win32"}), test_id)
|
||||
|
||||
def test_the_linux_ci_skip_set_fits_the_budget(self) -> None:
|
||||
skips = [(test_id, "observed on Linux CI") for test_id in LINUX_CI_SKIPS]
|
||||
|
||||
violations = self.runner._evaluate_skip_policy(
|
||||
skips=skips,
|
||||
max_skipped=self.policy["max_skipped"],
|
||||
no_skip_modules=self.policy["no_skip_modules"],
|
||||
platform_exclusive_tests=self.policy["platform_exclusive_tests"],
|
||||
platform="linux",
|
||||
)
|
||||
counted, _ = self.runner._partition_skips(
|
||||
skips,
|
||||
platform_exclusive_tests=self.policy["platform_exclusive_tests"],
|
||||
platform="linux",
|
||||
)
|
||||
|
||||
self.assertEqual(violations, [])
|
||||
self.assertEqual(self.policy["max_skipped"], 4)
|
||||
self.assertEqual(
|
||||
sorted(test_id for test_id, _ in counted),
|
||||
[
|
||||
f"{WECHAT_AES}.test_round_trip_decrypt",
|
||||
f"{WECHAT_AES}.test_wrong_app_id_raises",
|
||||
],
|
||||
)
|
||||
|
||||
def test_each_declared_test_skips_exactly_off_its_platforms(self) -> None:
|
||||
declared = self.policy["platform_exclusive_tests"]
|
||||
self.assertTrue(declared)
|
||||
for test_id, platforms in sorted(declared.items()):
|
||||
module_name, class_name, method_name = test_id.rsplit(".", 2)
|
||||
with self.subTest(test_id):
|
||||
module = importlib.import_module(module_name)
|
||||
method = getattr(getattr(module, class_name), method_name)
|
||||
self.assertEqual(
|
||||
bool(getattr(method, "__unittest_skip__", False)),
|
||||
sys.platform not in platforms,
|
||||
)
|
||||
|
||||
|
||||
WINDOWS_ONLY_SOURCE = (
|
||||
"import sys\nimport unittest\n\n\n"
|
||||
"class ExampleTests(unittest.TestCase):\n"
|
||||
' @unittest.skipUnless(sys.platform == "win32", "Windows only")\n'
|
||||
" def test_windows_only(self):\n"
|
||||
" pass\n"
|
||||
)
|
||||
|
||||
|
||||
def _write_governance_fixture(root: Path, declarations, files=None) -> list[str]:
|
||||
tests_dir = root / "tests"
|
||||
tests_dir.mkdir()
|
||||
sources = files if files is not None else {"test_example.py": WINDOWS_ONLY_SOURCE}
|
||||
for relative, source in sources.items():
|
||||
path = tests_dir / relative
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text(source, encoding="utf-8")
|
||||
policy = tests_dir / "skip_policy.json"
|
||||
policy.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"max_skipped": 4,
|
||||
"no_skip_modules": [],
|
||||
"no_skip_module_metadata": {},
|
||||
"platform_exclusive_tests": declarations,
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
allowlist = tests_dir / "mutation_survivor_allowlist.json"
|
||||
allowlist.write_text(json.dumps({"version": 1, "entries": []}), encoding="utf-8")
|
||||
return [
|
||||
"--repo-root",
|
||||
str(root),
|
||||
"--skip-policy",
|
||||
str(policy),
|
||||
"--mutation-survivor-allowlist",
|
||||
str(allowlist),
|
||||
]
|
||||
|
||||
|
||||
def _run_governance(declarations, files=None) -> subprocess.CompletedProcess:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
args = _write_governance_fixture(Path(tmp), declarations, files)
|
||||
return subprocess.run(
|
||||
[sys.executable, str(GOVERNANCE_SCRIPT), *args],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
cwd=str(ROOT),
|
||||
check=False,
|
||||
)
|
||||
|
||||
|
||||
def _entry(**overrides):
|
||||
future = (date.today() + timedelta(days=180)).isoformat()
|
||||
entry = {"platforms": ["win32"], "reason": "NTFS only", "review_after": future}
|
||||
entry.update(overrides)
|
||||
return {key: value for key, value in entry.items() if value is not None}
|
||||
|
||||
|
||||
class DeclarationGovernanceTests(unittest.TestCase):
|
||||
def test_runner_and_governance_accept_the_same_platforms(self) -> None:
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
"verify_test_debt_governance_platform_scope", GOVERNANCE_SCRIPT
|
||||
)
|
||||
assert spec is not None and spec.loader is not None
|
||||
governance = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(governance)
|
||||
|
||||
self.assertEqual(
|
||||
governance.SKIP_POLICY_PLATFORMS, _load_runner().SKIP_POLICY_PLATFORMS
|
||||
)
|
||||
|
||||
def test_a_current_declaration_passes(self) -> None:
|
||||
result = _run_governance({DECLARED: _entry()})
|
||||
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
|
||||
def test_defective_declarations_fail(self) -> None:
|
||||
past = (date.today() - timedelta(days=1)).isoformat()
|
||||
cases = {
|
||||
"missing method": (
|
||||
{"tests.test_example.ExampleTests.test_gone": _entry()},
|
||||
"test_gone",
|
||||
),
|
||||
"missing class": (
|
||||
{"tests.test_example.GoneTests.test_windows_only": _entry()},
|
||||
"GoneTests",
|
||||
),
|
||||
"missing module": (
|
||||
{"tests.test_gone.ExampleTests.test_windows_only": _entry()},
|
||||
"module path does not exist",
|
||||
),
|
||||
"unknown platform": (
|
||||
{DECLARED: _entry(platforms=["nt"])},
|
||||
"platforms",
|
||||
),
|
||||
"missing reason": ({DECLARED: _entry(reason=None)}, "reason"),
|
||||
"missing review date": (
|
||||
{DECLARED: _entry(review_after=None)},
|
||||
"missing review_after",
|
||||
),
|
||||
"past review date": (
|
||||
{DECLARED: _entry(review_after=past)},
|
||||
"is in the past",
|
||||
),
|
||||
}
|
||||
for label, (declarations, expected) in cases.items():
|
||||
with self.subTest(label):
|
||||
result = _run_governance(declarations)
|
||||
|
||||
self.assertNotEqual(result.returncode, 0, result.stdout)
|
||||
self.assertIn("platform_exclusive_tests", result.stdout)
|
||||
self.assertIn(expected, result.stdout)
|
||||
|
||||
|
||||
class PlatformSkipInventoryTests(unittest.TestCase):
|
||||
"""The gate must fail on a platform-conditional skip nobody declared.
|
||||
|
||||
Otherwise the Windows gate passes while every Linux run spends budget on it.
|
||||
"""
|
||||
|
||||
FORMS = {
|
||||
"decorator through a module-level alias": (
|
||||
{
|
||||
"test_example.py": "import os\nimport unittest\n\n"
|
||||
'IS_WINDOWS = os.name == "nt"\n\n\n'
|
||||
"class ExampleTests(unittest.TestCase):\n"
|
||||
' @unittest.skipUnless(IS_WINDOWS, "Windows only")\n'
|
||||
" def test_alias(self):\n"
|
||||
" pass\n"
|
||||
},
|
||||
["tests.test_example.ExampleTests.test_alias"],
|
||||
),
|
||||
"class decorator": (
|
||||
{
|
||||
"test_example.py": "import sys\nimport unittest\n\n\n"
|
||||
'@unittest.skipIf(sys.platform.startswith("win"), "POSIX only")\n'
|
||||
"class ExampleTests(unittest.TestCase):\n"
|
||||
" def test_one(self):\n"
|
||||
" pass\n\n"
|
||||
" def test_two(self):\n"
|
||||
" pass\n"
|
||||
},
|
||||
[
|
||||
"tests.test_example.ExampleTests.test_one",
|
||||
"tests.test_example.ExampleTests.test_two",
|
||||
],
|
||||
),
|
||||
"skipTest under a platform check": (
|
||||
{
|
||||
"test_example.py": "import platform\nimport unittest\n\n\n"
|
||||
"class ExampleTests(unittest.TestCase):\n"
|
||||
" def test_body(self):\n"
|
||||
' if platform.system() != "Windows":\n'
|
||||
' self.skipTest("Windows only")\n'
|
||||
},
|
||||
["tests.test_example.ExampleTests.test_body"],
|
||||
),
|
||||
"skipTest under a platform check in setUp": (
|
||||
{
|
||||
"test_example.py": "import os\nimport unittest\n\n\n"
|
||||
"class ExampleTests(unittest.TestCase):\n"
|
||||
" def setUp(self):\n"
|
||||
' if os.name != "nt":\n'
|
||||
' self.skipTest("Windows only")\n\n'
|
||||
" def test_one(self):\n"
|
||||
" pass\n"
|
||||
},
|
||||
["tests.test_example.ExampleTests.test_one"],
|
||||
),
|
||||
"decorator imported by name": (
|
||||
{
|
||||
"test_example.py": "import os\nimport unittest\n"
|
||||
"from unittest import skipIf\n\n\n"
|
||||
"class ExampleTests(unittest.TestCase):\n"
|
||||
' @skipIf(os.name == "nt", "POSIX only")\n'
|
||||
" def test_bare(self):\n"
|
||||
" pass\n"
|
||||
},
|
||||
["tests.test_example.ExampleTests.test_bare"],
|
||||
),
|
||||
"module in a test subdirectory": (
|
||||
{"connector/test_sub.py": WINDOWS_ONLY_SOURCE},
|
||||
["tests.connector.test_sub.ExampleTests.test_windows_only"],
|
||||
),
|
||||
}
|
||||
|
||||
def test_each_undeclared_platform_skip_fails_the_gate(self) -> None:
|
||||
for label, (files, test_ids) in self.FORMS.items():
|
||||
with self.subTest(label):
|
||||
result = _run_governance({}, files)
|
||||
|
||||
self.assertNotEqual(result.returncode, 0, result.stdout)
|
||||
for test_id in test_ids:
|
||||
self.assertIn(
|
||||
f"not declared in platform_exclusive_tests: {test_id}",
|
||||
result.stdout,
|
||||
)
|
||||
|
||||
def test_each_declared_platform_skip_passes(self) -> None:
|
||||
for label, (files, test_ids) in self.FORMS.items():
|
||||
with self.subTest(label):
|
||||
result = _run_governance(
|
||||
{test_id: _entry() for test_id in test_ids}, files
|
||||
)
|
||||
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
|
||||
def test_a_dependency_skip_is_not_a_platform_skip(self) -> None:
|
||||
files = {
|
||||
"test_example.py": "import unittest\n\nweb = None\n\n\n"
|
||||
"class ExampleTests(unittest.TestCase):\n"
|
||||
' @unittest.skipIf(web is None, "aiohttp not installed")\n'
|
||||
" def test_route(self):\n"
|
||||
" pass\n"
|
||||
}
|
||||
|
||||
result = _run_governance({}, files)
|
||||
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
|
||||
def test_a_declaration_without_a_platform_condition_fails(self) -> None:
|
||||
files = {
|
||||
"test_example.py": "import unittest\n\n\n"
|
||||
"class ExampleTests(unittest.TestCase):\n"
|
||||
' @unittest.skipUnless(False, "never")\n'
|
||||
" def test_windows_only(self):\n"
|
||||
" pass\n"
|
||||
}
|
||||
|
||||
result = _run_governance({DECLARED: _entry()}, files)
|
||||
|
||||
self.assertNotEqual(result.returncode, 0, result.stdout)
|
||||
self.assertIn("no platform-conditional skip", result.stdout)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
+25
-54
@@ -60,7 +60,8 @@ function findDirectNodeByRawId(graph, rawId) {
|
||||
if (!normalized) {
|
||||
return null;
|
||||
}
|
||||
return getDirectGraphNodes(graph).find((node) => normalizeNodeId(node?.id) === normalized) || null;
|
||||
const matches = getDirectGraphNodes(graph).filter((node) => normalizeNodeId(node?.id) === normalized);
|
||||
return matches.length === 1 ? matches[0] : null;
|
||||
}
|
||||
|
||||
function getChildNodeEntry(hostEntry, rawChildId) {
|
||||
@@ -136,13 +137,15 @@ function resolvePromotedWidget(entry, widget) {
|
||||
|
||||
export function getGraphNodeCatalog(graph) {
|
||||
const entries = [];
|
||||
const visitedGraphs = new WeakSet();
|
||||
const ancestorGraphs = new WeakSet();
|
||||
|
||||
function visit(currentGraph, parentExecutionId = "", parentPathTitles = []) {
|
||||
if (!currentGraph || typeof currentGraph !== "object" || visitedGraphs.has(currentGraph)) {
|
||||
if (!currentGraph || typeof currentGraph !== "object" || ancestorGraphs.has(currentGraph)) {
|
||||
return;
|
||||
}
|
||||
visitedGraphs.add(currentGraph);
|
||||
// IMPORTANT: instances share definition graphs. Stop ancestor cycles only;
|
||||
// global deduplication hides later identities and can allow a wrong-node write.
|
||||
ancestorGraphs.add(currentGraph);
|
||||
|
||||
for (const node of getDirectGraphNodes(currentGraph)) {
|
||||
const rawId = normalizeNodeId(node?.id);
|
||||
@@ -160,6 +163,7 @@ export function getGraphNodeCatalog(graph) {
|
||||
visit(subgraph, executionId, pathTitles);
|
||||
}
|
||||
}
|
||||
ancestorGraphs.delete(currentGraph);
|
||||
}
|
||||
|
||||
visit(graph);
|
||||
@@ -172,51 +176,27 @@ export function getGraphNodeEntry(graph, nodeId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const segments = normalized.split(":");
|
||||
let currentGraph = graph;
|
||||
let currentEntry = null;
|
||||
let currentExecutionId = "";
|
||||
let pathTitles = [];
|
||||
|
||||
for (let idx = 0; idx < segments.length; idx += 1) {
|
||||
const segment = segments[idx];
|
||||
const node = findDirectNodeByRawId(currentGraph, segment);
|
||||
if (!node) {
|
||||
currentEntry = null;
|
||||
break;
|
||||
}
|
||||
|
||||
currentExecutionId = currentExecutionId ? `${currentExecutionId}:${segment}` : segment;
|
||||
pathTitles = [...pathTitles, getNodeTitle(node, segment)];
|
||||
currentEntry = buildNodeEntry(node, currentGraph, currentExecutionId, pathTitles);
|
||||
|
||||
if (idx < segments.length - 1) {
|
||||
currentGraph = getNodeSubgraph(node);
|
||||
if (!currentGraph) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// IMPORTANT: legal local IDs contain colons. Match actual complete identities;
|
||||
// splitting or falling back after a collision can write to the wrong node.
|
||||
const catalog = getGraphNodeCatalog(graph);
|
||||
const exact = catalog.filter((entry) => entry.id === normalized);
|
||||
if (exact.length > 0) {
|
||||
return exact.length === 1 ? exact[0] : null;
|
||||
}
|
||||
|
||||
if (currentEntry) {
|
||||
return currentEntry;
|
||||
}
|
||||
|
||||
if (segments.length === 1) {
|
||||
const matches = getGraphNodeCatalog(graph).filter((entry) => entry.rawId === normalized);
|
||||
if (matches.length === 1) {
|
||||
return matches[0];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
const raw = catalog.filter((entry) => entry.rawId === normalized);
|
||||
return raw.length === 1 ? raw[0] : null;
|
||||
}
|
||||
|
||||
export function getGraphNodeEntryByObject(graph, targetNode) {
|
||||
if (!targetNode || typeof targetNode !== "object") {
|
||||
return null;
|
||||
}
|
||||
return getGraphNodeCatalog(graph).find((entry) => entry.node === targetNode) || null;
|
||||
const catalog = getGraphNodeCatalog(graph);
|
||||
const matches = catalog.filter((entry) => entry.node === targetNode);
|
||||
if (matches.length !== 1 || catalog.filter((entry) => entry.id === matches[0].id).length !== 1) {
|
||||
return null;
|
||||
}
|
||||
return matches[0];
|
||||
}
|
||||
|
||||
export function resolveGraphWidget(graph, nodeRefOrId, widgetName, sourceNodeId = null) {
|
||||
@@ -235,18 +215,9 @@ export function resolveGraphWidget(graph, nodeRefOrId, widgetName, sourceNodeId
|
||||
return null;
|
||||
}
|
||||
|
||||
const resolved = resolvePromotedWidget(entry, widget);
|
||||
if (!resolved) {
|
||||
return {
|
||||
hostEntry: entry,
|
||||
nodeEntry: entry,
|
||||
node: entry.node,
|
||||
widget,
|
||||
promotedDepth: 0,
|
||||
};
|
||||
}
|
||||
|
||||
return resolved;
|
||||
// IMPORTANT: a broken/cyclic promoted binding must fail closed; editing the
|
||||
// outer view instead can claim success without changing the execution value.
|
||||
return resolvePromotedWidget(entry, widget);
|
||||
}
|
||||
|
||||
export function getGraphWidgetCatalog(graph, nodeId) {
|
||||
|
||||
@@ -18,20 +18,20 @@ export const HOST_SURFACES = Object.freeze({
|
||||
* core manifest pins. These are three different subjects; do not collapse them.
|
||||
*/
|
||||
export const HOST_CORE_REFERENCE = Object.freeze({
|
||||
sourceRevision: "8010b48d",
|
||||
sourceDescribe: "v0.39.0-49-g8010b48d2",
|
||||
version: "0.39.0",
|
||||
tag: "v0.39.0",
|
||||
tagRevision: "b0b74356",
|
||||
bundledFrontendVersion: "1.55.14",
|
||||
sourceRevision: "7c4390a6",
|
||||
sourceDescribe: "v0.43.0-21-g7c4390a6f",
|
||||
version: "0.43.0",
|
||||
tag: "v0.43.0",
|
||||
tagRevision: "426f5eea",
|
||||
bundledFrontendVersion: "1.57.6",
|
||||
});
|
||||
|
||||
/**
|
||||
* Real-host validation state for the pinned core and two frontend subjects.
|
||||
*
|
||||
* CRITICAL: source review and repository validation are not runtime proof. This
|
||||
* state is backed by the paired real-host campaign on the refreshed core and both
|
||||
* frontend subjects in the compatibility matrix; do not extend it to the later
|
||||
* state stays pending until a paired campaign on the current core and both
|
||||
* frontend subjects is recorded; do not reuse older evidence or extend it to the later
|
||||
* frontend source head or Desktop surfaces, and reset it to `pending` whenever the
|
||||
* pinned subjects change.
|
||||
*/
|
||||
@@ -39,19 +39,19 @@ export const HOST_REAL_VALIDATION_STATE = "validated";
|
||||
|
||||
export const HOST_SURFACE_REFERENCES = Object.freeze({
|
||||
[HOST_SURFACES.standaloneFrontend]: Object.freeze({
|
||||
frontendVersion: "1.57.0",
|
||||
sourceRevision: "0e1a2fbbe4",
|
||||
sourceDescribe: "v1.57.0-309-g0e1a2fbbe4",
|
||||
// The reproducible release, 309 commits behind the reviewed source head.
|
||||
releaseVersion: "1.57.0",
|
||||
releaseTag: "v1.57.0",
|
||||
releaseRevision: "cdc18a92",
|
||||
frontendVersion: "1.60.0",
|
||||
sourceRevision: "aa4e48c08d",
|
||||
sourceDescribe: "v1.60.0-209-gaa4e48c08d",
|
||||
// The reproducible release, 209 commits behind the reviewed source head.
|
||||
releaseVersion: "1.60.0",
|
||||
releaseTag: "v1.60.0",
|
||||
releaseRevision: "5cb2899f",
|
||||
}),
|
||||
[HOST_SURFACES.desktop]: Object.freeze({
|
||||
desktopVersion: "0.9.4",
|
||||
coreVersion: "0.22.3",
|
||||
embeddedFrontendVersion: "1.43.18",
|
||||
standaloneFrontendVersion: "1.57.0",
|
||||
standaloneFrontendVersion: "1.60.0",
|
||||
frontendParity: "lagging",
|
||||
generation: "legacy_fixed_bundle",
|
||||
hostedVersionMode: "fixed",
|
||||
|
||||
@@ -63,6 +63,24 @@ export function acquireOpenClawSidebarLayout(container) {
|
||||
throw new TypeError("OpenClaw sidebar layout requires an element container");
|
||||
}
|
||||
|
||||
const nativePanel = container.closest(".side-bar-panel[data-panel][data-panel-id][data-panel-group-id]");
|
||||
if (nativePanel?.getAttribute("data-panel-id")?.trim() &&
|
||||
nativePanel.getAttribute("data-panel-group-id")?.trim()) {
|
||||
// CRITICAL: native panels couple flex-grow state with a zero flex-basis. A fixed
|
||||
// basis desynchronizes drag allocation, then snaps width on tab handoff. Let the
|
||||
// host own sizing and make only our mounted content responsive.
|
||||
const previous = container.getAttribute("data-openclaw-layout");
|
||||
container.setAttribute("data-openclaw-layout", "host");
|
||||
let released = false;
|
||||
return () => {
|
||||
if (released) return;
|
||||
released = true;
|
||||
if (container.getAttribute("data-openclaw-layout") !== "host") return;
|
||||
if (previous === null) container.removeAttribute("data-openclaw-layout");
|
||||
else container.setAttribute("data-openclaw-layout", previous);
|
||||
};
|
||||
}
|
||||
|
||||
const captured = new Map();
|
||||
let disposed = false;
|
||||
let cancelDeferred = null;
|
||||
|
||||
@@ -43,9 +43,9 @@
|
||||
}
|
||||
|
||||
/* Scoped fallback for supported host wrappers; JavaScript owns reversible actual allocation. */
|
||||
.side-bar-panel:has(.openclaw-sidebar-container),
|
||||
.p-splitterpanel:has(.openclaw-sidebar-container),
|
||||
.sidebar-content-container:has(.openclaw-sidebar-container) {
|
||||
.side-bar-panel:has(.openclaw-sidebar-container):not([data-openclaw-layout="host"]):not(:has([data-openclaw-layout="host"])),
|
||||
.p-splitterpanel:has(.openclaw-sidebar-container):not([data-openclaw-layout="host"]):not(:has([data-openclaw-layout="host"])),
|
||||
.sidebar-content-container:has(.openclaw-sidebar-container):not([data-openclaw-layout="host"]):not(:has([data-openclaw-layout="host"])) {
|
||||
min-width: var(--openclaw-sidebar-min-width) !important;
|
||||
}
|
||||
|
||||
@@ -1200,3 +1200,66 @@
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
/* Native splitter allocation belongs to the host; adapt only OpenClaw descendants. */
|
||||
[data-openclaw-layout="host"] .openclaw-sidebar-container {
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
[data-openclaw-layout="host"] :is(.openclaw-header, .openclaw-badges) {
|
||||
flex-wrap: wrap;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
[data-openclaw-layout="host"] :is(.openclaw-tabs, .openclaw-lab-actions) {
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
|
||||
}
|
||||
|
||||
[data-openclaw-layout="host"] :is(.openclaw-scroll-area, .openclaw-lab-header, .openclaw-lab-main, .openclaw-lab-card, .openclaw-lab-dim-row, .openclaw-form-group) {
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
[data-openclaw-layout="host"] :is(.openclaw-lab-card-head, .openclaw-lab-plan-header) {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
[data-openclaw-layout="host"] .openclaw-lab-dim-row {
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
|
||||
}
|
||||
|
||||
[data-openclaw-layout="host"] .openclaw-lab-run-item {
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
}
|
||||
|
||||
[data-openclaw-layout="host"] :is(.openclaw-lab-dim-row input, .openclaw-lab-dim-row select) {
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* Keep reserved status width from collapsing model editing in native sidebars. */
|
||||
[data-openclaw-layout="host"] .openclaw-model-controls {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
[data-openclaw-layout="host"] .openclaw-model-controls > .openclaw-input {
|
||||
min-width: min(100%, 120px);
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
[data-openclaw-layout="host"] .openclaw-model-controls > .openclaw-status {
|
||||
flex-basis: 100%;
|
||||
max-width: 100%;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
[data-openclaw-layout="host"] .openclaw-model-controls > .openclaw-status:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
font-size: var(--moltbot-font-md);
|
||||
}
|
||||
|
||||
/* Scoped fallback for supported host wrappers; JavaScript owns reversible actual allocation. */
|
||||
.side-bar-panel:has(.moltbot-sidebar-container),
|
||||
.p-splitterpanel:has(.moltbot-sidebar-container),
|
||||
.sidebar-content-container:has(.moltbot-sidebar-container) {
|
||||
/* CRITICAL: dual-class roots also match these aliases; native panels must not inherit the legacy floor. */
|
||||
.side-bar-panel:has(.moltbot-sidebar-container):not([data-openclaw-layout="host"]):not(:has([data-openclaw-layout="host"])),
|
||||
.p-splitterpanel:has(.moltbot-sidebar-container):not([data-openclaw-layout="host"]):not(:has([data-openclaw-layout="host"])),
|
||||
.sidebar-content-container:has(.moltbot-sidebar-container):not([data-openclaw-layout="host"]):not(:has([data-openclaw-layout="host"])) {
|
||||
min-width: var(--moltbot-sidebar-min-width) !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -551,6 +551,11 @@ export const ParameterLabTab = {
|
||||
showCompareWizard(targetNode = null) {
|
||||
// 1. Scan for loader nodes if no target provided
|
||||
let target = targetNode ? findComparableWidget(app.graph, targetNode) : null;
|
||||
// An explicit ambiguous object must not retarget another execution instance.
|
||||
if (targetNode && !target) {
|
||||
openclawUI.showBanner("warning", "Select a unique loader instance to compare models.");
|
||||
return;
|
||||
}
|
||||
if (!target) {
|
||||
const compareTargets = getGraphNodeCatalog(app.graph)
|
||||
.filter((entry) =>
|
||||
@@ -558,7 +563,9 @@ export const ParameterLabTab = {
|
||||
entry.node?.type === "LORALoader" ||
|
||||
entry.node?.type === "UNETLoader"
|
||||
)
|
||||
.map((entry) => findComparableWidget(app.graph, entry.node))
|
||||
// Shared definition objects are ambiguous across instances; retain
|
||||
// the catalog's unique execution context when scanning candidates.
|
||||
.map((entry) => findComparableWidget(app.graph, entry.id))
|
||||
.filter(Boolean);
|
||||
if (compareTargets.length === 0) {
|
||||
openclawUI.showBanner("warning", "No Checkpoint/LoRA loaders found in workflow.");
|
||||
@@ -893,35 +900,39 @@ export const ParameterLabTab = {
|
||||
|
||||
replayRun(run) {
|
||||
if (confirm("Apply these parameter values to the current workflow?")) {
|
||||
this.applyOverrides(run);
|
||||
openclawUI.showBanner("success", "Values applied to nodes.");
|
||||
try {
|
||||
this.applyOverrides(run);
|
||||
openclawUI.showBanner("success", "Values applied to nodes.");
|
||||
} catch {
|
||||
openclawUI.showBanner(
|
||||
"error",
|
||||
"Cannot apply values: a target node or widget is missing, invalid or ambiguous. Rebuild the plan from the current workflow."
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
applyOverrides(run) {
|
||||
let receiptWidget = null;
|
||||
Object.entries(run).forEach(([key, value]) => {
|
||||
if (key === "prompt_id" || key === "status") return;
|
||||
const unavailable = () => Object.assign(new Error("override_target_unavailable"), { code: "override_target_unavailable" });
|
||||
if (!run || typeof run !== "object" || Array.isArray(run)) {
|
||||
throw unavailable();
|
||||
}
|
||||
// IMPORTANT: resolve the entire run before writes. Per-key writes or a
|
||||
// getNodeById fallback can partially apply a stale or ambiguous plan.
|
||||
const updates = Object.entries(run).filter(([key]) => key !== "prompt_id" && key !== "status").map(([key, value]) => {
|
||||
const separatorIndex = key.indexOf(".");
|
||||
if (separatorIndex <= 0) return;
|
||||
if (separatorIndex <= 0) throw unavailable();
|
||||
const nodeId = key.slice(0, separatorIndex);
|
||||
const widgetName = key.slice(separatorIndex + 1);
|
||||
if (!validateParameterLabDimensions([{ node_id: nodeId, widget_name: widgetName, values: [value] }]).ok) {
|
||||
throw unavailable();
|
||||
}
|
||||
const resolved = resolveGraphWidget(app.graph, nodeId, widgetName);
|
||||
const fallbackNode = app.graph.getNodeById?.(this._coerceSelectedNodeId(nodeId));
|
||||
const node = resolved?.node || fallbackNode;
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
const widget =
|
||||
resolved?.widget ||
|
||||
(Array.isArray(node.widgets)
|
||||
? node.widgets.find((entry) => entry.name === widgetName)
|
||||
: null);
|
||||
if (widget) {
|
||||
widget.value = value;
|
||||
receiptWidget ||= widget;
|
||||
}
|
||||
if (!resolved?.widget) throw unavailable();
|
||||
return { widget: resolved.widget, value };
|
||||
});
|
||||
return receiptWidget;
|
||||
if (updates.length === 0) throw unavailable();
|
||||
updates.forEach(({ widget, value }) => { widget.value = value; });
|
||||
return updates[0].widget;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -46,6 +46,7 @@ export function renderSettingsLlm({ scroll, configRes, api, session, getAdminErr
|
||||
// Model input
|
||||
const modelRow = createFormRow("Model", sources.model === "env");
|
||||
const modelWrap = document.createElement("div");
|
||||
modelWrap.className = "openclaw-model-controls";
|
||||
modelWrap.style.display = "flex";
|
||||
modelWrap.style.gap = "8px";
|
||||
modelWrap.style.alignItems = "center";
|
||||
|
||||
Reference in New Issue
Block a user