Skip to content

refactor(plugin-sdk): replace API baselines with diffs - #123036

Merged
steipete merged 13 commits into
mainfrom
t3code/remove-plugin-sdk-baseline-hashes
Aug 13, 2026
Merged

steipete merged 13 commits into
mainfrom
t3code/remove-plugin-sdk-baseline-hashes

Conversation

@obviyus

@obviyus obviyus commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

Why this is needed

OpenClaw main moves fast. The current Plugin SDK check commits one generated hash record for each SDK entrypoint. When two PRs change the same entrypoint, both rewrite the same one-line record. Their source changes may be independent, but Git still reports a conflict.

Resolving that conflict means rebasing, regenerating the hashes, pushing again, and rerunning the full merge-head CI. Main often moves again before the PR lands, so maintainers repeat the same work.

The committed records are not used at runtime. Each record contains an entrypoint, an import name, and an opaque hash. CI checks that the hash matches the current declarations. Regenerating and committing the record makes the check pass. The record proves that the SDK changed, but it does not explain the change or decide whether the change is compatible.

#122082 split the original shared baseline into one file per entrypoint. That removed cross-entrypoint conflicts, but hot entrypoints still conflict whenever unrelated changes reach the same public API.

What changes

  • Delete the committed Plugin SDK hash records.
  • Compare the exact PR base with the exact tested merge head in CI.
  • Print the changed entrypoints, exports, signatures, and reachable declarations in a readable report.
  • Store the complete machine-readable diff as a CI artifact.
  • Compare the previous published SDK with the exact release candidate during release preflight.

A Plugin SDK change no longer fails PR CI only because a generated hash file needs an update. The CI report still shows reviewers exactly what changed.

Example

Before, Alice adds one field to SendOptions and Bob adds an unrelated field to SendResult. Both changes rewrite the same entrypoint hash, so one PR conflicts after main moves.

After, neither PR commits generated approval state. CI compares the two revisions and reports both declaration changes:

SendOptions: added accountId: string
SendResult: added traceId: string

Release protection

This PR does not remove release awareness. It makes the release check stronger and more useful.

During npm preflight, trusted workflow code:

  1. Resolves the version currently published on the selected npm channel.
  2. Compares that version's Plugin SDK with the exact release candidate.
  3. Saves the readable diff, both commit SHAs, the trusted workflow SHA, and a SHA-256 digest in an immutable receipt.
  4. Adds the receipt to the preflight manifest and uploads a separate copy for comparison.

If the SDK changed, the release operator must review the diff and supply its eight-character digest. The candidate check, the parent publish workflow, and the direct npm publish workflow validate the receipt independently. Publication stops when evidence is missing, altered, stale, produced by different workflow code, tied to another release SHA, based on an outdated npm predecessor, or acknowledged with the wrong digest.

The same parent check protects broad plugin and ClawHub publication. Older release tags do not need this new script because current trusted tooling renders their source directly.

Neither the old hashes nor this replacement can decide whether an API change is safe for every plugin. That remains a maintainer decision. The new report gives the maintainer the declarations to review instead of an opaque hash.

Alternatives considered

  • Keep rebasing and regenerating. This preserves the current weak signal but keeps wasting complete CI runs.
  • Split the baseline further. refactor(plugin-sdk): split API baseline by entrypoint #122082 already split it by entrypoint. Per-export files would create hundreds of generated files, while shared reachable declarations would still touch several records.
  • Use committed API reports. Tools such as API Extractor use this model. The reports are easier to read, but committed generated state still creates merge conflicts.
  • Use a custom merge driver. GitHub server-side merges do not use a maintainer's local driver. Automatic conflict resolution could also hide a real API change.
  • Require another PR-time acknowledgement. A label, trailer, or head-bound token would add more per-head work. CI already reports the exact PR change, while release preflight reviews the complete change from the published version to the candidate.

Tradeoffs

  • A nonempty PR diff is advisory. Reviewers must read the CI report. Publication remains blocked until a maintainer acknowledges the release diff.
  • Existing npm preflight artifacts become stale when this lands and must be regenerated once.
  • The diff job checks out and renders both revisions. That costs more than comparing committed hashes, but it avoids repeated full CI runs caused by hash conflicts.

Proof

  • Regression test reproduces the old same-entrypoint git merge-file conflict and proves both independent declaration changes appear in the new diff.
  • Black-box CLI test proves that blank and wrong acknowledgements fail while the matching digest passes.
  • Candidate, parent, and direct npm publish paths compare the immutable receipt and authenticate its workflow identity and lineage.
  • Live old-tag proof uses v2026.8.1-beta.1, which has no diff script, and produces a checked exact-SHA receipt with no changes and digest ff7b090f.
  • Historical CI compatibility and synthetic merge-head workflow regressions pass.
  • UTF-8 report bounds and interrupted-worktree cleanup have regression coverage.
  • pnpm check passed, including policy guards, production types, script types, test types, lint, and formatting.
  • pnpm check:workflows passed.
  • Focused SDK and release regressions passed. The focused release validator and workflow suites pass 86 tests.
  • Docs formatting and MDX checks passed.
  • Distill and Greybeard final passes found no blockers or rank-up moves.

Follow-up to #121496 and #122082.

Maintainer decision by @obviyus: keep digest acknowledgement at release time. It replaces PR-blocking generated state with one deliberate check before publication.

Exact head: 942858f35c30e887f12de8ebdd871adf45f27ffe.

@obviyus
obviyus requested review from a team as code owners August 13, 2026 06:30
@clawsweeper

clawsweeper Bot commented Aug 13, 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 scripts Repository scripts labels Aug 13, 2026
@github-actions

github-actions Bot commented Aug 13, 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: 1ef7f44dea080399692339148ad80ba00c33845c

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Aug 13, 2026
@obviyus
obviyus force-pushed the t3code/remove-plugin-sdk-baseline-hashes branch from 690ea83 to 79aadc0 Compare August 13, 2026 06:44
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 6:05 AM ET / 10:05 UTC.

ClawSweeper review

What this changes

Replaces committed Plugin SDK API baseline records with base-to-head declaration diffs and adds a digest acknowledgement to release publication workflows when that API changes.

Merge readiness

⚠️ Needs maintainer review before merge - 3 items remain

Keep open for maintainer merge handling. The proposed replacement is still absent from current main, but the exact PR head could not be hydrated locally and current GitHub status has unresolved failures, so this review cannot certify the merge result.

Priority: P2
Reviewed head: 942858f35c30e887f12de8ebdd871adf45f27ffe

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The PR has strong submitted proof and no supported code finding, but current failed checks and unavailable exact-head source prevent a higher-confidence merge rating.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The PR body and exact-head maintainer comment provide after-fix release-path output, acknowledgement rejection coverage, and focused CI evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The PR body and exact-head maintainer comment provide after-fix release-path output, acknowledgement rejection coverage, and focused CI evidence.
Evidence reviewed 6 items Current main still uses committed baselines: Current main retains the check and generation commands, so the requested base/head diff behavior is not already implemented.
Current owner paths: The existing generated-baseline check is selected by changed-file logic and CI, which the submitted patch replaces alongside its caller tests.
Existing release trust boundary: Current release workflows already pin trusted validation tooling to workflow SHA and bind preflight manifests to tag, release SHA, dist-tag, and tarball digest; the PR extends this boundary with SDK evidence.
Findings None None.
Security None None.

How this fits together

Plugin SDK declarations define the public contract consumed by plugins. CI reports contract changes for pull requests, while release workflows preserve reviewed evidence before publishing OpenClaw packages and plugins.

flowchart LR
  A[Plugin SDK declarations] --> B[API diff renderer]
  B --> C[Pull request CI]
  B --> D[Release preflight receipt]
  D --> E[Digest acknowledgement]
  E --> F[Package and plugin publication]
Loading

Before merge

  • Resolve merge risk (P1) - Current status includes failed check-dependencies, checks-ui, and openclaw/ci-gate runs; publication workflow changes should not land until the merge result has green exact-head checks or each failure is conclusively classified.
  • Resolve merge risk (P1) - The review checkout cannot read the submitted head because promisor hydration failed on GitHub DNS, limiting independent source and history verification to current main plus the supplied PR evidence.
  • Complete next step (P2) - A protected maintainer PR with release workflow changes needs exact merge-result validation; no narrow automated repair is established.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production/test LOC visibility reported total +2,384/-868; visible test files +743/-257; production split unavailable The supplied file list is truncated and the local checkout cannot hydrate the PR head, so a trustworthy full production-versus-test split is not available.
Release acknowledgement surface 2 workflow-dispatch inputs added Both npm preflight and canonical publish routing must enforce the same reviewed digest.

Stored data model

Persistent data-model change detected: serialized state: test/scripts/plugin-sdk-api-release-evidence.test.ts, unknown-truncated-pull-files, vector/embedding metadata: .agents/skills/release-openclaw-maintainer/references/extended-stable-backports.md, vector/embedding metadata: scripts/check-changed.mts, vector/embedding metadata: scripts/generate-plugin-sdk-api-baseline.ts, vector/embedding metadata: scripts/release-preflight.mts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Refresh release-gate proof on the merge result (recommended)
    Validate the current mergeable result against main and require green or explicitly resolved exact-head checks before landing the SDK publication gate.

Technical review

Best possible solution:

Validate the clean GitHub merge result against current main, resolve or classify the three failed checks, and retain one fail-closed acknowledgement path shared by every publication route.

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

Not applicable as an end-user bug report. The PR documents a controlled baseline-conflict reproduction, but this review could not rerun it because the exact head is unavailable locally.

Is this the best way to solve the issue?

Unclear: the supplied patch appears to replace all current baseline owner paths and preserve intentional-change review at publication, but the exact submitted source could not be independently read.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This changes bounded Plugin SDK review and release automation behavior without evidence of an active user-facing outage.
  • merge-risk: 🚨 compatibility: A Plugin SDK API change now requires a publication-time acknowledgement, affecting release-operator behavior for public plugin contracts.
  • merge-risk: 🚨 automation: The PR changes CI selection and both release publication workflows.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR body and exact-head maintainer comment provide after-fix release-path output, acknowledgement rejection coverage, and focused CI evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and exact-head maintainer comment provide after-fix release-path output, acknowledgement rejection coverage, and focused CI evidence.

Evidence

What I checked:

  • Current main still uses committed baselines: Current main retains the check and generation commands, so the requested base/head diff behavior is not already implemented. (package.json:1680, 7a7f6dfbd41e)
  • Current owner paths: The existing generated-baseline check is selected by changed-file logic and CI, which the submitted patch replaces alongside its caller tests. (scripts/check-changed.mts:677, 7a7f6dfbd41e)
  • Existing release trust boundary: Current release workflows already pin trusted validation tooling to workflow SHA and bind preflight manifests to tag, release SHA, dist-tag, and tarball digest; the PR extends this boundary with SDK evidence. (.github/workflows/openclaw-npm-release.yml:884, 7a7f6dfbd41e)
  • History and likely ownership: The locally available history attributes the current baseline and release surfaces to the current main ancestry, but shallow/promisor history prevents a deeper feature-history trace. (src/plugin-sdk/api-baseline.ts:1, 06600e2ca09f)
  • Exact-head maintainer evidence: The supplied PR discussion records exact-head release-gate inspection and focused-suite results for 942858f, including acknowledgement rejection and trusted-workflow binding. (942858f35c30)
  • Inspection limitation and release state: The local partial clone lacks the submitted head; Git attempted a promisor fetch but GitHub DNS resolution failed. The supplied latest release is v2026.7.1-2 at 0790d9f, so this unmerged PR is not shipped. (942858f35c30)

Likely related people:

  • steipete: Authored the prior merged baseline partitioning work and supplied the exact-head review of this PR's release acknowledgement path. (role: related feature author and release-gate reviewer; confidence: high; commits: d1452fb5d123; files: src/plugin-sdk/api-baseline.ts, .github/workflows/openclaw-npm-release.yml)
  • joshavant: The available shallow history attributes the currently checked baseline and release surfaces to this current-main commit. (role: recent current-main contributor; confidence: low; commits: 06600e2ca09f; files: src/plugin-sdk/api-baseline.ts, .github/workflows/openclaw-npm-release.yml, scripts/release-preflight.mts)

Rank-up moves

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

  • Refresh the merge-result CI and resolve or classify check-dependencies, checks-ui, and openclaw/ci-gate before merge.

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 (3 earlier review cycles)
  • reviewed 2026-08-13T07:13:31.813Z sha c347fbd705fa5679c64665a9e41e09bb7c3df239 :: needs changes before merge. :: [P1] Require acknowledgement when the SDK diff is nonempty
  • reviewed 2026-08-13T07:21:40.720Z sha c347fbd705fa5679c64665a9e41e09bb7c3df239 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-13T09:14:37.949Z sha 39cfbda :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 13, 2026
@obviyus
obviyus force-pushed the t3code/remove-plugin-sdk-baseline-hashes branch from d96bd35 to 39b9316 Compare August 13, 2026 08:26
@steipete

Copy link
Copy Markdown
Contributor

Exact-head maintainer review completed at e34079f (addresses the ClawSweeper rank-up move: exact-head confirmation of the release acknowledgement enforcement).

Release gate verified from workflow source on this head:

  • Preflight freezes the evidence receipt (base = previous published version tag per dist-tag, head = tag checkout SHA, full diff + sha256 digest) into the preflight manifest; the manifest embed is unconditional.
  • Both publish paths (openclaw-npm-release.yml publish job and openclaw-release-publish.yml resolve_release_target) validate the receipt with scripts/plugin-sdk-api-release-evidence.mjs fetched from the trusted workflow SHA, so release-tag content cannot weaken its own gate. Evidence is bound to the release SHA at three points (evidence.headSha, manifest.releaseSha, tag checkout).
  • Blank/mismatched/matching acknowledgement digests and altered-evidence rejection are covered by test/scripts/plugin-sdk-api-release-evidence.test.ts; status: unavailable is verifiably restricted to historical tags whose own package.json lacks plugin-sdk:api:diff, and current CI targets fail closed without it.
  • The acknowledgement input reaches shells only via env: (no untrusted ${{ }} interpolation); no permission changes.

Proof run: focused suites on this exact head — api-baseline.test.ts, plugin-sdk-api-release-evidence.test.ts, ci-workflow-guards.test.ts, openclaw-npm-extended-stable-workflow.test.ts, package-acceptance-workflow.test.ts, release-candidate-checklist.test.ts, changed-lanes.test.ts → 532 passed (one unrelated pre-existing local env failure reproduces identically on origin/main in an untouched region). Codex autoreview (gpt-5.6-sol, high): clean, no actionable findings. The regression test genuinely reproduces the old one-line hash-record git merge-file conflict and proves both independent declaration changes surface in the new diff. Exact-head report-plugin-sdk-api-diff CI job (real worktree + per-revision install + render pipeline) is green.

Non-blocking follow-ups noted: stale .gitignore:194-195 un-ignore lines for the deleted docs/.generated/plugin-sdk-api-baseline/ directory; release-candidate-checklist.mts reads --target-package from the operator cwd (can false-fail an extended-stable checklist run from a main checkout — fail-closed usability, never a bypass); pre-existing preflight run IDs become unusable by design (operator heads-up). checks-ui-e2e (3/4) failed on an unrelated Control UI background-tasks flake and was rerun.

Landing now via the repo-native flow.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 13, 2026
@steipete

Copy link
Copy Markdown
Contributor

@obviyus heads-up before your next push: the branch now carries two maintainer commits on top of your rebase — please pull/rebase onto the current remote head instead of force-pushing over them (your last rebase dropped their first versions).

  • test(ui): freeze page clock in background-tasks rail e2e — the merge gate failed 3× on checks-ui-e2e (3/4): the rail transcript is byte-compared across the detail-panel round-trip while relative ages ("11s"→"12s") tick on slow runners. Fixed with Playwright clock.setFixedTime(baseTime); race reproduced pre-fix with an injected 1.5s stall and proven immune post-fix.
  • fix(scripts): drop unused export on dependency-evidence CLI main — check-dependencies goes red with your "authenticate plugin SDK evidence" commit: Knip's workflow scan re-roots script references after the new actions/checkout step with path:, so scripts/generate-dependency-release-evidence.mts loses its workflow-entry status and its exported-but-never-imported main gets flagged. Nothing imports main (the module self-invokes via its entry guard), so the export was dead surface; removing the keyword fixes all three knip passes without config exceptions.

Landing flow continues on the combined head once CI is green.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Aug 13, 2026
@steipete
steipete merged commit d2afbd0 into main Aug 13, 2026
131 checks passed
@steipete
steipete deleted the t3code/remove-plugin-sdk-baseline-hashes branch August 13, 2026 10:45
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
* refactor(plugin-sdk): replace API baselines with diffs

* perf(plugin-sdk): bound API diff resources

* fix(plugin-sdk): isolate API diff dependencies

* fix(release): forward Plugin SDK acknowledgement

* fix(release): enforce SDK acknowledgement on publish

* chore: preserve generated-doc ignore policy

* fix(release): freeze SDK API evidence before publish

* fix(ci): satisfy SDK evidence guards

* fix(release): bind complete SDK evidence

* fix(release): authenticate plugin SDK evidence

* fix(plugin-sdk): abort interrupted API diffs

* test(ui): freeze page clock in background-tasks rail e2e

The rail transcript is compared byte-for-byte across the detail-panel
round-trip while it renders live relative ages; on slow CI runners the
second boundary ticks between the two reads (11s -> 12s) and fails the
equality assertion. Fix the page Date with Playwright setFixedTime while
keeping timers running so the tasks.list polling assertions still hold.

Repro: a 1.5s stall between the reads fails pre-fix with the exact CI
diff and passes post-fix.

* fix(scripts): drop unused export on dependency-evidence CLI main

Knip's workflow scan re-roots script references after an actions/checkout
step that sets path:, so the new trusted-tooling checkout in
openclaw-npm-release.yml stops marking this CLI as a workflow entry and
its exported main() surfaces as an unused export in check-dependencies.
Nothing imports main; the module invokes it through its own entry guard,
so the export keyword was dead surface either way.

---------

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

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL 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