Skip to content

fix(provision): extend blueprint types with client-side cross-ref fields + bump @constructive-io/graphql-codegen to 4.30.2#32

Merged
pyramation merged 2 commits intomainfrom
feat/provision-blueprint-and-codegen-bump
Apr 18, 2026
Merged

fix(provision): extend blueprint types with client-side cross-ref fields + bump @constructive-io/graphql-codegen to 4.30.2#32
pyramation merged 2 commits intomainfrom
feat/provision-blueprint-and-codegen-bump

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Combined version of #30 + #31 targeting main so the full CI suite runs (the stacked pair only got Socket Security because #31 was targeting a non-main branch).

Two independent commits:

  1. fix(provision): extend blueprint types with client-side cross-ref fields — same as #30.

    packages/provision declares tables, relations, and indexes using local ref / table_ref / source_ref / target_ref IDs so schemas can be written out-of-order; provisionBlueprint() resolves them to table_name / source_table / target_table before the blueprint reaches construct_blueprint(). node-type-registry@0.16.0 (pulled in by the PR chore(deps): bump all @constructive-io/* and graphile-* packages to latest #29 bump) no longer carries those fields, which broke pnpm build across blueprint.ts and all 10 src/schemas/*.ts files with ~260 TS2353/TS2339 errors.

    Fix is entirely at the type layer in packages/provision/src/blueprint.ts:

    • BlueprintTable = BaseBlueprintTable & { ref?: string }
    • BlueprintIndex with table_name relaxed to optional + table_ref?: string
    • Distributive AddRelationRefs<T> over the BlueprintRelation union so every arm gains optional source_ref / target_ref
    • BlueprintDefinition re-exported with the extended arrays

    Schemas already import from '../blueprint', so zero caller changes — all 10 schema files type-check unchanged. Also fixes 6 TS7018 implicit-any[] errors on empty grant_roles / grants / policies / grant_privileges arrays.

  2. chore(deps): bump @constructive-io/graphql-codegen to 4.30.2, @constructive-io/node to ^0.10.3, graphql-server-test to ^2.12.2 — same as #31.

    graphql-codegen@4.30.2 carries the upstream embedder template fix from constructive-io/constructive#1005 — generic autoEmbedWhere<T extends object> / autoEmbedInput<T extends object> signatures, matching the hand-patched sdk/cli/generated/cli/embedder.ts that shipped in chore(deps): bump all @constructive-io/* and graphile-* packages to latest #29. Verified no drift:

    $ grep -nE "autoEmbed(Where|Input)" node_modules/.../graphql-codegen/.../embedder.ts
    116:export async function autoEmbedWhere<T extends object>(
    161:export async function autoEmbedInput<T extends object>(
    
    $ grep -nE "autoEmbed(Where|Input)" sdk/cli/generated/cli/embedder.ts
    100:export async function autoEmbedWhere<T extends object>(
    145:export async function autoEmbedInput<T extends object>(
    

Full pnpm build is green across all 12 workspace projects after both commits.

This supersedes #30 and #31 — happy to close those once this lands.

Review & Testing Checklist for Human

  • Confirm all CI jobs pass (orm-tests, cli-e2e-tests, embedding-tests, embedding-pipeline, pgpm-deploy, rag-tests, Socket Security).
  • Optional: run pnpm generate:all locally and confirm the regenerated sdk/cli/generated/cli/embedder.ts diff is noise-only (prettier / header comments) with autoEmbedWhere<T> / autoEmbedInput<T> intact.
  • Sanity check: open one schema file (e.g. src/schemas/crm.ts) and confirm IntelliSense still works on both ref and the canonical BlueprintTable fields.

Notes

  • No runtime behavior changes; commit 1 is type-only + 3 as annotations on empty literals, commit 2 is package.json/lockfile only.
  • None of the other packages Dan just published (@constructive-io/cli, graphql-server, knative-job-service, playwright-test, react, sdk, @constructive-sdk/cli) are referenced from agentic-db's package graph, so nothing else to bump.

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

packages/provision declares tables, relations, and indexes using local
`ref` / `table_ref` / `source_ref` / `target_ref` IDs so schemas can
be written out-of-order; provisionBlueprint resolves these to
`table_name` / `source_table` / `target_table` before sending the
blueprint to construct_blueprint.

node-type-registry@0.16.0 no longer carries these client-side fields on
BlueprintTable / BlueprintIndex / BlueprintRelation. Extend the types
locally in blueprint.ts (and re-export under the canonical names) so
the 10 schema files and blueprint.ts itself type-check without touching
any caller or weakening the server wire format.

Also fixes TS7018 implicit-any[] errors on empty grant_roles / grants /
policies / grant_privileges arrays inside the serverDef builder.
…uctive-io/node to ^0.10.3, graphql-server-test to ^2.12.2

Picks up the upstream embedder template fix (constructive-io/constructive#1005)
so the next `pnpm generate:all` regenerates sdk/cli/generated/cli/embedder.ts
with the generic autoEmbedWhere/autoEmbedInput signatures already on main,
rather than the old narrow Record<string, unknown> shape that broke
lerna publish with 74 TS2345 errors.
@devin-ai-integration
Copy link
Copy Markdown

🤖 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 and CI monitoring

@pyramation pyramation merged commit 57df971 into main Apr 18, 2026
8 checks passed
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