Skip to content

feat(server): default the scoped routing plane to logical routing_public - #1466

Merged
pyramation merged 3 commits into
mainfrom
feat/logical-routing-schema
Jul 27, 2026
Merged

feat(server): default the scoped routing plane to logical routing_public#1466
pyramation merged 3 commits into
mainfrom
feat/logical-routing-schema

Conversation

@pyramation

@pyramation pyramation commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Server-side wiring for constructive-io/constructive-planning#1268 / #1264 items 3–4: constructive-db#2516 renamed the published routing plane to its logical name, so the platform DB now carries routing_public — but the server still hardcoded constructive_routing_public in places that ignored the configurable routing-schema option.

  • Default flips: apiDefaults.routingSchema (and the metaSchemas default entry) → routing_public. API_ROUTING_SCHEMA still overrides.
  • graphql/server no longer hardcodes the schema: the X-Api-Name lookup (queryByApiName) and the /flush domain query now build their SQL from getRoutingSchema(opts) (new helper in middleware/routing.ts, identifier-validated, interpolated as a quoted identifier).
  • express-context loaders (rls/cors/database-settings/pubkey/webauthn) previously hardcoded constructive_routing_public.*; LoaderContext gains routingSchema? (default routing_public via routingSchemaOf(ctx)), threaded from buildLoaderContext and createContextMiddleware({ routingSchema }).
  • Option rename (per review): scopedRoutinguseRouting, scopedRoutingSchemaroutingSchema, API_SCOPED_ROUTING_SCHEMAAPI_ROUTING_SCHEMA, and matching helper/constant names — "scoped routing" naming no longer leaks into config surfaces.

Integration fixtures (@constructive-db/routing@1.0.1 in pgpm.json) still publish the pre-rename prefixed schema, so the server-test suites pin routingSchema: 'constructive_routing_public' explicitly — they can drop that once the renamed plane packages are published.

Tests: graphql/server 120/120, express-context 4/4, graphql/env 9/9 (snapshot updated), server-test scoped suites 86/86 locally (upload/S3 suite requires MinIO, absent locally — verified on CI).

Link to Devin session: https://app.devin.ai/sessions/ef854ab8e37e4fedbb21bfd777608edd
Requested by: @pyramation

The platform database now publishes the routing plane under its logical
name (routing_public) rather than the constructive_-prefixed staging
name. The server default, the X-Api-Name lookup, the flush domain query,
and the express-context loaders all honor the configured
scopedRoutingSchema (threaded through LoaderContext.routingSchema)
instead of hardcoding constructive_routing_public. Integration suites
that seed the pre-rename published fixture modules pin the legacy schema
explicitly.
@pyramation pyramation self-assigned this Jul 27, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

…chema

scopedRouting -> useRouting, scopedRoutingSchema -> routingSchema,
API_SCOPED_ROUTING_SCHEMA -> API_ROUTING_SCHEMA, plus the matching
helper/constant names and docs.
1.0.1 was unpublished from npm; CI fixture installs fail with ETARGET.
@pyramation
pyramation merged commit d7fbcfb into main Jul 27, 2026
15 checks passed
@pyramation
pyramation deleted the feat/logical-routing-schema branch July 27, 2026 03:06
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