Skip to content

refactor: localize single-consumer preparation and output - #180547

Merged
steipete merged 17 commits into
mainfrom
deslop/z25-95-internal-surface-20261015
Oct 22, 2026
Merged

steipete merged 17 commits into
mainfrom
deslop/z25-95-internal-surface-20261015

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Internal preparation and rendering code retains private interfaces and leaf modules used by only one production consumer.

User Impact

No intended user-visible change. Public CLI, configuration, protocol, Plugin SDK, persistence, authorization, and lazy-loading contracts remain intact.

Why This Change Was Made

Keep single-use preparation with its existing operation owner. This removes private parameter/result carriers and forwarding frames across command preparation, CLI output, push/media handling, and plugin-local delivery and speech preparation. The safe-bin aggregate now directly owns its unchanged profiles and validator, eliminating two internal leaves while preserving the aggregate's eight exports and tooling callers.

Public-entry tests retain the supported behavior. Added preservation cases cover sandbox channel/main-key selection through stored sessions, Feishu missing-scope and late partial-cleanup failures, WhatsApp escaped formatting and chunk boundaries, and secure UUID refusal with one warning. No production test-only seam is introduced.

Best-effort tradeoffs accepted

No defensive guard is removed. Private helper stack names and incidental forwarding-microtask timing are not retained contracts; actual awaited effects, security checks, cancellation, cleanup, settlement, output bytes, and ordering remain. No schema, config key, dependency, durability, permission, or public API change is included. The standalone Phase E memory backend and its machinery and tests are untouched.

Evidence

Net production LOC: 500 removed (1,826 additions / 2,326 deletions across 31 production paths, excluding tests, fixtures/support, generated files, and declarations). Tests grow by 166 net lines across six files; there are 39 paths overall. Baseline and wrapper-inventory edits only remove orphan entries.

Focused tests run serially through repository wrappers with one worker, low priority, and isolated HOME/OpenClaw/XDG state. They cover the touched preparation, provider payloads, speech factories, hooks/video, safe-bin validation, channel/account projection, config preparation and model validation, sandbox explanation, Feishu tools, scoped secret resolution/selection, CLI-output parsing, WhatsApp delivery/formatting, and UUID behavior. Native targeted types and formatting pass. Packet reviews resolve actionable findings; a max-lines finding based on raw line count was rejected because the actual rule excludes blank lines/comments and scoped lint passes without the now-unused suppression. Full-branch independent review found no actionable P0–P2 defects. Assertion safety, mock exports, wrapper/eager-import closure, and line caps pass; runtime and static cycle checks both report zero cycles.

Known local limitations are retained, not called green: Qwen typed lint has two unchanged imported StreamFn alias diagnostics, reproduced serially on the base. The suppression inventory has 13 passing cases and one inherited mismatch (expected 100, actual 103); the extra entries are in src/cron/store/job-mutations.ts, src/transcripts/library.query-budget.test-support.ts, and ui/src/pages/sessions/view.tsx. Those files, the inventory test, and its parser inputs are unchanged against the branch base. A separate max-lines suppression census reports three unchanged UI suppressions missing from its baseline; this diff adds no suppression or allowlist entry.

No local broad suite, whole-graph typecheck, build, live provider/channel, or real-device proof is claimed. Exact-head hosted CI is the broad landing gate. Active lifecycle, sandboxed-provider, runtime-pinning, and other separately owned feature work is preserved rather than absorbed.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 22, 2026 11:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T11:14:49.539737Z 979643f Draft marked ready
ℹ️ About Codex in GitHub

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

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

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

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack channel: whatsapp-web Channel integration: whatsapp-web app: web-ui App: web-ui cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu labels Oct 22, 2026
@github-actions

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: 979643fefbe72c8ef4082c9baa7eadbcf0cac5f8
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/infra/exec-safe-bin-policy-profiles.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/infra/exec-safe-bin-policy-validator.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/infra/exec-safe-bin-policy.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@steipete
steipete enabled auto-merge (squash) October 22, 2026 11:21
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR moves single-consumer preparation and rendering into existing operation owners and consolidates the safe-bin implementation.

Example: A configured safe-bin command runs wc -l.

  • Before: The aggregate delegates to separate profile and validator modules.
  • After: The aggregate owns the same profiles and validation logic, preserving the command's approval behavior.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is coherent and source inspection found no introduced defect, but supplied validation is primarily focused tests and exact-head CI remains unresolved.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; the PR reports focused preservation tests and explicitly disclaims live provider or channel verification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction removes private indirection while preserving operation ownership, public interfaces, validation, cleanup, and output.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored cleanup coherently removes private forwarding layers, with no introduced defect found; exact-head CI still has an unattributed failure.

Priority: P3
Reviewed head: 979643fefbe72c8ef4082c9baa7eadbcf0cac5f8

Before merge

  • Complete next step - Determine whether the reset and complete failures in checks-node-changed-6 are caused by this diff using comparable base evidence, then resolve any demonstrated branch-caused failure.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped-entry-point verification is supplied; the added cases are preservation tests rather than red/green bug regressions.
Agent review details

How this fits together

CLI commands, agent-output parsers, and bundled plugins prepare configuration, provider requests, notifications, and rendered output before passing them to existing execution and storage owners.

