Skip to content

refactor: bind private core seams to serving owners - #176657

Merged
steipete merged 3 commits into
mainfrom
deslop/z19-64-core-private-owners-20261015
Oct 19, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/z19-64-core-private-owners-20261015

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Core tool construction still carries private implementation selectors supplied only by tests, plus forwarding protocols whose only consumer is their concrete owner. That duplicates the production path and lets fixtures bypass the module boundaries used in serving assembly.

What changed

  • Call the canonical message config, secret-preflight, and action owners directly. Migrate fixtures to scoped, namespace-preserving module mocks or the real ref-free preflight; retain current-source authority, account selection, idempotency, receipts, and scheduled-write settlement.
  • Use the single runtime auth-row cache and its actual numeric mutation revision, plus the real cache-trace environment/writer.
  • Move remote pinned-target resolution into its existing concrete bridge without changing containment, writable/protected-path, canonical pin, no-follow, abort, or settlement checks.
  • Remove the constant PDF auto-discovery selector and planner-only deps plumbing. Pass an already-captured fallback config as data rather than a one-member callback bag.
  • Keep sessions_send registration in the existing hosted-conversation assembly, retaining the same prepared config, tool order, durable run key, requester identity, and embedded-host exclusion.

This is the core-area split of a wider private-owner cleanup under the campaign's area-split rule. The extension area is separate. Current main's session-controller injection cutover is preserved; superseded runner hunks are deliberately omitted. No public SDK exports, protocol/config/CLI contracts, dependencies, persisted schemas, security guards, or Phase E session-memory code change.

Best-effort tradeoffs accepted

Size

50 paths; 99 net production lines removed, 81 net test/support lines removed, 180 overall lines removed against main 91e371698fe01519a2c225dc3e9877f14692742b. Moved bodies are counted on both sides, not as gross deletions. The four-file exec resolver slice is parked and restored exactly to base, so its unrelated OpenGrep findings require no exception here. The overlapping three-file nested-item repair is dropped in favor of main's #176658; no credit is claimed for that fix.

Evidence

Final signed head c71b30d7ad454f06c0768951ce5319f43a2b3fbd has completed successful exact-head CI 39183655600; aggregate check 117847401901 succeeded. The complete paginated exact-head check-run census has no failed or running suite. Selected runtime, native typechecking, ordinary lint, architecture/boundary, baseline ratchets, PostgreSQL conformance, UI and security checks passed. CodeQL is neutral; nonselected lanes are skipped. Same-head PR metadata replacements succeeded. This is final-head hosted proof, not a claim that incomplete local runtime attempts passed. No CI rerun or green-seeking source push was used.

The coordinator-required tooling refresh rebased the original patch onto main 48c6cfe1d17aa3598c2f99d191f0eb134b07b433, producing initial signed head df495e5316f690c9745cd8c3f1676541928a0842. Its patch-identical rebase had no authored-file overlap with main's intervening changes. The repair below is new evidence and requires fresh exact-head CI.

Initial CI and repair

Previous signed repair head: 5c4fb7d875109e197073383e7b0953f321d8f6cd. Its exact CI 39181502103 found three new failures in our added held-item assertions. This is an owned failure, not inherited proof: main independently landed #176658 (c5c558d96d4), settling semantic accounting before presentation acceptance. Rebased onto main 91e3716 for that named gate and restored all three overlapping repair files byte-for-byte to main, retaining its exactly-once regression and every accepted/rejected/superseded persistence/event/effect assertion. Main owns the simpler fix; this PR no longer changes those files. Fresh final-head CI remains required.

Initial CI run 39179657055 exposed two real failures: checks-node-changed-compact-small-5 (117829843342), cancellation-ignoring work across awaited preparation, and checks-node-changed-compact-small-9 (117829843385), abort-ignoring work after snapshot expiry. Both retained assertions found one active item after completion instead of zero. The latter case also fails scheduled main 39176649118 / 117820741610 and 39172446197 / 117808338668; neither assertion was weakened.

Source tracing found the same cause in main's #176403: item accounting lived inside the deliberately gated presentation callback. Declining presentation or throwing during acceptance skipped that accounting. The initial local repair is now superseded by main's #176658, which separates completed semantic accounting from accepted presentation. Its original focused proof was 42/42 under both Node and pinned Bun; that is main's evidence, not a local pass for our final branch.

The initial OpenGrep finding (39179656833 / 117829496993) concerned unchanged Git-parameter reads, also present in #167443's hosted scan. Its entire four-file exec cleanup slice was parked and restored exactly to base rather than requesting a scan exception. The initial PR-body heading failure was corrected in the body; same-head replacement 117829498470 succeeded. No CI job was rerun.

Historical superseded-repair proof: native checking passed in 24.580s and 30.520s, ordinary typed lint passed in 138.060s, formatting in 2.341s, and all 14 suppression tests in 73.845s; independent review was scoped-clean (0.96). These do not erase its later hosted assertion failures.

After named-gate integration, frozen warm-store installation passed in 43.180s; the first targeted typecheck exposed only missing fast-uri from the pre-rebase install. With the current pinned dependencies installed, targeted native types passed in 24.284s. All 14 fresh suppression tests passed in 68.204s; three-file formatting passed in 0.668s. Fresh independent P0–P2 rollback review was scoped-clean, with no actionable findings (0.96). The normal signed commit hook passed in 85ms.

The focused append-boundary runtime attempt was incomplete at a cold compiled-worker prerequisite and was stopped after 111.607s under the local build restriction; all seven owned descendants drained. No case verdict, retry, bypass, skip, or timeout change is claimed. Ordinary three-file typed lint passed in 129.424s. Current signed reconciliation head is c71b30d7ad454f06c0768951ce5319f43a2b3fbd; exact final-head hosted CI supplies broad runtime and cycle proof.

Initial-head proof retained for unchanged inputs:

  • Refreshed frozen install passed (111.548s) using the previous task-owned store. An initial cold-store attempt was interrupted after 760.654s; that setup-cache error is not a product/test failure or a passing install.
  • All 54 changed roots and their imported graph passed native tsrs checking (40.523s), through the repository wrapper at nice -n 10; no fallback or whole-graph command.
  • Clean source tree and whitespace check passed; retired private symbols have no Plugin SDK/package export.
  • Fresh focused suppression suite passed all 14 tests (84.371s wall; 67.94s canonical shard), also reduced-priority and serial. No baseline or suppression changes.
  • Canonical changed-file check selection passed in explicit 54-path dry-run mode (79.671s); planned broad checks were not executed locally.

Retained patch-identical prior-base evidence:

  • Isolated frozen dependency install passed (343.651s).
  • Targeted semantic typecheck of all 54 changed roots and their imported graph passed (189.219s).
  • Changed-file formatting passed (4.215s); whitespace validation passed.
  • Independent P0–P2 review passed with no actionable findings (confidence 0.87); all authored files remained frozen through final verification.
  • Targeted ordinary type-aware lint passed on 17 changed production/helper paths (437.279s), with no diagnostics.
  • Mandatory lint-suppression suite passed: 1 file, 14 tests (126.036s wall; 112.45s canonical shard).
  • Focused cache-trace/exec-target/remote-bridge runtime attempt was incomplete before assertions: the canonical runner hit a cold compiled-worker prerequisite. The task-owned run was interrupted after 158.598s to respect the campaign's local build budget; all owned descendants drained. No product failure, passing runtime result, or baseline attribution is claimed. No retry, bypass, skip, or timeout change was used.
  • Broad runtime/static-cycle gates belong to exact-head hosted CI under the coordinator's tightened CPU budget. The local worker cache contains no completed artifact, so the earlier cold preparation is not repeated or bypassed. No cycle/runtime pass is claimed locally.
  • Exact-head hosted CI is the broad/Linux proof; no build, E2E, live-provider, or device proof is claimed locally.

Review context limitation: optional unchanged command-secret modules were rejected by the review helper's sensitive-name policy. They were not renamed or copied to bypass it. All authored changes remain in review scope, with real turn, Gateway, action, inference, and bridge owner context supplied.

@clawsweeper

clawsweeper Bot commented Oct 19, 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 19, 2026
@steipete
steipete marked this pull request as ready for review October 19, 2026 00:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-19T01:09:13.988774Z c71b30d 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 19, 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: c71b30d7ad454f06c0768951ce5319f43a2b3fbd
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles/runtime-file-observation.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/runtime-persisted-rows.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/sandbox/remote-fs-bridge-pinned-frame.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/remote-fs-bridge.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes private implementation selectors and moves forwarding logic into the existing serving owners.

Example: An agent registers the PDF tool without an explicit PDF model.

  • Before: Serving assembly passes deferAutoModelResolution: true to postpone automatic discovery.
  • After: The factory postpones automatic discovery directly, without the private selector.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused owner consolidation with the prior finding resolved, no new actionable defect, and substantial passing exact-head validation; remaining CI is still pending.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored refactor is outside the ordinary contributor proof gate and does not materially change authority; passing hosted runtime shards support validation, while the body expressly leaves incomplete local runtime attempts unclaimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-approved direction removes alternate private construction paths and forwarding plumbing without adding public contracts, persistent state, or competing owners.

Merge readiness

✅ Ready for maintainer review

Keep this useful maintainer-authored refactor open. The earlier accounting finding is resolved, no actionable defect remains in the reviewed diff, and remaining exact-head CI checks are pending.

Priority: P3
Reviewed head: c71b30d7ad454f06c0768951ce5319f43a2b3fbd

Before merge

None.

Findings

None.

Agent review details

How this fits together

Agent tool assembly combines configuration, credentials, requester identity, and sandbox policy into executable tools that delegate to existing inference, dispatch, filesystem, and diagnostic owners.

flowchart TD
  A[Agent run] --> B[Tool assembly]
  B --> C[Serving owners]
  C --> D[Message dispatch]
  C --> E[Sandbox filesystem]
  C --> F[Inference selection]
  C --> G[Diagnostic writer]
Loading

Technical review

Best possible solution:

Retain the private-owner consolidation and main’s unchanged settlement implementation, then let the remaining exact-head checks complete.

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

This is an internal refactor; source comparison establishes removal of the earlier duplicate-accounting change, and no target code was executed locally.

Is this the best way to solve the issue?

The change follows existing owners, removes the replaced private paths, and preserves serving inputs and guards; the limited PDF discovery timing change is explicitly accepted by the maintainer author.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Runtime auth-row cache keeps the original intent (3ccacf7: Retain process-owned auth facts while preserving write-through publication and source invalidation; later receipt and canonical-row refinements remain intact.)
  • Remote pinned filesystem targets keeps the original intent (628a549: Authorize canonical destinations and pin mutations so aliases cannot redirect approved operations into protected paths.)
  • Message-tool private selectors keeps the original intent (2b8dbc3: The concept-module split carried the selectors forward without changing behavior; earlier git log -S history reaches an unavailable old blob, leaving their original introduction unknown.)
  • Cache tracing keeps the original intent (5392fa0: Record diagnostic stages and provider-bound context; the refactor retains environment controls, incognito exclusion, redaction, digests, and queued writing.)
  • PDF automatic discovery changes intended behavior with a stated reason (02b1075: Defer automatic model discovery to avoid agent-turn initialization stalls; this PR explicitly extends that serving behavior to direct private factory calls.)
  • Inference fallback configuration keeps the original intent (b1f4aac: Try the requester route first, then other authenticated configured providers; consuming the captured configuration directly preserves that routing policy.)
  • Hosted conversation assembly keeps the original intent (4466c0d: Group hosted conversation operations under their existing assembly; the moved sessions_send registration preserves configuration, requester identity, durable run key, tool order, and embedded-host exclusion.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Agustin Rivera: Raw commit 628a549 adds src/agents/sandbox/remote-fs-bridge-pinned-frame.ts:51 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 628a5497f636; files: src/agents/sandbox/remote-fs-bridge-pinned-frame.ts)

PR surface

Source -106, Tests -74. Total -180 across 50 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 14 265 371 -106
Tests 36 323 397 -74
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 50 588 768 -180

Review metrics

Metric Value Why it matters
Production versus test/support delta Production +265/−364; tests/support +323/−404 Both groups shrink; additions principally relocate existing algorithms and replace private fixture injection with scoped module mocks.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: The remaining change is internal owner consolidation with no established user-facing regression or new public capability.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-19T00:29:15.047Z sha df495e5 :: needs changes before merge. :: none
  • reviewed 2026-10-19T00:45:09.996Z sha 5c4fb7d875109e197073383e7b0953f321d8f6cd :: needs changes before merge. :: [P2] Remove the completion repair superseded by main’s settlement owner

Reviewed October 18, 2026, 9:13 PM ET / October 19, 2026, 01:13 UTC (Revision 3).

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The repair preserves terminal publication gating but settles discarded/rejected item accounting, with held and settled accounting assertions in the existing three-outcome regression. Independent P0–P2 review, targeted native types, ordinary changed-file lint, formatting, and all 14 suppression tests passed. The four-file exec resolver slice is parked and exactly restored to base, so no OpenGrep exception is requested. The body records initial CI failures and current proof gaps; fresh exact-head CI remains the broad gate.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 19, 2026
Use canonical message boundaries, the singleton auth-row cache, direct exec resolution and concrete sandbox pin owner. Preserve effect authority, delivery receipts and settlement. Current focused types, ordinary lint, suppression suite and independent review pass. Preserve this reviewed checkpoint before the coordinator-required tooling rebase; runtime and cycle proof remain incomplete.
Drop the overlapping local accounting repair after main c5c558d (#176658) landed. All three files now match the fetched main owner exactly; its accepted-history publication gates and exactly-once completion regression remain intact.
@steipete
steipete force-pushed the deslop/z19-64-core-private-owners-20261015 branch from 5c4fb7d to c71b30d Compare October 19, 2026 01:04
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head c71b30d rebases for the named nested-lifecycle CI failure and drops the overlapping local repair in favor of main's #176658. All three accounting/acceptance/regression files now exactly match main91e3716; main's exactly-once completion assertion and accepted-history presentation gates remain intact. The 50-path private-owner cleanup removes99 production lines, with no memory or public-contract change.

Fresh rollback review is scoped-clean at P0-P2; targeted native types, typed lint, formatting and all14 suppression tests pass. Local focused runtime was incomplete at a cold worker prerequisite and remains explicitly unclaimed. The updated body records both old failed heads and the current proof; fresh exact-head hosted CI is the broad gate.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. label Oct 19, 2026
@steipete
steipete merged commit 37c5859 into main Oct 19, 2026
149 checks passed
@steipete
steipete deleted the deslop/z19-64-core-private-owners-20261015 branch October 19, 2026 02:07
@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 19, 2026
* refactor: bind private core seams to serving owners

Use canonical message boundaries, the singleton auth-row cache, direct exec resolution and concrete sandbox pin owner. Preserve effect authority, delivery receipts and settlement. Current focused types, ordinary lint, suppression suite and independent review pass. Preserve this reviewed checkpoint before the coordinator-required tooling rebase; runtime and cycle proof remain incomplete.

* fix(agents): settle discarded nested tool items

* refactor(agents): use main nested lifecycle settlement owner

Drop the overlapping local accounting repair after main 46dea10 (openclaw#176658) landed. All three files now match the fetched main owner exactly; its accepted-history publication gates and exactly-once completion regression remain intact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. gateway Gateway runtime 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: ⏳ 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