Skip to content

Remove plugin tests that replay SDK behavior or restate source - #4374

Merged
SawyerHood merged 1 commit into
mainfrom
bb/test-audit-plugins-thr_s3kmw74uzx
Sep 25, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/test-audit-plugins-thr_s3kmw74uzx

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Several plugin tests didn't test the plugin:

  • They replayed Plugin SDK behaviour: the native-roots cap and defineCli parsing copied into six plugins.
  • Copies of the SDK RPC demo tests in github and docs registered their own stub handlers.
  • Some restated source, or could never run in CI: monaco language tests against a bundle CI never builds.
  • Some kept test-only exports alive: filterClaudeNativeRoots, combineWorkspaceWriteRoots, and the Plugin Guide *_MARKS arrays.

What changed

Found by a read-only test audit using the repo test-audit skill (#4361).

  • Claude native roots: drops the cap test that replayed the SDK filter, and inlines filterClaudeNativeRoots into resolveClaudeNativeRoots. No published SDK export changes.
  • defineCli replays: trims the generic parsing checks from six plugins. The SDK's cli-spec.test.ts covers them, and now also covers usageErrorExitCode at every usage-error site. Each plugin keeps:
    • its bb <name> <cmd> command-name assertion;
    • its own error envelopes.
      custom-instructions also keeps the required-text check, and proves a bare set leaves saved instructions intact.
  • github/docs: the SDK RPC demo copies are gone. Plugin-specific input validation now runs against the real loaded plugins: github startWork rejects a bad repo or item number, and docs /write rejects non-string content.
  • Plugin Guide: the hand-maintained *_MARKS arrays and their inventory tests are replaced by a rendered check. Each visual group's fixture must draw exactly surfaceIds(group). surfaces.ts and anatomy-manifest.json are unchanged.
  • monaco: the tautological language tests are dropped. stage-assets.mjs now fails the bundle build (prepare:bundled, part of smoke:tarball) if a claimed language id isn't registered.
  • Other removals:
    • pi rpc-child.extension-ui.test.ts
    • duplicate Claude and Codex workspace-write root tests; combineWorkspaceWriteRoots is no longer exported
    • the workflows doc-tree grep for a command that never shipped
    • concurrency-limit limits.test.ts
    • a duplicate tasks steer test
    • two inert plugin-build tests
    • an unreachable scaffold-script branch

Production, tooling and docs +33/−66; tests +134/−873.

How you verified

  • pnpm exec turbo run test lint typecheck passes over all 16 touched packages (52/52).
  • An independent verifier used before and after worktrees on 175d5ac. For each removed test it wrote the bug that test catches as a production change, then checked the old test fails and a remaining test also fails.
    • It found 5 lost failure modes, all restored in this PR: the Guide surface ids, custom-instructions set without text, CLI command names, github startWork input validation, and the docs content type.
    • Each restored assertion fails under its mutation.
  • The monaco check was confirmed to run in the packaging path: it passes on clean source and fails on a bad language id.

AGENT GENERATED

🤖 Generated with Claude Code

Remove plugin and SDK tests that replay shared helpers, restate source,
duplicate stronger tests, or keep test-only seams alive, and move the
coverage that mattered to the owning boundary.

- Claude native roots: drop the cap test that replayed the SDK filter;
  inline filterClaudeNativeRoots into resolveClaudeNativeRoots.
- github and docs: drop the SDK RPC inference/validation demo tests. Their
  plugin-specific input checks now run against the real plugins: github
  startWork rejects a bad repository or item number, and docs /write
  rejects non-string content.
- pi: drop rpc-child.extension-ui.test.ts; the session and bridge
  extension-ui tests cover auto-cancel, forwarding and responses.
- defineCli replays: trim the generic help, unknown option/command,
  unexpected argument and missing-argument checks from six plugins. Each
  plugin keeps its own command-name help assertion and error envelopes,
  custom-instructions keeps the required-text check (and proves a bare
  `set` leaves saved instructions intact), provider-retry keeps one exit-2
  check, and cli-spec.test.ts now covers usageErrorExitCode at every
  usage-error site.
- Claude workspace-write roots: drop tests below the bridge boundary.
- workflows: drop the doc-tree grep for a command that never shipped.
- monaco: drop tautological language tests that could not run in CI;
  stage-assets.mjs now fails the bundle build when a claimed language id
  is not registered.
- concurrency-limit: drop limits.test.ts (covered by server tests).
- Plugin Guide: replace the hand-kept *_MARKS arrays and their inventory
  tests with a rendered check that each visual group's fixture draws
  exactly the group's surface ids; update the maintenance skill.
- scaffold: drop a duplicate fidelity test and the unreachable
  fixtureResponsiveStrategy "reflow" branch.
- Codex: drop git-root combine tests below the translator boundary;
  un-export combineWorkspaceWriteRoots.
- tasks: drop a byte-for-byte duplicate side-chat steer test.
- plugin-build: drop an inert toolchain cache test and a restatement of
  PLUGIN_SERVER_EXTERNALS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@SawyerHood
SawyerHood merged commit 81f1262 into main Sep 25, 2026
18 checks passed
@SawyerHood
SawyerHood deleted the bb/test-audit-plugins-thr_s3kmw74uzx branch September 25, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant