Skip to content

refactor: consolidate one-consumer internal surfaces - #180786

Merged
steipete merged 30 commits into
mainfrom
deslop/z25-100-owner-locality-20261015
Oct 22, 2026
Merged

steipete merged 30 commits into
mainfrom
deslop/z25-100-owner-locality-20261015

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Single-consumer internal modules and forwarding frames expose APIs with no independent owner and obscure the code that actually uses them.

What Changed

Place provider registration/catalog projection, bounded directory-result preparation, IMAP prompts, onboarding presentation and CLI command construction in their existing production owners. Retire the private Foundry factory module and IMAP prompt module. Their meaningful assertions now enter existing public owners; no test-only production seam is added.

Public CLI, SDK, protocol, configuration, persisted-data and user-visible contracts remain intact. Dynamic-import boundaries, security checks and the standalone session-memory backend are unchanged.

Net production LOC: 159 removed (+720 / -879), across 17 production paths; 21 total changed paths. Test/support delta: +19 lines. Counts exclude tests, support, fixtures, generated files, declarations and tooling metadata; relocated bodies are not deletion credit.

Best-effort tradeoffs accepted

  • Session-cleanup presentation consumes the resolved path directly instead of spreading unused internal fields into a throwaway summary. No incident or contract requires getter/enumeration effects on hypothetical non-record inputs.
  • No security, authorization, durability, bounded-resource, FIFO or settlement guard is removed.

Evidence

Each retained implementation packet passed focused owner/consumer tests, targeted native types, typed lint, formatting, diff inspection and independent P0–P2 review. The IMAP source-size assertion passed through real protocol parsing on unchanged production before its private seam retired. Foundry factory assertions now run through real provider registration. No suppression, timeout, retry or skip was added.

Recovery from CI run 39818723583: three update-runtime jobs, the Gateway exec-completion job, and the real-Gateway managed-media recap job failed. Local update head/base runs matched each other but not Linux CI. Both Gateway cases passed on both head and base; that does not establish a fix. The UI recap timeout did not match the older registered same-case failures; all 12 real-Gateway jobs in the six latest completed scheduled runs passed. Local browser E2E is outside the campaign proof budget.

Under the campaign's reachable-slice rule, remove every changed production file reachable from those failed flows, not the whole PR: the union of head/base Gateway graphs plus the browser application graph. Restore their obsolete test migrations and inventory rows. Every restored production blob equals both base 068c4d8 and fetched main b2094b6. The original 500-line candidate is preserved on the pushed parked branch deslop/z25-parked-ci100-gateway-20261015, without a PR; the 341-line dropped slice still needs attributable platform proof before recovery. This smaller PR is the mandatory CI-attribution split, not an exhaustion claim.

Focused restoration proof: runner/fork/prefix/import-boundary and CLI recovery/settlement/diagnostics passed 63 cases in nine files; targeted native types and typed lint passed. The six UI restorations passed 106 cases in seven focused files, targeted native types, typed lint and independent P0–P2 review. Runtime and static cycles are zero; assertion-safety, mock-export, wrapper/eager-import closure and line-cap gates passed. The required suppression suite has 13 passing cases and an investigated inherited inventory mismatch (103 versus 100), naming unchanged cron, transcript test-support and UI sessions files; no allowance was changed.

Exact-head hosted CI remains the broad landing gate. No broad local suite, build, E2E, whole-graph typecheck or live-provider/device proof is claimed.

@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.

@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-22T17:29:53.871005Z 80e7fa5 New commits
ℹ️ 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.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

Current revision: 80e7fa554279a3d737b28e1f80ecb3f5123fb7e3

This PR no longer changes files in the maintainer security-review tier.

Separate CODEOWNERS requirements still apply to security policy and enforcement files.

@steipete
steipete enabled auto-merge (squash) October 22, 2026 16:44
@steipete
steipete disabled auto-merge October 22, 2026 16:52
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR folds private single-consumer helpers and modules into their existing production owners while retaining public contracts.

Example: An execution allowlist contains /tmp/a?b.

  • Before: /tmp/acb matches, while /tmp/a/b does not.
  • After: The same results come through matchAllowlist after its private matcher moves into the command-resolution owner.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The inspected implementation is coherent and preserves established contracts; supporting evidence is focused test reporting rather than demonstrated shipped-entry-point behavior.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; the body reports focused owner and consumer tests, including real IMAP protocol parsing, and explicitly claims no live-provider or browser proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible failure is claimed; private forwarding surfaces make production ownership harder to follow.
Reason: The maintainer has approved the direction, and the diff removes private handoffs while preserving the public facade, checks, and established behavior.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored PR open: the consolidation is coherent, and no actionable introduced defect was found; GitHub currently reports a merge conflict.

Priority: P3
Reviewed head: f4185931a31fd6a776508722a7b0661f391dc7c8

Before merge

  • Complete next step - Resolve the reported merge conflict, preserve current-main behavior, and rerun checks affected by the resolution.

Findings

None.

Agent review details

How this fits together

CLI commands, agent events, provider requests, and UI projections enter existing owners that prepare results, enforce established checks, and return unchanged public output.

flowchart TD
  A[CLI and Gateway inputs] --> B[Existing runtime owners]
  C[Plugin requests] --> D[Plugin execution owners]
  E[UI events and catalogs] --> F[Plain TypeScript projections]
  B --> G[Existing checks and effects]
  D --> G
  F --> H[User presentation]
  G --> H
Loading

Technical review

Best possible solution:

Land the consolidation through the existing owners after resolving the reported conflict while preserving current-main contracts.

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

This is a behavior-preserving refactor, so there is no reported user bug to reproduce; no target code was executed during review.

Is this the best way to solve the issue?

Moving single-consumer implementations into their existing owners completes the cutovers without adding competing state or public surfaces.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7f4cbc1e2a1a.

Provenance checked

  • Execution allowlist matching keeps the original intent (Infra: tighten exec allowlist glob matching #43798: Preserve POSIX case sensitivity and prevent question-mark wildcards from crossing path separators.)
  • Foundry image-provider implementation keeps the original intent (d0a8408: Add MAI image generation; subsequent changes retained deployment validation, refreshed authentication, request deadlines, and bounded response reads.)
  • Interactive update reporting keeps the original intent (fix: keep failed update report uploads in the CLI #156633: Keep completed diagnostics and prepared reports available across retryable or uncertain submissions without duplicating publication.)
  • Embedded-agent facade and internal barrel keeps the original intent (bb46b79: Internalize the runtime while retaining an embedded-agent facade; the PR removes the intermediary and keeps the facade bound to canonical implementations.)
  • Provider request handoffs keeps the original intent (refactor: fold private request handoffs into their owners #178251: Keep request preparation with its existing owner while preserving validation, authorization, cancellation, response bounds, and recovery.)
  • Diagnostic preparation and steering frame timing changes intended behavior with a stated reason (unknown: Available commit history did not establish a separate snapshot or microtask-count contract; extended content history was limited by missing blobs, and the maintainer explicitly records the narrow timing tradeoffs.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff consolidates private implementations, redirects consumers, and removes obsolete inventory entries; a reference search found no remaining imports of the six retired modules. (f4185931a31f)
  • Execution security contract retained: The matcher retains case handling, separator-bounded wildcards, target normalization, and its bounded regex cache. The hardening rationale in Infra: tighten exec allowlist glob matching #43798 remains respected, and migrated tests enter matchAllowlist. (src/infra/exec-command-resolution.ts:75, f4185931a31f)
  • Reporting recovery retained: The folded reporting loop retains explicit confirmation, prepared report reuse, status-only reconciliation, and browser-choice retirement established by fix: keep failed update report uploads in the CLI #156633. (src/cli/update-cli/update-command-triage.ts:187, f4185931a31f)
  • Current main still has the intermediary: Pinned current-main source retains the internal runner barrel and public facade forwarding through it, so this PR's central consolidation is not already implemented there. (src/agents/embedded-agent-runner.ts:1, 7f4cbc1e2a1a)
  • Accepted direction and tradeoffs: The maintainer-authored body explicitly accepts diagnostic input timing, removal of unused summary spreading, redundant string normalization, and a private steering microtask hop; the inspected hunks preserve the substantive checks surrounding them. (f4185931a31f)
  • Current merge and gate state: Live REST metadata reports mergeable=false and mergeable_state=dirty for the reviewed head; openclaw/ci-gate remains pending, while dependency review and sensitive-change authority checks succeeded. (f4185931a31f)

PR surface

Source -501, Tests +22, Other -2. Total -481 across 73 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 56 1584 2085 -501
Tests 15 79 57 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 2 -2
Total 73 1663 2144 -481

Labels

Label changes:

  • add P3: This is internal cleanup 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 cleanup 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, 12:56 PM ET / 16:56 UTC.

@steipete
steipete force-pushed the deslop/z25-100-owner-locality-20261015 branch from f418593 to cb61c9b Compare October 22, 2026 16:59
@openclaw-barnacle openclaw-barnacle Bot removed app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling labels Oct 22, 2026
@steipete
steipete merged commit ab7663d into main Oct 22, 2026
143 of 148 checks passed
@steipete
steipete deleted the deslop/z25-100-owner-locality-20261015 branch October 22, 2026 18:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
* refactor(xai): localize video preparation and poll frames

* refactor(agents): rank recovery suggestions at their sole caller

* refactor(onboarding): keep browser handoff frames in their owner

* refactor(infra): keep allowlist matching in its sole owner

* refactor(clickclack): prepare activity text in its sole handlers

* refactor(agents): keep nested lifecycle in its subscriber

* refactor(foundry): register image provider in its sole owner

* refactor(agents): prepare diagnostic records at their owner

* refactor(file-transfer): prepare directory results at execution

* refactor(ui): prepare Activity previews in the reducer

* refactor(cli): render dry-run failures at their public entry

* refactor(ui): keep model display preparation with its callers

* refactor(commands): keep heartbeat and TTY preparation local

* refactor(auto-reply): prepare media notes in their projection

* refactor(infra): filter process warnings in the installed callback

* refactor(cli): keep help and display decisions in their owners

* refactor: render private profile and cleanup results at their callers

* refactor: keep avatar and model projections with their callers

* refactor(gateway): format startup summaries at their logging phase

* refactor(reply): keep chunk planning in its public owners

* refactor: localize steering and cold status preparation

* refactor(providers): localize catalog projection callbacks

* refactor: localize transcript actions and attachment presentation

* refactor: localize search presence and UTF-8 phases

* refactor(cli): fold JSON mode frames into output detection

* refactor(imap): own email prompt at admitted dispatch

* refactor(agents): retire internal runner re-export barrel

* refactor(cli): own failure reporting inside update triage

* refactor: isolate unproven gateway cleanup slice

* refactor: isolate unproven UI cleanup slice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant