Add opt-in CNC scoped introspection - #1719
Draft
Zetazzz wants to merge 6 commits into
Draft
Conversation
Zetazzz
force-pushed
the
feat/cnc-scoped-introspection
branch
from
August 14, 2026 13:09
d42cd85 to
8a83d70
Compare
This was referenced Aug 16, 2026
Zetazzz
force-pushed
the
feat/cnc-scoped-introspection
branch
from
August 18, 2026 05:19
a8fed57 to
fa39446
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
graphile-scoped-introspectionpackage undergraphile/.GRAPHILE_INTROSPECTION_MODE=stock|scoped-required; absence defaults tostock.scoped-requiredis selected.Default and opt-in boundaries
stock(default)ConstructivePresetretains upstreamPgIntrospectionPlugin.graphile-settings.makePgServiceis the upstream PostGraphile factory, without CNC service fields or introspection settings.graphile-scoped-introspection, so its pinned upstream contract sentinel cannot affect stock startup.scoped-required(opt-in)ScopedIntrospectionPresetwhile constructing the schema handler.makeScopedPgServiceselects dependency-closure catalog retention, bounded introspection settings, configured dependency schemas, and configured capability extensions.Configuration is owned by
@constructive-io/graphql-envand forwarded through typedGraphileOptions; the plugin package does not readprocess.env. Precedence remains defaults → config file → environment → runtime override, and malformed explicit mode values fail during option resolution.Architecture
The scoped SQL is CNC-owned, static, and parameterized. It is adapted from the MIT-licensed
pg-introspection@1.0.1query structure and does not patch installed Graphile, Dataplan, or pg-introspection packages or import private package subpaths.The introspection mode, catalog policy, and PgService option contracts have a single owner in
@constructive-io/graphql-types. The scoped plugin re-exports those public types for compatibility;graphile-settingsconsumes the canonical contract directly and has no package dependency ongraphile-scoped-introspection.Database clients continue to use the normal three-argument
withPgClientFromPgService(service, settings, callback)lifecycle. Final pool teardown remains the responsibility ofPgService.release().Validation
@constructive-io/graphql-env: 1 suite / 14 tests passed, including default, valid values, malformed values, and config/env/runtime precedence.graphile-settings: 6 non-database suites / 47 tests passed, including upstream-default and scoped service wiring.@constructive-io/graphql-server: 14 suites / 145 tests passed, including proof that stock wiring does not invoke the scoped loader.graphile-scoped-introspection: 6 suites / 18 tests passed.@constructive-io/perf-harness: 6 suites / 11 tests passed, including the explicit worker CLI protocol.git diff --checkagainst the PR base passed.pnpm install --frozen-lockfileand offline frozen-lockfile install passed.graphile-settingshas no runtime reference to the scoped package.28375,28378), matching schema hash67dae5a669c8aaa4a8cbf71a943cc0854f8ad610e835c03204c9e178c2cbe5f3, successful runtime validation in both cases, and no database URL in the report.Follow-up
When Graphile progressive introspection is available, CNC can replace this concentrated opt-in package boundary with the upstream implementation while preserving the server configuration boundary.