Skip to content

Add caller-preset trust and protected composition - #1745

Draft
Zetazzz wants to merge 1 commit into
test/performance-harness-corefrom
agent/graphile-preset-trust-composition
Draft

Add caller-preset trust and protected composition#1745
Zetazzz wants to merge 1 commit into
test/performance-harness-corefrom
agent/graphile-preset-trust-composition

Conversation

@Zetazzz

@Zetazzz Zetazzz commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements F03 from constructive-io/constructive-planning#1693 as a reusable Graphile preset trust boundary:

  • adds deterministic base -> caller -> protected preset composition;
  • requires explicit trust admission before non-empty caller presets may enter Graphile resolution;
  • recursively rejects caller ownership of server-protected paths and plugins, including nested extends, cycles, accessors, and malformed preset structure;
  • reports failures through canonical internal startup errors without logging preset values;
  • reconstructs the current CNC-owned server preset through the primitive with an empty caller layer, preserving current runtime behavior.

Architecture boundary

The primitive receives its protected paths and plugin names from the owning server or feature. It does not hard-code scoped introspection, retirement, storage, WebSocket admission, or other future feature settings.

Caller preset activation remains intentionally dormant. graphile.extends / graphile.preset are not wired into runtime configuration in this PR; safe activation must wait until F17 includes preset composition in the exact build/cache identity.

This PR does not claim a direct performance improvement. It establishes the composition and trust contract required by later independently reviewable features.

Validation

  • pnpm install --frozen-lockfile
  • pnpm --filter @constructive-io/errors test — 42 tests passed
  • pnpm --filter @constructive-io/graphql-server exec jest --runInBand — 162 tests passed
  • focused preset-composition suite — 19 tests passed
  • pnpm --filter @constructive-io/errors build
  • pnpm --filter @constructive-io/express-context build
  • pnpm --filter @constructive-io/graphql-server build — CJS and ESM
  • pnpm --filter @constructive-io/perf-harness test — 7 tests passed
  • pnpm --filter @constructive-io/perf-harness build — CJS and ESM
  • ESLint on all changed TypeScript files — no errors (one pre-existing unused catch-variable warning in graphile.ts)
  • Prettier check on all new files
  • git diff --check

Excluded

  • no caller-facing Graphile configuration or trust toggle;
  • no build/cache identity changes (F17);
  • no feature-specific protected settings (including F15/F28);
  • no scoped-introspection, build-state retirement, dependency patch, or benchmark scenario changes.

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