Skip to content

Trim shape-only tests in the tool packages (CL-7475) - #666

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-7475-trim-tests
Sep 6, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-7475-trim-tests

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Part of CL-7475. Owner ruling: test only logic that is ours and not obviously correct; never build tests for coverage. This trims the main-side tool packages accordingly; the e2e/sandbox-sidecar half follows on the #632 branch.

packages/access-tools/src/tool.test.ts

Removed:

  • "declares exactly the four access tools" — bundle-shape assertion
  • "requires the sanctioned env keys" — pin assertion
  • "grant_access and revoke_access declare approval: ask; the reads do not" — approval-flag literal assertion

Kept: input-validation-before-fetch, the 403-surfaces-as-tool-error case, and the grant/list round trip — these exercise our own logic, not the bundle's static shape.

packages/access-tools/src/client.test.ts

Removed:

  • "listPrincipals sends sidecar auth and parses the response"
  • "listGrants filters by principalId and resource"
  • "grantAccess round-trips the created grants"
  • "revokeAccess sends a DELETE to the grant's own path"

All four were pure client-wrapper pass-through tests (assert the request we just built matches the request we just sent). Kept the two cases that prove an untrusted hub response (403/404) is parsed into the right typed error (AccessForbiddenError / AccessNotFoundError) rather than trusted.

packages/catalog-tools/src/tool.test.ts

Removed:

  • "the bundle's shape" describe block (3 tests: declared tool list + approval flags, required env keys, schema/capability-vocabulary shape check)
  • "the offering bundle's shape" describe block (2 tests: declared tool list + approval flags, required env keys)

Kept everything else: the read tools' validation/formatting behaviour (pick_models, estimate_run_cost, list_model_concepts) and, per write tool, the happy path plus unknown-canonical-name and 403 refusal cases.

packages/access-tools/test/routes.test.ts, packages/catalog-tools/src/routes.test.ts, packages/tool-registry-publish/src/pack.test.ts

No changes — already limited to 401/403/ceiling/happy-path authz-ceiling coverage (routes) or a genuine packing/import round-trip guard (pack.test.ts), not shape/pin/native-@intX assertions.

Verify

  • bun test packages/access-tools packages/catalog-tools packages/tool-registry-publish — green (DB-gated routes suite skips locally as expected)
  • bun run typecheck — clean

@linear-code

linear-code Bot commented Sep 6, 2026

Copy link
Copy Markdown

CL-7475

Deleted the bundle-shape assertions (declared tool list, approval-flag
literals, required env keys) and the pure client-wrapper pass-through
tests that only reasserted a request shape or the fixture body already
handed to the fetch stub. Kept the cases that test something ours and
not obviously correct: input validation before ever calling fetch, a
grant/list round-trip, and the two client cases proving a 403/404 from
the hub is parsed into the right typed error rather than trusted.
Deleted the two 'bundle's shape' describe blocks (declared tool list,
approval flags, required env keys, and the schema-vocabulary check),
which only reasserted literals already fixed by the tool definitions
themselves. Kept every case that exercises real logic: the read-only
tools' validation and formatting behaviour, and each write tool's
happy path, unknown-name refusal, and 403 handling.
@TheGreatAxios
TheGreatAxios merged commit 251d76e into main Sep 6, 2026
7 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-7475-trim-tests branch September 6, 2026 17:42
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