Skip to content

refactor(plugins): remove the redundant config policy relay - #140904

Merged
steipete merged 1 commit into
mainfrom
steipete/cleanup-plugin-policy-relay
Sep 7, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/cleanup-plugin-policy-relay

Conversation

@steipete

@steipete steipete commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Related: #135868, #140815

What Problem This Solves

The private plugin-policy facade repeats a normalizer signature and forwards every call directly to the shared implementation. Two additional aliases repeat imported types. This is the requested owner follow-up to #140815 in the maintainer's deletion campaign.

Why This Change Was Made

Replace the forwarding function with a named re-export of the same canonical normalizer and import the existing types directly. Make the shared default resolver private after the facade, its only external consumer, disappears. Both exported names, the normalizer's call signature/default resolver/results, and the activation-policy implementation stay intact. The four direct consumer families—manifest discovery, hook discovery, skill discovery, and agent settings—continue using the same facade.

The existing wrapper-shadowing guidance explicitly permits a pure re-export when the wrapper adds no behavior. Its earlier rename in e74be5d41db only distinguished the core import; it introduced no policy requiring an additional wrapper. The separate registry timeout helper remains because it floors positive values and has a different accepted domain.

User Impact

No user-visible behavior change. Plugin configuration, activation policy, and discovery retain their existing semantics with less duplicate code. No configuration option, schema, storage behavior, dependency, or authorization change.

Evidence

  • All 245 existing tests across eight suites passed before (65.64s) and after the complete two-file cleanup (39.25s), covering config policy/state, manifest registry, hooks, skills, agent settings, bundle settings, and cached MCP settings.

  • The first full check passed core and test types, then both Knip scans correctly flagged the now-unused identityNormalizePluginId export. The completed patch makes that existing helper private; it keeps all internal uses and retains the separately consumed NormalizePluginId type.

  • The complete selected check:changed plan passed in 603.94s, including core/test types, all three zero-entry Knip scans, lint, zero runtime import cycles, and architecture/storage guards. All 17 recorded source/test/dependency input hashes remained unchanged.

  • Full pnpm build passed in 544.62s, including public SDK declarations/exports, 53 native control-plane module loads, CLI bootstrap imports, and UI checks. Both full checks and build ran on pinned base 038acb2695d298ac671c3b886647025abdbfd22c, verifying all 17 recorded input hashes and the complete changed-path set before and after each command.

  • Independent review of the complete patch is scoped-clean through P2.

  • Refresh onto 64887802d73bb7f2d0ce499aef979a71807ac5fd was clean; all 17 source/test/dependency input hashes remained byte-identical, including the lockfile. Exact-head CI supplies integration proof for refreshed main.

  • Fresh author-open PR discovery and complete net diffs for all 16 truncated/missing file inventories found no competing change in this owner.

  • Initial exact-head CI passed. Final refresh onto 7ab1c97cb7fee1a5bc72da1cf913ea25873c3497 is patch-identical. Main added the Team Reports workspace; the offline install lacked cached package metadata, then the normal frozen install passed its supply-chain check. All 15 source/test hashes stayed identical, all 245 tests passed again (83.45s), and final branch review is scoped-clean through P2.

  • ClawSweeper review: no findings, security issues, or before-merge/rank-up actions. Its source/caller review confirms the preserved callable contract and absence of external/default-resolver SDK consumers.

Class Added Removed Net
Production 4 16 -12
Tests 0 0 0
Tooling 0 0 0
Docs 0 0 0

The policy owner shrinks from 53 to 41 lines; the shared normalizer keeps the same line count. Existing behavior tests and all baselines remain intact.

@steipete steipete self-assigned this Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 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 size: XS maintainer Maintainer-authored PR labels Sep 7, 2026
@steipete
steipete marked this pull request as ready for review September 7, 2026 06:07
@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 Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 2:26 AM ET / 06:26 UTC.

ClawSweeper review

What this changes

The PR replaces a forwarding plugin-configuration function with a direct re-export, simplifies type imports, and makes its unused default-resolver export private.

Merge readiness

✅ Ready for maintainer review

This remains a useful, bounded cleanup: current main retains the redundant wrapper, and the introduced changes preserve its callable contract. No actionable correctness or security findings remain.

