Skip to content

fix: break plugin registry type import cycle#93738

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
giodl73-repo:fix-plugin-registry-type-cycle
Jun 16, 2026
Merged

fix: break plugin registry type import cycle#93738
vincentkoc merged 1 commit into
openclaw:mainfrom
giodl73-repo:fix-plugin-registry-type-cycle

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Break the plugin registry/type-barrel static import cycle by replacing type-only imports with TS import type queries.
  • Update the test-projects routing expectation for Android script tests that use the shared temp-dir helper.
  • Keep runtime behavior unchanged while letting the madge import-cycle guard see the registry contracts as leaf type references.

Validation

  • node --import tsx scripts/check-import-cycles.ts
  • node --import tsx scripts/check-madge-import-cycles.ts
  • node scripts/check-deprecated-api-usage.mjs
  • node scripts/check-deprecated-jsdoc.mjs
  • node scripts/generate-kysely-types.mjs --verify
  • node scripts/check-kysely-guardrails.mjs
  • node scripts/check-database-first-legacy-stores.mjs
  • node node_modules/vitest/vitest.mjs run --config test/vitest/vitest.tooling.config.ts src/scripts/test-projects.test.ts -t "routes top-level test helpers to importing repo tests" --reporter=dot
  • node_modules/oxfmt/bin/oxfmt --check --threads=1 src/plugins/types.ts src/plugins/registry-types.ts src/plugins/runtime-state.ts src/scripts/test-projects.test.ts
  • node_modules/oxlint/bin/oxlint --tsconfig config/tsconfig/oxlint.core.json src/plugins/types.ts src/plugins/registry-types.ts src/plugins/runtime-state.ts src/scripts/test-projects.test.ts
  • git diff --check

Real behavior proof

  • Source-level architecture guard proof: the failing madge import-cycle check reports Madge import cycle check: 0 cycle(s).
  • Source-level tooling proof: the focused test-projects route expectation passes with 1 passed | 81 skipped.
  • Runtime behavior is unchanged; this only changes type-only references and a test expectation.

@clawsweeper

clawsweeper Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 16, 2026, 2:43 PM ET / 18:43 UTC.

Summary
The branch changes plugin registry/public type references to import type queries and adjusts a tooling test expectation for Android tests that import the shared temp-dir helper.

PR surface: Source +3, Tests +1. Total +4 across 4 files.

Reproducibility: yes. Source inspection shows the stricter madge guard collects static import/export declarations, while the PR replaces the problematic type-only static edges with import type queries; I did not rerun checks because this review is read-only.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No automated repair is needed; the protected maintainer label leaves final landing to explicit maintainer handling.

Security
Cleared: No security or supply-chain concern found; the diff is limited to TypeScript type references and a tooling test expectation.

Review details

Best possible solution:

Land the narrow type-cycle fix after maintainer handling if the exact head keeps the import-cycle guards, formatting, lint, and focused tooling tests green.

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

Yes. Source inspection shows the stricter madge guard collects static import/export declarations, while the PR replaces the problematic type-only static edges with import type queries; I did not rerun checks because this review is read-only.

Is this the best way to solve the issue?

Yes. The import-query approach is the narrowest maintainable fix because it preserves the existing plugin registry/public type contract and avoids weakening the architecture guard.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: This is a small internal architecture/tooling cleanup with no user-facing runtime behavior change claimed.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal-style guard output and focused tooling-test output for this internal source-level change.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal-style guard output and focused tooling-test output for this internal source-level change.
Evidence reviewed

PR surface:

Source +3, Tests +1. Total +4 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 43 40 +3
Tests 1 2 1 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 45 41 +4

What I checked:

  • PR diff remains useful on current main: Comparing the PR head to origin/main shows the Android test expectation is already on current main, while the three plugin type-reference changes remain unique to this PR. (src/plugins/registry-types.ts:33, b59dd5e9fb4e)
  • Madge guard target: The madge-style guard records static import/export declarations as graph edges, so replacing selected type imports with import type queries removes those edges from that guard without adding runtime code. (scripts/check-madge-import-cycles.ts:31, b59dd5e9fb4e)
  • Runtime guard distinction: The runtime import-cycle guard already excludes type-only import/export declarations, so this PR targets the stricter static architecture guard rather than runtime value imports. (scripts/check-import-cycles.ts:74, b59dd5e9fb4e)
  • Plugin registry contract unchanged: The registry shape and exported type names remain the same; only local type dependencies on the plugin type barrel and channel types move to import type queries. (src/plugins/registry-types.ts:33, b59dd5e9fb4e)
  • Test routing context: Android version tests import the shared temp-dir helper through android-version.test-support.ts, matching the routed test expectation included in the branch and already present on current main. (test/scripts/android-version.test-support.ts:5, b59dd5e9fb4e)
  • Live PR state: GitHub reports this PR open, non-draft, cleanly mergeable, labeled maintainer, and with successful relevant CI/status checks for the reviewed head. (b59dd5e9fb4e)

Likely related people:

  • Vincent Koc: Recent history includes the registry type surface split and follow-up cycle/runtime registry seam work that this PR adjusts. (role: recent area contributor; confidence: high; commits: c87994bc9abd, 74e7b8d47b18, 543c14a4edd1; files: src/plugins/registry-types.ts, src/plugins/types.ts, src/plugins/runtime-state.ts)
  • Peter Steinberger: Recent plugin/channel refactors and build export surface repairs touch the same plugin boundary area that the registry type surface depends on. (role: adjacent owner; confidence: medium; commits: 3e013342de26, d5cb8cebcd83, ab96520bbad5; files: src/plugins/types.ts, src/plugins/registry-types.ts, src/channels/plugins/types.plugin.ts)
  • joshavant: The Android pinned release versioning commit introduced the Android version tests and shared test support that explain the test-project routing expectation. (role: adjacent test owner; confidence: medium; commits: 40eec48caf29; files: test/scripts/android-version.test.ts, test/scripts/android-pin-version.test.ts, test/scripts/android-version.test-support.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 16, 2026
@vincentkoc vincentkoc self-assigned this Jun 16, 2026
@vincentkoc
vincentkoc force-pushed the fix-plugin-registry-type-cycle branch from b59dd5e to 0637f18 Compare June 16, 2026 19:42
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer verification complete. I rebased the contributor branch onto current origin/main and resolved the runtime-state.ts conflict by preserving the newer workspace-state import while keeping the registry reference type-only. Runtime behavior remains unchanged.

Verified:

  • node --import tsx scripts/check-madge-import-cycles.ts — 0 cycles
  • node --import tsx scripts/check-import-cycles.ts — 0 runtime value cycles
  • node scripts/run-vitest.mjs src/scripts/test-projects.test.ts — 82 passed
  • git diff --check — clean
  • fresh structured autoreview — clean
  • PR CI — 139 passed, 0 pending, 0 failed

Ready to squash merge.

@vincentkoc
vincentkoc merged commit e587195 into openclaw:main Jun 16, 2026
166 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 17, 2026
crh-code pushed a commit to crh-code/openclaw that referenced this pull request Jun 18, 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants