Skip to content

[kumo] Fix catalog schema initialization#596

Open
pranavkatariain wants to merge 1 commit into
cloudflare:mainfrom
pranavkatariain:fix/catalog-init-loads-schemas
Open

[kumo] Fix catalog schema initialization#596
pranavkatariain wants to merge 1 commit into
cloudflare:mainfrom
pranavkatariain:fix/catalog-init-loads-schemas

Conversation

@pranavkatariain

Copy link
Copy Markdown
Contributor

Fixes initCatalog so awaiting it loads the generated catalog schemas before synchronous validation methods are used.

Previously, initCatalog called catalog.validateTree({}), but validation only reads already-loaded schemas and does not trigger the async schema import. This meant the documented setup path could still return Schemas not loaded.

This change:

  • calls loadSchemas() directly from initCatalog
  • keeps the existing initCatalog(catalog) API shape for compatibility
  • adds regression coverage for the documented setup path
  • removes the stale AGENTS.md note

Note: initCatalog currently accepts a catalog argument even though schema loading is shared module state. This PR keeps that API shape for compatibility and only fixes the documented setup flow.

Testing

  • pnpm --filter @cloudflare/kumo test src/catalog/catalog.test.ts --run

  • pnpm --filter @cloudflare/kumo typecheck

  • git diff --check main...HEAD

  • Reviews

    • bonk has reviewed the change
    • automated review not possible because: small catalog initialization fix reviewed manually
  • Tests

    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows: n/a
    • Additional testing not necessary because: n/a

@pranavkatariain pranavkatariain marked this pull request as ready for review June 20, 2026 07:43
@pranavkatariain

Copy link
Copy Markdown
Contributor Author

/bonk review please

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