Skip to content

ci: check the Plugin SDK export surface on every pull request - #207167

Merged
obviyus merged 4 commits into
mainfrom
core/sdk-budget-ci-lane
Nov 28, 2026
Merged

obviyus merged 4 commits into
mainfrom
core/sdk-budget-ci-lane

Conversation

@obviyus

@obviyus obviyus commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Problem

#206995 added a Plugin SDK export without a surface budget line and merged with green PR CI. Main's SDK surface check then failed (public exports 3933 > 3932, public callable exports 2260 > 2259) until a follow-up added the line.

Why PR CI did not catch it:

  • check:changed selects plugin-sdk:check-exports and plugin-sdk:surface:check for SDK paths. But PR CI calls it lint-only (ci.yml, "Run changed lint", lintOnly: true), so only lint commands run.
  • The only other runner is the generated-doc-baselines job in workflow-sanity.yml. It runs only on workflow_dispatch, never on a pull request.

Fix

The baseline-ratchets job (scripts/ci-baseline-ratchets.mts) already runs on every node PR. It now also runs plugin-sdk:check-exports and plugin-sdk:surface:check on every run:

  • The surface check is a large TypeScript program, so it runs in the same slot as the database-worker and database-dialect snapshots. They run one after another and never overlap (the memory rule from c695d653). The export check is light and joins the shared queue.
  • It runs on every PR, not only SDK-path PRs: the SDK import closure reaches far outside src/plugin-sdk. For example, adding @deprecated to src/channels/chat-type.ts moves the deprecated-export count, and no changed-path rule sees that.

No new workflow or job.

Impact

Contributors: a PR that changes the SDK export surface without its budget line now fails checks-fast-baseline-ratchets instead of turning main red after merge. Cost per PR: one surface check (about 7 s and 3.5 GB peak locally) in the existing job.

Evidence

  • Red/green on a PR-like change set: a scratch copy of main with fix(codex): list skills by name when skills_read can load them #206995's export added on top of a tagged base, run with pnpm check:baseline-ratchets --base <base> --no-merge-base:
    • a new SDK function without a budget line: plugin-sdk-surface fails, public exports 3933 > 3932, public callable exports 2261 > 2260, exit 1;
    • the same change plus the budget lines: [ok] plugin-sdk-exports, [ok] plugin-sdk-surface, exit 0.
  • test/scripts/ci-baseline-ratchets.test.ts: the expected command list now includes both SDK checks in their slots (4/4).
  • Adversarial review: a first version selected the checks by changed path. The review showed that version missed real budget inputs outside src/plugin-sdk and reproduced a miss. This version drops path selection.

…hat touches the SDK surface

- PR CI ran check:changed lint-only, and the surface budget step in Workflow Sanity runs only on workflow_dispatch, so #206995 merged an unbudgeted export.
- The baseline-ratchets job (every node PR) adds plugin-sdk:check-exports and plugin-sdk:surface:check when the PR's changed paths touch the SDK surface; the path predicate moves to changed-path-facts and check:changed reuses it.
@clawsweeper

clawsweeper Bot commented Nov 28, 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 size: XS labels Nov 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. labels Nov 28, 2026
@obviyus
obviyus merged commit 7c16b31 into main Nov 28, 2026
103 checks passed
@obviyus
obviyus deleted the core/sdk-budget-ci-lane branch November 28, 2026 03:08
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 28, 2026
…aw#207167)

## Problem

openclaw#206995 added a Plugin SDK export without a surface budget line and merged with green PR CI. Main's SDK surface check then failed (`public exports 3933 > 3932`, `public callable exports 2260 > 2259`) until a follow-up added the line.

Why PR CI did not catch it:
- `check:changed` selects `plugin-sdk:check-exports` and `plugin-sdk:surface:check` for SDK paths. But PR CI calls it lint-only (`ci.yml`, "Run changed lint", `lintOnly: true`), so only lint commands run.
- The only other runner is the `generated-doc-baselines` job in `workflow-sanity.yml`. It runs only on `workflow_dispatch`, never on a pull request.

## Fix

The baseline-ratchets job (`scripts/ci-baseline-ratchets.mts`) already runs on every node PR. It now also runs `plugin-sdk:check-exports` and `plugin-sdk:surface:check` on every run:
- The surface check is a large TypeScript program, so it runs in the same slot as the database-worker and database-dialect snapshots. They run one after another and never overlap (the memory rule from `4d6287da`). The export check is light and joins the shared queue.
- It runs on every PR, not only SDK-path PRs: the SDK import closure reaches far outside `src/plugin-sdk`. For example, adding `@deprecated` to `src/channels/chat-type.ts` moves the deprecated-export count, and no changed-path rule sees that.

No new workflow or job.

## Impact

Contributors: a PR that changes the SDK export surface without its budget line now fails `checks-fast-baseline-ratchets` instead of turning main red after merge. Cost per PR: one surface check (about 7 s and 3.5 GB peak locally) in the existing job.

## Evidence

- Red/green on a PR-like change set: a scratch copy of main with openclaw#206995's export added on top of a tagged base, run with `pnpm check:baseline-ratchets --base <base> --no-merge-base`:
  - a new SDK function without a budget line: `plugin-sdk-surface` fails, `public exports 3933 > 3932`, `public callable exports 2261 > 2260`, exit 1;
  - the same change plus the budget lines: `[ok] plugin-sdk-exports`, `[ok] plugin-sdk-surface`, exit 0.
- `test/scripts/ci-baseline-ratchets.test.ts`: the expected command list now includes both SDK checks in their slots (4/4).
- Adversarial review: a first version selected the checks by changed path. The review showed that version missed real budget inputs outside `src/plugin-sdk` and reproduced a miss. This version drops path selection.
- Local review on this head: patch is correct, 0 findings.
- CI cost on this PR's runner: `plugin-sdk-surface` 8.48 s and `plugin-sdk-exports` 0.28 s inside `checks-fast-baseline-ratchets`, which took 4m50s in total.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
## Problem

#206995 added a Plugin SDK export without a surface budget line and merged with green PR CI. Main's SDK surface check then failed (`public exports 3933 > 3932`, `public callable exports 2260 > 2259`) until a follow-up added the line.

Why PR CI did not catch it:
- `check:changed` selects `plugin-sdk:check-exports` and `plugin-sdk:surface:check` for SDK paths. But PR CI calls it lint-only (`ci.yml`, "Run changed lint", `lintOnly: true`), so only lint commands run.
- The only other runner is the `generated-doc-baselines` job in `workflow-sanity.yml`. It runs only on `workflow_dispatch`, never on a pull request.

## Fix

The baseline-ratchets job (`scripts/ci-baseline-ratchets.mts`) already runs on every node PR. It now also runs `plugin-sdk:check-exports` and `plugin-sdk:surface:check` on every run:
- The surface check is a large TypeScript program, so it runs in the same slot as the database-worker and database-dialect snapshots. They run one after another and never overlap (the memory rule from `c695d653`). The export check is light and joins the shared queue.
- It runs on every PR, not only SDK-path PRs: the SDK import closure reaches far outside `src/plugin-sdk`. For example, adding `@deprecated` to `src/channels/chat-type.ts` moves the deprecated-export count, and no changed-path rule sees that.

No new workflow or job.

## Impact

Contributors: a PR that changes the SDK export surface without its budget line now fails `checks-fast-baseline-ratchets` instead of turning main red after merge. Cost per PR: one surface check (about 7 s and 3.5 GB peak locally) in the existing job.

## Evidence

- Red/green on a PR-like change set: a scratch copy of main with #206995's export added on top of a tagged base, run with `pnpm check:baseline-ratchets --base <base> --no-merge-base`:
  - a new SDK function without a budget line: `plugin-sdk-surface` fails, `public exports 3933 > 3932`, `public callable exports 2261 > 2260`, exit 1;
  - the same change plus the budget lines: `[ok] plugin-sdk-exports`, `[ok] plugin-sdk-surface`, exit 0.
- `test/scripts/ci-baseline-ratchets.test.ts`: the expected command list now includes both SDK checks in their slots (4/4).
- Adversarial review: a first version selected the checks by changed path. The review showed that version missed real budget inputs outside `src/plugin-sdk` and reproduced a miss. This version drops path selection.
- Local review on this head: patch is correct, 0 findings.
- CI cost on this PR's runner: `plugin-sdk-surface` 8.48 s and `plugin-sdk-exports` 0.28 s inside `checks-fast-baseline-ratchets`, which took 4m50s in total.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit 7c16b31)

Release adaptation: Add both existing SDK checks without overlapping the large SDK surface check with either large database check.

Follow-up audit: No required nonselected PR/SHA follow-up. Other same-path candidates (9c9e3c7) are not selected prerequisites in the source assessment; owner proof below checks the selected stable contract.

Co-authored-by: RomneyDa <[email protected]>
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 impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. scripts Repository scripts size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant