Skip to content

fix(plugin-sdk): detect private type changes in API baseline - #120975

Merged
steipete merged 2 commits into
mainfrom
steipete/angry-jemison-742797
Aug 9, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/angry-jemison-742797

Conversation

@steipete

@steipete steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where Plugin SDK API baseline checks could miss breaking changes to private option or result declarations referenced by public exports. A required member could become optional, or a result shape could change, without changing the recorded per-entrypoint hash.

Why This Change Was Made

The baseline now hashes TypeScript's compiler-emitted declaration closure for each public export owner, following repo-local declaration imports and re-exports transitively while leaving external package declarations external. This preserves the public Plugin SDK surface and existing baseline JSON schema, avoids a fragile handwritten semantic type walker, and keeps the visible export declaration compact by storing only the closure digest.

User Impact

Plugin authors see no API change. Maintainers and CI now reliably detect private declaration changes that alter the effective public Plugin SDK contract.

Evidence

  • node scripts/run-vitest.mjs src/plugin-sdk/api-baseline.test.ts — 9 tests passed.
  • pnpm plugin-sdk:api:gen and pnpm plugin-sdk:api:check — generated manifest and check mode passed.
  • node scripts/check-changed.mjs -- <changed paths> — all selected core, extension, lint, typecheck, boundary, and Plugin SDK gates passed on Testbox tbx_01kzjm921gdz8jgmn460zcbb4q (run).
  • git diff --check — passed.
  • Pre-PR autoreview — no accepted/actionable findings.

AI-assisted: implementation and review were completed with coding-agent assistance; the maintainer reviewed the final diff and proof.

@clawsweeper

clawsweeper Bot commented Aug 9, 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 size: L labels Aug 9, 2026
@steipete
steipete marked this pull request as ready for review August 9, 2026 07:16
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete force-pushed the steipete/angry-jemison-742797 branch from 05d2324 to e6dc1be Compare August 9, 2026 07:31
@steipete steipete closed this Aug 9, 2026
@steipete steipete reopened this Aug 9, 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. P2 Normal backlog priority with limited blast radius. labels Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

This PR updates Plugin SDK API baselines to hash transitive, repository-local TypeScript declarations referenced by public exports, detecting breaking changes to private option and result types.

Regression provenance

Possible regression — probable (reviewed change; reproduction). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this maintainer-authored, maintainer-labeled PR open for normal review. Current main still hashes only each public declaration, while the PR adds a deterministic local declaration-closure digest that covers private types reachable from public exports; no concrete patch defect was found.

Priority: P2
Reviewed head: e6dc1beadc563906af7ac65d0cd042dafa08dc19

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has a focused owner-boundary design and meaningful regression coverage; exact-head CI remains the final merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored compatibility-check change has focused Testbox and CI evidence; the external-contributor real-behavior-proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored compatibility-check change has focused Testbox and CI evidence; the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 4 items Current-main gap: Current main renders and hashes each public declaration surface without traversing declaration imports, while public definePluginEntry uses non-exported option and result types.
Closure implementation: The PR emits declarations, resolves repository-owned references only, and hashes deterministically sorted transitive closure sections.
Regression coverage: The fixture changes transitive private option and result declarations, includes a re-export cycle, and verifies external package declarations remain excluded.
Findings None None.
Security None None.

How this fits together

Plugin SDK baseline generation converts public TypeScript entrypoints into a committed compatibility manifest checked by CI. The new closure step follows compiler-emitted local declarations before producing the per-export digest used by that manifest.

flowchart LR
  A[Public Plugin SDK export] --> B[TypeScript declaration emit]
  B --> C[Local declaration closure]
  C --> D[Stable closure digest]
  D --> E[Committed API baseline]
  E --> F[Plugin SDK CI check]
Loading

Before merge

  • Resolve merge risk (P1) - The exact-head Plugin SDK baseline CI job is still in progress; merge after it confirms generated output with the repository-pinned TypeScript 6.0.3 toolchain.
Agent review details

Security

None.

PR surface

Source +341, Tests +105, Generated 0. Total +446 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 416 75 +341
Tests 1 106 1 +105
Docs 0 0 0 0
Config 0 0 0 0
Generated 1 149 149 0
Other 0 0 0 0
Total 5 671 225 +446

Review metrics

Metric Value Why it matters
Production versus test delta production +416/-75; tests +106/-1 The production growth establishes the compiler-owned compatibility boundary; the focused fixture exercises its private-type and external-package invariants.

Stored data model

Persistent data-model change detected: serialized state: src/plugin-sdk/api-baseline.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land one deterministic compiler-based closure digest per public export after exact-head baseline CI passes, retaining external declarations outside the committed closure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land one deterministic compiler-based closure digest per public export after exact-head baseline CI passes, retaining external declarations outside the committed closure.

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

Yes, source reproducible: current main hashes the public declaration without its private referenced declarations, and the PR fixture demonstrates the resulting hash blind spot. This read-only review did not execute the test locally.

Is this the best way to solve the issue?

Yes: compiler-emitted declaration closure hashing follows the actual TypeScript public contract without creating a second handwritten type-analysis system.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs Plugin SDK compatibility detection for plugin authors without changing runtime behavior or the published SDK API.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored compatibility-check change has focused Testbox and CI evidence; the external-contributor real-behavior-proof gate does not apply.

Label justifications:

  • P2: This repairs Plugin SDK compatibility detection for plugin authors without changing runtime behavior or the published SDK API.
  • 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 member-authored compatibility-check change has focused Testbox and CI evidence; the external-contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • steipete: Owns the current baseline path in recent history and authored both commits in this PR. (role: recent area contributor; confidence: high; commits: 6246f67784e6, c6f86f526cb8, e6dc1beadc56; files: src/plugin-sdk/api-baseline.ts, src/plugin-sdk/api-baseline-declaration-closure.ts)
  • vincentkoc: Authored the prior work expanding and stabilizing Plugin SDK public API baseline coverage. (role: historical feature contributor; confidence: medium; commits: ddbec923d4ee, 41e56d56fcae; files: src/plugin-sdk/api-baseline.ts, src/plugin-sdk/api-baseline.test.ts)

Rank-up moves

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

  • Wait for the exact-head Plugin SDK baseline check to pass 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.

@steipete
steipete merged commit e09b0eb into main Aug 9, 2026
137 checks passed
@steipete
steipete deleted the steipete/angry-jemison-742797 branch August 9, 2026 07:52
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Landed with exact-head proof complete.

ClawSweeper found no concrete defect. Its optional rank-up move was to wait for the exact-head Plugin SDK baseline check; that check passed before merge.

steipete added a commit that referenced this pull request Aug 9, 2026
#120975 changed the baseline generator to hash private types but landed
without regenerating the manifest; the check-plugin-sdk-api-baseline
lane was gated off on that PR and first failed here. Regenerated via
pnpm plugin-sdk:api:gen with no SDK surface change in this branch.
steipete added a commit that referenced this pull request Aug 9, 2026
…ng AI setup (#120907)

* fix(macos): let AI setup proceed when the login keychain is unavailable

A missing/locked login keychain made GatewayActivationBindingKeyStore
unable to mint the activation binding key, and onboarding refused every
candidate and manual-key activation with 'Secure storage is unavailable'.
The fingerprint only protects the crash/relaunch resume receipt, so
degrade instead of refusing: write an ownerless pending record (still
matched exactly, never as a wildcard), keep the full activation-ambiguity
window, and skip only restart reconciliation, which needs fingerprint
proof by design. A relaunch then repeats activation rather than trusting
the receipt.

Reported by Peter Steinberger.

* fix(macos): render proper provider brand icons in onboarding AI setup

Nearly every provider icon URL the gateway sends is a simpleicons.org
SVG, which AsyncImage cannot decode, so the Connect your AI page fell
back to generic symbols for every tool and provider; the two GitHub
avatar PNGs that did render clashed as full-color rasters.

Bundle nine monochrome template marks (Simple Icons CC0; xAI from
LobeHub icons, MIT) and resolve them local-first by brand id/kind,
including composed choice ids like xai-oauth. Remote icons now load via
NSImage(data:), which decodes SVG, with vector payloads tinted as
templates so plugin-supplied icons blend too. Every glyph sits in a
uniform rounded well; install cards show host-only links, hover states,
and a softer translucent surface shared by all setup sections instead
of controlBackgroundColor.

Requested by Peter Steinberger.

* fix(macos): use failable UTF-8 decode in icon vector sniffing (swiftlint)

* fix(macos): address ClawSweeper review of onboarding icon/keychain changes

- Refuse relaunch handoff from ownerless (keychain-unavailable) completed
  receipts at the reconciliation trust boundary; such receipts can belong
  to replaced credentials, so setup repeats a fresh activation instead.
- Decode and pass the canonical brandId the gateway sends for candidates,
  auth options, and manual providers so bundled marks resolve for opaque
  choice ids.
- Scan the bounded XML prolog (comments, declarations, doctype) when
  sniffing remote SVG payloads; comment-prefixed vectors now tint as
  templates.

* refactor(macos): move setup error enum to support file (swiftlint file length)

* chore(i18n): refresh native source inventory

* fix(macos): give keychain-unavailable activations attempt-specific unbound leases

A nil owner made concurrent unbound attempts indistinguishable: a stale
attempt's delayed response could complete or clear a newer attempt's
record. Unbound attempts now mint a random per-attempt lease id with a
sentinel fingerprint — live matching stays attempt-exact, restart
reconciliation's fingerprint guard rejects them, and relaunch
verification refuses unbound receipts before any handoff.

* chore(macos): ship third-party artwork notices with provider icons

Simple Icons (CC0) attribution and the LobeHub Icons MIT license text
for the xAI mark now travel inside the bundled ProviderIcons directory.

* fix(ci): refresh plugin-sdk API manifest for private-type hashing

#120975 changed the baseline generator to hash private types but landed
without regenerating the manifest; the check-plugin-sdk-api-baseline
lane was gated off on that PR and first failed here. Regenerated via
pnpm plugin-sdk:api:gen with no SDK surface change in this branch.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 10, 2026
…w#120975)

* fix(plugin-sdk): hash private declaration dependencies

* chore(plugin-sdk): refresh API baseline
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 10, 2026
…ng AI setup (openclaw#120907)

* fix(macos): let AI setup proceed when the login keychain is unavailable

A missing/locked login keychain made GatewayActivationBindingKeyStore
unable to mint the activation binding key, and onboarding refused every
candidate and manual-key activation with 'Secure storage is unavailable'.
The fingerprint only protects the crash/relaunch resume receipt, so
degrade instead of refusing: write an ownerless pending record (still
matched exactly, never as a wildcard), keep the full activation-ambiguity
window, and skip only restart reconciliation, which needs fingerprint
proof by design. A relaunch then repeats activation rather than trusting
the receipt.

Reported by Peter Steinberger.

* fix(macos): render proper provider brand icons in onboarding AI setup

Nearly every provider icon URL the gateway sends is a simpleicons.org
SVG, which AsyncImage cannot decode, so the Connect your AI page fell
back to generic symbols for every tool and provider; the two GitHub
avatar PNGs that did render clashed as full-color rasters.

Bundle nine monochrome template marks (Simple Icons CC0; xAI from
LobeHub icons, MIT) and resolve them local-first by brand id/kind,
including composed choice ids like xai-oauth. Remote icons now load via
NSImage(data:), which decodes SVG, with vector payloads tinted as
templates so plugin-supplied icons blend too. Every glyph sits in a
uniform rounded well; install cards show host-only links, hover states,
and a softer translucent surface shared by all setup sections instead
of controlBackgroundColor.

Requested by Peter Steinberger.

* fix(macos): use failable UTF-8 decode in icon vector sniffing (swiftlint)

* fix(macos): address ClawSweeper review of onboarding icon/keychain changes

- Refuse relaunch handoff from ownerless (keychain-unavailable) completed
  receipts at the reconciliation trust boundary; such receipts can belong
  to replaced credentials, so setup repeats a fresh activation instead.
- Decode and pass the canonical brandId the gateway sends for candidates,
  auth options, and manual providers so bundled marks resolve for opaque
  choice ids.
- Scan the bounded XML prolog (comments, declarations, doctype) when
  sniffing remote SVG payloads; comment-prefixed vectors now tint as
  templates.

* refactor(macos): move setup error enum to support file (swiftlint file length)

* chore(i18n): refresh native source inventory

* fix(macos): give keychain-unavailable activations attempt-specific unbound leases

A nil owner made concurrent unbound attempts indistinguishable: a stale
attempt's delayed response could complete or clear a newer attempt's
record. Unbound attempts now mint a random per-attempt lease id with a
sentinel fingerprint — live matching stays attempt-exact, restart
reconciliation's fingerprint guard rejects them, and relaunch
verification refuses unbound receipts before any handoff.

* chore(macos): ship third-party artwork notices with provider icons

Simple Icons (CC0) attribution and the LobeHub Icons MIT license text
for the xAI mark now travel inside the bundled ProviderIcons directory.

* fix(ci): refresh plugin-sdk API manifest for private-type hashing

openclaw#120975 changed the baseline generator to hash private types but landed
without regenerating the manifest; the check-plugin-sdk-api-baseline
lane was gated off on that PR and first failed here. Regenerated via
pnpm plugin-sdk:api:gen with no SDK surface change in this branch.
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 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.

1 participant