Skip to content

refactor(types): deslop UI, package, and plugin contracts - #165804

Merged
steipete merged 9 commits into
mainfrom
deslop/l398-types-guards-ui-pkg-ext-20261005
Oct 6, 2026
Merged

steipete merged 9 commits into
mainfrom
deslop/l398-types-guards-ui-pkg-ext-20261005

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private UI, package, and plugin types repeat contracts already owned by parsers, factories, schemas, and runtime APIs, creating extra definitions that can drift apart.

User Impact

No intended user-visible change. Configuration, persisted data, wire payloads, tool descriptions, plugin manifests, and rendered UI are preserved. No migration is needed.

Why This Change Was Made

This accumulated cleanup removes 1,193 net production lines (476 added / 1,669 removed across 128 production files), excluding tests, fixtures, documentation, generated files, and the shrink-only size baseline. No code moved outside the monorepo.

  • Derive UI controller, parser, navigation, and projection types from their owners. Preserve receiver-free callbacks and leaf contracts needed to avoid cycles.
  • Reuse AI stream-function signatures and infer private transport, scanner, truncation, and summarization results. Derive Markdown format keys from the capability table. Retain the published streaming-helper types.
  • Derive provider catalog, OAuth parser, realtime factory, and embedding-client types, while retaining the allocation-friendly Ollama projection.
  • Derive memory/REM/wiki reports and import results from their producers. Remove the unavailable-Intl fallback for the supported Node runtime.
  • Carry Policy's admitted finding and deny-rule types through consumers instead of rechecking states excluded by validation.
  • Reuse meeting, Diff, ONNX worker, Logbook, and migration-parser contracts; infer private QA lifecycle, scenario, parity, and transcript results. Preserve intentionally partial Google Meet and Beam contracts.
  • Reuse device-pair and Canvas runtime contracts, infer filesystem error classifications, and inline the single-use notification-key serialization helper with unchanged key bytes.
  • Keep Firecrawl wire and SSRF validation at their boundaries; reuse the parsed URL and normalized scrape result. Derive private voice-call command, TTS, exposure, and replay types.

Remove two exports made unnecessary by inference and one obsolete max-lines suppression; shrink its baseline entry. Two existing Firecrawl assertions now check that the fresh response omits cached, and the Slack scenario test derives its input type from the existing buildRun contract. Assertions and behavior coverage are retained; no tests, suppressions, dependencies, manifests, or configuration keys were added.

Fixes found along the way

GitHub Copilot's onboarding tests still used Vitest threads after auth-profile writes moved behind the application-main-thread database owner. Route the existing suite through the existing isolated fork project. All 57 cases and their assertions remain unchanged; the native selector still runs the suite once. The QA routing and awaited-cleanup fixes from main (ad99343036f) are included through the rebase.

Evidence

The final branch is based on 70d7e3cf90ebe1d8b1eb4f6609d7606685677990, including the SIGKILL replay fix 8e3c6beb8f6 and the subsequent QA fixture repair. Both rebases were conflict-free; the final rebase preserved all eight existing commits as identical patches. Independent Codex review of the batch, portable Slack declaration correction, and test routing found no actionable P0–P2 issues.

On final head 61cf595fd78cf5890e875a7bd7fb43326ba5c7c7, isolated Linux proof passed core/UI/extension production types, extension test types, affected QA/Copilot tests and routing checks, lint, Knip, plugin contracts, and test/scripts/lint-suppressions.test.ts. Runtime import cycles: 0. Madge cycles: 0. Earlier focused package, provider, memory, policy, tool, and UI suites remain valid for the patch-identical production changes.

A clean native qaRuntime build completed, its recorded commit was verified, and extensions/qa-lab/src/gateway-kill-restart-send.e2e.test.ts passed three consecutive times through the supported prebuilt-runtime route. Complete replay invocations took 94.88, 97.64, and 95.95 seconds. The final-head hosted replay also passed in job 112116749298: the SIGKILL case took 31.77 seconds, with the file completing successfully in 38.57 seconds.

Matched-metadata base/head UI builds both produced 33,985,648 raw JavaScript bytes and 1,349,539 CSS bytes: delta 0 bytes. Gzip totals also matched: 9,467,801 JavaScript and 239,607 CSS bytes. The UI changes erase to unchanged JavaScript; no executable rendering code changed.

SDK comparison found no added/removed entrypoints, export-name changes, or top-level signature changes. Reachable declaration differences come from deriving private types. The Slack factory retains its explicit portable contract, and its declaration build passed. Configuration, manifests, wire data, persisted shapes, and tool descriptions remain unchanged.

The changed Firecrawl assertions remain in the existing 59-case suite (9 seconds wall time); its 26-case parser suite also passed. The existing Slack scenario suite passed in 28 seconds wall time, predominantly compilation. No cases, waits, retries, thresholds, or fixture work were added to those tests.

Infrastructure observations are retained separately from passing proof: two earlier Mac runs passed and two timed out before the initial Gateway listener; a Linux worker build exhausted temporary-filesystem quota before running any case. A later QA build declined success because a child process group outlived its leader; its owner completed cleanup, and a clean rebuild plus the three replay passes above followed. No test or production guard was weakened to obtain these results.

The earlier hosted round found the same production dependency advisory and Doctor fixture type errors as contemporaneous main CI. It also exposed the QA auth routing/lifetime issues now fixed on main and the Copilot routing issue corrected here. The complete paginated final-head inventory contains 154 terminal checks: 107 successful, 46 skipped, one neutral, and zero failures. CI run 37416526063 completed successfully on 61cf595fd78cf5890e875a7bd7fb43326ba5c7c7; the CI, dependency-review, and security-sensitive-review status gates all passed. No inherited-failure exception is needed.

@clawsweeper

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

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 6, 2026, 1:07 AM ET / 05:07 UTC (Revision 5).

ClawSweeper review

What this changes

The branch derives private UI, package, and plugin types from existing producers, removes redundant checks, and routes Copilot auth tests through the existing isolated database-worker project.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: the cleanup remains useful and is not already implemented on current main. No actionable introduced defect was found; the previous compatibility warning is unsupported by the changed contracts.

Likely related people: steipete, qingminglong, and vincentkoc are routing candidates.

Priority: P3
Reviewed head: 61cf595fd78cf5890e875a7bd7fb43326ba5c7c7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, coherent cleanup with no actionable correctness finding and substantial reported validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The verified repository-admin author is exempt from ordinary contributor proof requirements, and the diff does not materially change authority. The captured body reports exact-head native Gateway restart replay and unchanged UI build totals as supplemental validation. Stored shapes, keys, and schemas are unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The verified repository-admin author is exempt from ordinary contributor proof requirements, and the diff does not materially change authority. The captured body reports exact-head native Gateway restart replay and unchanged UI build totals as supplemental validation. Stored shapes, keys, and schemas are unchanged.
Evidence reviewed 10 items Introduced change inspected: Read the complete introduced diff in bounded directory batches using the pinned merge-base and original head. Changes principally replace private type mirrors with producer-derived contracts; no dependency, manifest, SDK entrypoint, configuration-key, or schema changes were introduced.
Current-main necessity and prior warning: The pinned main version still declares ApplicationStartupSettings explicitly. The PR removes that private declaration and return annotation while preserving the complete startup function, credential handling, settings updates, and defaults. This provides no trigger for the previous generic config/default compatibility blocker.
Persisted notification identity preserved: Inlining the notification-key helper preserves the same JSON tuple, thread normalization, SHA-256 hashing, namespaces, and stored subscription shape. Dock-layout storage likewise changes only type declarations and receiver annotations; no stored-data contract changes require migration.
Findings None None.
Security None None.

How this fits together

These contracts connect provider responses, plugin operations, and Gateway state to their consumers, including the Control UI. Deriving private types from their owners reduces duplicate definitions while preserving runtime outputs.

flowchart LR
  A[Provider responses] --> C[Parsers and runtime owners]
  B[Gateway and plugin state] --> C
  C --> D[Derived private contracts]
  D --> E[Package and plugin consumers]
  D --> F[Control UI]
  E --> G[Existing runtime outputs]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/google-meet/src/cli-doctor.ts, serialized state: ui/src/components/dock-panel-layout.ts, unknown-truncated-pull-files, vector/embedding metadata: extensions/google/embedding-provider.ts, vector/embedding metadata: extensions/lmstudio/src/embedding-provider.ts, vector/embedding metadata: extensions/memory-core/src/concept-vocabulary.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep private contracts derived from their authoritative producers while preserving published APIs, runtime validation, and existing persisted bytes.

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

Not applicable: this PR primarily removes duplicate private type definitions, and source inspection found no introduced failure to reproduce.

Is this the best way to solve the issue?

Yes: deriving private contracts from existing owners is a focused way to prevent drift, and the inspected runtime edits preserve already-validated behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal contract cleanup with no intended user-visible behavior change or identified urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The verified repository-admin author is exempt from ordinary contributor proof requirements, and the diff does not materially change authority. The captured body reports exact-head native Gateway restart replay and unchanged UI build totals as supplemental validation. Stored shapes, keys, and schemas are unchanged.

Evidence

What I checked:

  • Introduced change inspected: Read the complete introduced diff in bounded directory batches using the pinned merge-base and original head. Changes principally replace private type mirrors with producer-derived contracts; no dependency, manifest, SDK entrypoint, configuration-key, or schema changes were introduced. (61cf595fd78c)
  • Current-main necessity and prior warning: The pinned main version still declares ApplicationStartupSettings explicitly. The PR removes that private declaration and return annotation while preserving the complete startup function, credential handling, settings updates, and defaults. This provides no trigger for the previous generic config/default compatibility blocker. (ui/src/app/startup-settings.ts:77, 2983dfcfb319)
  • Persisted notification identity preserved: Inlining the notification-key helper preserves the same JSON tuple, thread normalization, SHA-256 hashing, namespaces, and stored subscription shape. Dock-layout storage likewise changes only type declarations and receiver annotations; no stored-data contract changes require migration. (extensions/device-pair/notify-state.ts:50, 61cf595fd78c)
  • Policy admission invariant: The existing runtime predicate already requires a record-valued when field and string provider. The tightened type predicate and removal of optional checks describe values already admitted by that unchanged validator; they introduce no new policy rejection or authorization path. (extensions/policy/src/doctor/shape-helpers.ts:13, 61cf595fd78c)
  • Firecrawl security boundary retained: Read the complete client and API adapter. Endpoint validation receives the URL already parsed by its sole caller; protocol, hostname, private-endpoint, response parsing, sanitization, and guarded transport checks remain. The API adapter now consumes the normalized scrape result directly. (extensions/firecrawl/src/firecrawl-client.ts:148, 61cf595fd78c)
  • Supported runtime and test routing: Root package engines require Node >=24.16.0 <25 or >=26.1.0, supporting Intl.Segmenter. Copilot's test path is added to the existing database-worker list, whose project uses isolated forks; ordinary extension projects exclude that same list. No test cases, waits, or worker configuration were added. (test/vitest/vitest.extension-database-workers-paths.mjs:296, 61cf595fd78c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • qingminglong: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-05T21:23:57.431Z sha 1ef6f64 :: blocked before merge. :: none
  • reviewed 2026-10-05T21:45:04.488Z sha 7c04bfc :: blocked before merge. :: none
  • reviewed 2026-10-05T22:19:27.284Z sha 7c04bfc :: blocked before merge. :: none
  • reviewed 2026-10-06T03:47:13.223Z sha 64dc19f :: blocked before merge. :: none

@steipete
steipete disabled auto-merge October 5, 2026 21:27
@steipete
steipete force-pushed the deslop/l398-types-guards-ui-pkg-ext-20261005 branch from 7c04bfc to 64dc19f Compare October 6, 2026 03:41
@steipete
steipete force-pushed the deslop/l398-types-guards-ui-pkg-ext-20261005 branch from 64dc19f to 61cf595 Compare October 6, 2026 05:01
@steipete
steipete merged commit 46fe514 into main Oct 6, 2026
166 checks passed
@steipete
steipete deleted the deslop/l398-types-guards-ui-pkg-ext-20261005 branch October 6, 2026 06:23
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
…65804)

## What Problem This Solves

Private UI, package, and plugin types repeat contracts already owned by parsers, factories, schemas, and runtime APIs, creating extra definitions that can drift apart.

## User Impact

No intended user-visible change. Configuration, persisted data, wire payloads, tool descriptions, plugin manifests, and rendered UI are preserved. No migration is needed.

## Why This Change Was Made

This accumulated cleanup removes **1,193 net production lines** (476 added / 1,669 removed across 128 production files), excluding tests, fixtures, documentation, generated files, and the shrink-only size baseline. No code moved outside the monorepo.

- Derive UI controller, parser, navigation, and projection types from their owners. Preserve receiver-free callbacks and leaf contracts needed to avoid cycles.
- Reuse AI stream-function signatures and infer private transport, scanner, truncation, and summarization results. Derive Markdown format keys from the capability table. Retain the published streaming-helper types.
- Derive provider catalog, OAuth parser, realtime factory, and embedding-client types, while retaining the allocation-friendly Ollama projection.
- Derive memory/REM/wiki reports and import results from their producers. Remove the unavailable-Intl fallback for the supported Node runtime.
- Carry Policy's admitted finding and deny-rule types through consumers instead of rechecking states excluded by validation.
- Reuse meeting, Diff, ONNX worker, Logbook, and migration-parser contracts; infer private QA lifecycle, scenario, parity, and transcript results. Preserve intentionally partial Google Meet and Beam contracts.
- Reuse device-pair and Canvas runtime contracts, infer filesystem error classifications, and inline the single-use notification-key serialization helper with unchanged key bytes.
- Keep Firecrawl wire and SSRF validation at their boundaries; reuse the parsed URL and normalized scrape result. Derive private voice-call command, TTS, exposure, and replay types.

Remove two exports made unnecessary by inference and one obsolete max-lines suppression; shrink its baseline entry. Two existing Firecrawl assertions now check that the fresh response omits `cached`, and the Slack scenario test derives its input type from the existing `buildRun` contract. Assertions and behavior coverage are retained; no tests, suppressions, dependencies, manifests, or configuration keys were added.

## Fixes found along the way

GitHub Copilot's onboarding tests still used Vitest threads after auth-profile writes moved behind the application-main-thread database owner. Route the existing suite through the existing isolated fork project. All 57 cases and their assertions remain unchanged; the native selector still runs the suite once. The QA routing and awaited-cleanup fixes from main (`6ee87b63457`) are included through the rebase.

## Evidence

The final branch is based on `62d077729fa637b0358fb92d429252cb8130945b`, including the SIGKILL replay fix `930b86b8fb3` and the subsequent QA fixture repair. Both rebases were conflict-free; the final rebase preserved all eight existing commits as identical patches. Independent Codex review of the batch, portable Slack declaration correction, and test routing found no actionable P0–P2 issues.

On final head `61cf595fd78cf5890e875a7bd7fb43326ba5c7c7`, isolated Linux proof passed core/UI/extension production types, extension test types, affected QA/Copilot tests and routing checks, lint, Knip, plugin contracts, and `test/scripts/lint-suppressions.test.ts`. Runtime import cycles: **0**. Madge cycles: **0**. Earlier focused package, provider, memory, policy, tool, and UI suites remain valid for the patch-identical production changes.

A clean native `qaRuntime` build completed, its recorded commit was verified, and `extensions/qa-lab/src/gateway-kill-restart-send.e2e.test.ts` passed **three consecutive times** through the supported prebuilt-runtime route. Complete replay invocations took **94.88, 97.64, and 95.95 seconds**. The final-head hosted replay also passed in [job 112116749298](https://github.com/openclaw/openclaw/actions/runs/37416526063/job/112116749298): the SIGKILL case took 31.77 seconds, with the file completing successfully in 38.57 seconds.

Matched-metadata base/head UI builds both produced **33,985,648 raw JavaScript bytes and 1,349,539 CSS bytes: delta 0 bytes**. Gzip totals also matched: 9,467,801 JavaScript and 239,607 CSS bytes. The UI changes erase to unchanged JavaScript; no executable rendering code changed.

SDK comparison found no added/removed entrypoints, export-name changes, or top-level signature changes. Reachable declaration differences come from deriving private types. The Slack factory retains its explicit portable contract, and its declaration build passed. Configuration, manifests, wire data, persisted shapes, and tool descriptions remain unchanged.

The changed Firecrawl assertions remain in the existing 59-case suite (9 seconds wall time); its 26-case parser suite also passed. The existing Slack scenario suite passed in 28 seconds wall time, predominantly compilation. No cases, waits, retries, thresholds, or fixture work were added to those tests.

Infrastructure observations are retained separately from passing proof: two earlier Mac runs passed and two timed out before the initial Gateway listener; a Linux worker build exhausted temporary-filesystem quota before running any case. A later QA build declined success because a child process group outlived its leader; its owner completed cleanup, and a clean rebuild plus the three replay passes above followed. No test or production guard was weakened to obtain these results.

The earlier hosted round found the same production dependency advisory and Doctor fixture type errors as contemporaneous main CI. It also exposed the QA auth routing/lifetime issues now fixed on main and the Copilot routing issue corrected here. The complete paginated final-head inventory contains **154 terminal checks: 107 successful, 46 skipped, one neutral, and zero failures**. [CI run 37416526063](https://github.com/openclaw/openclaw/actions/runs/37416526063) completed successfully on `61cf595fd78cf5890e875a7bd7fb43326ba5c7c7`; the CI, dependency-review, and security-sensitive-review status gates all passed. No inherited-failure exception is needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant