Skip to content

refactor: deslop channels core and mid-size core dirs - #161029

Merged
steipete merged 3 commits into
mainfrom
deslop/l160-channels-midcore
Sep 29, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/l160-channels-midcore

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Maintainer-requested cleanup of repeated projections, forwarding layers, duplicate local types, and narrating comments across channel core and the mid-size core directories.

User Impact

No intended behavior change. Channel transport/action shapes, security decisions and fail-closed defaults, provider request/wire formats, persisted Fleet/plugin state, and status text remain unchanged. No migration or operator action is required. src/audit and src/cron are untouched.

Why This Change Was Made

The final diff removes 1,000 net production lines (+564/-1,564). The two migrated Fleet tests retain every case and assertion (net +4 test lines); the assertion baseline only shrinks. Recent merged work since September 18 and #159811 were inspected first, and overlapping cleanup that landed during proof was retained at rebase.

  • Channels: share activation diagnostics and send-result projection; reuse accessor-safe reads and canonical setup/registration types; remove redundant normalizer/spawn forwarding, dead cache data, and local helper scaffolding.
  • Claws: project partial-install and validation failures from the owning operation; derive Doctor's expected cron fields from the existing Gateway request builder.
  • Meetings: share browser audio-source restoration between status and leave; remove private Chrome/audio forwarding and duplicate process/preparation/consult contracts.
  • Media/TTS: reuse media capability/output and entry-option types, simplify file/CLI/polling paths, and replace the voice-model cast with the canonical record coercer.
  • Fleet/plugin state/transcripts: call the existing container argument builder directly, carry prepared namespace facts through storage helpers, derive journal range types from their owner, and share identical startup failure handling.
  • Security/status/system agent: share diagnostic/remediation projection, use canonical deduplication and lazy loading, reuse the prepared model-selection updater, and consolidate identical setup guidance dispatch.
  • Remove comments that merely repeat declarations while retaining lifecycle, authority, compatibility, and non-obvious behavior explanations.

Fixes Found Along the Way

No confirmed pre-existing product defect or flaky test was found in the lane. Hosted architecture CI caught two type-import cycles introduced by candidate type reuse. Both candidates were removed; their original declarations remain local. Two map-spread lint findings were fixed by retaining the original callback projection form. No assertions, timeouts, or coverage were weakened.

Evidence

Final head: 2b7da4dc2925b2d89f73ac74df50043f07c4b1dd. Rebase base: 2993f78605b1b537042753d56e15e7ee0febe6fa. All execution used Blacksmith Testbox; source hashes were verified before execution.

Refreshed after conflict resolution, on tbx_01m3p5qwc5c0cycd8a9tkmzhtc (controller run):

  • node scripts/check-changed.mjs --base origin/main --head HEAD: passed, 2,166 seconds, including production/test typechecks, lint, dead exports, boundary and authority guards.
  • pnpm check:architecture: passed, 175 seconds; zero runtime and Madge cycles.
  • pnpm build: passed, 388 seconds.
  • Full src/channels, src/security, src/media-understanding, src/tts, and src/plugin-state suites: 376 files / 3,992 tests passed; 1 platform file / 5 tests skipped; 460 seconds.
  • All import-boundary suites, including src/infra/fs-safe-import-boundary.test.ts: 8 shards passed, 79 seconds.
  • Source-derived security/status differential proof against the new base: 8,363 comparisons passed, including branch precedence/defaults, finding order/identity, exact external wrapper bytes, and optional status fields. Environmental adapters are synthetic; full directory tests also passed.
  • Fresh isolated Codex autoreview at P0–P2: scoped-clean. git diff --check: passed.

The initial complete campaign also passed every touched directory plus Talk siblings (593 files / 6,750 tests; 7 platform skips), and all 132 pnpm test:extensions shards in 4,257 seconds, including meeting audio/script and channel setup consumers. The rebase retained the newly landed overlapping cleanup and removed duplicate parts of this patch; unchanged areas retain that proof. Initial full proof lease: tbx_01m3nf8nsz3qk2edj6mvc94tx3 (run).

Changed test cost on Testbox with --maxWorkers=1: pnpm test src/fleet/cell-profile.test.ts passed 65 tests in 2 seconds wall; pnpm test src/fleet/containers.runtime.test.ts passed 35 tests in 20 seconds including cold runtime preparation. No permanent tests were added.

Inherited main CI failures

Final-head CI run 36554056015 tested merge 2950b38d2d163e4f0f910f56e0497656a1fa12af, whose parents are main 88e0f4ac3acc0539ff05b144d8a452ebde3c4e9e and this PR's exact head 2b7da4dc2925b2d89f73ac74df50043f07c4b1dd. The completed job census is 77 successful, 21 skipped, 57 cancelled, and two failed jobs (the publication shard and the derived CI gate). One cancelled shard had already recorded a separate failure; it is attributed explicitly below, not treated as passing coverage.

  • checks-node-changed-compact-small-15 (job 109359477483): src/agents/subagents/registry/subagent-control.publication.test.ts, “revalidates the session after held publication preparation permits retirement,” throws SESSION_DELIVERY_GENERATION_UNAVAILABLE. The same test, error code, and stack fail in scheduled main run 36550256341, job 109346582592, head a49e76e1862516e566de2de56b5df99b60c45756. The test removes its session during publication preparation; the unchanged generation owner rejects the now-unavailable row, while the unchanged cancellation owner catches only a revoked generation.
  • checks-node-changed-compact-small-3 (job 109359477465, ultimately cancelled): seven src/gateway/server.incognito-lifetime.test.ts assertions fail because expiry cleanup returns ok: false or leaves the session row present. The identical seven cases and assertions fail on the same scheduled main run in job 109346582369: 24-hour expiry, another Gateway's publication, all three sibling creation-stamp variants, and both cleanup-retry variants.

Independent evidence comes from completed main job annotations, compared against the retained full PR job logs. Both failing tests and their publication/generation or Incognito expiry/deletion/lifecycle owners are byte-identical between the independent main head and the tested PR merge. This PR changes none of those owners, session storage/admission, the test configuration, or the failure branches. The Incognito fixtures exercise session deletion with synthetic state; changed channel send/setup flows and plugin-state operations do not participate in these failing assertions. The original failure monitor names job 109359477483 and cancels the run; the CI gate fails downstream. Cancelled coverage remains incomplete hosted coverage, with the completed lane Testbox proof above retained separately.

Current-head architecture, security-fast, all selected Security High checks, ClawSweeper review, security-sensitive approval, and dependency review passed. No CI rerun or proof-only push was requested.

Earlier head:

Prior corrected head 7fa68ac79a1133adb2796998719a2f84b9cf6f7c passed architecture and security/dependency approval, then failed CI run 36537630985, job checks-node-compact-small-3, on two test/scripts/plugin-sdk-surface-report.test.ts assertions: budgets 4,591 exports / 2,695 callables versus actual 4,594 / 2,698. Fail-fast cancelled remaining jobs and the derived CI gate failed.

The identical assertions/counts fail on scheduled main run 36538101258, head d2811224dc0deedce837aef252d97d624f8c4425, job checks-node-compact-small-36. Upstream b4ae783fbfd added three public callable exports to src/plugin-sdk/agent-harness-runtime.ts without updating the budget. The tested merge parent and main proof contain that commit. This PR changes neither those exports/implementation owners nor the surface-report script or failing test.

Peter explicitly authorized exact-head admin squash merge when independently proved inherited main failures are the only CI failures and lane Testbox proof passes. The exact-head REST squash merge succeeded as f8f3bd5468458768bd76c60d672e317fb2b30e7c on September 29; merge ancestry on origin/main was verified. The inherited main failures remain coordinator-owned; no CI reruns or proof-only branch refreshes were requested.

All task leases have been stopped. Additional completed proof leases: tbx_01m3nnk9nx3v8ga005945xkeww (typechecks/test costs; exposed repaired lint), tbx_01m3ntsm9qh6scnx1rggwpp55v (full corrected gate), and tbx_01m3nzhzg5dp7kw924qz15ctdd (type-cycle correction). tbx_01m3nd1bve75ramdgn5kfv95p7 expired before proof. Slow snapshot preparation was handled with 90-minute idle leases; no local test/check/build execution or protected staging cleanup was used.

@clawsweeper

clawsweeper Bot commented Sep 29, 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 Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 2b7da4dc2925b2d89f73ac74df50043f07c4b1dd
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/security/audit-channel.ts: Controls product security checks or trust decisions. Check whether the change weakens detection, protection, or remediation.
  • src/security/audit-extra.sync.ts: Controls product security checks or trust decisions. Check whether the change weakens detection, protection, or remediation.
  • src/security/audit.ts: Controls product security checks or trust decisions. Check whether the change weakens detection, protection, or remediation.
  • src/security/external-content.ts: Controls product security checks or trust decisions. Check whether the change weakens detection, protection, or remediation.

Carefully review these changes before merging.

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 6:23 AM ET / 10:23 UTC (Revision 4).

ClawSweeper review

What this changes

The branch consolidates channel, Claw, meeting, media, plugin-state, security, and status helpers, removes redundant comments, and updates Fleet tests for a shared container argument builder.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: this cleanup remains distinct from current main. The earlier security-audit conflict is resolved, and source review found no definite introduced bug. The required existing-install upgrade proof remains outstanding.

Priority: P3
Reviewed head: 2b7da4dc2925b2d89f73ac74df50043f07c4b1dd

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The cleanup is coherent and extensively checked as reported, but existing-install upgrade behavior remains unverified.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The maintainer-authored internal refactor is exempt from the external contributor proof gate. Its body reports Testbox checks of changed paths, but supplies no published-updater observation for Doctor and plugin activation; inspection found no stored-data contract change.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored internal refactor is exempt from the external contributor proof gate. Its body reports Testbox checks of changed paths, but supplies no published-updater observation for Doctor and plugin activation; inspection found no stored-data contract change.
Evidence reviewed 9 items Distinct work remains: Current main lacks the shared meeting-audio source, and its Claw Doctor and channel setup code still differs from this branch.
Prior audit conflict resolved: The pinned base has no security-file changes since the merge base, and the recorded test merge has the pinned base followed by this PR head as parents. The latest fetched main adds no changes in the reviewed owner trees.
Pinned test-merge parentage: The recorded test merge names 88e0f4a as its first parent and 2b7da4d as its second. Its full tree could not be read locally because a promised Git object was unavailable.
Findings None None.
Security None None.

How this fits together

Channel messages pass through access decisions and delivery before reaching the Gateway and agents. Plugin setup, Claw schedules, meeting media, and stored plugin state feed that runtime, while security and status diagnostics report on it.

flowchart LR
A[Channel messages] --> B[Access and delivery]
C[Plugin setup] --> B
B --> D[Gateway and agents]
E[Claw schedules] --> D
F[Meeting media and plugin state] --> D
D --> G[Security and health reports]
Loading

Before merge

  • Resolve merge risk (P1) - The required published-driver × candidate upgrade cell is absent for the changed Claw Doctor and channel plugin paths, leaving behavior on an existing installation unverified.
  • Complete next step (P2) - Record a published-driver × candidate upgrade run using existing Claw cron and channel plugin state, and confirm Doctor health and plugin activation.
  • 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: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify an existing installation (recommended)
    Record a published-updater to candidate upgrade with existing Claw cron and channel plugin state, then check Doctor health and plugin activation.

Technical review

Best possible solution:

Keep the consolidated owners while demonstrating unchanged Claw health and channel activation after an upgrade driven by a published updater.

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

Not applicable: this refactor reports no product defect to reproduce. The review compared its changed paths with pinned source and current main.

Is this the best way to solve the issue?

Yes: the branch generally reuses existing owners instead of adding parallel behavior. Its existing-install behavior still needs the required upgrade check.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5d6f464a1cb3.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored internal refactor is exempt from the external contributor proof gate. Its body reports Testbox checks of changed paths, but supplies no published-updater observation for Doctor and plugin activation; inspection found no stored-data contract change.
  • remove merge-risk: 🚨 security-boundary: Current PR review merge-risk labels are merge-risk: 🚨 compatibility.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change.
  • merge-risk: 🚨 compatibility: Changed Doctor and channel plugin paths still lack the repository-required proof using an existing installation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored internal refactor is exempt from the external contributor proof gate. Its body reports Testbox checks of changed paths, but supplies no published-updater observation for Doctor and plugin activation; inspection found no stored-data contract change.

Evidence

What I checked:

  • Distinct work remains: Current main lacks the shared meeting-audio source, and its Claw Doctor and channel setup code still differs from this branch. (src/meeting-bot/audio-bridge-source.ts:2, 2b7da4dc2925)
  • Prior audit conflict resolved: The pinned base has no security-file changes since the merge base, and the recorded test merge has the pinned base followed by this PR head as parents. The latest fetched main adds no changes in the reviewed owner trees. (88e0f4ac3acc)
  • Pinned test-merge parentage: The recorded test merge names 88e0f4a as its first parent and 2b7da4d as its second. Its full tree could not be read locally because a promised Git object was unavailable. (2950b38d2d16)
  • Security-sensitive source comparison: Channel audit still deduplicates by the same finding fields in first-seen order. The external-content wrapper still uses a fresh random marker ID and the same start and end markers; no new authority-bearing value or final-effect path was found in these edits. (src/security/audit-channel.ts:577, 2b7da4dc2925)
  • Doctor upgrade boundary: Claw Doctor now derives its expected cron execution fields from the Gateway request builder, so existing scheduled state is relevant to upgrade verification. (src/claws/doctor.ts:60, 2b7da4dc2925)
  • Repository upgrade policy: The applicable repository policy calls for a published-driver × candidate proof cell for changes touching Doctor or plugin loading. The PR body reports Testbox source checks and suites, but no such upgrade cell. (AGENTS.md:84, 2b7da4dc2925)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the repository-required published-driver × candidate upgrade result for existing Claw cron and channel plugin state.

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-09-29T06:54:00.012Z sha ffef289 :: blocked before merge. :: none
  • reviewed 2026-09-29T07:45:35.449Z sha 7fa68ac :: blocked before merge. :: none
  • reviewed 2026-09-29T08:31:39.663Z sha 7fa68ac :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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 Sep 29, 2026
@steipete
steipete force-pushed the deslop/l160-channels-midcore branch from 7fa68ac to 2b7da4d Compare September 29, 2026 10:11
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 29, 2026
@steipete
steipete merged commit f8f3bd5 into main Sep 29, 2026
168 of 228 checks passed
@steipete
steipete deleted the deslop/l160-channels-midcore branch September 29, 2026 10:42
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
* refactor: deslop channels core and mid-size core dirs

* fix(types): avoid cyclic channel and media imports

* refactor(channels): simplify remaining helper scaffolding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fleet merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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