Skip to content

refactor: deslop worker, transport and UI fixtures - #182739

Merged
steipete merged 1 commit into
mainfrom
deslop/t04-4-worker-fixtures-20261015
Oct 24, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/t04-4-worker-fixtures-20261015

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Independent test families maintain copied wire framing, state records, lifecycle
fixtures and cleanup blocks. This stack gives each repeated family one existing
test-support owner, or a small adjacent owner where no suitable one exists.
Scenarios, assertions and authority remain at their original consumers.

User Impact

Test maintenance only. No production code, public SDK/config/protocol, schema,
durability, permission, rendering or user-visible behavior changes. No assertion,
test case, parameter row, or suite/test/mock/hook registration is removed or weakened.

Completion HTTP fixtures

Four raw servers reuse the existing completion suite's server, SSE and context
helpers. Fresh loopback servers, response-release ordering, exact headers/frames,
error metadata and finally-close propagation remain. Provenance: #174840/#175058.

Best-effort tradeoffs accepted: two handlers collect the same small synthetic
request bodies as UTF-8 instead of discarding them; wire bytes and cases stay intact.

Queue reply interception

The existing committed-reply owner handles enqueue replies too. Enqueue still
matches command type without inspecting input; existing operations keep ID matching.
Held replies, attempts, loss diagnostics, release and spy cleanup retain per-call
state. All three consumers migrate and the duplicate helper disappears.
Provenance: #152840/#157413.

Best-effort tradeoffs accepted: none; no queue durability or settlement guard changed.

Node supervisor fixtures

The existing fixture owner layers capacity observation, terminal/receipt/file
access and disposal once. Generic fixtures remain unchanged; startup-only store,
optional signal and main-only JSON readers remain local. Each receipt/store call
constructs a fresh handle. Three isolated-launch builders share their existing owner.
Provenance: #149158/#175294.

Best-effort tradeoffs accepted: internal function-property insertion order may differ;
own keys, override precedence, callback lifetimes and cleanup behavior are preserved.

Publication recording

Two identical receipt-bearing publication collectors use an adjacent owner.
Each invocation still allocates a fresh array/subscription and registers its own
onTestFinished unsubscribe; specialized transaction projections remain local.
Provenance: #178563.

Best-effort tradeoffs accepted: none. Static cleanup statements are shared, not runtime
cleanup registrations; no top-level subscription or shared mutable array is introduced.

Historical approval SQL

An import-free frozen fixture owns the byte-identical two-kind CREATE TABLE body.
The older reader adds only its historical system-agent kind, preserving its full
DDL including whitespace/indexes. Its reader/query/resolution functions are unchanged.
Neither fixture derives from today's schema. Provenance: #170280/#156033.

Best-effort tradeoffs accepted: none; this changes no persisted schema or migration
contract. The two historical DDL forms remain exactly 3,354 and 4,061 bytes.

Entered gates

Eight factory shapes reuse the landed entered-gate owner from #182660. Every call
retains fresh promises, synchronous entered notification and async wait semantics.
Release/open/resume/pause aliases, zero-arity wrappers, request during/finally/join,
disposal identity and idle cleanup lists remain. The orphaned duplicate support
file is deleted after all its callers migrate.

Best-effort tradeoffs accepted: none; no production admission, authorization,
ordering, cancellation or write-capable settlement mechanism changed.

Explicit usage records

Twelve complete zero-cost records reuse the existing fresh usage owner, with
explicit input/output/total counters rather than deriving totals. Singleton,
in-loop and per-function allocation sites remain unchanged, including fresh cost
objects. Partial/legacy serialized fixtures stay local. Provenance: #139745.

Best-effort tradeoffs accepted: none; exact fields, omissions, counter values and
object-key order were compared with each original literal.

Provider catalog models

Seven tests reuse the existing catalog-model builder. Names, headers, params,
family presence, context/output budgets and special provider/API fields remain
explicit. Incomplete/negative rows stay local. The self-hosted setup slice is
omitted because #182687 owned it during selection. Provenance: #178651/#151849/#151570.

Best-effort tradeoffs accepted: harmless property insertion ordering in internal
fixtures only; own keys, omitted versus undefined values and freshness remain exact.

Audio transport callbacks

The existing MeetingBot audio fixture owns repeated callback queue construction.
Node-host retains manual acceptance; local transport explicitly enables draining.
Success callbacks remain microtask queued and backpressure retains callbacks.

Best-effort tradeoffs accepted: none; each emitter, mock and callback queue is fresh.

Management catalog fixtures

Repeated complete management catalog defaults use the existing test-helper owner.
Caller-specific node identity, install facts, service results and overrides remain
local. Process factories and lifecycle ownership are unchanged.

Best-effort tradeoffs accepted: none; no catalog/runtime policy or mock registration changed.

Board frame fixtures

Two suites share mounting, default host callbacks and iframe message construction.
The helper keeps projected state and current-widget reads lazy, preserves revision
updates/flush ordering, and appends unmount to the original caller-owned disposer
array. Invalid-source cases remain local. No production view changes.

Best-effort tradeoffs accepted: none; cleanup order, source identity, omitted
message fields and per-call host callbacks remain unchanged.

Property descriptor restoration

Fourteen tests share one import-free restore-or-delete helper. Every descriptor
capture remains at its original module/beforeEach/local/loop lifetime; cleanup
placement, order, getter identity and inherited-property visibility remain.

Best-effort tradeoffs accepted: none; the helper neither captures nor auto-registers cleanup.

Composer capabilities

Two browser suites reuse the existing capability-menu builder with explicit empty
basePath (the owner's default is intentionally different). The overflow skills
table remains local and keeps its array identity. Original callbacks and empty
arrays stay fresh at the original fixture call site.

Best-effort tradeoffs accepted: none; optional keys remain absent and the original
three mock allocations per fixture call are preserved.

Unused conversation-menu helper

Remove the unused openChatConversationOptions test helper and its comment.
The feature's test consumer was removed by #182539 (6045ee8); the earlier
consumer disappeared in #182377. A whole tracked-tree symbol search finds only
the definition. All remaining menu helpers and their callers remain unchanged.
This is not a dormant feature foundation or a production capability removal.

Best-effort tradeoffs accepted: none; the removed helper contains no assertions
or registrations and no test reads it. The separate dashboard helper is excluded
because open #180697 already owns that deletion.

Board native command results

Retire the board GitHub Actions suite's duplicate Buffer command-result constructor
in favor of the existing import-free identity test-support owner (#175876).
All three callers, synthetic credentials, authority checks and scenarios stay local
and unchanged. Results and both empty buffers remain fresh on each invocation.

Best-effort tradeoffs accepted: none; Buffer bytes, own-key order, values and
freshness match. No credential, transport, cache or authorization behavior changes.

Preservation counts

Native TypeScript AST source call sites, not expanded parameter cases. Assertions
include expect/expect.soft, browser expect.poll/expect.element, expectDefined and
Node assert calls. All table
rows, custom registration aliases and full assertion/matcher bodies were also
checked for conservation. Each tuple is assertions / tests / suites / hooks.
The hook column counts before/afterAll/Each. Separately, publication keeps its
two aroundEach registrations and all eleven other onTestFinished source sites.
Its four collector invocations still register four fresh unsubscribe callbacks;
only the duplicated onTestFinished factory statement moves from two copies to one.

Cut Before → after
Completion HTTP 82 / 24 / 3 / 0 → 82 / 24 / 3 / 0
Queue replies 103 / 15 / 3 / 3 → 103 / 15 / 3 / 3
Node fixtures 250 / 30 / 5 / 3 → 250 / 30 / 5 / 3
Publication fixtures 167 / 28 / 0 / 0 → 167 / 28 / 0 / 0
Historical SQL 20 / 6 / 1 / 0 → 20 / 6 / 1 / 0
Entered gates 363 / 55 / 4 / 5 → 363 / 55 / 4 / 5
Usage records 264 / 68 / 5 / 11 → 264 / 68 / 5 / 11
Catalog models 190 / 44 / 5 / 3 → 190 / 44 / 5 / 3
Audio fixtures 72 / 26 / 3 / 3 → 72 / 26 / 3 / 3
Management catalog 151 / 41 / 5 / 7 → 151 / 41 / 5 / 7
Board frame 83 / 16 / 5 / 2 → 83 / 16 / 5 / 2
Descriptors 820 / 139 / 10 / 26 → 820 / 139 / 10 / 26
Composer capabilities 143 / 15 / 1 / 4 → 143 / 15 / 1 / 4
Unused helper 0 / 0 / 0 / 0 → 0 / 0 / 0 / 0
Board native results 49 / 15 / 1 / 4 → 49 / 15 / 1 / 4
Total 2,757 / 522 / 51 / 71 → 2,757 / 522 / 51 / 71

Evidence

Complete candidate after the two-line fixture-publication repair and exclusions:
GitHub reports 743 additions / 1,398 deletions = 655 net lines removed, 76 files, zero
production lines changed. No new suppressions, skips,
retries, timeouts, dependencies or baseline allowances.

Source-extracted probes preserve exact fixture values, own-key sets/omissions,
reference identities, generated literals, gate aliases and microtasks. Actual
apply_patch verification caught and repaired out-of-order backend artifact hunks
before application; that failed atomic application changed no tracked source.
Fresh full-base independent review returned scoped-clean through P2, including
all four added support files. Formatting and initial native conservation passed.
The later Board substitution also passed fresh whole-candidate review through P2.

The initial focused core selection was intentionally stopped and joined after
five completed project groups when its transitive-consumer expansion was found
to include a packaging E2E file outside the local budget. That E2E did not run;
completed results are retained and only unfinished non-E2E selection is resumed.
The interrupted wrapper is not an all-green result.

The attachment-service suite exposed ten RPC preparation failures. A serial
base-equivalent control restored all three branch-owned files in the original
two-file shard's import closure to pinned base 3d2d217, then reproduced all ten
with matching names and error signatures (14 passed/10 failed, 128.90 seconds).
Source inspection traces these to publication of config before adding the
suite's session-store route: eager capture from #182582 is already in that base.
The candidate is restored and a minimal local repair republishes the completed
fixture config before RPC preparation. Runtime snapshot behavior, security
checks, assertions and registrations are untouched. The repaired original shard
passed both files and all 24 cases (144.56 seconds test duration, 160.01 seconds
wrapper), red on the pinned-base control and green with this local fixture fix.
Fresh independent full-base review of the repaired candidate, with complete
fixture and runtime-snapshot owner context, returned scoped-clean through P2
with no actionable findings. Remaining proof is not represented as passed.

The owner-settlement slice is restored byte-for-byte to the pinned base because
open #182725 owns that file; its 81 assertions, ten tests, two suites and four
hooks remain in the repository, outside this PR. The 18-net updater consolidation
was also dropped: it introduced a runtime import into a widely shared fixture
owner. All three files are byte-identical to the pinned base; the unused-helper
cut replaces it without expanding that dependency graph.

The final pre-write census caught new open #182737 owning chat.directive-tags.
That file is also restored byte-for-byte to the pinned base; its 450 assertions,
71 tests, two suites and four hooks remain in the repository, outside this PR.
The independent eight-net Board native-result cut replaces the twelve-net usage
slice. Its full source and import-free owner were inspected, and seven native
before/after comparisons preserve Buffer bytes, object shape and per-call freshness.

The resumed core run completed 78 files / 1,077 cases: 77 files and 1,076 cases
passed, with nine of ten project groups green (2,039.47 seconds runner / 2,042.28
seconds wrapper). Its sole failed case was the first fresh-overrides staging row,
which surfaced a serialized Reef plugin-instance retirement failure after 5,000ms,
not an npm timeout. Source tracing shows that even an empty isolated profile can
load that setup through original-state Doctor migration backup discovery.

After dropping the updater slice, the directly reachable package-update support
file is byte-identical to pinned base. A single-file base-equivalent control
passed both original table cases (80.31 seconds test duration / 191.16 seconds
wrapper, including required worker-fixture preparation). This is an inconclusive
reproduction of the original larger-shard failure, not proof that it is fixed or
inherited. The original failed local result and remaining lifecycle uncertainty
are retained in the native review evidence. No timeout, retry, skip or expectation
changed. The long existing process/SQLite suites retain their real boundary
contracts; no new test cases or waiting budgets were added.

Final UI proof passed 18 files / 260 cases: 14 ordinary files / 186 cases,
one isolated file / 23 cases and three browser files / 51 cases (75.49 seconds
runner / 78.06 seconds wrapper). Completion transport proof passed all three
package files / 38 cases (4.62 seconds test duration / 15.14 seconds wrapper).
Final native source conservation confirms the counts above. Final full-base
independent review completed with no actionable findings through P2.

The original final guards passed scoped core/UI lint, mock-export completeness,
zero runtime value cycles, zero Madge cycles and all 14 suppression cases. UI lint
reported one reactivity warning on unchanged overflow-test line 55. Four remaining
UI type leaves passed after the private components proof config included the
existing Board custom-element declaration owner; no source type was weakened.

Final Board proof passed all 28 runtime cases (31.38 seconds test duration /
47.02 seconds wrapper), its updated narrow type leaf (2.07 seconds), formatting
and scoped lint (18.40 seconds). This completes all 19 narrow owning type leaves.
The final delta guards confirm the conservation table, zero runtime value cycles,
zero Madge cycles and all 14 suppression cases. The added file's changed-check
planner dry run passed; no broad local changed-check suite was run. Fresh final
whole-candidate review returned no actionable findings through P2. Staged Git
counts (745 additions / 1,400 deletions) confirm the same 655-net / 76-file
measurement above. Every runtime run uses
isolated HOME/OpenClaw/XDG, nice priority 10, maxWorkers=1 and serial heavy commands.
Hosted exact-head PR CI will supply broad proof; no local build, broad check-changed,
whole-graph typecheck or product E2E is planned under the campaign budget.

Release-note context: internal test-fixture ownership cleanup; no user-visible change.

Consolidate repeated test setup into existing or adjacent fixture owners while preserving every assertion, scenario and registration. Keep per-call state, cleanup lifetimes and wire/schema values explicit. Republish the completed attachment-service fixture config before RPC preparation.

Release-note context: internal test-fixture ownership cleanup; no user-visible change.
@clawsweeper

clawsweeper Bot commented Oct 24, 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.

@steipete
steipete marked this pull request as ready for review October 24, 2026 17:18
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-24T17:18:16.998748Z b3a96e7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 24, 2026
@steipete
steipete enabled auto-merge (squash) October 24, 2026 17:35
@clawsweeper

clawsweeper Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates repeated test fixtures while preserving their scenarios, assertions, values, and cleanup lifetimes.

Example: An enqueue test holds a committed deliveryQueue.enqueue worker reply.

  • Before: A separate enqueue-specific helper intercepts and releases the reply.
  • After: The shared queue-reply helper performs the same interception without requiring an input ID.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, source-verified test maintenance with substantial reported focused validation; evidence remains harness-based and broad exact-head CI is unfinished.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only PR changes no shipped entry point; supplied validation exercises the affected suites, while inspected screenshots concern earlier synthetic-session work and provide no additional evidence for this diff.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-approved direction removes repeated fixture implementations without adding product machinery or weakening the inspected test contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides useful test-fixture consolidation, with no actionable introduced defect found; exact-head CI remains pending.

Priority: P3
Reviewed head: b3a96e71237500711954a7e78dbc1955f1131d5f

Before merge

None.

Findings

None.

Agent review details

How this fits together

Test-support factories supply synthetic records, HTTP responses, worker interception, and mounted UI fixtures to existing suites, which retain their independent assertions.

flowchart LR
  A[Test scenarios] --> B[Shared fixture factories]
  B --> C[Transport and worker owners]
  B --> D[Mounted UI components]
  C --> E[Existing assertions]
  D --> E
  E --> F[Caller owned cleanup]
Loading

Technical review

Best possible solution:

Retain the fixture consolidation and use the existing exact-head CI gate for landing.

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

This is a test refactor; the reported attachment-fixture failure and base control are documented in the full body, but were not rerun during this read-only review.

Is this the best way to solve the issue?

The change uses existing fixture owners where available, removes replaced helpers, and keeps scenario-specific inputs and assertions local.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Transport HTTP fixtures keeps the original intent (fe4cff7: Transport concept ownership and focused coverage were separated while preserving compatible request and stream behavior.)
  • Node supervisor fixtures keeps the original intent (8277325: Launch and lifecycle coverage protects against orphaned work and incompatible launches; this PR shares setup while retaining those cases.)
  • Historical approval fixtures keeps the original intent (1f0deff: Historical schema fixtures independently exercise compatibility and repair rather than deriving expected history from current DDL.)
  • Board frame fixtures keeps the original intent (32223e3: Synchronous owners retain frame lifecycle and authority while Solid consumes projections; the shared mounting helper preserves that composition.)
  • Entered gates keeps the original intent (ca43a38: A narrow owner supplies fresh entered/release promises without changing ordering or cleanup.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced change and current main: The pinned introduction changes only tests and test support; fetched main has no intervening changes to those paths, and the verified test merge retains the same intended scope. (b3a96e712375)
  • Historical SQL preserved exactly: Read-only extraction and comparison confirmed identical 3,354-byte two-kind DDL and identical 4,061-byte older-reader SQL; the fixture remains independent of current production schema. (src/state/operator-approval-schema.test-support.ts:2, b3a96e712375)
  • Existing gate owner reused: The entered gate reuses the same deferred implementation and preserves synchronous entry notification followed by an awaited release; its existing owner landed in refactor: deslop sessions, dispatch and OAuth fixtures #182660. (src/agents/entered-gate.test-support.ts:3, ca43a3864058)
  • Fixture publication follows current contract: The attachment suite now republishes config after adding its session-store route, matching publication-time capture introduced by perf(config): reuse published snapshots for ACP reads #182582; existing suite cleanup clears the snapshot. (src/gateway/worker-environments/session-attachment-service.test.ts:128, b3a96e712375)
  • Validation and accepted tradeoffs: The complete PR body reports focused transport, UI, worker, lint, and type validation while explicitly retaining an inconclusive lifecycle failure. Its maintainer author accepts synthetic request-body collection and internal fixture property-order differences. Live checks show pending PostgreSQL jobs and an aggregate CI gate, without a reported test failure. (b3a96e712375)
  • Policy and inspection limits: Read root and all changed-path ancestor AGENTS.md files and applied fixture-preservation guidance; maintainer notes are absent. Some older blobs are unavailable during history/blame inspection, and the installed Solid cheatsheet is absent. Current source and repository guidance remain inspectable; no target code or tests were executed, and final Git status is clean. (AGENTS.md, b3a96e712375)

Likely related people:

  • Peter Steinberger: Raw commit ca43a38 adds src/agents/entered-gate.test-support.ts:3 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ca43a3864058; files: src/agents/entered-gate.test-support.ts)

PR surface

Tests -655. Total -655 across 76 files. Added test files: 4.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 76 743 1398 -655
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 76 743 1398 -655

Labels

Label changes:

  • add P3: Internal test maintenance with no production behavior, public contract, or persisted-state change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: Internal test maintenance with no production behavior, public contract, or persisted-state change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed October 24, 2026, 1:35 PM ET / 17:35 UTC.

steipete added a commit that referenced this pull request Oct 24, 2026
Share request frames, deferreds, placement journals, pairing, prompt reports and model fixtures without changing assertions or scenarios. Defer transcript fixture consolidation while its support owner belongs to #182739.
@steipete
steipete merged commit 69759aa into main Oct 24, 2026
233 of 239 checks passed
@steipete
steipete deleted the deslop/t04-4-worker-fixtures-20261015 branch October 24, 2026 17:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

steipete added a commit that referenced this pull request Oct 24, 2026
Share request frames, deferreds, placement journals, pairing, prompt reports and model fixtures without changing assertions or scenarios. Defer transcript fixture consolidation while its support owner belongs to #182739.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
Consolidate repeated test setup into existing or adjacent fixture owners while preserving every assertion, scenario and registration. Keep per-call state, cleanup lifetimes and wire/schema values explicit. Republish the completed attachment-service fixture config before RPC preparation.

Release-note context: internal test-fixture ownership cleanup; no user-visible change.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
…82751)

Share request frames, deferreds, placement journals, pairing, prompt reports and model fixtures without changing assertions or scenarios. Defer transcript fixture consolidation while its support owner belongs to openclaw#182739.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui gateway Gateway runtime size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant