Skip to content

chore: update schemas from constructive-db - #2001

Open
Anmol1696 wants to merge 1 commit into
mainfrom
schema-update/20261114-094134
Open

Anmol1696 wants to merge 1 commit into
mainfrom
schema-update/20261114-094134

Conversation

@Anmol1696

Copy link
Copy Markdown
Contributor

Automated Schema + SDK Update

This PR was created by the schema-propagation workflow.

What changed

Updated schema files from constructive-db and regenerated ALL SDK clients.

Source: constructive-db@0ff2de29c89

Schemas updated

  • sdk/constructive-sdk/schemas/ — all API targets from constructive-db (auto-discovered)
  • sdk/migrate-client/schemas/ — migrate
  • pgpm/export/src/meta-export-tables.json — generated meta export table list

Clients regenerated

  • sdk/constructive-sdk/src/ — ORM client
  • sdk/constructive-cli/src/ — CLI client
  • sdk/constructive-react/src/ — React hooks
  • sdk/migrate-client/src/ — Migrate client

Skill references updated

  • .agents/skills/ — Generated skill documentation

Auto-generated by constructive-hub schema-propagation

Auto-generated by schema-propagation workflow.
Source: constructive-db@0ff2de29c89
@luxor-code-review

luxor-code-review Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Review complete. 🟡 4 medium

💬 Inline comments (3)

📍 Findings outside the diff (1) — 🟡 1 medium — defects on lines GitHub can't attach comments to

🟡 Medium — Tree-nodes models emit unsupported where/orderBy args · getAllTreeNodesRecord.ts:45–61 · unchanged line

// sdk/constructive-react/src/compute/orm/models/getAllTreeNodesRecord.ts
45	    const { document, variables } = buildFindManyDocument(
46	      'GetAllTreeNodesRecord',
47	      'getAllTreeNodes',
48	      args.select,
49	      {
50	        where: args?.where,
51	        orderBy: args?.orderBy as string[] | undefined,
52	        first: args?.first,
53	        last: args?.last,
54	        after: args?.after,
55	        before: args?.before,
56	        offset: args?.offset,

The generated getAllTreeNodesRecord model builds findMany/findFirst documents with where: GetAllTreeNodesRecordFilter and orderBy: GetAllTreeNodesRecordsOrderBy variables (sdk/constructive-react/src/compute/orm/models/getAllTreeNodesRecord.ts:45-61), but the schema root field getAllTreeNodes accepts only after/first/offset/id/sId and defines no such filter or orderBy input types. Any caller passing where, orderBy, last, or before — all allowed by the exported FindManyArgs type — gets a GraphQL validation error, and the field's actual id/sId parameters are unreachable through the generated API. Additionally, findFirst labels the QueryBuilder with the nonexistent root field getAllTreeNodesRecord (line 94), which today is inert metadata but will break any consumer relying on fieldName.

The same defects appear in infraGetAllTreeNodesRecord.ts, platformInfraGetAllTreeNodesRecord.ts, and databaseGraphGetAllTreeNodesRecord.ts, replicated across the constructive-sdk and constructive-cli packages.

🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 Remove stale create from CLI usage strings (secret.ts:28) — This PR removes the create subcommand and its handler from the secret, internal-secret, platform-secret, platform-internal-secret, app-internal-secret, file, and platform-file CLI commands, but the generated usage help string still advertises create, so --help directs users to a subcommand that now errors.

This is a pure regeneration PR: all 691 changed files are generated artifacts across four SDK packages plus auto-generated .agents/skills reference docs, reflecting schema changes (BuilderBinding→ServiceBinding, removal of create-mutations for read-shaped records, new auth/config/compute surfaces). The removals were verified to be internally consistent across packages (no dangling imports, keys, or stale type references), and the new hooks and models wire correctly against the regenerated SDLs. The remaining issues are codegen-template defects that produce broken or stale output in specific generated families:

Files Change
sdk/constructive-cli/src/{config,storage}/cli/commands/* Secret/file command handlers drop the create subcommand but usage strings still advertise it
sdk/constructive-cli/src/storage/cli/commands/file.ts, platform-file.ts Update commands forward downloadUrl/filePath fields absent from the regenerated patch inputs
sdk/*/compute/orm/models/*GetAllTreeNodesRecord.ts Tree-nodes models emit where/orderBy args the schema root fields do not accept
sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts Rewritten hook lost the onSuccess list-cache invalidation of the hook it replaces
sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts Same lost-invalidation pattern for function-graph create

Reviewed commit: 3f99985

@luxor-code-review luxor-code-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR regenerates the SDK packages (constructive-cli, constructive-react, constructive-sdk, migrate-client) and skill reference docs after upstream GraphQL schema changes: BuilderBinding is replaced by ServiceBinding, read-shaped create mutations and resolve-route/deep-link queries are removed, and new auth mutations (ensureAuthCsrf, exchangeNativeHandoff), config secret surfaces, platformReservedSubdomain, and resource health/utilization queries are added.

Key findings

Comment on lines +343 to +345
downloadUrl: cleanedData.downloadUrl,
expiryEnqueuedAt: cleanedData.expiryEnqueuedAt,
filePath: cleanedData.filePath,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 bug · medium

CLI file update forwards fields absent from FilePatch

The regenerated cnc file update and platform-file update commands forward downloadUrl and filePath in the mutation's data object (sdk/constructive-cli/src/storage/cli/commands/file.ts:343-345), but neither field exists on FilePatch nor on PlatformFilePatch. Since cleanedData is cast to the patch type, cleanedData.downloadUrl and cleanedData.filePath are invalid property accesses and the package fails to compile; if type-checking is bypassed, the GraphQL server rejects the unknown input fields and every file update / platform-file update invocation errors out.

The same defect appears in sdk/constructive-cli/src/storage/cli/commands/platform-file.ts at lines 337-339.

📋 Prompt for AI Agents

In sdk/constructive-cli/src/storage/cli/commands/file.ts (lines 343 and 345) and sdk/constructive-cli/src/storage/cli/commands/platform-file.ts (lines 337 and 339), delete the downloadUrl: cleanedData.downloadUrl, and filePath: cleanedData.filePath, entries from the update data object, and remove any corresponding prompt entries, because FilePatch and PlatformFilePatch (sdk/constructive-cli/src/storage/orm/input-types.ts) do not define these fields and the code currently fails to compile. Prefer regenerating the CLI with @constructive-io/graphql-codegen if that is the standard workflow.

Comment on lines +44 to 55
mutationKey: customMutationKeys.createPrincipal(),
mutationFn: (variables: CreatePrincipalVariables) =>
getClient()
.principal.create({
data,
.mutation.createPrincipal(variables, {
select: args.select,
})
} as {
select: S;
} & StrictSelect<S, CreatePrincipalPayloadSelect>)
.unwrap(),
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: principalKeys.lists(),
});
},
...mutationOptions,
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 bug · medium

useCreatePrincipalMutation lost list invalidation

The rewritten useCreatePrincipalMutation no longer invalidates principalKeys.lists() on success (sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts:44-55), whereas the hook this patch replaces did. Since the same patch removes the Principal table create mutation and PrincipalModel.create, this hook is now the only create path in the React SDK, yet the principals list cache is never marked dirty after a successful create. Consumers render a stale principal list — missing the new principal or showing deleted ones — until the query goes stale or a refetch occurs.

📋 Prompt for AI Agents

In sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts around lines 40-55, import useQueryClient from '@tanstack/react-query' and principalKeys from '../query-keys', create the query client, and add onSuccess: () => { queryClient.invalidateQueries({ queryKey: principalKeys.lists() }); } before ...mutationOptions in the useMutation config, so newly created principals appear in cached lists. Note the file is generated; prefer fixing the codegen template if the hook is regenerated.

Comment on lines 46 to 58
return useMutation({
mutationKey: functionGraphMutationKeys.create(),
mutationFn: (data: CreateFunctionGraphInput['functionGraph']) =>
mutationKey: customMutationKeys.createFunctionGraph(),
mutationFn: (variables: CreateFunctionGraphVariables) =>
getClient()
.functionGraph.create({
data,
.mutation.createFunctionGraph(variables, {
select: args.select,
})
} as {
select: S;
} & StrictSelect<S, CreateFunctionGraphPayloadSelect>)
.unwrap(),
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: functionGraphKeys.lists(),
});
},
...mutationOptions,
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 bug · medium

useCreateFunctionGraphMutation lost list invalidation

The rewritten useCreateFunctionGraphMutation dropped the onSuccess invalidation of functionGraphKeys.lists() (sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts:46-58) that the previous generated hook performed. The patch simultaneously removes the FunctionGraph table create mutation backing the old hook, so after creating a graph through this hook the useFunctionGraphsQuery cache is never refreshed. Users see the new graph only after the list query goes stale or the page remounts.

📋 Prompt for AI Agents

In sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts around lines 46-58, import useQueryClient from '@tanstack/react-query' and functionGraphKeys from '../query-keys', create the query client, and add onSuccess: () => { queryClient.invalidateQueries({ queryKey: functionGraphKeys.lists() }); } before ...mutationOptions in the useMutation config so the function graph list refreshes after createFunctionGraph succeeds. Prefer fixing the codegen template since the file is generated.

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