Skip to content

fix(plugins): canonicalize service registration identity - #117232

Merged
fuller-stack-dev merged 9 commits into
mainfrom
codex/qa400-plugin-service-registration-id
Sep 16, 2026
Merged

fuller-stack-dev merged 9 commits into
mainfrom
codex/qa400-plugin-service-registration-id

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Plugin background services and Gateway discovery services could register a whitespace-padded ID, then use a different identity for duplicate ownership, reload selection, health or diagnostics. Reading plugin-controlled ID accessors repeatedly could also throw after admission.

User Impact

A service has one canonical core-owned identity throughout its lifecycle. Frozen and getter-only descriptors remain supported, native/private-field callback receivers are preserved, and unreadable IDs produce redacted registration diagnostics. No operator action or configuration migration is required.

Why This Change Was Made

Read and trim the descriptor ID once at registration, store it on the core registration, and use that snapshot in ownership checks and runtime identity consumers. The plugin descriptor is never mutated or cloned. Callback this remains the original descriptor; its own raw ID remains unchanged.

This replaces the earlier mutation approach after the ClawSweeper readonly-descriptor compatibility finding. Contributor ancestry and Peter Steinberger’s original contribution are preserved. Earlier catalog/publication prerequisites from #149587 are in main. The subsequent exact inventory correction is integrated as described below.

Evidence

  • Reproduced six compatibility failures before the repair: four direct/projected discovery cases and two background-service cases for padded frozen/getter-only descriptors.
  • After the repair, all 42 discovery lifecycle cases and 19 registration cases passed, including real native-backed start, canonical reload selection, and stop/cleanup behavior.
  • All 40 affected health/diagnostics/reload cases passed. Targeted Gateway reload checks passed 365 cases, with 470 unrelated cases intentionally skipped.
  • Production changes are net +7 lines: canonical registration identity fields and guarded/redacted admission replace descriptor mutation and downstream ID rereads. Test fixture migrations retain existing behavioral assertions.
  • Fresh independent review and isolated autoreview both passed at P0–P2, with no findings. Two subsequent brace-only test lint fixes preserve all reviewed expressions and production source.
  • Required local scoped checks passed: production/core-test/root-test types, formatting, line-growth, core/script/root-test lint, and native guards. Completed test proof was retained without replay.
  • Signed candidate 3dc8f54c56755fd6c551d385826cb84356c6e93c preserves contributor ancestry. Exact-published-head hosted CI and native preparation/merge remain pending. Historical proof for the superseded mutation approach is not used to clear this repair.

Canonical CI prerequisites

CI on the prior head exposed two main-branch prerequisites: the exact inventory count was stale after #150316, and src/scripts/ci-changed-scope.test.ts needed formatting. This head merges the exact published #150341 correction (95 npm / 91 ClawHub), whose base already includes the landed #150330 formatting fix. Both complete publisher-set comparisons are preserved; production publication policy is unchanged.

All 26 Registry source hashes and the checked runtime/dependency context are unchanged. The single affected inventory case passed on this committed integration (107 unrelated cases skipped), and formatting passed for both prerequisite files. The canonical fixes remain credited in their original history. Existing Registry runtime proof and fresh review are retained without replay; the new published-head CI and native merge gates remain mandatory.

@steipete
steipete marked this pull request as ready for review August 1, 2026 05:26
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 1, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 6:42 PM ET / 22:42 UTC (Revision 25).

ClawSweeper review

What this changes

The PR stores a canonical service ID separately from plugin descriptors, uses it throughout service and discovery lifecycles, updates regression fixtures, and integrates the publisher-inventory test correction.

Merge readiness

✅ Ready for maintainer review

This remains a useful repair: current main and the latest release still reread plugin-controlled service IDs. The previous descriptor-compatibility findings are resolved, and no actionable introduced defects were found.

Priority: P2
Reviewed head: 3dc8f54c56755fd6c551d385826cb84356c6e93c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with relevant compatibility coverage and no remaining actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored internal repair is exempt from the external-contributor proof gate. The captured body reports registration, reload, discovery, and cleanup regression results matching the inspected owners; those are supplemental test evidence, not an independently observed live deployment.
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 repair is exempt from the external-contributor proof gate. The captured body reports registration, reload, discovery, and cleanup regression results matching the inspected owners; those are supplemental test evidence, not an independently observed live deployment.
Evidence reviewed 9 items Canonical identity and descriptor preservation: The registration owner catches unreadable IDs, records a redacted diagnostic, stores the normalized ID on the registration, and retains the original descriptor. Existing same-owner and cross-owner duplicate handling remains intact.
Current main still needs the repair: Fetched main reads service.id without an admission guard and rereads existing descriptors during duplicate checks; registrations do not yet carry the canonical ID field.
Latest release comparison: The v2026.9.4 source also uses unguarded descriptor reads and does not store a canonical registration ID. The broader lifecycle repair is therefore not established as shipped.
Findings None None.
Security None None.

How this fits together

Plugins register background services and local Gateway discovery advertisers with OpenClaw. The registry supplies their identities to startup, reload selection, health reporting, diagnostics, and cleanup.

flowchart TD
  A[Plugin service descriptor] --> B[Read and normalize ID once]
  B --> C{Valid and available?}
  C -->|No| D[Registration diagnostic or duplicate no-op]
  C -->|Yes| E[Registration with canonical ID]
  E --> F[Startup and discovery callbacks]
  E --> G[Reload selection and health reporting]
  F --> H[Owned cleanup]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +7, Tests +125. Total +132 across 27 files.

View PR surface stats
Area Files Added Removed Net
Source 8 44 37 +7
Tests 19 314 189 +125
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 27 358 226 +132

Review metrics

Metric Value Why it matters
Production versus test growth Production net +7 lines; tests and test support net +125 lines The small production increase establishes one registration identity owner; most growth covers descriptor compatibility and migrates fixtures.

Technical review

Best possible solution:

Keep canonical identity in the existing registration owner while preserving plugin descriptors, callback receivers, and lifecycle authority.

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

Yes, from source: current main admits IDs through an unguarded getter and rereads them later, so throwing or changing accessors can disrupt registration and lifecycle identity. Runtime reproduction was not performed here.

Is this the best way to solve the issue?

Yes. A core-owned snapshot fixes the mismatch at registration while preserving supported descriptor objects and updating downstream consumers together.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs bounded plugin identity and lifecycle failures without evidence of an urgent widespread outage.
  • 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 repair is exempt from the external-contributor proof gate. The captured body reports registration, reload, discovery, and cleanup regression results matching the inspected owners; those are supplemental test evidence, not an independently observed live deployment.

Evidence

What I checked:

  • Canonical identity and descriptor preservation: The registration owner catches unreadable IDs, records a redacted diagnostic, stores the normalized ID on the registration, and retains the original descriptor. Existing same-owner and cross-owner duplicate handling remains intact. (src/plugins/registry-registrars-operations.ts:321, 3dc8f54c5675)
  • Current main still needs the repair: Fetched main reads service.id without an admission guard and rereads existing descriptors during duplicate checks; registrations do not yet carry the canonical ID field. (src/plugins/registry-registrars-operations.ts:321, 75ba5e3fae5c)
  • Latest release comparison: The v2026.9.4 source also uses unguarded descriptor reads and does not store a canonical registration ID. The broader lifecycle repair is therefore not established as shipped. (src/plugins/registry-registrars-operations.ts, 3a9d69db306c)
  • Prior findings addressed at the production boundary: Registration tests exercise canonical, frozen, and getter-only descriptors through actual registration, start, canonical reload selection, and cleanup. Additional cases check throwing getters, unchanged descriptor identity, independent namespaces, and duplicate ownership. Discovery tests cover direct and projected registrations. These tests were inspected, not executed in this read-only review. (src/plugins/registry.service-registration.test.ts:55, 3dc8f54c5675)
  • Lifecycle and diagnostic authority: Service startup, retained ownership, logging, and health now consume the registration ID. Diagnostic access still requires the matching exporter plugin identity and bundled or trusted-official origin; capability operations retain their active-lease checks and cleanup revocation. No new principal or persistent authority is introduced. (src/plugins/services.ts:489, 3dc8f54c5675)
  • Review continuity: Tree-object comparisons against the previous reviewed head show identical blobs for the registrar, service runtime, registration types, and discovery runtime. Earlier readonly-descriptor and first-read findings are resolved in the inspected current code. Some broader local history queries encountered unavailable historical blobs; GitHub commit metadata and available tree objects supplied the bounded provenance checks. (src/plugins/registry-registrars-operations.ts, 81fbfbe7e2a0)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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 (24 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-19T03:58:14.959Z sha f1680dc :: found issues before merge. :: [P1] Keep canonical identity off plugin-owned service objects | [P2] Guard the initial service ID read
  • reviewed 2026-08-25T05:52:32.953Z sha f1680dc :: needs changes before merge. :: [P1] Keep canonical identity off plugin-owned objects | [P2] Guard the first service ID read
  • reviewed 2026-08-25T06:34:53.266Z sha f1680dc :: found issues before merge. :: [P1] Keep canonical identity off plugin-owned service objects | [P2] Guard the initial service ID read
  • reviewed 2026-09-02T02:10:09.967Z sha f1680dc :: blocked before merge. :: [P1] Keep canonical identity off plugin-owned service objects | [P2] Guard the first service-ID read
  • reviewed 2026-09-16T21:19:01.350Z sha 21cb0e3 :: blocked before merge. :: [P1] Preserve registration of read-only padded service descriptors
  • reviewed 2026-09-16T21:49:30.274Z sha 6187f84 :: blocked before merge. :: [P1] Preserve registration of read-only padded service descriptors
  • reviewed 2026-09-16T21:58:54.140Z sha 5af3e55 :: blocked before merge. :: [P1] Preserve registration of read-only padded service descriptors
  • reviewed 2026-09-16T22:19:54.489Z sha 81fbfbe :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 6, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 15, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 2, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 15, 2026
Integrate Peter Steinberger's original fix at the current retained registry
boundary while preserving original objects, prototypes and callback receivers.
Reject unsafe identity accessors with redacted diagnostics and retain the
verified upstream contract-fixture correction.
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

This PR no longer has blocked security-sensitive file changes. A future security-sensitive change requires a fresh /allow-security-sensitive-change comment after the guard blocks that new head SHA.

  • Current SHA: 3dc8f54c56755fd6c551d385826cb84356c6e93c

@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 15, 2026
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: 3dc8f54c56755fd6c551d385826cb84356c6e93c

@github-actions github-actions Bot removed dependencies-changed PR changes dependency-related files security-sensitive-changed labels Sep 16, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Sep 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations size: L and removed size: M labels Sep 16, 2026
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
steipete and others added 2 commits September 16, 2026 15:23
Follow #150316: Logbook, Memory Wiki, and 1Password remain bundled and are deferred from both registries. Restore the exact release-plan integration inventory to 95 npm and 91 ClawHub packages while preserving publisher equality checks.
@fuller-stack-dev
fuller-stack-dev merged commit 54a7161 into main Sep 16, 2026
212 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the codex/qa400-plugin-service-registration-id branch September 16, 2026 22:57
@fuller-stack-dev

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…7232)

* fix(plugins): canonicalize service registration identities

* test(plugins): isolate service identity loader coverage

* fix(plugins): snapshot canonical service registration identities

* test(release): align publisher inventory with deferred plugins

Follow openclaw#150316: Logbook, Memory Wiki, and 1Password remain bundled and are deferred from both registries. Restore the exact release-plan integration inventory to 95 npm and 91 ClawHub packages while preserving publisher equality checks.

---------

Co-authored-by: Jason (Json) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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