Skip to content

feat(api): defer grpc/graphql/swagger off Ready module graph - #1401

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/clawql-api-ready-lazy-a621
Oct 23, 2026
Merged

cursor[bot] merged 2 commits into
mainfrom
cursor/clawql-api-ready-lazy-a621

Conversation

@danielsmithdevelopment

Copy link
Copy Markdown
Owner

Summary

Stacked on #1400 (clawql-inference/keys). Defers @grpc/grpc-js, graphql, and swagger2openapi so equal-arm Ready / LOAD=db never evaluates them at module init.

Changes

  • execute-core: dynamic import() for native GraphQL/gRPC execute
  • native-protocol-merge / custom-sources-merge / spec-loader: dynamic loaders + swagger2openapi
  • Drop heavy re-exports from execute/index and spec/index barrels
  • Test import path fix for graphql-native-loader.test.ts

Remasure (Bun --smol, equal-arm, N=2k)

Arm Anon median
Keys + catalog-on (#1400) ~136.2 MB
This PR + catalog-on ~128.0 MB (~8 MB)
This PR + catalog-off ~132.3 MB

Peer gap now ~26–29 MB vs ~99–102 MB.

Test plan

  • npm run build -w clawql-api
  • vitest native-protocol-merge + graphql-native-loader (12 passed)
  • BUN_RUNTIME=1 BUN_SMOL=1 N=2000 npm run benchmark:heap-vs-anon-plateau
  • Ready maps probe: no grpc/swagger hits; listen anon ~81 MB
Open in Web Open in Cursor 

@cursor
cursor Bot force-pushed the cursor/clawql-api-ready-lazy-a621 branch 2 times, most recently from 39fb4fa to bef87c8 Compare October 23, 2026 19:17
@cursor
cursor Bot force-pushed the cursor/clawql-api-ready-lazy-a621 branch 2 times, most recently from ac857de to 0c73811 Compare October 23, 2026 19:52
cursoragent and others added 2 commits October 23, 2026 20:16
Dynamic-import native execute + native protocol loaders + swagger2openapi
so equal-arm LOAD=db listen never evaluates @grpc/grpc-js, graphql, or
swagger. Drop those modules from the clawql-api barrel re-exports.

Remasure Bun --smol N=2k: ~128.0 MB anon median (~8 MB vs keys tip).

Co-authored-by: Daniel Smith <danielsmithdevelopment@gmail.com>
Co-authored-by: Daniel Smith <danielsmithdevelopment@gmail.com>
@cursor
cursor Bot force-pushed the cursor/clawql-api-ready-lazy-a621 branch from 0c73811 to 7d3dbd8 Compare October 23, 2026 20:16
@cursor
cursor Bot changed the base branch from cursor/inference-keys-ready-lazy-a621 to main October 23, 2026 20:16
@cursor
cursor Bot merged commit dec0b7f into main Oct 23, 2026
2 checks passed
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.

2 participants