Add zero-patch CNC scoped introspection package - #1719
Draft
Zetazzz wants to merge 1 commit into
Draft
Conversation
Zetazzz
force-pushed
the
feat/cnc-scoped-introspection
branch
from
August 14, 2026 13:09
d42cd85 to
8a83d70
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-settingsresponsible only formakePgServicenormalization, convenience re-exports, and explicitConstructivePresetwiring.ScopedIntrospectionPresetdirectly from its owner package while continuing to use the narrowgraphile-settingsservice factory.Architecture
This implementation uses no pnpm patches and does not modify installed Graphile, Dataplan, or pg-introspection packages. The scoped SQL is CNC-owned, static, and parameterized; it is adapted from the MIT-licensed
pg-introspection@1.0.1query structure and the prior CNC implementation. It does not import private package subpaths or rewrite upstream SQL at runtime.Stock-only configurations delegate to the upstream
PgIntrospectionPluginhelper. Scoped configurations use the CNC query, and mixed stock/scoped services select independently. The replacement preset atomically disables the upstream plugin without mutating its singleton. A pinnedgraphile-build-pg@5.1.3contract sentinel fails deterministically on version or gather-shape drift.Client lifecycle
Introspection uses the normal three-argument
withPgClientFromPgService(service, settings, callback)API. Each checkout returns to the upstream pool after the query; there is no destroy mode or custom release protocol. Final pool teardown remains the responsibility ofPgService.release(), which the performance worker retains infinallyfor success and failure paths.Validation
graphile-scoped-introspection: 6 suites / 18 tests passed.graphile-settings: 6 non-database suites / 48 tests passed; real PostgreSQLConstructivePresetbuild and runtime query passed.@constructive-io/perf-harness: 6 suites / 8 tests passed.git diff --checkpassed.pnpm install --frozen-lockfileandpnpm install --frozen-lockfile --offlinepassed.16685,16687), matching schema hash6f78c926837733edca7c1706b1fde33bc260defb54d89000f6327cbeb2b1e1f3, runtime validation in both cases, and no database URL in the report.finallyteardown path.test/performance-harness-corecontains no patch files, nopatchedDependencies, and no.gitattributespatch rule.Follow-up
When Graphile progressive introspection is available, CNC can replace this concentrated package boundary with the upstream implementation while leaving
graphile-settingsand the performance harness wiring narrow.