Skip to content

fix: prevent stale Files saves after workspace replacement - #178336

Merged
shakkernerd merged 3 commits into
mainfrom
files-source-save
Oct 20, 2026
Merged

shakkernerd merged 3 commits into
mainfrom
files-source-save

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #178310.

What Problem This Solves

An open Files editor could save its draft into a replacement managed workspace after the same chat was reset. When the new workspace contained the same relative filename and initial bytes, the old content hash still passed and the replacement file was overwritten.

User Impact

The editor now refuses that changed workspace target and keeps the unsaved draft. Close and reopen the file to edit the current workspace. The existing content-conflict controls still handle changes within the same source.

The source precondition is optional for API clients: requests that omit it retain their existing behavior. Current session authorization, file containment and content-hash checks continue to apply.

Why This Change Was Made

The Files read returns the existing managed workspace ID together with the resolved workspace and file lookup roots. The editor retains those facts and sends them as a source precondition. The Gateway compares them with its current source through the existing write-authorization callback, including immediately before filesystem mutation. Client-supplied values never select a directory.

A source-change refusal also refreshes the Files listing, so reopening selects the current workspace while the original draft remains visible. The same source descriptor stays with the retained draft and preview. A fresh read with identical text and hash can therefore replace an old save closure, while conflict recovery cannot silently move an old draft to another workspace. Source changes produce their own refusal instead of offering the ordinary content-conflict Overwrite action.

Evidence

The baseline reproduction used registered session creation and Files handlers with real managed-worktree allocation, same-key reset, detachment and replacement. It verified that an old hash-only save overwrote the replacement file. The regression now rejects detached and replacement sources, checks unchanged disk contents, permits a fresh read/save, and preserves legacy requests without a source precondition. Further cases cover a reset that retains the managed ID but changes the root, a changed lookup root inside the same workspace, and source or authority revocation immediately before filesystem mutation.

The final head also passed a connected browser scenario using the built Control UI served by an isolated real Gateway. It opened a draft in A, reset the same chat to B with identical filename and bytes, and verified the actual browser save returned session_file_source_changed, left B unchanged and preserved the draft. Closing and reopening through Files then reached editable B; the fresh browser save wrote B and carried exactly its newly read source descriptor. The test compared the served JavaScript bytes with the built artifact and verified Gateway cleanup. The recording below captures that complete flow.

Formatting/lint, protocol generation and all selected compiler groups passed for the descriptor change, together with 339 tests across 25 files in six shards (205.66 seconds total test-wrapper wall time). The final listing-recovery correction passed 124 tests across seven direct caller files in 6.62 seconds, plus its two affected compiler graphs. Unchanged backend results remain applicable. The connected scenario took 11.790 seconds; its file took 21.031 seconds, and the Vitest run took 50.32 seconds. The committed mocked browser scenario also passed on the final head. Current CI is green. The first attempt hit a 180-second QA Gateway setup timeout. One diagnostic retry of that job passed all five cases on the same tested merge, using the workflow’s normal GitHub-hosted retry route in place of the original Blacksmith runner. The original timing failure is retained; the retry does not establish a code fix or inherited failure. The initial full run took 3,093 seconds including runner queue time, with 21,941 aggregate successful-job runner-seconds; the retried job took 435 seconds.

The matched before/after stills use synthetic Gateway responses under the same viewport and file conditions. The recording uses the real Gateway path described above. The after capture and recording are bound to 830e07c39666d4aefd634a589d5961f25bec5b49; the baseline capture remains at its original pre-fix revision.

Visual evidence

Open preview

Before After
Before: the stale draft is accepted after the workspace changes After: the changed-workspace save is refused and the draft remains visible

Real Gateway: stale save refused, draft retained, fresh reopen and save

[email protected]

Visual verification

  • Baseline: 2e41793
  • Exact head: 830e07c39666d4aefd634a589d5961f25bec5b49
  • Scenario: Matched browser comparison: open notes.md in A, replace the workspace with identical filename and bytes, and attempt a stale save. The recording additionally exercises the built Control UI served by a real isolated Gateway: reset the same chat to B, refuse the old draft, preserve B bytes and the draft, then reopen through Files and save a fresh edit.
  • Runtime/build: OpenClaw source830e07c39666d4aefd634a589d5961f25bec5b49, tree df35d1c7ac7dc0d0b140c45fb84fd090afb15245; real Gateway-served /assets/index-DE8yqh3q.js matches the built bytes, SHA256 4146926ae3eb38032b111df001629ae01df48ee5451235d1802946d2aa897fb8.
  • Baseline stale saves accepted: 1
  • Fixed stale saves accepted: 0
  • Fresh replacement-workspace save: 1 successful save
  • Matched 1280x900 light-theme before/after captures use synthetic Gateway responses; the recording uses an isolated real Gateway and its served built UI.
  • Real same-chat reset retains the managed ID but changes the workspace root; filename and initial bytes remain identical.
  • The stale browser save returns session_file_source_changed, leaves B unchanged and preserves the draft without a generic Overwrite action.
  • Closing and reopening through Files reaches editable B; the fresh browser save succeeds on disk and carries exactly the fresh source descriptor.
  • The served asset is byte-identical to the built artifact; isolated Gateway cleanup completed.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: M labels Oct 20, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Bind managed-workspace file saves and retained drafts to the workspace identity and lookup roots captured when the file was opened.

Example: Open README.md containing "base\n", edit it, then reset the same chat into a replacement workspace containing identical bytes.

  • Before: The old content hash passes, allowing the stale draft to overwrite the replacement file.
  • After: The save returns session_file_source_changed, preserves the draft and replacement file, and refreshes Files so reopening permits a fresh edit.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused repair with distinct lifecycle and UI regressions, supplied real-Gateway evidence, and no actionable defect found.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor-proof gate; its supplied exact-head isolated-Gateway/browser scenario covers stale-save refusal, preserved replacement bytes and draft, and a successful fresh reopen/save.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An old Files editor can overwrite a replacement workspace when its filename and starting bytes match.
Reason: The maintainer-authored direction restores the established write-target contract with a focused additive precondition and visible recovery.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it addresses a verified overwrite bug still present on main, and the reviewed head has no actionable correctness or security findings; CI remains pending.

Priority: P2
Reviewed head: 830e07c39666d4aefd634a589d5961f25bec5b49

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI Files editor reads through session-scoped Gateway RPCs; the Gateway resolves workspace ownership and passes live source and authorization checks into the existing content-CAS filesystem writer.

flowchart LR
  A[Files editor] --> B[Session operations]
  B --> C[Gateway Files handlers]
  C --> D[Current workspace owner]
  C --> E[Source and authorization guard]
  E --> F[Content CAS writer]
  F --> G[Workspace file]
Loading

Technical review

Best possible solution:

Keep the optional source precondition in the existing Files owner, preserving content hashes, live authorization, filesystem containment, and recoverable drafts.

Do we have a high-confidence way to reproduce the issue?

Yes: the linked issue records a real registered-handler/worktree lifecycle reproduction, and current main visibly accepts byte-only CAS after resolving the replacement workspace; this review executed no target code.

Is this the best way to solve the issue?

The change repairs the read-time target invariant through existing owners, distinguishes source replacement from ordinary content conflicts, and avoids changing existing clients' content-hash contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 78e97d169703.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced change: The pinned introduced diff adds an optional source descriptor, checks it through the existing write guard, retains it in editor closures and draft identity, and refreshes the owning listing after refusal. (src/gateway/server-methods/sessions-files.ts:536, 830e07c39666)
  • Current main retains the bug: Main resolves the current workspace and supplies only content-hash CAS to the writer; its editor supplies no read-time source precondition. The reproduction in Files saves can overwrite a replacement workspace after a same-chat reset #178310 exercises real allocation, reset, replacement, and resulting disk contents. (src/gateway/server-methods/sessions-files.ts:554, 78e97d169703)
  • Final filesystem boundary: The source comparison supplements current session authorization; client values do not select directories. The existing writer invokes the composed guard before writing and through assertBeforeMutation. (src/gateway/server-methods/workspace-fs.ts:286, 830e07c39666)
  • Earlier review addressed: The source descriptor includes workspaceId, root, and fileRoot, addressing the earlier resolved-root finding. The latest commit additionally refreshes only the current owning listing without replacing the retained draft. (ui/src/pages/chat/components/chat-session-workspace.ts:316, 830e07c39666)
  • Supplied behavior evidence and inspection limit: Inspected downloaded before/after images show the synthetic stale save changing from accepted to refused with the draft visible. The PR supplies an exact-head real-Gateway recording and describes unchanged replacement bytes followed by a successful fresh save. Recording inspection was unavailable: the manifest reports 'ffprobe failed: spawnSync ffprobe ENOENT', and the browser fallback returned 'Cache miss'; this is a reviewer infrastructure limitation. (830e07c39666)
  • Merge and validation state: GitHub reports the reviewed head mergeable, with checks still queued or running rather than a reported conflict. Read-only diff checking passed and the checkout remained clean; no target tests were executed during this review. (830e07c39666)

Likely related people:

  • Shakker: Raw commit c4ccdcb adds src/gateway/server-methods/sessions-files.ts:123 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c4ccdcb8b4d2; files: src/gateway/server-methods/sessions-files.ts)

PR surface

Source +62, Tests +530, Docs 0. Total +592 across 11 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 6 104 42 +62
Tests 4 531 1 +530
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 636 44 +592

Review metrics

Metric Value Why it matters
Production versus test changes Production +104/-42 lines; tests +531/-1 lines The production growth carries one source precondition through existing owners; tests cover replacement lifecycle, changed lookup roots, final-write revocation, retained drafts, and listing recovery.
Protocol additions One optional expectedSource request parameter and one optional source result descriptor The shared descriptor contains workspaceId, root, and fileRoot; requests omitting it retain their existing content-CAS behavior.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #178310
Summary: The canonical issue and these alternative fixes address the same stale Files write after same-chat workspace replacement.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is recording.

Label justifications:

  • P2: The fix prevents incorrect file overwrites in the bounded case of an editor retained across same-chat managed-workspace replacement.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-20T10:34:05.520Z sha 1115fbe :: needs changes before merge. :: [P2] Bind the source precondition to the resolved file root
  • reviewed 2026-10-20T14:46:38.522Z sha 7534cf0 :: needs maintainer review before merge. :: none

Reviewed October 20, 2026, 12:38 PM ET / 16:38 UTC (Revision 3).

@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 20, 2026
@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 20, 2026
@shakkernerd shakkernerd self-assigned this Oct 20, 2026
@shakkernerd
shakkernerd merged commit a44dc77 into main Oct 20, 2026
286 of 289 checks passed
@shakkernerd
shakkernerd deleted the files-source-save branch October 20, 2026 17:41
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: Files now refuses stale saves after a workspace change, preserves the draft, and uses the current workspace when the file is reopened.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…178336)

Bind Files edits to the workspace and lookup roots from the original read. Refuse saves after a workspace change, preserve the draft, and refresh the listing so a fresh reopen can save to the current workspace.

Refs openclaw#178310.
steipete added a commit that referenced this pull request Oct 24, 2026
* test(scripts): deslop q0163 tests

Remove the redundant root-changelog rejection harness; pr-closeout-gates.test.ts covers the same prepare_gates rejection before hosted gates. Keep the independent bot-credit boundary.

Trim installer wiring inventories covered by install-ps1.release.test.ts native-npm-stderr, pnpm-source-bootstrap-lifecycle, same-prefix-shim-transaction and method-switch-preservation. Retain Windows cwd, SQLite stdin, source-target, relative tarball and freshness guards. Reuse PowerShell arguments.

Drop baseline npm argument-shape assertions while keeping real probe execution, skip/failure diagnostics and temporary-install cleanup. CI-only: oxfmt, plain oxlint and diff check pass; tests and coverage not run. Shard lines 1108 to 1022; distinct parser and lifecycle contracts prevent the requested 40 percent cut.

* test(scripts): trim q0163 tooling assertion layers

Keep installer contracts as focused guards, with executable cwd, archive identity, shim transaction and runtime proof in install-ps1.release.test.ts. Keep all installer failure and checkout-boundary scenarios.

Remove copied calibration phase/receipt inventories and duplicate clawlog missing-value variants that share the same pre-dispatch guard. Retain resource observations, retirement rejection, no-retry, output preservation and option-specific parsing paths.

Keep baseline selection/skip evidence, leaving label and timeout policy to targeted-docker-lane-groups.test.ts. Replace changelog exception-decoding scaffolding with direct spawn status and diagnostic assertions. No production changes; CI-only static checks pass. Remaining unique parser and process-lifecycle contracts prevent a 40 percent cut.

* test(scripts): reuse q0163 fixtures and trim attribution variants

Reuse the existing release Git fixture and one PowerShell invocation helper. Keep real Git history and file/streamed installer entrypoints unchanged.

Exercise internal, named bot, app prefix, bot suffix, case normalization and multi-handle scanning once at the scanner boundary. Retain direct empty/null/internal non-bot classification and the shell human-credit rejection.

CI-only: formatting, plain oxlint and diff checks pass; no test runs. The shard is 946 lines versus 1108 at baseline. Unique parser and shared process-cleanup contracts prevent the remaining cut to 664 without deleting distinct behavior.

* test(ui): deslop q0165 tests

Remove the retained-sentinel E2E replay: pages/config/updates.test.ts covers sentinel rendering and recovery exclusion, and app/update-overlay-helpers.test.ts covers external-supervisor guidance without failure triage. Keep the full update dialog/read-failure/recovery browser scenario.

Drop optional screenshot writers while retaining required-field accessibility and keyboard autosave checks. Drop duplicate failure-count checks and row-mode request restatements; route tests cover dashboard/compact query shapes and session-list owner tests cover reconciliation. Keep all three live row-event routes and their no-refetch assertion.

CI-only validation: oxfmt, plain oxlint, and git diff --check. No test or coverage runs. Reduce 994 to 914 lines; retain distinct browser lifecycle paths rather than force the 40 percent target.

* test(scripts): deslop q0164 tests

Drop six redundant wrapper alias cases: retained two-identity-alias, star-barrel, and named-binding origin cases exercise the same collector paths; check-export-name-collisions.test.ts retains direct alias classification proof. Simplify Kova fixture data and reuse the existing script-file fixture writer for CI build selection. Preserve release authority, compiler lifetime, graph resolution, and ratchet boundary cases.

CI-only campaign: plain oxlint, oxfmt, and diff checks passed; runtime and coverage proof deferred to hosted CI. Shard LOC 1537 -> 1489; declarations 28 -> 27; expanded cases 66 -> 60. The 40% LOC target was not reached without dropping distinct boundary coverage.

* test(scripts): remove q0164 redundant proof layers

Replace the ratchet workflow/command inventory replay with direct prepare_ratchet_base_args proof on the real depth-one checkout; ci-baseline-ratchets.test.ts owns argument forwarding and ci-workflow-planning.test.ts keeps workflow wiring. ci-changed-node-test-plan.source-owners.test.ts retains focused source/no-dist ownership; ci-run-node-test-shard.test.ts retains child resource propagation.

Remove copied runner-label and credentialed-job assertions and replay only distinct event gates. Consolidate alias, type-only, ambient declaration and batch-resolution proof into one Madge cycle that depends on every resolver path. plugin-sdk-api-release-evidence.test.ts retains changed-payload rejection; preserve head-identity integration here. Trim Kova fixture scaffolding and CLI inputs without removing its error paths.

CI-only: oxfmt, plain oxlint and git diff --check passed; no tests or coverage run. Shard LOC 1537 -> 1350 (12.2%); this follow-up 1489 -> 1350. The 40% target remains unmet: remaining suites and consumed helpers have distinct publication, parser and lifecycle contracts, with no safe whole-file removal identified.

* test(scripts): consolidate q0164 routing and fixtures

Replace workflow-by-workflow routing replay with direct, shared-worker and dispatch-gated branch cases; retain a generic hosted-runner guard for protected publishers and forwarding through both release orchestrators. release-no-push-workflow.test.ts retains backend/candidate routing cases and ci-workflow-planning.test.ts retains native/hosted policy coverage.

Reduce wrapper graphs to minimal declarations while retaining every value-definition and origin-resolution case, including the cross-batch scan. Remove publish-result identity restatements already validated by resolveReleasePublishInputs and the internal fetch-count assertion. Drop compiler timing-log scaffolding without changing preparation or disposal assertions.

CI-only: oxfmt, plain oxlint and git diff --check passed; no tests or coverage run. Original shard LOC 1537 -> 1288 (16.2%); this additional commit 1350 -> 1288. The 40% target remains unmet; no unique parser, publication-authority or lifecycle cases were intentionally discarded to force the metric.

* test(daemon): deslop q0168 tests

Remove duplicate native restart and stop/start rows. The retained named-profile guarded host-service lifecycle exercises both launchd activation paths; keep SIGTERM respawn and stop/restart bootstrap as distinct native scenarios.

Reuse the PID already verified by the running-runtime wait in the co-located Gateway regression. Leave Windows lifecycle and cleanup proof intact. CI-only validation: oxfmt, oxlint and git diff --check; no tests or coverage run.

* test(daemon): deslop q0168 native e2e layers

Keep native SIGTERM/KeepAlive proof; remove launchd replays owned by launchd-missing-plist.test.ts (both ghost-registration cases), launchd.test.ts (bootstrap repair and stopped activation), launchd-service-membership.test.ts (co-located node/Gateway port), config/paths.test.ts and infra/gateway-supervision.test.ts (install identity), and managed-gateway-bindings.test.ts plus test/scripts/live-gateway-dist-fence.test.ts (loaded native publication refusal). Generic service start outcomes remain in service.test.ts.

Keep Windows native failure recovery, external Scheduler extinction, Doctor admission, hosted restart/stop, no-respawn and Startup fallback. Use one external Scheduler stop API instead of replaying the same process-tree behavior. Remove callback and generic service-restart replays covered by schtasks.stop.test.ts and schtasks.settlement.test.ts. Launcher readback remains in schtasks.install.test.ts and schtasks.test.ts; Startup migration removal remains in schtasks.startup-fallback.test.ts. Replace fixture diagnostic snapshots with the cleanup exit code; keep evidence retention and all resource verification. Supervisor completion remains checked by native process exit and completed task result, rather than duplicate probe trace events.

Shard base: 1193 lines; final: 715 lines (40.1% reduction). CI-only: oxfmt, plain oxlint and git diff --check passed; no test or coverage commands run.

* test(scripts): deslop q0166 tests

Remove the duplicate non-import inventory replay: ci-changed-node-test-plan.source-owners.test.ts keeps policy scanners beside ordinary importers and checks the same inventory; ci-check-family-scope.test.ts owns architecture routing; ci-changed-node-test-plan.test.ts retains direct-test lint inventory selection. The watch logic has no separate added/renamed/import-edge decision branch.

Consolidate backport fixture writes and CLI invocation, reuse the deferred helper, and pass hosted-health evidence tuples directly. Preserve release, permission, boundary, error and concurrency assertions. CI-only: oxfmt, plain oxlint and diff checks passed; no tests or coverage run. Line reduction falls short of 40% because the remaining small suites cover distinct behavior.

* test(scripts): consolidate q0166 owner proof

Derive materializer expectations from fixture lock bytes instead of copying release versions and hashes; retain lock rejection, lifecycle suppression, output paths and permissions. Remove the exact success-log snapshot and unused child environment settings.

Keep lexical comment/regexp cases in test/architecture-smells.test.ts and boundary-specific path encodings here. Keep Tool Search success, mode and timeout assertions in upgrade-survivor-assertions.test.ts, and CLI application in upgrade-survivor-config-recipe.test.ts. Frozen policy retains committed identity selection, recipe differences, old-baseline acceptance, missing config and disabled-search rejection.

Reduce GitHub normalization and permission variants to distinct wrapper branches. CI-only: oxfmt, plain oxlint and diff checks pass; no tests or coverage executed. No retired subjects found. Original 1461 lines now 1355; the 40 percent target remains unmet because the retained fixtures exercise distinct boundaries and lifecycle behavior.

* test(scripts): reduce q0166 fixture and request setup

Remove shadowed event-filter inputs and a schema-literal restatement. Share GitHub request deadline setup across fetch/body cases, pass selector flags directly, centralize successful CLI assertions, and minimize backport fixture bodies and bound arguments. Preserve separator and direct invocation paths, permission/error branches, and legacy frozen-recipe assertions.

Rechecked PASS 15 moves: all subjects remain active and the retained specialized cases have no stronger duplicate owner proof. Original shard 1461 lines becomes 1312, below the requested 40 percent reduction. Further deletions would remove distinct behavior. CI-only: oxfmt, plain oxlint and diff checks pass; no tests, builds or coverage run.

* test(ui): remove redundant q0165 e2e layers

Port q0165 commits 0acf5908952ed8483aae936a334f04975eb18cd7 and 7e4349a8c9ec5fdbfe27318692e415354e088cf1 onto the campaign lane. The first commit is already present at the lane head; preserve its cleanup and apply the remaining deletions. Keep unrelated lane inventory changes, including the already-removed external-supervisor entry.

Remove the redundant native health and external-supervisor E2E layers and short-enum replay. Retain owning native-health, update-report/recovery, required-field browser, and enum-control coverage. No affected test file differs between the source first commit and the original lane head.

CI-only validation: oxlint, oxfmt --check, and git diff --check passed. Independent static review found no actionable P0-P2 findings. No tests, coverage, Testbox, or check-changed were run.

* test(ui): deslop q0169 tests

Remove the duplicate Inbox E2E layer. Keep notification disclosure and dismissal proof in sidebar-issue-item.test.tsx, tab-scoped dismissal in sidebar-attention-layout.browser.test.ts, and desktop/mobile approval preservation in sidebar-attention-scope.e2e.test.ts.

Remove optional Activity proof capture scaffolding without changing its assertions. Leave the duplicate versions Escape interaction to chat-pane-versions-menu.browser.test.ts; retain outside-click, keyboard switch, geometry and browser Back integration.

CI-only validation: plain oxlint, oxfmt and git diff --check. Static cases 17 to 15; shard LOC 1123 to 945 (15.9%). Below the 40% target: retain unique missing-link recovery, packaged Nostr host-slot actions, warm-refresh DOM continuity, sidebar geometry and collapsed-reply reveal.

* test(ui): consolidate q0169 owner-boundary coverage

Remove remembered-session E2E replays covered by bootstrap.agent-selection.test.ts (removed-agent/default and missing-session recovery), bootstrap-location.test.ts, and route-resolution.test.ts (forced-literal collision). Keep the explicit dead-end screen and both escape routes.

Remove warm-owner-refresh E2E duplication: owner-first-roster.test.ts checks every publication through successful and failed warm refreshes; app-sidebar-row-identity.browser.test.ts checks keyed DOM reuse; sidebar-cached-list-stability.e2e.test.ts observes transient row stability through refresh. Drop only its two exact inventory entries.

Keep versions geometry with the original long headline and browser Back integration. Delegate repeated selection, focus and overlay interactions to chat-pane-versions-menu.test.ts, chat-pane-versions-menu.browser.test.ts, solid/menu-navigation.browser.test.ts, and solid/popover.browser.test.tsx. Remove literal copy and redundant RPC-shape assertions.

CI-only: plain oxlint exited 0; oxfmt and git diff --check passed. No tests run. Shard test LOC: original 1123, previous 945, now 673 (40.1% reduction).

* test(agents): deslop q0167 tests

Remove transport failure replays covered by subagent-announce-delivery.test.ts and subagent-announce-direct-delivery.test.ts. Keep failure formatting in the private parent-review case and empty-result behavior in subagent-announce.timeout.test.ts.

Compact usage fixtures and assert independent idempotency keys directly. Preserve the unique route, store, and lifecycle scenarios; the safe reduction is 1491 to 1380 lines (7.4%), below the 40% target. CI-only: oxlint, oxfmt, and diff checks passed; no tests or coverage run.

* test(agents): consolidate q0167 announce scenarios

Reduce the original shard from 1491 to 894 lines. Consolidate routing setup, failure findings with the immediate private handoff, account routing with same-timestamp idempotency, and pending/wake/forward lifecycle phases. Retain real-store unknown versus zero usage and concurrent bound-session delivery.

Exact-run final recovery remains covered by subagent-announce.requester-settle-wake.test.ts (delivers the complete final source reply after a same-run silent terminal) and subagent-announce-result.test.ts (registered deletion archive). Retain late non-final progress exclusion in the wake scenario. Accepted-wake revocation remains covered by registerDescendantWakeCurrencyTests in subagent-announce-delivery.test-support.ts, registered in subagent-announce-delivery.test.ts. Generic normalization/channel conflicts remain covered by src/utils/delivery-context.test.ts.

CI-only validation: oxfmt, plain oxlint and git diff --check pass. No tests, coverage or build commands run.

* test(plugins): deslop q0171 tests

Remove the compatibility-selection E2E replay covered by install.npm-spec.test.ts: preserves an existing npm plugin by resolving update metadata to a compatible version.

Remove the relocation replay covered by update-channel.consent.test.ts and the retained update-authority.e2e.test.ts bridge-publication case; carry source and load-path assertions into that case. Payload verification remains owned by payload-verification.test.ts.

Share the later-install peer-survival scenario while preserving runtime peer, host symlink, and manifest/lockfile assertions. Compact hook payload checks without dropping error, no-hook, or run-isolation cases.

CI-only validation: plain oxlint, oxfmt, and git diff --check pass. No tests or coverage run. Reduction is 1426 to 1300 lines; retain the distinct authority, lifecycle, and supply-chain boundaries rather than forcing the 40 percent target.

* test(plugins): remove duplicate q0171 e2e layers

Retire the stale-install replay covered by install-package-dir.test.ts: does not let a closed installer roll back under a successor live lease; install-package-dir.rollback.test.ts covers commit and rollback under successor leases. install.npm-spec.test.ts retains archive rollback and retry proof.

Retire retained-updater settlement replay: install-transaction.test.ts leaves deferred settlement with its caller and retains the original assertion; plugin-lifecycle-lease.test.ts fences nested index commits after outer/nested revocation; update-command-executor.test.ts retires direct preflight ownership before independent acquisition. Keep cohort publication revocation E2E.

Retire synchronous-authority replay covered by package-update-filesystem.test.ts: rejects a returned Promise at each raw authority boundary before effects; install-package-dir.rollback.test.ts retains async planning and publication-assertion rollback. Missing-integrity denial remains in npm-integrity.test.ts: rejects missing resolved integrity when an expected pin exists.

Retire hook-error replay covered by agent-tool-definition-adapter.after-tool-call.fires-once.test.ts: fires after_tool_call exactly once on error when both adapter and handler are active. Retain no-hook and colliding-run cases with independent expected payloads.

Original shard: 1426 lines. Final shard: 855 lines, down 40.04 percent. Plain oxlint, oxfmt and diff checks pass; tests and coverage intentionally not run in CI-only mode. Embedded download-cancellation program unchanged.

* test(scripts): deslop q0170 tests

Remove copied workload and deadcode argument inventories while retaining trusted helper/provider/output routing, Knip version pinning, admission, secret isolation, and concurrent scan outcome assertions.

Drop the publisher workflow command-shape check; mantis-publish-pr-evidence.test.ts retains executable manifest/render/upload behavior. The retained staging-user, Telegram failure, timing, worker-binding, and Mantis evidence cases cover distinct branches or authority/provenance boundaries. Preserve the capture-overlay regression from e8ffa35.

CI-only: oxfmt, plain oxlint, and git diff --check pass. No tests or coverage executed. Shard lines 1320 -> 1276 (3.3%); the 40% target is not met without discarding distinct proof.

* test(scripts): reduce q0170 duplicate proof layers

Remove workflow command/output inventories while keeping permission, credential isolation, trusted-helper and capture-overlay regression guards. Keep capture provenance in mantis-web-ui-chat-evidence; rendering and publication remain owned by mantis-publish-pr-evidence.test.ts.

Consolidate argument rejection setup and same-branch variants. Keep native timing preference in the independent-runs case. Retain one serialized diagnostic identity mismatch and exercise terminal-invalid diagnostic bounds once, preserving each ingress failure producer.

Static validation: oxfmt, plain oxlint, git diff --check. No test, coverage, or build runs (CI-only). Original shard 1320 lines -> 1165 (-11.7%); 40% remains unmet because remaining suites own distinct executable, authority, parser, and lifecycle branches.

* test(scripts): remove q0170 parser boundary replays

Keep strict Boolean parsing at the executable openclaw-release-clawhub-runtime-state.test.ts boundary. Keep duplicate and missing-string rejection in report-cli-helpers.test.ts and test-perf-budget.test.ts; missing split arguments remain covered by test-group-report.test.ts and docker-e2e-helper-cli.test.ts.

Retain empty split values, affirmative casing normalization, permissive token distinctions, numeric error paths, repeated strings, and option-separator contracts where equivalent boundary proof was not found. CI-only: oxfmt, plain oxlint, and git diff --check passed; no tests/builds/coverage run. Shard 1320 -> 1141 lines (-13.6%); 40% remains unachieved without dropping distinct proof.

* test(ui): deslop q0172 tests

Remove E2E replays already covered by the owning boundaries:
- Catalog refresh: config-page.session-observer.test.ts (slow refresh,
  stale result retirement, rejection recovery), app-host.chat-metadata.test.ts
  (config/metadata events and Gateway close), session-observer-settings.test.tsx
  (explicit utility model patch).
- Reply availability and request-free reconnect: chat-pane-history-reply.test.ts;
  retain the browser reconnect refresh and paginated source navigation scenario.
- Auto-follow: logs-page.test.tsx forces a scroll when re-enabled and covers
  incremental cursor reads; retain native-viewport wrapping geometry.
- Defaults mutations: config-mutation.test.ts, model-providers-page.actions.test.ts,
  and view.test.ts cover persistence, reset, busy/retry and advertised choices;
  retain browser alignment and open-option metadata geometry.

Remove optional screenshot/video capture plumbing, keeping visual assertions.
Drop only the deleted catalog file entries from owner inventory and timings.

CI-only: formatting, diff-check and plain oxlint passed; no tests or coverage run.
Shard lines 1332 -> 1043 (21.7%); declarations 13 -> 10; expanded cases 20 -> 15.
Below 40% target: retained source-preview interaction, publication races,
confirmed saved-split admission, ownership isolation and theme hot reload lack
an equivalent retained browser proof.

* test(scripts): deslop q0173 tests

Keep the ws relocation case for the shared generated-import branch. Keep npm manifest and CLI rejection cases for the shared manager validation loop; the complete manager-owned identity cases still cover npm, pnpm and Bun reads.

Keep canonical per-path guard cases and fork coverage in selects heavy lanes. Preserve all cleanup, redaction, publication, relocation and scheduler error boundaries. Factor npm expected commands and remove unused fixture labels and irrelevant malformed-limit host overrides.

* test(scripts): remove redundant q0173 proof layers

Keep per-path decisions in ci-check-family-scope.test.ts and selected UI/Windows target projection in ci-workflow-planning.test.ts (projects one selected test set into dedicated jobs; keeps cycle and Kysely checks blocking in the existing guard row). Retain heavy event selection and screenshot budget proof here.

Keep reference discovery in src/agents/docs-path.test.ts and custodian source composition in src/skills/loading/workspace-skill-snapshot.test.ts (keeps custodian skills absent from every non-custodian discovery surface). Snapshot proof now checks copied and pruned bytes at the canonical resource roots directly.

Keep metadata rejection policy in openclaw-npm-extended-stable-release.test.ts (completed successful plugin run at the exact branch and SHA; authenticated main recovery tooling with exact source identity). Retain workflow lineage and publisher authority cases. Simplify npm fixtures and import-result assertions without removing platform or resolver branches. CI-only: static lint and formatting passed; no test execution.

* test(scripts): consolidate q0173 owner-boundary fixtures

Remove the remaining heavy-lane inventory replay. ci-workflow-planning.test.ts retains complete family coverage by validation tier, macOS event selection, proof/boundary routing, and dedicated UI/Windows projection. ci-published-driver-update-plan.test.ts connects each event to the required job. Keep the unique screenshot-budget regression.

Run package identity against its real shell owner rather than replaying installation setup. docker-e2e-source-roots.test.ts preserves package proof settlement and the wrapper handoff to identity inspection. Keep manifest/CLI mismatch rejection, all manager identity details, and native-proof outcomes.

Consolidate scheduler cases without removing branches, preserve per-instance host snapshot proof with scoped spies, reuse numeric diagnostic fixture fields, and narrow fake GitHub calls to the two exact recovery endpoints. No production, config or helper edits. CI-only: oxlint, formatting and diff checks passed; no tests run.

* test(qa-lab): deslop q0174 tests

Share identical Telegram configuration and debug reads, reuse MCP pairing setup, and inline single-use Doctor and transcript fixtures. Keep all security, transport, and lifecycle cases and assertions; no safe whole-scenario deletion was found. CI-only validation: plain oxlint, oxfmt, and diff checks.

* test(ui): deslop q0175 tests

Remove duplicate file-copy and workspace-source E2E layers. Clipboard fallback and retirement remain in ui/src/lib/clipboard.test.ts and the file sidebar clipboard feedback suite in chat-sidebar.test.ts. Workspace source mismatch, retained draft identity and reopening remain in chat-session-workspace.test.ts, including the regression tests from a44dc77 (#178336); editor draft persistence remains in chat-sidebar-file-view.browser.test.ts and chat-file-drafts.browser.test.ts.

Nullable enum identity, unset and required behavior remain in config-form-scalar-integrity.browser.test.ts, with schema normalization in config-form-composition-integrity.browser.test.ts. Message-width naming and reload persistence remain in settings-message-width.e2e.test.ts. Custom snooze rejection, Escape focus and Cancel remain in session-menu.browser.test.ts; retain both E2E viewport paths for native date segment editing and reuse.

Drop only the deleted file path entries from CI owner/proof inventories. Preserve catalog ordering, image revocation and submit browser-task ordering scenarios. Shard test LOC: 913 -> 542 (40.6% reduction); static expanded cases: 21 -> 12. CI-only mode: oxfmt, diff-check and plain oxlint passed; no tests, coverage, builds or check-changed run.

* test(e2e): deslop q0176 tests

Remove the duplicated Mattermost DM retry/retirement replay and its multi-purpose fixture. Retain the real redirect test, including queue ambiguity across database reopen and refusal to replay after dispatch.

Remaining owner proof: extensions/mattermost/src/mattermost/send.authority.test.ts (stops DM backoff after retirement), client.test.ts (DM retry success), channel.send-loopback.test.ts (sender authority over HTTP), src/infra/outbound/deliver-queue.cancellation-integration.test.ts (retired queued callers and recovery), and delivery-queue.storage.test.ts (durable terminal fences).

Keep both LINE reference-only and concrete-sender branches, dropping only the resolved-membership variant: doctor.ts classifies references without inspecting access-group membership. Keep Discord plugin-instance capture and Cloudflare HTTP/WebSocket authority proof unchanged.

CI-only validation: plain oxlint, oxfmt and git diff --check passed. No tests, coverage or build run. LOC 1323 -> 1139 (13.9%); static expanded cases 11 -> 8. Below 40% because the remaining capture lifecycle, redirect ambiguity, identity/expiry and LINE warning branches are distinct.

* test(e2e): remove redundant q0176 proof layers

Retire the Cloudflare visitor composite replay. Remaining proof: src/gateway/github-user-identity.oidc.test.ts covers canonical HTTP/WS identity and malformed numeric claims; extensions/visitor-access/src/visitors.authority.test.ts covers numeric grants and expiry; src/gateway/http-auth-utils.test.ts covers live admission authority; src/gateway/server.auth.identity-scopes.test.ts covers real WS denial and revocation.

Keep real Gateway capture execution, after-turn recording, model-backed notes, late-STT fencing and socket isolation. Remove duplicate wire/output and registry-inspection assertions; reuse the existing Responses SSE fixture. Runtime instance ownership remains covered by runtime-plugins.channel-ownership.test.ts, runtime-plugins.channel-borrowing.test.ts and prepared-model-runtime.registry-borrow.test.ts; summary content is covered by src/transcripts/summary-model.test.ts.

Keep LINE alias and reference-only/concrete-sender branches plus config preservation. Drop unrelated UI/entrypoint checks and owner-covered warning replays: src/commands/doctor/channel-capabilities.test.ts, shared/empty-allowlist-scan.test.ts, shared/allowfrom-fallback-migration.test.ts, extensions/line/src/doctor.test.ts and bot-handlers.join-intro.test.ts.

CI-only validation: plain oxlint, oxfmt and git diff --check pass; no tests, coverage or builds run. Original shard LOC 1323 -> 793 (40.06% reduction), previous commit 1139 -> 793. Only shard tests changed; Cloudflare replay has no remaining path-list references.

* test: retain release integrity guards and typed fixtures

* test(agents): remove stale announce lint artifacts

* test: preserve distinct fixtures and prune retired baselines

* test(ci): account for selected singleton capacity
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
* test(scripts): deslop q0163 tests

Remove the redundant root-changelog rejection harness; pr-closeout-gates.test.ts covers the same prepare_gates rejection before hosted gates. Keep the independent bot-credit boundary.

Trim installer wiring inventories covered by install-ps1.release.test.ts native-npm-stderr, pnpm-source-bootstrap-lifecycle, same-prefix-shim-transaction and method-switch-preservation. Retain Windows cwd, SQLite stdin, source-target, relative tarball and freshness guards. Reuse PowerShell arguments.

Drop baseline npm argument-shape assertions while keeping real probe execution, skip/failure diagnostics and temporary-install cleanup. CI-only: oxfmt, plain oxlint and diff check pass; tests and coverage not run. Shard lines 1108 to 1022; distinct parser and lifecycle contracts prevent the requested 40 percent cut.

* test(scripts): trim q0163 tooling assertion layers

Keep installer contracts as focused guards, with executable cwd, archive identity, shim transaction and runtime proof in install-ps1.release.test.ts. Keep all installer failure and checkout-boundary scenarios.

Remove copied calibration phase/receipt inventories and duplicate clawlog missing-value variants that share the same pre-dispatch guard. Retain resource observations, retirement rejection, no-retry, output preservation and option-specific parsing paths.

Keep baseline selection/skip evidence, leaving label and timeout policy to targeted-docker-lane-groups.test.ts. Replace changelog exception-decoding scaffolding with direct spawn status and diagnostic assertions. No production changes; CI-only static checks pass. Remaining unique parser and process-lifecycle contracts prevent a 40 percent cut.

* test(scripts): reuse q0163 fixtures and trim attribution variants

Reuse the existing release Git fixture and one PowerShell invocation helper. Keep real Git history and file/streamed installer entrypoints unchanged.

Exercise internal, named bot, app prefix, bot suffix, case normalization and multi-handle scanning once at the scanner boundary. Retain direct empty/null/internal non-bot classification and the shell human-credit rejection.

CI-only: formatting, plain oxlint and diff checks pass; no test runs. The shard is 946 lines versus 1108 at baseline. Unique parser and shared process-cleanup contracts prevent the remaining cut to 664 without deleting distinct behavior.

* test(ui): deslop q0165 tests

Remove the retained-sentinel E2E replay: pages/config/updates.test.ts covers sentinel rendering and recovery exclusion, and app/update-overlay-helpers.test.ts covers external-supervisor guidance without failure triage. Keep the full update dialog/read-failure/recovery browser scenario.

Drop optional screenshot writers while retaining required-field accessibility and keyboard autosave checks. Drop duplicate failure-count checks and row-mode request restatements; route tests cover dashboard/compact query shapes and session-list owner tests cover reconciliation. Keep all three live row-event routes and their no-refetch assertion.

CI-only validation: oxfmt, plain oxlint, and git diff --check. No test or coverage runs. Reduce 994 to 914 lines; retain distinct browser lifecycle paths rather than force the 40 percent target.

* test(scripts): deslop q0164 tests

Drop six redundant wrapper alias cases: retained two-identity-alias, star-barrel, and named-binding origin cases exercise the same collector paths; check-export-name-collisions.test.ts retains direct alias classification proof. Simplify Kova fixture data and reuse the existing script-file fixture writer for CI build selection. Preserve release authority, compiler lifetime, graph resolution, and ratchet boundary cases.

CI-only campaign: plain oxlint, oxfmt, and diff checks passed; runtime and coverage proof deferred to hosted CI. Shard LOC 1537 -> 1489; declarations 28 -> 27; expanded cases 66 -> 60. The 40% LOC target was not reached without dropping distinct boundary coverage.

* test(scripts): remove q0164 redundant proof layers

Replace the ratchet workflow/command inventory replay with direct prepare_ratchet_base_args proof on the real depth-one checkout; ci-baseline-ratchets.test.ts owns argument forwarding and ci-workflow-planning.test.ts keeps workflow wiring. ci-changed-node-test-plan.source-owners.test.ts retains focused source/no-dist ownership; ci-run-node-test-shard.test.ts retains child resource propagation.

Remove copied runner-label and credentialed-job assertions and replay only distinct event gates. Consolidate alias, type-only, ambient declaration and batch-resolution proof into one Madge cycle that depends on every resolver path. plugin-sdk-api-release-evidence.test.ts retains changed-payload rejection; preserve head-identity integration here. Trim Kova fixture scaffolding and CLI inputs without removing its error paths.

CI-only: oxfmt, plain oxlint and git diff --check passed; no tests or coverage run. Shard LOC 1537 -> 1350 (12.2%); this follow-up 1489 -> 1350. The 40% target remains unmet: remaining suites and consumed helpers have distinct publication, parser and lifecycle contracts, with no safe whole-file removal identified.

* test(scripts): consolidate q0164 routing and fixtures

Replace workflow-by-workflow routing replay with direct, shared-worker and dispatch-gated branch cases; retain a generic hosted-runner guard for protected publishers and forwarding through both release orchestrators. release-no-push-workflow.test.ts retains backend/candidate routing cases and ci-workflow-planning.test.ts retains native/hosted policy coverage.

Reduce wrapper graphs to minimal declarations while retaining every value-definition and origin-resolution case, including the cross-batch scan. Remove publish-result identity restatements already validated by resolveReleasePublishInputs and the internal fetch-count assertion. Drop compiler timing-log scaffolding without changing preparation or disposal assertions.

CI-only: oxfmt, plain oxlint and git diff --check passed; no tests or coverage run. Original shard LOC 1537 -> 1288 (16.2%); this additional commit 1350 -> 1288. The 40% target remains unmet; no unique parser, publication-authority or lifecycle cases were intentionally discarded to force the metric.

* test(daemon): deslop q0168 tests

Remove duplicate native restart and stop/start rows. The retained named-profile guarded host-service lifecycle exercises both launchd activation paths; keep SIGTERM respawn and stop/restart bootstrap as distinct native scenarios.

Reuse the PID already verified by the running-runtime wait in the co-located Gateway regression. Leave Windows lifecycle and cleanup proof intact. CI-only validation: oxfmt, oxlint and git diff --check; no tests or coverage run.

* test(daemon): deslop q0168 native e2e layers

Keep native SIGTERM/KeepAlive proof; remove launchd replays owned by launchd-missing-plist.test.ts (both ghost-registration cases), launchd.test.ts (bootstrap repair and stopped activation), launchd-service-membership.test.ts (co-located node/Gateway port), config/paths.test.ts and infra/gateway-supervision.test.ts (install identity), and managed-gateway-bindings.test.ts plus test/scripts/live-gateway-dist-fence.test.ts (loaded native publication refusal). Generic service start outcomes remain in service.test.ts.

Keep Windows native failure recovery, external Scheduler extinction, Doctor admission, hosted restart/stop, no-respawn and Startup fallback. Use one external Scheduler stop API instead of replaying the same process-tree behavior. Remove callback and generic service-restart replays covered by schtasks.stop.test.ts and schtasks.settlement.test.ts. Launcher readback remains in schtasks.install.test.ts and schtasks.test.ts; Startup migration removal remains in schtasks.startup-fallback.test.ts. Replace fixture diagnostic snapshots with the cleanup exit code; keep evidence retention and all resource verification. Supervisor completion remains checked by native process exit and completed task result, rather than duplicate probe trace events.

Shard base: 1193 lines; final: 715 lines (40.1% reduction). CI-only: oxfmt, plain oxlint and git diff --check passed; no test or coverage commands run.

* test(scripts): deslop q0166 tests

Remove the duplicate non-import inventory replay: ci-changed-node-test-plan.source-owners.test.ts keeps policy scanners beside ordinary importers and checks the same inventory; ci-check-family-scope.test.ts owns architecture routing; ci-changed-node-test-plan.test.ts retains direct-test lint inventory selection. The watch logic has no separate added/renamed/import-edge decision branch.

Consolidate backport fixture writes and CLI invocation, reuse the deferred helper, and pass hosted-health evidence tuples directly. Preserve release, permission, boundary, error and concurrency assertions. CI-only: oxfmt, plain oxlint and diff checks passed; no tests or coverage run. Line reduction falls short of 40% because the remaining small suites cover distinct behavior.

* test(scripts): consolidate q0166 owner proof

Derive materializer expectations from fixture lock bytes instead of copying release versions and hashes; retain lock rejection, lifecycle suppression, output paths and permissions. Remove the exact success-log snapshot and unused child environment settings.

Keep lexical comment/regexp cases in test/architecture-smells.test.ts and boundary-specific path encodings here. Keep Tool Search success, mode and timeout assertions in upgrade-survivor-assertions.test.ts, and CLI application in upgrade-survivor-config-recipe.test.ts. Frozen policy retains committed identity selection, recipe differences, old-baseline acceptance, missing config and disabled-search rejection.

Reduce GitHub normalization and permission variants to distinct wrapper branches. CI-only: oxfmt, plain oxlint and diff checks pass; no tests or coverage executed. No retired subjects found. Original 1461 lines now 1355; the 40 percent target remains unmet because the retained fixtures exercise distinct boundaries and lifecycle behavior.

* test(scripts): reduce q0166 fixture and request setup

Remove shadowed event-filter inputs and a schema-literal restatement. Share GitHub request deadline setup across fetch/body cases, pass selector flags directly, centralize successful CLI assertions, and minimize backport fixture bodies and bound arguments. Preserve separator and direct invocation paths, permission/error branches, and legacy frozen-recipe assertions.

Rechecked PASS 15 moves: all subjects remain active and the retained specialized cases have no stronger duplicate owner proof. Original shard 1461 lines becomes 1312, below the requested 40 percent reduction. Further deletions would remove distinct behavior. CI-only: oxfmt, plain oxlint and diff checks pass; no tests, builds or coverage run.

* test(ui): remove redundant q0165 e2e layers

Port q0165 commits 0acf5908952ed8483aae936a334f04975eb18cd7 and 7e4349a8c9ec5fdbfe27318692e415354e088cf1 onto the campaign lane. The first commit is already present at the lane head; preserve its cleanup and apply the remaining deletions. Keep unrelated lane inventory changes, including the already-removed external-supervisor entry.

Remove the redundant native health and external-supervisor E2E layers and short-enum replay. Retain owning native-health, update-report/recovery, required-field browser, and enum-control coverage. No affected test file differs between the source first commit and the original lane head.

CI-only validation: oxlint, oxfmt --check, and git diff --check passed. Independent static review found no actionable P0-P2 findings. No tests, coverage, Testbox, or check-changed were run.

* test(ui): deslop q0169 tests

Remove the duplicate Inbox E2E layer. Keep notification disclosure and dismissal proof in sidebar-issue-item.test.tsx, tab-scoped dismissal in sidebar-attention-layout.browser.test.ts, and desktop/mobile approval preservation in sidebar-attention-scope.e2e.test.ts.

Remove optional Activity proof capture scaffolding without changing its assertions. Leave the duplicate versions Escape interaction to chat-pane-versions-menu.browser.test.ts; retain outside-click, keyboard switch, geometry and browser Back integration.

CI-only validation: plain oxlint, oxfmt and git diff --check. Static cases 17 to 15; shard LOC 1123 to 945 (15.9%). Below the 40% target: retain unique missing-link recovery, packaged Nostr host-slot actions, warm-refresh DOM continuity, sidebar geometry and collapsed-reply reveal.

* test(ui): consolidate q0169 owner-boundary coverage

Remove remembered-session E2E replays covered by bootstrap.agent-selection.test.ts (removed-agent/default and missing-session recovery), bootstrap-location.test.ts, and route-resolution.test.ts (forced-literal collision). Keep the explicit dead-end screen and both escape routes.

Remove warm-owner-refresh E2E duplication: owner-first-roster.test.ts checks every publication through successful and failed warm refreshes; app-sidebar-row-identity.browser.test.ts checks keyed DOM reuse; sidebar-cached-list-stability.e2e.test.ts observes transient row stability through refresh. Drop only its two exact inventory entries.

Keep versions geometry with the original long headline and browser Back integration. Delegate repeated selection, focus and overlay interactions to chat-pane-versions-menu.test.ts, chat-pane-versions-menu.browser.test.ts, solid/menu-navigation.browser.test.ts, and solid/popover.browser.test.tsx. Remove literal copy and redundant RPC-shape assertions.

CI-only: plain oxlint exited 0; oxfmt and git diff --check passed. No tests run. Shard test LOC: original 1123, previous 945, now 673 (40.1% reduction).

* test(agents): deslop q0167 tests

Remove transport failure replays covered by subagent-announce-delivery.test.ts and subagent-announce-direct-delivery.test.ts. Keep failure formatting in the private parent-review case and empty-result behavior in subagent-announce.timeout.test.ts.

Compact usage fixtures and assert independent idempotency keys directly. Preserve the unique route, store, and lifecycle scenarios; the safe reduction is 1491 to 1380 lines (7.4%), below the 40% target. CI-only: oxlint, oxfmt, and diff checks passed; no tests or coverage run.

* test(agents): consolidate q0167 announce scenarios

Reduce the original shard from 1491 to 894 lines. Consolidate routing setup, failure findings with the immediate private handoff, account routing with same-timestamp idempotency, and pending/wake/forward lifecycle phases. Retain real-store unknown versus zero usage and concurrent bound-session delivery.

Exact-run final recovery remains covered by subagent-announce.requester-settle-wake.test.ts (delivers the complete final source reply after a same-run silent terminal) and subagent-announce-result.test.ts (registered deletion archive). Retain late non-final progress exclusion in the wake scenario. Accepted-wake revocation remains covered by registerDescendantWakeCurrencyTests in subagent-announce-delivery.test-support.ts, registered in subagent-announce-delivery.test.ts. Generic normalization/channel conflicts remain covered by src/utils/delivery-context.test.ts.

CI-only validation: oxfmt, plain oxlint and git diff --check pass. No tests, coverage or build commands run.

* test(plugins): deslop q0171 tests

Remove the compatibility-selection E2E replay covered by install.npm-spec.test.ts: preserves an existing npm plugin by resolving update metadata to a compatible version.

Remove the relocation replay covered by update-channel.consent.test.ts and the retained update-authority.e2e.test.ts bridge-publication case; carry source and load-path assertions into that case. Payload verification remains owned by payload-verification.test.ts.

Share the later-install peer-survival scenario while preserving runtime peer, host symlink, and manifest/lockfile assertions. Compact hook payload checks without dropping error, no-hook, or run-isolation cases.

CI-only validation: plain oxlint, oxfmt, and git diff --check pass. No tests or coverage run. Reduction is 1426 to 1300 lines; retain the distinct authority, lifecycle, and supply-chain boundaries rather than forcing the 40 percent target.

* test(plugins): remove duplicate q0171 e2e layers

Retire the stale-install replay covered by install-package-dir.test.ts: does not let a closed installer roll back under a successor live lease; install-package-dir.rollback.test.ts covers commit and rollback under successor leases. install.npm-spec.test.ts retains archive rollback and retry proof.

Retire retained-updater settlement replay: install-transaction.test.ts leaves deferred settlement with its caller and retains the original assertion; plugin-lifecycle-lease.test.ts fences nested index commits after outer/nested revocation; update-command-executor.test.ts retires direct preflight ownership before independent acquisition. Keep cohort publication revocation E2E.

Retire synchronous-authority replay covered by package-update-filesystem.test.ts: rejects a returned Promise at each raw authority boundary before effects; install-package-dir.rollback.test.ts retains async planning and publication-assertion rollback. Missing-integrity denial remains in npm-integrity.test.ts: rejects missing resolved integrity when an expected pin exists.

Retire hook-error replay covered by agent-tool-definition-adapter.after-tool-call.fires-once.test.ts: fires after_tool_call exactly once on error when both adapter and handler are active. Retain no-hook and colliding-run cases with independent expected payloads.

Original shard: 1426 lines. Final shard: 855 lines, down 40.04 percent. Plain oxlint, oxfmt and diff checks pass; tests and coverage intentionally not run in CI-only mode. Embedded download-cancellation program unchanged.

* test(scripts): deslop q0170 tests

Remove copied workload and deadcode argument inventories while retaining trusted helper/provider/output routing, Knip version pinning, admission, secret isolation, and concurrent scan outcome assertions.

Drop the publisher workflow command-shape check; mantis-publish-pr-evidence.test.ts retains executable manifest/render/upload behavior. The retained staging-user, Telegram failure, timing, worker-binding, and Mantis evidence cases cover distinct branches or authority/provenance boundaries. Preserve the capture-overlay regression from 07d977c.

CI-only: oxfmt, plain oxlint, and git diff --check pass. No tests or coverage executed. Shard lines 1320 -> 1276 (3.3%); the 40% target is not met without discarding distinct proof.

* test(scripts): reduce q0170 duplicate proof layers

Remove workflow command/output inventories while keeping permission, credential isolation, trusted-helper and capture-overlay regression guards. Keep capture provenance in mantis-web-ui-chat-evidence; rendering and publication remain owned by mantis-publish-pr-evidence.test.ts.

Consolidate argument rejection setup and same-branch variants. Keep native timing preference in the independent-runs case. Retain one serialized diagnostic identity mismatch and exercise terminal-invalid diagnostic bounds once, preserving each ingress failure producer.

Static validation: oxfmt, plain oxlint, git diff --check. No test, coverage, or build runs (CI-only). Original shard 1320 lines -> 1165 (-11.7%); 40% remains unmet because remaining suites own distinct executable, authority, parser, and lifecycle branches.

* test(scripts): remove q0170 parser boundary replays

Keep strict Boolean parsing at the executable openclaw-release-clawhub-runtime-state.test.ts boundary. Keep duplicate and missing-string rejection in report-cli-helpers.test.ts and test-perf-budget.test.ts; missing split arguments remain covered by test-group-report.test.ts and docker-e2e-helper-cli.test.ts.

Retain empty split values, affirmative casing normalization, permissive token distinctions, numeric error paths, repeated strings, and option-separator contracts where equivalent boundary proof was not found. CI-only: oxfmt, plain oxlint, and git diff --check passed; no tests/builds/coverage run. Shard 1320 -> 1141 lines (-13.6%); 40% remains unachieved without dropping distinct proof.

* test(ui): deslop q0172 tests

Remove E2E replays already covered by the owning boundaries:
- Catalog refresh: config-page.session-observer.test.ts (slow refresh,
  stale result retirement, rejection recovery), app-host.chat-metadata.test.ts
  (config/metadata events and Gateway close), session-observer-settings.test.tsx
  (explicit utility model patch).
- Reply availability and request-free reconnect: chat-pane-history-reply.test.ts;
  retain the browser reconnect refresh and paginated source navigation scenario.
- Auto-follow: logs-page.test.tsx forces a scroll when re-enabled and covers
  incremental cursor reads; retain native-viewport wrapping geometry.
- Defaults mutations: config-mutation.test.ts, model-providers-page.actions.test.ts,
  and view.test.ts cover persistence, reset, busy/retry and advertised choices;
  retain browser alignment and open-option metadata geometry.

Remove optional screenshot/video capture plumbing, keeping visual assertions.
Drop only the deleted catalog file entries from owner inventory and timings.

CI-only: formatting, diff-check and plain oxlint passed; no tests or coverage run.
Shard lines 1332 -> 1043 (21.7%); declarations 13 -> 10; expanded cases 20 -> 15.
Below 40% target: retained source-preview interaction, publication races,
confirmed saved-split admission, ownership isolation and theme hot reload lack
an equivalent retained browser proof.

* test(scripts): deslop q0173 tests

Keep the ws relocation case for the shared generated-import branch. Keep npm manifest and CLI rejection cases for the shared manager validation loop; the complete manager-owned identity cases still cover npm, pnpm and Bun reads.

Keep canonical per-path guard cases and fork coverage in selects heavy lanes. Preserve all cleanup, redaction, publication, relocation and scheduler error boundaries. Factor npm expected commands and remove unused fixture labels and irrelevant malformed-limit host overrides.

* test(scripts): remove redundant q0173 proof layers

Keep per-path decisions in ci-check-family-scope.test.ts and selected UI/Windows target projection in ci-workflow-planning.test.ts (projects one selected test set into dedicated jobs; keeps cycle and Kysely checks blocking in the existing guard row). Retain heavy event selection and screenshot budget proof here.

Keep reference discovery in src/agents/docs-path.test.ts and custodian source composition in src/skills/loading/workspace-skill-snapshot.test.ts (keeps custodian skills absent from every non-custodian discovery surface). Snapshot proof now checks copied and pruned bytes at the canonical resource roots directly.

Keep metadata rejection policy in openclaw-npm-extended-stable-release.test.ts (completed successful plugin run at the exact branch and SHA; authenticated main recovery tooling with exact source identity). Retain workflow lineage and publisher authority cases. Simplify npm fixtures and import-result assertions without removing platform or resolver branches. CI-only: static lint and formatting passed; no test execution.

* test(scripts): consolidate q0173 owner-boundary fixtures

Remove the remaining heavy-lane inventory replay. ci-workflow-planning.test.ts retains complete family coverage by validation tier, macOS event selection, proof/boundary routing, and dedicated UI/Windows projection. ci-published-driver-update-plan.test.ts connects each event to the required job. Keep the unique screenshot-budget regression.

Run package identity against its real shell owner rather than replaying installation setup. docker-e2e-source-roots.test.ts preserves package proof settlement and the wrapper handoff to identity inspection. Keep manifest/CLI mismatch rejection, all manager identity details, and native-proof outcomes.

Consolidate scheduler cases without removing branches, preserve per-instance host snapshot proof with scoped spies, reuse numeric diagnostic fixture fields, and narrow fake GitHub calls to the two exact recovery endpoints. No production, config or helper edits. CI-only: oxlint, formatting and diff checks passed; no tests run.

* test(qa-lab): deslop q0174 tests

Share identical Telegram configuration and debug reads, reuse MCP pairing setup, and inline single-use Doctor and transcript fixtures. Keep all security, transport, and lifecycle cases and assertions; no safe whole-scenario deletion was found. CI-only validation: plain oxlint, oxfmt, and diff checks.

* test(ui): deslop q0175 tests

Remove duplicate file-copy and workspace-source E2E layers. Clipboard fallback and retirement remain in ui/src/lib/clipboard.test.ts and the file sidebar clipboard feedback suite in chat-sidebar.test.ts. Workspace source mismatch, retained draft identity and reopening remain in chat-session-workspace.test.ts, including the regression tests from f238a5d (openclaw#178336); editor draft persistence remains in chat-sidebar-file-view.browser.test.ts and chat-file-drafts.browser.test.ts.

Nullable enum identity, unset and required behavior remain in config-form-scalar-integrity.browser.test.ts, with schema normalization in config-form-composition-integrity.browser.test.ts. Message-width naming and reload persistence remain in settings-message-width.e2e.test.ts. Custom snooze rejection, Escape focus and Cancel remain in session-menu.browser.test.ts; retain both E2E viewport paths for native date segment editing and reuse.

Drop only the deleted file path entries from CI owner/proof inventories. Preserve catalog ordering, image revocation and submit browser-task ordering scenarios. Shard test LOC: 913 -> 542 (40.6% reduction); static expanded cases: 21 -> 12. CI-only mode: oxfmt, diff-check and plain oxlint passed; no tests, coverage, builds or check-changed run.

* test(e2e): deslop q0176 tests

Remove the duplicated Mattermost DM retry/retirement replay and its multi-purpose fixture. Retain the real redirect test, including queue ambiguity across database reopen and refusal to replay after dispatch.

Remaining owner proof: extensions/mattermost/src/mattermost/send.authority.test.ts (stops DM backoff after retirement), client.test.ts (DM retry success), channel.send-loopback.test.ts (sender authority over HTTP), src/infra/outbound/deliver-queue.cancellation-integration.test.ts (retired queued callers and recovery), and delivery-queue.storage.test.ts (durable terminal fences).

Keep both LINE reference-only and concrete-sender branches, dropping only the resolved-membership variant: doctor.ts classifies references without inspecting access-group membership. Keep Discord plugin-instance capture and Cloudflare HTTP/WebSocket authority proof unchanged.

CI-only validation: plain oxlint, oxfmt and git diff --check passed. No tests, coverage or build run. LOC 1323 -> 1139 (13.9%); static expanded cases 11 -> 8. Below 40% because the remaining capture lifecycle, redirect ambiguity, identity/expiry and LINE warning branches are distinct.

* test(e2e): remove redundant q0176 proof layers

Retire the Cloudflare visitor composite replay. Remaining proof: src/gateway/github-user-identity.oidc.test.ts covers canonical HTTP/WS identity and malformed numeric claims; extensions/visitor-access/src/visitors.authority.test.ts covers numeric grants and expiry; src/gateway/http-auth-utils.test.ts covers live admission authority; src/gateway/server.auth.identity-scopes.test.ts covers real WS denial and revocation.

Keep real Gateway capture execution, after-turn recording, model-backed notes, late-STT fencing and socket isolation. Remove duplicate wire/output and registry-inspection assertions; reuse the existing Responses SSE fixture. Runtime instance ownership remains covered by runtime-plugins.channel-ownership.test.ts, runtime-plugins.channel-borrowing.test.ts and prepared-model-runtime.registry-borrow.test.ts; summary content is covered by src/transcripts/summary-model.test.ts.

Keep LINE alias and reference-only/concrete-sender branches plus config preservation. Drop unrelated UI/entrypoint checks and owner-covered warning replays: src/commands/doctor/channel-capabilities.test.ts, shared/empty-allowlist-scan.test.ts, shared/allowfrom-fallback-migration.test.ts, extensions/line/src/doctor.test.ts and bot-handlers.join-intro.test.ts.

CI-only validation: plain oxlint, oxfmt and git diff --check pass; no tests, coverage or builds run. Original shard LOC 1323 -> 793 (40.06% reduction), previous commit 1139 -> 793. Only shard tests changed; Cloudflare replay has no remaining path-list references.

* test: retain release integrity guards and typed fixtures

* test(agents): remove stale announce lint artifacts

* test: preserve distinct fixtures and prune retired baselines

* test(ci): account for selected singleton capacity
RomneyDa added a commit that referenced this pull request Nov 11, 2026
Release adaptation: bind optional managed-workspace source identity through the current Gateway get/set and UI draft owners. Retain current authorization, lifecycle, fs-safe and source-less legacy-client contracts.

Canonical companion audit through 65367f9: current producers/callers closed; future sandbox/adoption, lazy UI and deduplication changes are not prerequisites. Independent final review: no P0/P1 findings. Exact nine-file patch and sanitized before/after UI evidence verified. Parent Gateway and UI tests, scoped types, lint, format and docs checks passed.

(cherry picked from commit a44dc77)

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files saves can overwrite a replacement workspace after a same-chat reset

1 participant