Skip to content

refactor: reuse existing owners across measured consumer clones - #178116

Merged
steipete merged 2 commits into
mainfrom
deslop/z33-33-existing-owner-consumers-20261015
Oct 20, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z33-33-existing-owner-consumers-20261015

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Measured clone families still repeat filesystem missing-path policy, FIFO tail bookkeeping, validation projections, plugin database-root discovery, and bounded-cache eviction. Private annotations also repeat their owning contracts.

User Impact

No intended user-visible change. Existing public configuration, protocol, persisted data, SDK surface, authorization, ordinary shutdown settlement, and durability remain unchanged.

Why This Change Was Made

Delegate to the existing strict missing-path, path-existence, keyed-queue, and collection owners. Share decision criterion validation and plugin-owned resource traversal beside their existing consumers. Keep endpoint-specific validation, ordering, and error policies at the same boundaries; derive private types from the existing authoritative types. Team Reports shares its eight numeric JSON projections locally, while the existing SQL helper remains the engine owner.

This is the disjoint consumer/owner area split accompanying #178019: 72 paths including the shrink-only assertion baseline, 65 production paths, 398 net production lines removed, with 145 net test/support lines added. The original 537-line, 116-path batch was split to stay below the campaign's 80-path CI-attribution limit. Most of the original Map area is now parked after an inconclusive CI replay; its old 139-line reduction is not counted as landed savings. The repaired retained Map fragment removes only three lines, making the two current candidates 401 net production lines, not 537. No core-private or cross-plugin imports are added; plugin reuse uses existing SDK contracts only.

The credential queue retains fresh main's WorkerTaskPool, access/schema leases, live-authority checks, error hydration, and settlement. Discord retains main's removal of the test-only clock injection. The Phase E standalone memory backend, factory, registry, expiry, federation, and tests are untouched.

Best-effort tradeoffs accepted

  • Exact promise microtask counts are not a contract; FIFO, rejection healing, unrelated-key concurrency, and draining remain protected by the existing queue owner and consumer tests. No security or settlement guard is removed.
  • Buzz's former truthiness check would retain an oversized cache if an invalid empty-string identifier were inserted. Valid Nostr identifiers are nonempty; the existing pruning owner now evicts that invalid key normally. The cache bounds and replay checks remain. The source checks originated in feat(channels): configure mentions in bot-created threads #157713 and fix(buzz): reconnect silently skips retained inbound messages #116925; this is not a claim that their replay/mention fixes were hypothetical or are being removed.

Evidence

Independent full-cut review completed with no actionable P0-P2 findings. Earlier source-bound focused consumer proof is retained for the byte-identical accumulator paths, including structured-output, tool-authority, session-override and prompt-prefix stability; fresh qualification covers the changed credential owner and six plugin additions. Fresh native types (93 explicit roots), focused typed/syntax lint, and formatting passed. All 22 selected test files ran serially: 185 cases passed and one Buzz socket-presence case exceeded its existing 15-second timeout, reporting about 24 seconds elapsed. One bounded focused head replay reproduced that timeout. The serial selected-case comparison on clean main a876cbba56de9bcc623d1df607664df685ff62da also exceeded the same 15-second deadline, reporting 26,011 milliseconds elapsed. Both selected replays filtered the other five cases; no authored skip was added. These local timeouts remain investigated and unresolved under host load, not causal proof of an inherited or PR-created product defect, and no timeout or assertion was changed. Team Reports conformance and read-budget cases, all nine avatar cases, and all credential/queue contracts passed. Runtime and static cycle checks both reported zero; the staged changed-check planner dry run passed. All current source hashes match the retained receipts. No local passing-test aggregate is claimed.

The transcript test-only SQL observation repair captures expanded SQL before native statement disposal, preserving the same exact query counts and index-plan assertions. Its original finalized-statement error reproduced on clean main; the repaired selected cases passed. No assertion, timeout, retry, skip, suppression, or baseline is weakened.

PR CI on the exact head is the broad integration and PostgreSQL parity proof. No local broad suite, build, whole-graph typecheck, real Gateway state, or remote lease was used.

Initial hosted run 39376919246 identified one cleanup bookkeeping omission: four removed assertion counts needed the matching shrink-only edit in config/assertion-safety-baseline.txt. That correction reduces allowances by five and introduces none. The production source remains unchanged from the reviewed candidate. Independent review of the correction found no actionable P0-P2 issue; the assertion-safety guard and fresh 14-case suppression audit both passed.

The same run's checks-node-changed-compact-small-4 failed the unchanged bundled-catalog test with typesafe/typesafe: Error: Missing modelCatalog.providers.typesafe.baseUrl. Scheduled main run 39375515792, job 118472955176, reports the exact same error. The actual PR checkout d5f835a898179abe5c773931e8df692f243463e0 has ordered parents abf93bd5a1c5b39a3ff95365bc76270ec318b2e4 and the original PR head; its determining test, provider-catalog owner, normalizer, catalog types, SDK barrel, and Typesafe manifest are byte-identical to that baseline. The assertion-baseline failure is ours; the matching catalog failure is inherited. Neither failed result is relabeled green, and repaired-head CI remains required.

@clawsweeper

clawsweeper Bot commented Oct 20, 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 20, 2026 05:49
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: telegram Channel integration: telegram gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling extensions: acpx channel: buzz extensions: browser plugin: team-reports labels Oct 20, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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-20T05:54:12.905399Z c7685dd 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.

@github-actions

github-actions Bot commented Oct 20, 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: 079ada2adc79773d24f21136581a63e7128b3c59
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles/session-override.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/harness/tool-authority.runtime.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/plugin-model-catalog-credentials.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/server/ws-connection/connect-device-metadata.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/infra/client-credential-async.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/infra/client-credential-ipc.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/security/install-policy.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 added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces repeated queue bookkeeping, filesystem-error handling, cache pruning, validation, and database-root discovery with shared implementations.

Example: Two file operations target same-file while another targets other-file.

  • Before: Private admission bookkeeping preserves same-file ordering while allowing other-file to proceed.
  • After: The existing shared queue provides the same ordering and concurrency.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source changes preserve the reviewed contracts and have focused harness coverage; broad validation remains incomplete and two failed checks lack verified attribution.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied validation reports focused consumer and worker tests, without claiming a shipped-entry-point run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-approved direction removes duplicated policy without adding configuration, public SDK surface, or competing state owners.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed refactor removes duplicated implementations while preserving their existing contracts; no actionable introduced bug was found.

Priority: P3
Reviewed head: c7685ddfa5e3694e94583955885cb8c704b46bf7

Before merge

None.

Findings

None.

Agent review details

How this fits together

Core and plugin consumers pass operations and metadata through shared helpers, retaining domain authority checks before storage or transport effects.

flowchart TD
  A[Core consumers] --> C[Shared helpers]
  B[Plugin consumers] --> C
  C --> D[Domain authority checks]
  D --> E[Existing workers and clients]
  E --> F[Storage and transport]
Loading

Technical review

Best possible solution:

Retain the shared-owner refactor with its existing domain guards and settle the required CI results before landing.

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

This PR proposes a refactor rather than a reported runtime defect; source inspection supports the stated duplicated implementations.

Is this the best way to solve the issue?

Reusing the established helpers is appropriate: the changed consumers remove their old implementations while retaining endpoint-specific policy and lifecycle ownership.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -398, Tests +145. Total -253 across 71 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 65 506 904 -398
Tests 6 170 25 +145
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 71 676 929 -253

Review metrics

Metric Value Why it matters
Production versus test/support delta Production +506/-904; tests/support +170/-25. The production reduction removes repeated implementations; supporting changes protect ordering, provider-specific discovery, catalog filtering, and existing SQL observations.

Labels

Label changes:

  • add P3: Behavior-preserving internal cleanup with no intended user-visible change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: Behavior-preserving internal cleanup with no intended user-visible change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Establish base-versus-head attribution for the TypeSafe Doctor and baseline-ratchet failures, and evaluate the remaining exact-head CI results.

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 20, 2026, 2:07 AM ET / 06:07 UTC.

@steipete
steipete merged commit b1ee9a7 into main Oct 20, 2026
191 checks passed
@steipete
steipete deleted the deslop/z33-33-existing-owner-consumers-20261015 branch October 20, 2026 07:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 20, 2026
PR #178192 moved terminal recovery onto the aggregate retry policy. Keep its two component helpers private and exercise the same expectations through that public policy. PR #178116 replaced the Telegram group-config alias with the canonical resolver type; remove the unused alias.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…claw#178116)

* refactor: reuse existing owners for measured consumer clones

* chore(safety): shrink removed assertion allowances
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
PR openclaw#178192 moved terminal recovery onto the aggregate retry policy. Keep its two component helpers private and exercise the same expectations through that public policy. PR openclaw#178116 replaced the Telegram group-config alias with the canonical resolver type; remove the unused alias.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: buzz channel: discord Channel integration: discord channel: telegram Channel integration: telegram cli CLI command changes commands Command implementations extensions: acpx extensions: browser gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: team-reports 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