Skip to content

refactor(runtime): deslop private runtime exports - #164816

Merged
steipete merged 4 commits into
mainfrom
deslop/l367-knip-dead-exports-20261003
Oct 4, 2026
Merged

steipete merged 4 commits into
mainfrom
deslop/l367-knip-dead-exports-20261003

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private runtime facades and unused helper layers retain code that no supported production path needs.

User Impact

No intended user-visible change. Config keys, CLI output, message formats, model-facing descriptions, public plugin SDK contracts, and July 2026+ persisted shapes remain supported. No migration or operator action is required.

Why This Change Was Made

This Knip-driven batch removes 1,015 net production lines (+187/−1,202), excluding tests, documentation, and qualification inventories.

  • Narrow private SDK and memory-host facades to their actual consumers; delete orphan source declarations and forwarding modules. Preserve public SDK exports and known tagged official-plugin consumers.
  • Inline channel target parsing, Talk log/diagnostic projection, approval hints, context defaults, sandbox rename resolution, and SSH argument forwarding into their existing owners.
  • Remove unused MiniMax option plumbing while retaining all four setup entrypoints.
  • Delete the unreachable scoped expiry cache and paired-provider catalog factory, including tests exclusive to those dead paths. Keep behavioral tests for reachable production paths.
  • Simplify Matrix's fixed cache-key plumbing and normalize decoded sync data once. Use the SDK's identical inherited wantsSave() implementation; remove only obsolete pre-March raw-sync migration support while retaining July's normalized saved-sync format.
  • Shrink deleted-file qualification entries and private facade export inventories, and update the SDK catalog descriptions. Retain public export expectations, wildcard prohibitions, and owner behavior tests.

The normal production and all-exports Knip scans reported no unused exports on the starting base. A supplemental entry-export scan identified private facade candidates; each deletion then received consumer, manifest, documentation, and tagged-contract checks. Knip 6.32.2 does not expose a class-member issue category, so a separate method inventory was checked without deleting framework hooks.

Evidence

Independent Codex review of the full change and subsequent corrections completed with no P0/P1 findings. The rebase onto current main was patch-identical.

  • Core and extension typechecks passed.
  • 359 focused tests passed across 26 files, including channel targets, Talk, memory helpers, MiniMax, Matrix persistence/SDK behavior, approval reactions, and sandbox bridges.
  • The complete plugin-contract suite passed: 1,132 tests across 48 files (node scripts/run-vitest.mjs src/plugins/contracts --maxWorkers=1, 568.53s wall time).
  • Both final cycle checks passed with zero cycles (Madge and runtime value imports). Production and all-exports Knip 6.32.2 scans also passed with zero findings (114.88s and 187.37s). Exact-head hosted CI remains the broad build/check/test gate.

Validation used the authorized serialized nice -n 15 local fallback after remote admission and source-sync attempts could not reach a test payload. An oversized unchanged session-store selection and the optional broad local preflight were interrupted; their incomplete portions are not counted as passing proof.

The changed tests add no cases or fixtures. Individual timing runs used pnpm test <file> --maxWorkers=1; provider-catalog took 15.94s (11 tests), and the final embeddings partial-mock proof took 158.40s (15 tests, dominated by cold transformation). SDK-subpath inventory assertions passed in the full contract run above. Hosted CI timing is pending for the corrected head.

The first hosted run exposed a stale assertion baseline (migration.ts: 7 < 8); the corrective commit shrinks it and fixes the embeddings mock to preserve real exports, removing its obsolete baseline entry. The affected test, assertion/SQLite/timeout/mock ratchets, and both cycle checks pass. That run also reported the ACPX owner-session fixture mismatch; main now contains its exact fixture correction in d2a9f9a114c (its main workflow skipped test jobs, so this is source-fix evidence, not a passing hosted replay). The new exact-head run remains required.

Independent Hetzner comparison now qualifies that memory-forget failure as inherited from main: clean detached main a6b9da2 failed the same ten cases, while exact PR head 8a0cc249 passed all twelve tests. Additional remote core/extension types, 262 memory/schema tests (two existing skips), and both cycle checks passed. The complete 103-file dynamic-consumer audit found no additional restoration candidate. No schema change was made. See the pinned reproduction and landing evidence. The explicit maintainer-authorized main-red exception applies; CI remains recorded as failed rather than green.

Remove unused private SDK exports and their orphan helpers, types, and test-only implementations. Inline redundant target, logging, provider, and sandbox forwarding paths into their existing owners.

Preserve public SDK and supported official-plugin contracts. Keep July 2026+ Matrix state formats while removing the pre-March raw-sync reader, and keep persisted cache keys unchanged.

Independent Codex review completed with no P0/P1 findings.
@clawsweeper

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

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 8a0cc249b872b09b285e0e50eb963e7e2b418329
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/sandbox.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/fs-bridge-rename-targets.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/ssh.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: matrix Channel integration: matrix extensions: memory-core Extension: memory-core scripts Repository scripts docker Docker and sandbox tooling agents Agent runtime and tooling extensions: minimax size: XL labels Oct 4, 2026
@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 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 4, 2026, 4:37 AM ET / 08:37 UTC (Revision 4).

ClawSweeper review

What this changes

The branch removes unused private runtime exports and helper layers, consolidates forwarding logic into existing owners, and simplifies Matrix sync-cache handling.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open as useful maintainer-authored cleanup. No actionable introduced defect was found, and the new pinned main/head comparison resolves the previous CI-attribution concern under the recorded inherited-failure exception.

Priority: P3
Reviewed head: 8a0cc249b872b09b285e0e50eb963e7e2b418329

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent cleanup with preserved supported contracts and no actionable findings; the documented inherited CI failure remains accurately recorded.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this verified maintainer-authored cleanup, and the diff does not materially change authority. Reported tests remain supplemental; source and shipped-writer comparison verify supported Matrix state compatibility without migration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this verified maintainer-authored cleanup, and the diff does not materially change authority. Reported tests remain supplemental; source and shipped-writer comparison verify supported Matrix state compatibility without migration.
Evidence reviewed 10 items Pinned introduction and clean checkout: Inspected the merge-base-to-head introduced hunks across the complete local file list. The original head records parent 61388a1; the supplied test merge is stale and was not used to infer removal of current-main behavior. Final status remained clean and diff whitespace checking passed.
Private SDK boundary: The changed SDK entrypoints are classified private-local by the canonical inventory. The two changed SDK implementation files outside that inventory are not registered entrypoints. The public entrypoint inventory and public API baseline are unchanged.
Sandbox security equivalence: The retained resolver resolves both endpoints before checking both write permissions, matching the removed forwarding chain. Remote rename still performs writable and pinned-target checks before mutation; SSH argument inlining preserves session.assertCurrent.
Findings None None.
Security None None.

How this fits together

Private runtime facades connect OpenClaw’s bundled plugins to host capabilities. This cleanup narrows those connections while preserving the owners that handle channel targets, sandbox operations, memory, and voice.

flowchart TD
  A[Bundled plugins] --> B[Private runtime facades]
  B --> C[Existing host owners]
  D[Configuration and saved state] --> C
  C --> E[Channel and sandbox operations]
  C --> F[Memory and voice behavior]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface 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: config/assertion-safety-baseline.txt, unknown-data-model-change: packages/memory-host-sdk/src/engine-embeddings.ts, unknown-data-model-change: packages/memory-host-sdk/src/engine-storage.ts, unknown-truncated-pull-files, vector/embedding metadata: packages/memory-host-sdk/src/engine-embeddings.ts, vector/embedding metadata: packages/memory-host-sdk/src/host/internal.ts, and 3 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Retain the smaller private facades and existing runtime owners while preserving supported plugin and saved-state contracts.

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

Not applicable to this cleanup. The separate memory-forget CI failure has a pinned contributor-reported main/head comparison; this reviewer did not execute tests.

Is this the best way to solve the issue?

Yes. Removing unused private seams and inlining equivalent forwarding logic into existing owners follows the repository’s ownership model without adding parallel behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change or demonstrated 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 ordinary external-contributor proof gate does not apply to this verified maintainer-authored cleanup, and the diff does not materially change authority. Reported tests remain supplemental; source and shipped-writer comparison verify supported Matrix state compatibility without migration.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Inspected the merge-base-to-head introduced hunks across the complete local file list. The original head records parent 61388a1; the supplied test merge is stale and was not used to infer removal of current-main behavior. Final status remained clean and diff whitespace checking passed. (8a0cc249b872)
  • Private SDK boundary: The changed SDK entrypoints are classified private-local by the canonical inventory. The two changed SDK implementation files outside that inventory are not registered entrypoints. The public entrypoint inventory and public API baseline are unchanged. (scripts/lib/plugin-sdk-entries.mts:25, 8a0cc249b872)
  • Sandbox security equivalence: The retained resolver resolves both endpoints before checking both write permissions, matching the removed forwarding chain. Remote rename still performs writable and pinned-target checks before mutation; SSH argument inlining preserves session.assertCurrent. (src/agents/sandbox/fs-bridge-rename-targets.ts:7, 8a0cc249b872)
  • Affirmative Matrix dependency signal: The changed sync store extends MemoryStore from matrix-js-sdk, and removing its wantsSave override explicitly depends on inherited SDK behavior. The owning plugin pins matrix-js-sdk 42.4.0. (extensions/matrix/src/matrix/client/file-sync-store.ts:35, 8a0cc249b872)
  • Inherited Matrix save contract: Verified repository ownership through npm metadata and inspected v42.4.0 source: MemoryStore.wantsSave returns false, identical to the removed override. GitHub resolves that dependency tag to the cited commit. (src/store/memory.ts:323, bbffce963f72)
  • Supported Matrix state compatibility: The shipped v2026.9.8 writer saves normalized accumulator data; the candidate retains that normalized reader, version 1, current:meta, and current:sync: keys. The maintainer-authored body expressly scopes removal to obsolete pre-March raw-sync migration support while retaining July-and-later saved state. (extensions/matrix/src/matrix/client/file-sync-store.ts:107, fc23bc864e45)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • roboclaw-bot: 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 (3 earlier review cycles)
  • reviewed 2026-10-04T07:36:58.663Z sha 61388a1 :: blocked before merge. :: none
  • reviewed 2026-10-04T07:55:01.046Z sha 8a0cc24 :: blocked before merge. :: none
  • reviewed 2026-10-04T08:05:31.525Z sha 8a0cc24 :: blocked before merge. :: none

@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Independent main/head reproduction

The memory-forget failure is independently reproduced on clean main. The PR head passes the same two files.

Detached checkout Exact revision Result
Fresh origin/main a6b9da2bdeeeb5d666fe7434972acd84451af6fd 10 failed, 2 passed; all failures report no such table: memory_session_tombstones or an assertion wrapping that error (50.97s).
PR head 8a0cc249b872b09b285e0e50eb963e7e2b418329 12 passed (52.51s).

Both ran sequentially on the same Hetzner Linux x64 machine, using Node 24.19.0 and pnpm 12.5.1. Each revision had a separate fresh detached checkout and its own frozen dependency install; tracked source was verified clean.

pnpm test extensions/memory-core/src/memory-forget-recovery.test.ts extensions/memory-core/src/memory-forget.worker-settlement.test.ts --maxWorkers=1

This reproduces the ten cases in the failed hosted job. Its checkout log identifies merge 9b3fc134, merging this PR head into main 69b262734d2c3b6bfc92d96aebd8c0aad1859b03.

The dynamic-consumer audit covered all 103 changed production files, including schema/table creators, worker and plugin registrations, manifests, glob/entrypoint generation, module initialization, and string/namespace consumers. It found no additional restoration candidate. The tombstone creator, worker binding, schema-admission owner, and Kysely write path are not removed by this PR. No schema change or restoration was made in this landing pass.

Additional checks on the exact PR head passed on that lease: core and extension typechecks; 262 memory/database-schema tests across 13 files (two existing skips); Madge and runtime-value cycle checks, both zero. Earlier exact-source proof also passed 1,132 plugin-contract tests and both production/all-exports Knip scans. The leased push confirmed the published head was unchanged.

The only failing non-aggregate hosted check is the memory-forget extension bundle; its CI gate failures are downstream. Security-sensitive and dependency review statuses are successful. Landing is authorized under the explicit proven-main-red, non-security exception, pinned to the API-observed PR head. The main failure remains a separate repair responsibility.

@steipete
steipete enabled auto-merge (squash) October 4, 2026 08:36
@steipete
steipete merged commit 403b0ce into main Oct 4, 2026
208 of 211 checks passed
@steipete
steipete deleted the deslop/l367-knip-dead-exports-20261003 branch October 4, 2026 08:38
github-actions Bot pushed a commit to SebbeBengtsonSebbeBengtson1528/openclaw that referenced this pull request Oct 4, 2026
Remove unused private SDK forwards and declarations, inline single-use runtime helpers, and preserve supported plugin and persisted-data contracts.

Validated types, focused behavior, plugin contracts, Knip, memory/database schemas, and zero import cycles. Clean detached main reproduced the hosted memory-forget failures; the exact PR head passed all 12 corresponding tests. The maintainer-authorized main-red exception and full evidence are recorded in the PR.

Main-red evidence: openclaw/openclaw#164816 (comment)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
Remove unused private SDK forwards and declarations, inline single-use runtime helpers, and preserve supported plugin and persisted-data contracts.

Validated types, focused behavior, plugin contracts, Knip, memory/database schemas, and zero import cycles. Clean detached main reproduced the hosted memory-forget failures; the exact PR head passed all 12 corresponding tests. The maintainer-authorized main-red exception and full evidence are recorded in the PR.

Main-red evidence: openclaw#164816 (comment)
RomneyDa added a commit that referenced this pull request Oct 16, 2026
…ade exports were removed (#173777)

* fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed

Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which #164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported.

Fixes #173386

* fix(plugin-sdk): include private runtime export record in PR wrapper inventory
RomneyDa added a commit that referenced this pull request Oct 16, 2026
…ade exports were removed (#173777)

* fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed

Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which #164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported.

Fixes #173386

* fix(plugin-sdk): include private runtime export record in PR wrapper inventory

(cherry picked from commit 970fc2f)
RomneyDa added a commit that referenced this pull request Oct 16, 2026
…ade exports were removed (#173777)

* fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed

Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which #164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported.

Fixes #173386

* fix(plugin-sdk): include private runtime export record in PR wrapper inventory

(cherry picked from commit 970fc2f)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…ade exports were removed (openclaw#173777)

* fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed

Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which openclaw#164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported.

Fixes openclaw#173386

* fix(plugin-sdk): include private runtime export record in PR wrapper inventory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: matrix Channel integration: matrix docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: memory-core Extension: memory-core extensions: minimax P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed size: XL 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.

1 participant