Skip to content

refactor(packages): deslop packages - #164707

Merged
steipete merged 2 commits into
mainfrom
deslop/l366-packages2-simplify
Oct 4, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/l366-packages2-simplify

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Shared packages still contain private forwarding layers, repeated transformations, and unused internal bookkeeping after earlier cleanup passes.

User Impact

No intended user-visible change. Public package exports and APIs, protocol/config shapes, persisted data, error text, model-facing output, and lifecycle/security decisions stay unchanged. No migration or dependency change is required.

Why This Change Was Made

This second package pass keeps existing owners and removes structure that contributes no behavior:

  • Agent execution: inline one-use continuation/argument helpers and usage projection; keep tool-plan state with its caller; drain stream waiters directly; route validation to its existing llm-core owner.
  • Markdown and tool-call repair: reuse canonical span slicing, inline rendered-size search, prepare marker ranks once, and remove a test-only virtual-boundary telemetry option.
  • Memory helpers: share Chinese/Japanese token emission, use native byte counting/concatenation, keep defaults in their owner, remove an unset private wrapping option, and generate six identical revision triggers without changing their names, order, or effects.
  • ACP, network and terminal helpers: remove forwarding declarations and one-use predicates while preserving eviction/cancellation ownership, SSRF policy and redaction boundaries.
  • Catalog, media and SDK projections: reuse pricing schema fields, inline lexical root matching and error-cause formatting, and remove private type/string-normalization aliases.

The SDK namespace inheritance candidate was retained because its protected method can be used by external subclasses. The multimodal indexing fallback was also retained after review.

BELOW-1000: 285 net production LOC removed, plus 3 test lines. The prior l327 branches changed scripts, not packages; later package passes had already removed the larger redundant owners. This is one coverage-exhausted batch. The complete size-sorted READ log for all 114 production files over 200 lines, with the earlier l327 file lists, is attached below.

Fixes found along the way

No independently verified bug or flaky test was identified. The virtual-boundary test still exercises successful parsing; only its removed private telemetry assertion disappeared.

Evidence

  • Blacksmith Testbox tbx_01m429pdfap7qcfxw4rqwv2q45 (run): pnpm install --frozen-lockfile, then focused node scripts/run-vitest.mjs owner/sibling selection: 65 files / 1,343 tests passed, seven shards in 68.62 seconds.
  • node --import ./scripts/tsx.mjs scripts/check-madge-import-cycles.ts: 0 cycles. node --import ./scripts/tsx.mjs scripts/check-import-cycles.ts: 0 runtime value cycles.
  • node scripts/check-changed.mjs --base fd69a4eedd301350a14ba8dffcdfc621b1493131 passed conflict markers and line/max-line ratchets, then requested assertion baseline shrink session-reset-recall.ts: 3 -> 1; that exact maintenance update is included. Its rerun could not start because the lease expired during source-capsule preparation. Remaining full gates are delegated to exact-head hosted CI; the standalone test timing was completed on AWS below.
  • AWS Crabbox cbx_20ddda3eeb9e: the CJK correction passed node scripts/run-vitest.mjs packages/memory-host-sdk/src/host/query-expansion.test.ts (29 tests) and targeted Oxlint (0 warnings/errors). Both cycle checks were rerun and reported 0. pnpm test packages/tool-call-repair/src/payload.test.ts --maxWorkers=1 passed 27 tests in 3.76 seconds wall time (Vitest 1.95 seconds); no test cases were added, so there is no added CI test cost.
  • First hosted run 37170875928 failed check-lint-core-1 on typescript(no-misused-spread) in CJK token emission. The correction restores explicit Array.from(part) code-point iteration, passed fresh independent review and the AWS checks above, and does not add a suppression.
  • No new test cases or runtime cost were added. Three telemetry-only test lines were removed; the existing virtual-boundary parsing assertion remains. The combined focused run's 68.62 seconds is observed remote wall time, not a claimed hosted-CI saving.
  • Independent Codex autoreview completed through the direct API route after the normal login route failed. Its single fallback finding was addressed by retaining the original multimodal fallback; no other P0-P2 findings were reported.
  • git diff --check and touched-file formatting passed. Public barrels/manifests and removed-symbol references were checked across source, plugins, packages, UI, apps, scripts and tests.
  • Initial lease tbx_01m428dt5qj3f1wmnv0ypj5nae expired before tests began. The replacement passed the focused checks above, then also expired before the gate rerun. Both Testboxes were confirmed stopped. The task-owned AWS lease was stopped after its successful proof; no unrelated lease or protected staging was removed.

The final head is f230198cba4fd062829aeb51c99daf4d87a01186. Its hosted run has two inherited failures, verified independently on the current head da987fc619889e24c014685f2bc036ef1c4c5af3 of unrelated PR #164726 (only two DuckDuckGo files changed):

This PR job Failure Independent current-run evidence
checks-fast-baseline-ratchets scripts/check-test-mock-exports.mts: spawnSync git ENOBUFS Same ratchet failure
checks-node-compact-small-11-2 test/scripts/type-suppression-inventory.test.ts: expected 16 entries, received 18; both additional entries are in src/plugin-sdk/plugin-config-runtime.test.ts Same test and added entries

The offending tools, test inventory and SDK test are unchanged by this PR. The exact hosted base cc740dfaf528fa92d36af5eba2e97c15708c3c4f already contains both SDK negative type assertions but lacks their inventory entries. The lane adds no @ts-expect-error or mock factory. The package proof passed independently; these main/tooling failures remain with the CI coordinator. Merged as b72a95e3f75cb6143847265fe83cc2362b57eea2 using the explicitly authorized inherited-failure exception, pinned to the reviewed head above. All remaining CI jobs passed or were intentionally skipped. The Security Review workflow completed successfully and its combined gate cited only the same failed CI aggregate. Merge ancestry and the landed 285-line production reduction were verified on origin/main.

Complete package coverage and l327 merged files

l366 packages second-pass coverage

Scope: packages/** excluding packages/ai. Baseline: fd69a4e.

All production source was read largest-first across disjoint owner lanes, including smaller files, package manifests, exports and main consumers. Every production source file over 200 lines is listed below, sorted by baseline size. Existing lifecycle, schema, transport, redaction and public API contracts were retained. Recent history and open deslop overlap were checked; #164269 overlap and audit/cron closure were excluded from edits.

Previous l327 merged files

The l327 branches merged as #163894 and #164009; neither changed packages. Later package passes #159279, #161002 and #161210 explain why most remaining code already belongs to narrow concrete owners.

164009 — refactor(scripts): deslop CI and release tooling

  • config/knip.scripts-exports.config.ts
  • scripts/check-openclaw-package-tarball.mts
  • scripts/ci-build-manifest.mjs
  • scripts/ci-run-timings.mjs
  • scripts/control-ui-i18n.ts
  • scripts/docs-i18n/doc_chunked_raw.go
  • scripts/docs-i18n/localized_links.go
  • scripts/e2e/lib/release-user-journey/write-clickclack-plugin.mjs
  • scripts/frv-publication-status.mts
  • scripts/frv.d.mts
  • scripts/frv.mjs
  • scripts/full-release-validation-policy.d.mts
  • scripts/full-release-validation-policy.mjs
  • scripts/full-release-validation-state.mjs
  • scripts/generate-npm-package-lock.mts
  • scripts/github/release-validation-campaign.mjs
  • scripts/lib/actions-artifact-archive.mjs
  • scripts/lib/ci-changed-node-test-plan.mts
  • scripts/lib/ci-extension-test-shards.mts
  • scripts/lib/ci-node-test-plan.mts
  • scripts/lib/cross-os-release-checks/config.ts
  • scripts/lib/cross-os-release-checks/install.ts
  • scripts/lib/docker-e2e-plan.mts
  • scripts/lib/docker-e2e-scenarios.mts
  • scripts/lib/plugin-npm-package-manifest.mts
  • scripts/lib/release-beta-verifier.ts
  • scripts/lib/release-postpublish-diagnostic-schema.mts
  • scripts/protocol-gen-swift.ts
  • scripts/release-ci-summary.mjs
  • scripts/render-github-release-notes.mts
  • scripts/test-docker-all.mts
  • test/plugin-clawhub-metadata.test.ts
  • test/plugin-npm-package-manifest.test.ts
  • test/scripts/ci-changed-node-test-plan.config-fallback.test.ts
  • test/scripts/ci-changed-node-test-plan.integration.test.ts
  • test/scripts/ci-changed-node-test-plan.policy.test.ts
  • test/scripts/ci-changed-node-test-plan.source-owners.test.ts
  • test/scripts/ci-changed-node-test-plan.test-support.ts
  • test/scripts/ci-extension-preparation.test.ts
  • test/scripts/ci-node-test-plan.test.ts
  • test/scripts/ci-workflow-pr-control.test.ts
  • test/scripts/extension-test-plan.test.ts
  • test/scripts/generate-npm-package-lock.test.ts
  • test/scripts/npm-runner.test.ts
  • test/scripts/openclaw-cross-os-release-checks.test.ts
  • test/scripts/release-priority.test.ts
  • test/vitest-pr-exempt-retention.test.ts

163894 — refactor(ci): deslop browser test ownership inventory

  • scripts/lib/ci-ui-e2e-owner-inventory.mts

Production file coverage

Baseline lines File Result
1834 packages/tool-call-repair/src/stream-normalizer.ts READ: bounded buffering, provider ordering and protection ownership are real contracts; recent #163934 retained.
1486 packages/markdown-core/src/ir.ts READ: use canonical span slicing instead of private clamp/finalize combinations.
1465 packages/agent-core/src/agent-loop.ts READ: inline the only continuation assertion and argument-preparation helper; move tool-plan state into its sole owner instead of exporting a factory from steering. Preserve tool admission, cancellation, ordering, commit, and settlement paths.
1295 packages/gateway-client/src/client.ts READ — Node adapter owns transport policy, node v3/v4 negotiation, token persistence obligations, and stop draining; retained real lifecycle and shipped compatibility contracts.
1165 packages/gateway-protocol/src/schema/agents-models-skills.ts READ — Named public agent/model/workshop schemas and inferred types; existing revision/outcome field owners already shared, native/codegen identities retained.
1005 packages/agent-core/src/harness/compaction/compaction.ts READ: context token estimation now scans directly instead of creating a private usage/index DTO through a single-use helper. Retain all CLI/unavailable usage barriers and prompt/summary bytes.
885 packages/memory-host-sdk/src/host/session-files.ts READ: actor snapshots, worker redaction revision fencing, archive classification, reset recall, and provenance contracts require the distinct paths; no sound further reduction.
872 packages/llm-core/src/types.ts READ: public provider/plugin contracts and shipped v2026.9.7 runtime-context compatibility remain externally consumed; no sound API-preserving removal.
833 packages/gateway-protocol/src/schema/sessions.ts READ — Public session lifecycle, file, grouping, observer, and usage contracts; shared request properties already reuse canonical schemas.
821 packages/gateway-protocol/src/schema/plugins.ts READ — Public plugin catalog/install/consent schemas; real source variants and named native-generation branches retained.
768 packages/agent-core/src/agent.ts READ: queues retain submitted/in-flight cancellation ownership and awaited listener settlement; forwarding methods form the public Agent API. No sound further removal.
753 packages/gateway-client/src/session-projection.ts READ — APPLIED: imports canonical nullable string normalization directly; durable/live identity and snapshot ordering logic retained.
748 packages/worker-runtime/src/worker-task-pool-core.ts READ: queue admission, host exchanges, cooperative pressure, native retirement, and retained owner settlement have distinct observable lifetimes; no sound reduction.
746 packages/gateway-protocol/src/schema/cron.ts READ — EXCLUDED: cron/heartbeat closure belongs to the concurrent Automations lane; read only and untouched.
732 packages/gateway-protocol/src/schema/channels.ts READ — Public Talk/channel schemas preserve turn/capture conditionals, distinct transports, voice IDs, and provider-owned open fields.
721 packages/memory-host-sdk/src/host/query-expansion.ts READ: unified Chinese/Japanese script-part and bigram emission; retained all language stop-word data and Korean particle behavior.
707 packages/markdown-core/src/reasoning-tag-parser.ts READ: malformed recovery, parser ownership and source-coordinate projection require remaining branches.
707 packages/model-catalog-core/src/model-catalog-normalize.ts READ: separate raw manifest normalization and runtime row projection serve externally supplied inputs; transport, pricing, suppression and context-window checks enforce different contracts. No sound removal without changing accepted shapes.
695 packages/sdk/src/client.ts READ — RPC inheritance removal was reverted after review: exported namespace subclasses can use or override protected call(); protected API retained.
683 packages/gateway-protocol/src/public-schema.ts READ — Explicit public schema exports define the reviewed package surface; broad wildcard replacement would expand published API.
680 packages/gateway-client/src/protocol-client.ts READ — Single wire lifecycle owner already centralizes handshake, correlation, reconnect, callbacks, and generation fencing; retained.
638 packages/agent-core/src/types.ts READ: exported agent, tool, hook and event contracts are used outside the package; declaration merging is explicitly supported. No sound API-preserving removal.
606 packages/tool-call-repair/src/payload.ts READ: JSON/XML precedence, partial syntax and payload limits enforce distinct grammar contracts.
597 packages/gateway-protocol/src/validator-registry.ts READ — Named published validators delegate to one lazy compiler; explicit export surface and non-schema prechecks retained.
596 packages/terminal-core/src/table.ts READ: excluded because open PR #164269 owns it.
578 packages/gateway-protocol/src/schema/audit-activity.ts READ — EXCLUDED: audit closure; read only, metadata bounds and correlated wire/type contracts untouched.
574 packages/memory-host-sdk/src/host/session-transcript-corpus.ts READ: synchronous admitted-reader and asynchronous filesystem/worker paths preserve separate execution boundaries; ownership, archive identity, and keyset classification retained.
560 packages/gateway-client/src/session-subscriptions.ts READ — One coordinator owns observer leases, approval upgrades, ordered wire changes, timeout recovery, and release acknowledgement; retained.
556 packages/sdk/src/run-event-replay.ts READ — Retained bounded replay and reconnect/unsubscribe receipt ordering, recovery cancellation, and active-baseline ownership.
554 packages/markdown-core/src/reasoning-tags.ts READ: incremental caches preserve bounded work and stable Markdown ownership.
549 packages/gateway-protocol/src/connect-error-details.ts READ — EXCLUDED: open deslop PR #164269 touches this file; read only, public recovery and pairing semantics untouched.
545 packages/agent-core/src/harness/env/kill-tree.ts READ: Unix PID-instance checks, group/session ownership, Linux traversal bounds and Windows escalation each enforce distinct live process contracts; no sound removal.
535 packages/memory-host-sdk/src/host/memory-schema-storage-migration.ts READ: current binary embedding conversion, bounded cache migration, transaction authority renewal, unknown-dependent refusal, and foreign-key checks remain required; no schema/retention change.
527 packages/gateway-protocol/src/schema/logs-chat.ts READ — Public chat/history/event shapes and bounded sanitized error projections; existing base event owner retained.
512 packages/gateway-protocol/src/schema/worker-admission.ts READ — Build-bound worker admission/live-event contracts; common message, request, and response owners already reused.
502 packages/memory-host-sdk/src/host/internal.ts READ: retained multimodal content fallback after review; discovery error, symlink, file-change and glob handling remain necessary.
495 packages/net-policy/src/redact-sensitive-url.ts READ: simplified authority matching, config-path checks and query iteration; bounded recursive redaction retained.
481 packages/gateway-protocol/src/schema/openclaw.ts READ — Public system-agent setup and wizard contracts preserve exact activation/secret/owner semantics and generated-client shape.
475 packages/gateway-protocol/src/schema/session-placement.ts READ — Public discriminated placement contracts preserve state-specific required fields and native schema names; existing shared property owners retained.
453 packages/gateway-protocol/src/schema/users.ts READ — Public identity, preference, and provider authorization schemas; scope/status distinctions and deliberate shared aliases retained.
432 packages/agent-core/src/agent-stream-response.ts READ: streamed async tool fragments retain transcript persistence, result-redaction replacement and provider completion ownership. Distinct paths remain necessary.
432 packages/llm-core/src/validation.ts READ: coercion handles external JSON-schema data, scoped/recursive references and nullable unions; schema wrappers establish compile-time parameter types. Already simplified by #163934; no sound further removal.
432 packages/retry/src/index.ts READ: #164278 recently simplified this dependency-free owner; distinct retry-after, abort and numeric-call contracts remain necessary.
420 packages/gateway-protocol/src/schema/agent.ts READ — Public agent/channel action entrypoints include live authority and routing metadata; cron-related closure also left untouched.
420 packages/memory-host-sdk/src/host/memory-schema.ts READ: generated six identical revision triggers from the existing two tables and three mutation events; preserved names, SQL effects, ordering, migration/refusal behavior, and one exec call.
420 packages/memory-host-sdk/src/host/types.ts READ: externally consumed memory manager/status and diagnostic contracts retained intact.
409 packages/net-policy/src/ip.ts READ: inlined three private single-use helpers while retaining SSRF classification.
404 packages/workboard-contract/src/index.ts READ: public board data shapes and shared constants; deleting fields or aliases would change caller contracts.
398 packages/gateway-protocol/src/schema/config.ts READ — Public update/config metadata, activation phases, consent reports, and nullable status contracts; common apply and git metadata already shared.
396 packages/agent-core/src/harness/session/tool-result-pairing.ts READ: repeated IDs are paired by occurrence; duplicate/synthetic replacement and displaced outcomes have different ownership. Legacy text/ID handling remains used by persisted session SQL/projection.
395 packages/markdown-core/src/render.ts READ: replace temporary union and branching comparator with prepared ranks; preserve callback and structural style ordering.
391 packages/gateway-protocol/src/schema/approvals.ts READ — Public approval snapshots and native discriminated variants preserve decision/status correlations and reviewer-safe presentation.
391 packages/gateway-protocol/src/theme.ts READ — Portable public theme validation preserves CSS safety grammar, error text, optional artwork IDs, and byte ceilings.
389 packages/markdown-core/src/render-aware-chunking.ts READ: inline single-use rendered-size search and remove duplicate normalization of internal limits.
384 packages/gateway-protocol/src/schema/exec-approvals.ts READ — Public file/native execution approval variants retain authorization-sensitive field exclusions and distinct owner contracts.
381 packages/acp-core/src/structured-auth-redaction.ts READ: replaced a boolean-only backslash counting loop with direct predecessor detection.
377 packages/mermaid-renderer/src/renderer.ts READ: sandbox, sanitizer, private channel, serialized rendering and disposal enforce distinct contracts.
376 packages/normalization-core/src/json-schema.ts READ: reference, Unicode pattern, schema traversal and JSON validation paths enforce different TypeBox and malformed-input contracts.
374 packages/normalization-core/src/number-coercion.ts READ: externally consumed coercion, timer, expiry and rounding variants differ in accepted values and failure behavior.
372 packages/gateway-protocol/src/schema/board.ts READ — Public widget operations/content and native named unions retain grant/revision/ticket contracts; cron closure untouched.
366 packages/sdk/src/types.ts READ — APPLIED: removed four private alias-only DTO names; ToolInvokeParams, ToolInvokeResult, SessionCreateParams, and SessionSendParams expose identical shapes.
358 packages/gateway-protocol/src/schema/environments.ts READ — Shared environment summary factory intentionally creates distinct nominal nested schemas for public result owners; retained.
358 packages/tool-call-repair/src/grammar.ts READ: remove unused test-only line-break telemetry while retaining virtual-boundary parser coverage.
357 packages/agent-core/src/harness/utils/truncate.ts READ: streaming line scans avoid retaining source buffers; UTF-8 fallback, surrogate repair and independent head/tail ceilings preserve externally consumed behavior. Canonical truncate helper differs for negative/fractional limits, so not substituted.
353 packages/agent-core/src/harness/compaction/utils.ts READ: extraction, bounded diagnostic tails, sender provenance and summary serialization preserve prompt-byte/token-accounting contracts; recent runtime-context suppression fix retained.
349 packages/gateway-protocol/src/schema/audit-run.ts READ — EXCLUDED: audit closure; read only, exact execution identity and correlated selection contracts untouched.
342 packages/markdown-core/src/assistant-transcript.ts READ: structural HTML and link-preservation options have real UI and IR consumers.
342 packages/normalization-core/src/error-coercion.ts READ: removed private property-key enumeration and inlined single-use cause formatting; preserve guarded access, redaction and error ordering.
334 packages/worker-runtime/src/worker-task-pool-retirement.ts READ: cancellation, execution receipt, artifact cleanup, failed-retirement custody, rotation, and idle clocks are distinct contracts; no sound collapse.
333 packages/memory-host-sdk/src/host/memory-schema-fts.ts READ: body/path FTS declarations, rowid ownership, collision refusal, schema reconciliation, and savepoint rollback retained.
329 packages/model-catalog-core/src/remote-catalog-bundle.ts READ: derive cost and hosted pricing schemas from the tier rate fields instead of declaring them three times; preserve strictness, required fields and errors.
326 packages/media-core/src/mime.ts READ: excluded because open PR #164269 owns it; MIME inventories and bounded byte-sniff precedence retained.
318 packages/sdk/src/transport.ts READ — Transport owns connection retirement, response/event receipts, reconnect observers, and close lifecycle; optional broad identity contract retained.
314 packages/gateway-protocol/src/schema/update-runs.ts READ — Public ledger projection already shares vocabulary, timestamps, version, driver, and admission owners; retained durable data contract.
313 packages/terminal-core/src/ansi-sequences.ts READ: streaming and complete-input parsing intentionally differ for partial bounded controls.
309 packages/gateway-protocol/src/schema/worker-inference.ts READ — Shared worker message/frame primitives already canonical; per-event required data and strict prepared-bundle validation retained.
307 packages/model-catalog-core/src/model-catalog-types.ts READ: published catalog types differ from runtime/config types; existing common leaf types already own shared primitives.
306 packages/gateway-client/src/pending-request.ts READ — Single pending-request owner preserves deadlines, cancellation, accepted-once callbacks, and identity-only suspension replay.
303 packages/terminal-core/src/ansi.ts READ: removed redundant empty-input branch; grapheme boundary performance contracts retained.
300 packages/gateway-protocol/src/schema/sessions-row.ts READ — Public row projection carries intentionally optional/nullable display and ownership data; compact/full cache contract retained.
295 packages/agent-core/src/harness/compaction/branch-summarization.ts READ: branch budget and error contracts differ from ordinary compaction; merging would require new policy knobs and change errors. Recent predecessor already simplified branch ancestry selection.
293 packages/gateway-protocol/src/schema/nodes.ts READ — Public node work and invoke contracts preserve queue limits, command progress, JSON transport, and native-client schema identities.
292 packages/acp-core/src/runtime/types.ts READ: externally consumed adapter/API declarations have no removable internal machinery.
291 packages/markdown-core/src/frontmatter.ts READ: YAML/freeform recovery paths preserve shipped metadata behavior.
283 packages/gateway-protocol/src/schema/worker-protocol-primitives.ts READ — Canonical worker message/frame/budget helpers have multiple concrete consumers; retained shared owner.
283 packages/workboard-contract/src/sessions-board.ts READ: public normalization preserves specific diagnostics, replacement semantics and persisted board structure; no sound simplification beyond already shared field validators.
282 packages/worker-runtime/src/worker-task-pool-owned.ts READ: result completion and explicit owner release intentionally differ; input preparation custody and synchronous request admission cannot collapse into Promise-only paths.
280 packages/markdown-core/src/html-scanner.ts READ: rendering and visibility consumers require distinct malformed-input and script-escaping policies.
279 packages/gateway-client/src/session-projection-final-identity.ts READ — Final identity and snapshot inference preserve transcript identity, imported-row distinction, and provisional final reconciliation.
278 packages/model-catalog-core/src/model-catalog-pricing.ts READ: feed-specific pricing qualifications and thresholds enforce billing meaning; existing rate owner already consolidates shared logic.
276 packages/memory-host-sdk/src/host/memory-recall-metadata.ts READ: provenance validation and bounded SQL candidates with post-query exact project eligibility prevent false authority and candidate starvation; no sound further reduction.
268 packages/gateway-protocol/src/gateway-error-details.ts READ — Public structured error and shipped message fallback contracts preserved; cron-related declarations untouched.
265 packages/gateway-protocol/src/schema/snapshot.ts READ — Public hello snapshot preserves optional producer readiness, presence, update state, and heartbeat closure.
257 packages/session-url-contract/src/focus.ts READ: excluded because open PR #164269 owns it; URL selectors and malformed-route cases remain public contracts.
254 packages/llm-core/src/utils/event-stream.ts READ: drain private pending Promise resolvers directly, eliminating repeated array shifts, unreachable guard and unnecessary cast. Producer settlement and payload retention remain intact.
251 packages/gateway-protocol/src/schema/sessions-catalog.ts READ — Public catalog locator/cursor/native-terminal contracts and schema identity retained; one tiny single-use property bag noted to parent during proof freeze.
244 packages/llm-core/src/model-contracts/anthropic.ts READ: exports preserve model-family aliases and overlapping independently documented provider capabilities; a descriptor layer would add policy indirection.
240 packages/memory-host-sdk/src/host/markdown-chunks.ts READ: weighted CJK budgets, surrogate-safe splitting, overlap, and curated-entry metadata preserve persisted chunk hashes and source positions.
239 packages/gateway-protocol/src/schema/devices.ts READ — Public device/token rotation and bootstrap delivery contracts require correlated withheld/in-band variants and shipped older v4 response shape.
235 packages/gateway-protocol/src/schema/frames.ts READ — Public v4 request/response/hello/event wire contracts; scoped capabilities and shipped node compatibility retained.
235 packages/gateway-protocol/src/schema/protocol-schema-selection.ts READ — Derived registry already removes duplicated inventory; explicit exclusion set preserves published/native generator membership.
235 packages/normalization-core/src/agent-run-terminal-outcome.ts READ: timeout, cancellation and lifecycle adapters preserve distinct precedence and finality contracts.
232 packages/worker-runtime/src/worker-task-server.ts READ: serialized resource closures and worker execution, cancellation response fencing, and input-consumed receipts cannot share a simpler lifetime.
228 packages/agent-core/src/internal-hooks.ts READ: WeakMaps deliberately keep host-owned admission/preparation/provenance off public plugin objects and preserve one-shot acknowledgement. No sound owner removal.
224 packages/gateway-client/src/session-projection-message-identity.ts READ — APPLIED: removed nonpublic readSessionProjectionString forwarding function; canonical normalizeNullableString now used directly.
223 packages/model-catalog-core/src/provider-model-id-normalization.ts READ: manifest and fallback aliases serve different loading boundaries; current provider aliases are externally observable.
222 packages/acp-core/src/runtime/session-identity.ts READ: simplified absent-identity comparison; persisted normalization and resolved-ID precedence retained.
222 packages/gateway-protocol/src/schema/questions.ts READ — Public transient question input/output and secret binding shapes preserve since metadata and native record reuse.
217 packages/agent-core/src/harness/messages.ts READ: role conversion, persisted timestamp validation and shipped runtime-context projection have externally observable bytes; no sound further removal.
216 packages/memory-host-sdk/src/host/batch-runner.ts READ: one canonical group runner already handles provider submission, bounded concurrency, split recovery, polling, and output accounting; externally exposed options retained.
214 packages/memory-host-sdk/src/host/config-utils.ts READ: narrow config projection preserves roster/workspace inheritance and cross-conversation privacy defaults; current legacy-input ownership contracts retained.
213 packages/worker-runtime/src/retained-operation.ts READ: map, flatMap, and finally have distinct synchronous servicing and error-combination contracts; replacing them with promises or extra mapped operations changes progress/settlement.
211 packages/tool-call-repair/src/promote.ts READ: provider callbacks and content-index projection preserve real provider representations.
205 packages/worker-runtime/src/worker-task-pool-resources.ts READ: message-port receipts, shared exit listeners, and retirement readback preserve actual resource custody; no sound collapse.

The SDK namespace inheritance candidate was rejected: its protected method can be used by external subclasses. No schema, retention, durability, policy, dependency or protocol change is included. No bugs or flaky tests were identified. This is one coverage-exhausted batch below 1,000 net production lines, not a completed 1,000-line batch.

Simplify private package plumbing, reuse canonical span and validation owners, and consolidate repeated memory and pricing construction without changing public contracts. Preserve lifecycle and security boundaries. Remove 285 net production lines after complete package coverage; retain exported SDK inheritance and multimodal fallback.
@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: f230198cba4fd062829aeb51c99daf4d87a01186
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • packages/acp-core/src/structured-auth-redaction.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • packages/net-policy/src/redact-sensitive-url.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@steipete
steipete enabled auto-merge (squash) October 4, 2026 02:24
@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 3, 2026, 11:27 PM ET / October 4, 2026, 03:27 UTC (Revision 3).

ClawSweeper review

What this changes

Simplify shared package helpers, repeated transformations, and private bookkeeping while preserving public interfaces and existing runtime behavior.

Warning

SQLite table change

This PR modifies persisted SQLite tables in packages/memory-host-sdk/src/host/memory-schema.ts. Prefer a design that avoids changing persisted SQLite tables. If the change is necessary, verify migration and upgrade compatibility against an existing database before merge.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this remains a distinct, coherent maintainer-authored cleanup. The introduced diff contains no actionable correctness finding or concrete security regression.

Priority: P3
Reviewed head: f230198cba4fd062829aeb51c99daf4d87a01186

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent cleanup with preserved contracts, useful recorded validation, and no actionable introduced defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this verified repository-admin cleanup. Recorded remote tests supplement source review but are not claimed as live product proof; no material stored-data contract changes require migration evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this verified repository-admin cleanup. Recorded remote tests supplement source review but are not claimed as live product proof; no material stored-data contract changes require migration evidence.
Evidence reviewed 9 items Repository policy and clean checkout: Read the complete root AGENTS.md and applied ownership, compatibility, security, and test-value guidance. No ancestor AGENTS.md exists under the changed packages or config paths; .agents/maintainer-notes is absent. The checkout remained clean.
Pinned introduction and current-main necessity: Reviewed all introduced hunks between fd69a4e and f230198. Current main retains the original session-store, Markdown-rendering, memory-trigger, and CJK-tokenization implementations; this cleanup is still distinct. The supplied test merge is stale and was not used to infer removal of base behavior.
Complete captured body inspected: Retrieved and read the complete 32,932-unit body. Its SHA-256 matches the supplied snapshot, adf137313cb4159eefa86cefbb8351b423224a3cdee9837a4fcf6952f6e2579d. It records focused remote validation, retained SDK subclass behavior, retained multimodal fallback, and conditional inherited-CI handling.
Findings None None.
Security None None.

How this fits together

OpenClaw's shared packages process agent execution, conversation events, Markdown, memory requests, and network diagnostics. Their outputs feed Gateway clients, plugins, providers, and terminal presentation.

flowchart TD
  A[Agent and client requests] --> B[Shared package owners]
  C[Provider responses and transcripts] --> B
  B --> D[Validation and normalization]
  D --> E[Session and memory processing]
  D --> F[Markdown and diagnostic rendering]
  E --> G[Gateway and plugin consumers]
  F --> G
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -285, Tests -3, Other 0. Total -288 across 40 files.

View PR surface stats
Area Files Added Removed Net
Source 38 285 570 -285
Tests 1 0 3 -3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 40 286 574 -288

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: packages/memory-host-sdk/src/host/batch-utils.ts, serialized state: packages/memory-host-sdk/src/host/response-snippet.ts, unknown-data-model-change: packages/memory-host-sdk/src/host/memory-schema.ts, unknown-data-model-change: packages/memory-host-sdk/src/host/query-expansion.ts, unknown-data-model-change: packages/memory-host-sdk/src/host/response-snippet.ts, vector/embedding metadata: packages/memory-host-sdk/src/host/batch-http.ts, and 6 more. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep the existing package owners and supported contracts while adopting the smaller private implementation.

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

Not applicable: the PR proposes behavior-preserving cleanup and reports no independently verified product bug.

Is this the best way to solve the issue?

Yes: the diff reuses existing owners and removes private indirection without introducing competing implementations or changing supported contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change.
  • 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 external-contributor proof gate does not apply to this verified repository-admin cleanup. Recorded remote tests supplement source review but are not claimed as live product proof; no material stored-data contract changes require migration evidence.

Evidence

What I checked:

  • Repository policy and clean checkout: Read the complete root AGENTS.md and applied ownership, compatibility, security, and test-value guidance. No ancestor AGENTS.md exists under the changed packages or config paths; .agents/maintainer-notes is absent. The checkout remained clean. (AGENTS.md:1, f230198cba4f)
  • Pinned introduction and current-main necessity: Reviewed all introduced hunks between fd69a4e and f230198. Current main retains the original session-store, Markdown-rendering, memory-trigger, and CJK-tokenization implementations; this cleanup is still distinct. The supplied test merge is stale and was not used to infer removal of base behavior. (packages/markdown-core/src/render.ts:282, 47206579b8e2)
  • Complete captured body inspected: Retrieved and read the complete 32,932-unit body. Its SHA-256 matches the supplied snapshot, adf137313cb4159eefa86cefbb8351b423224a3cdee9837a4fcf6952f6e2579d. It records focused remote validation, retained SDK subclass behavior, retained multimodal fallback, and conditional inherited-CI handling. (f230198cba4f)
  • Stored contract unchanged: The trigger generator preserves the two literal table names, insert/update/delete order, six trigger names, IF NOT EXISTS behavior, revision increment, and surrounding migration sequence. No material stored-data model or migration contract changes. (packages/memory-host-sdk/src/host/memory-schema.ts:332, f230198cba4f)
  • Private cleanup preserves supported interfaces: Checked package manifests, public barrels, removed-symbol references, canonical validation forwarding, and the complete edited payload test. Removed helpers and telemetry are outside public exports; public SDK type names retain their shapes, and virtual-boundary parsing still has its successful-result assertion. (packages/tool-call-repair/src/payload.test.ts:89, f230198cba4f)
  • Security and authority preservation: Inspected credential redaction, URL redaction, IP classification, inbound-root matching, ACP parent matching, and cancellation ownership. Changes preserve their predicates and final operations without materially transferring or extending authority. The guard comment verifies repository-admin authority for steipete and requires no additional sensitive-product approval: refactor(packages): deslop packages #164707 (comment). (packages/acp-core/src/structured-auth-redaction.ts:90, f230198cba4f)

Likely related people:

  • steipete: 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 (2 earlier review cycles)
  • reviewed 2026-10-04T02:28:20.285Z sha 1bda9af :: blocked before merge. :: none
  • reviewed 2026-10-04T03:06:35.370Z sha f230198 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit b72a95e into main Oct 4, 2026
225 of 231 checks passed
@steipete
steipete deleted the deslop/l366-packages2-simplify branch October 4, 2026 03:29
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
Simplify private package plumbing and repeated transformations while preserving public APIs, protocol shapes, lifecycle ordering and security behavior. Reuse canonical Markdown spans and llm validation; reduce memory byte/token/trigger boilerplate, internal aliases and private forwarding helpers.

Coverage-exhausted batch: 285 net production lines removed; the PR contains a READ log for all 114 production files over 200 lines. Blacksmith Testbox passed 1,343 tests in 65 files and both cycle checks reported zero. Independent review completed; the original multimodal fallback and SDK protected API were retained. Shrink the affected assertion baseline from 3 to 1. Exact-head hosted CI owns the final gate.

Land under the explicitly authorized inherited-failure exception. Final-head CI run 37172814274 has only the mock-export ratchet git ENOBUFS failure and the type-suppression inventory 18-versus-16 mismatch. Unrelated PR openclaw#164726 current run 37172830533 reproduces both exact failures in unchanged tooling/SDK test files. All remaining CI jobs passed or were intentionally skipped; Security Review reports only the same failed CI aggregate. The CJK lint correction passed independent review, AWS focused tests and lint, and both zero-cycle guards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed 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.

1 participant