Priority: P3
Reviewed head: bf1b889dbff50ae4d71e79449299c9c8d5131f20

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with useful reported validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored internal refactor is exempt from external-contributor runtime proof; its normalizer and discovery callers remain unchanged in behavior, with reported test and build results serving as supplemental validation.
Patch quality 🐚 platinum hermit (4/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 external-contributor runtime proof; its normalizer and discovery callers remain unchanged in behavior, with reported test and build results serving as supplemental validation.
Evidence reviewed 7 items Introduced scope and preserved implementation: The verified merge-base-to-head patch changes only the facade's forwarding declaration, type aliases, and the helper's export visibility. The shared implementation retains the same optional configuration argument, default resolver, normalization operations, and return type.
Caller and export boundary: Source searches and caller inspection found the facade used by manifest discovery, hook discovery, skill discovery, and agent settings. These callers continue importing the same name; none inspect function identity or its name. The default resolver has only internal uses after the patch, with no matching public SDK or package export.
Existing behavior coverage: The unchanged policy tests exercise custom ID resolution for allowlists, denylists, and entry keys, plus metadata allowlist strictness and denylist precedence. The supplied PR body reports 245 passing tests after the final refresh and earlier successful changed checks and build; these commands were not rerun during this read-only review.
Findings None None.
Security None None.

How this fits together

Plugin configuration normalization converts operator settings into a consistent shape used by manifest discovery, hooks, skills, and agent settings. The policy facade provides this normalization without activating plugin runtime code.

flowchart LR
  A[Plugin configuration] --> C[Shared configuration normalizer]
  B[Optional plugin ID resolver] --> C
  C --> D[Policy facade re-export]
  D --> E[Manifest discovery]
  D --> F[Hook and skill discovery]
  D --> G[Agent settings]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -12. Total -12 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 4 16 -12
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 4 16 -12

Review metrics

None.

Technical review

Best possible solution:

Keep one canonical normalizer behind the existing internal import name while preserving defaults, alias resolution, and activation semantics.

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

Not applicable: this is behavior-preserving cleanup, and source inspection confirms the existing forwarding wrapper rather than a reported runtime defect.

Is this the best way to solve the issue?

Yes: a named re-export removes the redundant implementation while retaining the existing call signature and canonical default resolver.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is an internal simplification with no intended user-visible behavior change.
  • 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: The maintainer-authored internal refactor is exempt from external-contributor runtime proof; its normalizer and discovery callers remain unchanged in behavior, with reported test and build results serving as supplemental validation.

Evidence

What I checked:

  • Introduced scope and preserved implementation: The verified merge-base-to-head patch changes only the facade's forwarding declaration, type aliases, and the helper's export visibility. The shared implementation retains the same optional configuration argument, default resolver, normalization operations, and return type. (src/plugins/config-normalization-shared.ts:211, bf1b889dbff5)
  • Caller and export boundary: Source searches and caller inspection found the facade used by manifest discovery, hook discovery, skill discovery, and agent settings. These callers continue importing the same name; none inspect function identity or its name. The default resolver has only internal uses after the patch, with no matching public SDK or package export. (src/plugins/config-policy.ts:14, bf1b889dbff5)
  • Existing behavior coverage: The unchanged policy tests exercise custom ID resolution for allowlists, denylists, and entry keys, plus metadata allowlist strictness and denylist precedence. The supplied PR body reports 245 passing tests after the final refresh and earlier successful changed checks and build; these commands were not rerun during this read-only review. (src/plugins/config-policy.test.ts:9, bf1b889dbff5)
  • Still distinct from main and the latest release: Inspection of fetched main and v2026.9.2 shows both retain the forwarding wrapper. The merged guard cleanup at refactor(plugins): reuse canonical config record and timeout guards #140815 changes normalization guards and timeouts, rather than implementing this facade cleanup. (src/plugins/config-policy.ts:22, c78e6aea330f)
  • Feature-area history and routing: Current-main path history identifies Peter Steinberger's recent guard cleanup, activation changes, and earlier wrapper-shadowing work. Supplied merged-PR metadata connects the recent guard cleanup to steipete. Parent-blob availability prevented exact source-line introduction verification, so no introducing-author claim is made. (src/plugins/config-normalization-shared.ts, 008d71af9ed3)
  • Repository guidance supports a pure re-export: The wrapper-shadowing guard explicitly recommends a pure re-export when a wrapper adds no behavior. Root and plugin-scoped policy were read fully; no maintainer-notes directory or intervening src/AGENTS.md exists. (scripts/check-wrapper-shadowing.mts:178, bf1b889dbff5)

Likely related people:

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

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-09-07T06:13:05.740Z sha 75d77b67286e3fd583f3a783e783e3b687445ce9 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/cleanup-plugin-policy-relay branch from 75d77b6 to bf1b889 Compare September 7, 2026 06:21
@steipete
steipete merged commit 93a7f6d into main Sep 7, 2026
173 checks passed
@steipete
steipete deleted the steipete/cleanup-plugin-policy-relay branch September 7, 2026 06:36
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. size: XS 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