Skip to content

refactor: finish export shadow hazard renames - #121471

Merged
steipete merged 3 commits into
mainfrom
steipete/shadow-hazard-renames-0810
Aug 10, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/shadow-hazard-renames-0810

Conversation

@steipete

@steipete steipete commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Several internal exports still used the same names for distinct behaviors, leaving ambiguous grep/navigation targets and preserving two entries in the export-name-collision debt baseline. The original work order covered six hazards; while this branch was validating, #121388 landed the queue, configured-binding, node-handler/file, and ACP resolver portions on main.

Why This Change Was Made

This PR finishes the remaining owner-specific names without changing behavior, gateway method strings, config keys, tool names, or the shipped Plugin SDK export name:

  1. resolveQueueSettingsCore: already satisfied by refactor: eliminate wrapper export shadowing hazards #121388 on current main.
  2. Configured-binding registry: refactor: eliminate wrapper export shadowing hazards #121388 deleted the redundant façade and made the configured registry canonical on current main.
  3. Node pending handlers: refactor: eliminate wrapper export shadowing hazards #121388 supplied the distinct work/action names and file rename; this PR completes the requested cycle removal by importing the existing wake helpers directly from nodes.wake.ts.
  4. resolveAcpSessionKey: already satisfied by refactor: eliminate wrapper export shadowing hazards #121388 on current main.
  5. The chat-button builder is now buildApprovalButtonPresentation; openclaw/plugin-sdk/approval-reply-runtime keeps buildApprovalPresentation as the shipped compatibility alias with a removal-intent comment.
  6. The daemon-only resolver is now resolveDaemonHomeDir, with its service-environment ownership documented; src/utils.ts remains untouched.

The collision baseline shrinks from 233 to 231 on this PR base. Production LOC is +28/-22 (net +6): four formatting lines make the now-direct wake import explicit, and two required contract comments document the SDK compatibility and daemon home ownership. Tests are +3/-3; generated baselines are +6/-22.

AI-assisted: yes (Codex).

User Impact

No user-visible behavior changes. Internal names now identify one behavior each, the pending-node import cycle is removed, daemon service paths cannot be confused with runtime home resolution, and existing Plugin SDK consumers retain their current approval builder export.

Evidence

  • node scripts/run-vitest.mjs src/gateway/server-methods/nodes.pending-work.test.ts src/gateway/server-methods/nodes.test.ts src/gateway/server-import-boundary.test.ts — 3 files, 27 tests passed.
  • node scripts/run-vitest.mjs src/infra/exec-approval-reply.test.ts src/infra/approval-presentation.test.ts — 2 files, 49 tests passed.
  • node scripts/run-vitest.mjs src/daemon/service-env.test.ts src/daemon/restart-logs.test.ts src/daemon/inspect.test.ts src/daemon/launchd.test.ts src/daemon/systemd.test.ts — 5 files, 425 passed, 5 skipped.
  • Earlier full work-order scopes before refactor: eliminate wrapper export shadowing hazards #121388 landed: queue 8 files/33 tests; channel plugins 582/5,585; gateway methods 151/3,011; ACP 172/1,369. The broad src/infra filter was host-contention dominated; the exact touched infra files passed cleanly above.
  • pnpm lint:tmp:export-name-collisions — passed; baseline 233 → 231 on the current PR base (the original worktree began at 244 before overlapping main cleanups landed).
  • pnpm plugin-sdk:api:check and pnpm plugin-sdk:surface:check — passed; 4,847 public exports remain unchanged.
  • pnpm check:import-cycles — 0 runtime value cycle(s).
  • pnpm build — passed in 11m33s; no [INEFFECTIVE_DYNAMIC_IMPORT] warning.
  • node scripts/check-changed.mjs — passed via the repository-approved local fallback after Blacksmith/Daytona/Azure were unavailable and the raw AWS fallback lacked hydrated workspace dependencies.
  • pnpm format <touched paths> and git diff --check — passed.
  • Whole-branch autoreview — clean; no accepted/actionable findings.

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts size: S maintainer Maintainer-authored PR labels Aug 10, 2026
@steipete
steipete force-pushed the steipete/shadow-hazard-renames-0810 branch from 3f8cc88 to 809f6eb Compare August 10, 2026 06:44
@steipete
steipete marked this pull request as ready for review August 10, 2026 06:45
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 10, 2026
@clawsweeper

clawsweeper Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 3:50 AM ET / 07:50 UTC.

ClawSweeper review

What this changes

Renames internal approval and daemon helpers, directs pending-node work to its wake-helper owner, and preserves the public Plugin SDK approval-builder export as an alias.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking findings: this protected maintainer PR still completes three distinct internal naming and import-boundary cleanups not present on main. Merge after the remaining exact-head checks complete successfully.

Priority: P3
Reviewed head: dfa3d57b8fe69f89f53531111fde1ecd64c58690

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, coherent refactor with preserved SDK compatibility and no identified correctness defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal refactor is exempt from the external-contributor real-behavior-proof gate; focused test, build, SDK-surface, and import-cycle evidence is recorded in the PR body.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal refactor is exempt from the external-contributor real-behavior-proof gate; focused test, build, SDK-surface, and import-cycle evidence is recorded in the PR body.
Evidence reviewed 5 items SDK compatibility preserved: The public approval-reply SDK subpath keeps the shipped buildApprovalPresentation export as an alias for the renamed internal builder; the package export subpath is unchanged.
Gateway owner boundary: Pending-node work imports the wake helpers directly from their owning module, while the public node registry remains a compatibility aggregator without a back-import from the wake module.
Daemon rename is exhaustive: The resolver retains its HOME/USERPROFILE behavior and every daemon caller now uses the daemon-specific name; unrelated runtime home resolution remains separate.
Findings None None.
Security None None.

How this fits together

Gateway pending-work handlers enqueue work and wake reconnecting nodes; daemon code resolves service-owned paths; the Plugin SDK exposes portable approval controls to plugins. The PR clarifies these ownership boundaries without changing their external behavior.

flowchart LR
  A[Gateway request] --> B[Pending work handler]
  B --> C[Wake helper module]
  D[Approval request] --> E[Button presentation builder]
  E --> F[Plugin SDK compatibility export]
  G[Service environment] --> H[Daemon home resolver]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head integration checks are still in progress; no source-level merge risk was identified.
  • Complete next step (P2) - No repair lane is needed: there is no actionable defect, and the remaining action is routine maintainer handling after exact-head checks.
Agent review details

Security

None.

PR surface

Source +6, Tests 0, Generated 0, Other -16. Total -10 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 9 28 22 +6
Tests 2 3 3 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 1 6 6 0
Other 1 0 16 -16
Total 13 37 47 -10

Review metrics

Metric Value Why it matters
Production versus test delta production +28/-22 (net +6); tests +3/-3; generated baselines +6/-22 The small production increase is limited to owner-boundary naming and the public SDK compatibility alias; test changes follow the moved import and renamed helper.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the direct owner imports and daemon-specific naming, retain the SDK alias through the next major release, and merge once exact-head checks are green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the direct owner imports and daemon-specific naming, retain the SDK alias through the next major release, and merge once exact-head checks are green.

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

Not applicable: this is a behavior-preserving internal refactor, not a reported runtime failure.

Is this the best way to solve the issue?

Yes: direct imports from the wake owner, distinct daemon naming, and a retained public SDK alias remove ambiguity without changing gateway methods or plugin callers.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is behavior-neutral internal cleanup with no reported user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal refactor is exempt from the external-contributor real-behavior-proof gate; focused test, build, SDK-surface, and import-cycle evidence is recorded in the PR body.

Evidence

What I checked:

Likely related people:

  • steipete: Authored all three reviewed commits and the related merged cleanup that established the adjacent gateway split. (role: recent area contributor; confidence: high; commits: 2c8343dbb408, ce717eb8665f, dfa3d57b8fe6; files: src/gateway/server-methods/nodes.pending-work.ts, src/infra/exec-approval-reply.ts, src/daemon/paths.ts)
  • Ayaan Zaidi: Available blame identifies this contributor at the shallow-history boundary for the underlying approval, daemon, and pending-node code. (role: current-main source author; confidence: medium; commits: 9c3241f19f6b; files: src/infra/exec-approval-reply.ts, src/daemon/paths.ts, src/gateway/server-methods/nodes.pending-work.ts)

Rank-up moves

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

  • Allow the remaining exact-head integration checks to finish before merging.

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 (1 earlier review cycle)
  • reviewed 2026-08-10T06:51:13.347Z sha 809f6eb :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/shadow-hazard-renames-0810 branch from 809f6eb to dfa3d57 Compare August 10, 2026 07:43
@steipete
steipete merged commit bcf3429 into main Aug 10, 2026
123 checks passed
@steipete
steipete deleted the steipete/shadow-hazard-renames-0810 branch August 10, 2026 08:01
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 11, 2026
* refactor(gateway): distinguish pending node handlers

* refactor(approvals): distinguish button presentation builder

* refactor(daemon): distinguish service home resolver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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