flowchart TD
  A[CLI and plugin entry points] --> B[Existing operation owners]
  B --> C[Local preparation and rendering]
  C --> D[Existing authority and validation checks]
  D --> E[Transport and storage owners]
  E --> F[Results and user output]
Loading

Technical review

Best possible solution:

Retain the behavior-preserving consolidation and land it after the failing CI scenario has an evidence-backed disposition.

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

This is a behavior-preserving refactor rather than a reported product bug; inspection found no concrete introduced failure.

Is this the best way to solve the issue?

Moving private single-consumer frames into their existing owners achieves the stated cleanup without adding a competing implementation or changing public contracts.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -500, Tests +166, Other -3. Total -337 across 39 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 31 1821 2321 -500
Tests 6 194 28 +166
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 3 -3
Total 39 2015 2352 -337

Review metrics

Metric Value Why it matters
Production versus test LOC Production +1,821/-2,321; tests +194/-28 Production shrinks by 500 lines while added tests protect distinct fallback, cleanup, selection, formatting, caching, and secure-UUID behavior.

Labels

Label changes:

  • add P3: This is internal maintenance with no intended user-visible behavior change or demonstrated urgent regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is internal maintenance with no intended user-visible behavior change or demonstrated urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

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

Workflow

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

Reviewed October 22, 2026, 7:29 AM ET / 11:29 UTC.

@steipete
steipete disabled auto-merge October 22, 2026 11:32
@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head CI completed for 979643fefbe72c8ef4082c9baa7eadbcf0cac5f8, run 39768720137 / attempt 1. This is an inherited-failure landing under the standing cleanup-campaign instruction, not a green-CI claim.

Failed job Attribution and proof
checks-node-changed-6 / 119791301706 The restart E2E complete/reset cases with child replaced: false time out in waiting-for-continuation, with calls parent,parent,child,child. The identical pair failed on independently source-bound clean main 6c00e67f5703c85f2aea88cf79f7ff702821fbb5 in Blacksmith run 39721952754 (2 failed, 3 unselected, 200.60 s), already published in the retained baseline evidence. The failed test, restart-recovery owner and Gateway work-admission owner are byte-identical from that baseline through this run’s actual main parent and tested merge. Fifteen selected determining inputs are unchanged between the historical baseline and actual main parent.
openclaw/ci-gate / 119798391781 Inspected aggregate reports only the Node core test matrix failing, caused by the leaf above. All other selected matrix summaries pass.

The latest-main classification is unknown, because its job layout has no matching job; it is not used as inheritance proof. The coordinator flake catalog and last six completed scheduled runs were checked. Historical raw replay archives were removed during their earlier authorized closeout; the durable native evidence and published report remain, and no new baseline execution is claimed here.

Actual CI checkout 51e1d25ae1572b400e06345b4326853c02063402 has ordered parents cd7b139617654304728df3cebfca4acc08e2eda2 and this exact PR head. Its tree b148aab4a6344d5237c622693a37ed0a0fd5360a was independently reconstructed with git merge-tree. Reachable lifecycle-work code has only the reviewed private release-function fold; push-web is also reachable. This is not a claim of full runtime-graph disjointness or whole-runtime equality.

Paginated census: 321 terminal checks, no pending checks; only the two failures above. Fourteen cancelled metadata auto-responses have successful replacements; no cancelled test-suite proof gap. Hosted lint/types, baseline ratchets, security-fast, and every other selected suite pass. Focused affected-module proof, native targeted types, independent review, runtime/static cycles (both zero), wrapper/import-closure checks and line caps are recorded in the PR. Local inherited diagnostics remain disclosed.

No CI rerun, synthetic commit, branch update or repush was used to chase green. The existing auto-merge request was retired through native recovery before selecting this same reviewed head for the protected inherited-failure route. No security, review, public contract, lazy-loading, or Phase E exception is requested.

@steipete
steipete merged commit 1fb7766 into main Oct 22, 2026
312 of 331 checks passed
@steipete
steipete deleted the deslop/z25-95-internal-surface-20261015 branch October 22, 2026 11:35
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

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

* refactor(slack): fold single-consumer preparation helpers

* refactor: keep private status and release frames with callers

* refactor(providers): fold private payload compatibility frames

* refactor: fold private push delivery and media parsing frames

* refactor(speech): fold private provider preparation frames

* refactor(cli): fold hook mutation and video download frames

* refactor(exec): reunite internal safe-bin policy owner

* refactor(channels): fold private account projection frames

* refactor(cli): fold private config preparation frames

* refactor(cli): localize sandbox explanation selection

* refactor(feishu): fold tool-local execution frames

* refactor(cli): fold command-secret resolver frames

* refactor(cli): localize command-secret target frames

* refactor(agents): fold CLI output parser frames

* refactor(whatsapp): localize markdown formatting frames

* refactor(cli): fold model-validation preparation frames

* refactor(uuid): fold the private warning frame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: feishu Channel integration: feishu channel: reef Channel integration: reef channel: slack Channel integration: slack channel: synology-chat channel: whatsapp-web Channel integration: whatsapp-web ci:full Keep ordinary native-locale CI selection on the next PR run. cli CLI command changes commands Command implementations docker Docker and sandbox tooling extensions: elevenlabs extensions: fish-audio Extension: fish-audio extensions: qwen extensions: venice P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts security-sensitive-changed size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant