Skip to content

chore: update schemas from constructive-db - #1778

Open
Anmol1696 wants to merge 1 commit into
mainfrom
schema-update/20260825-225508
Open

chore: update schemas from constructive-db#1778
Anmol1696 wants to merge 1 commit into
mainfrom
schema-update/20260825-225508

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@a6bf45dbfbf

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@a6bf45dbfbf
@tenki-reviewer

tenki-reviewer Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review complete. 🟠 2 high · 🟡 1 medium

💬 Inline comments (3)


This is a large auto-generated codegen regeneration (2,489 files) that updates the GraphQL schemas and re-emits the ORM clients, CLI commands, and React hooks across constructive-sdk, constructive-cli, and constructive-react. The substantive changes are the addition of new compute (cluster/image/machine), storage, and remote ORM modules with realtime support, new agent fields (kind, visibility, databaseId, principal columns), and the admin permissions-to-capabilities rename.

Files Change
sdk/constructive-cli/src/compute/cli/commands/* Generated search/list commands build searchWhere filters whose keys (embedding.vector, search.query) do not match the ORM filter types, so the search commands are rejected by the GraphQL API at runtime.
sdk/constructive-cli/src/remote/orm/input-types.ts, sdk/constructive-sdk/src/remote/orm/input-types.ts Generated UpdateMachineMessageInput/DeleteMachineMessageInput declare only id while the schema requires recordedAt, so update/delete on MachineMessage fail at runtime.
sdk/constructive-cli/src/storage/orm/realtime.ts, sdk/constructive-sdk/src/remote/orm/realtime.ts Realtime ConnectionState never transitions because it is only updated in dispose(), so getConnectionState() always reports disconnected.
sdk/constructive-sdk/src/**/orm/*, sdk/constructive-react/src/**/orm/*, sdk/constructive-cli/src/**/orm/* Regenerated ORM clients, models, input types, and query builders for all modules (bulk generated, low signal).
sdk/constructive-sdk/schemas/*.graphql, sdk/migrate-client/schemas/migrate.graphql Updated GraphQL schemas driving the regeneration.

Note: the holistic, sweep, and two per-lens scan passes hit their step caps and did not publish; findings reflect the six scanner artifacts that did publish.

Reviewed commit: d509b07

@tenki-reviewer tenki-reviewer 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.

Regenerates all SDK clients and GraphQL schemas from updated schemas, adding new compute/storage/remote ORM modules, new agent fields, and renaming the admin permissions surface to capabilities.

Key findings

Comment on lines +191 to +206
const searchWhere = {
embedding: {
vector: query,
},
trgmBody: {
value: query,
threshold: 0.3,
},
trgmPath: {
value: query,
threshold: 0.3,
},
search: {
query,
},
};

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 · high

Search where-clause keys mismatch filter types

The generated search/list commands build searchWhere with embedding: { vector: query } and search: { query }, but the ORM filter types define embedding as VectorFilter (no vector field) and search as FullTextFilter (only matches) (sdk/constructive-cli/src/compute/cli/commands/platform-proposal-comment.ts:191). Vector similarity search belongs on the separate vectorEmbedding: VectorNearbyInput field, so the generated filter is invalid and the search command is rejected by the GraphQL API at runtime. The same issue appears in proposal-comment.ts, platform-proposal.ts, proposal.ts, proposals-chunk.ts, platform-proposals-chunk.ts, repository.ts, and platform-repository.ts.

📋 Prompt for AI Agents

In sdk/constructive-cli/src/compute/cli/commands/platform-proposal-comment.ts (searchWhere block, lines 191-206) and the identical blocks in proposal-comment.ts, platform-proposal.ts, proposal.ts, proposals-chunk.ts, platform-proposals-chunk.ts, repository.ts, and platform-repository.ts, fix the search where clause to match the ORM filter types: replace embedding: { vector: query } with vectorEmbedding: { vector: query } (the vectorEmbedding field is VectorNearbyInput; embedding is only VectorFilter with no vector key), and replace search: { query } with search: { matches: query } (the search field is FullTextFilter which only exposes matches). Also update the autoEmbedWhere(searchWhere ?? {}, ['embedding'], embedder) calls to target ['vectorEmbedding'] so the string query is embedded into the correct field. This makes the generated search/list commands send a filter the GraphQL API accepts instead of one that is rejected at runtime.

Comment on lines +786 to +794
export interface UpdateMachineMessageInput {
clientMutationId?: string;
id: string;
machineMessagePatch: MachineMessagePatch;
}
export interface DeleteMachineMessageInput {
clientMutationId?: string;
id: string;
}

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 · high

MachineMessage input omits required recordedAt

The generated UpdateMachineMessageInput/DeleteMachineMessageInput types declare only id (sdk/constructive-cli/src/remote/orm/input-types.ts:786), yet the remote schema requires recordedAt: Datetime! on both mutations and the model injects recordedAt into the payload (machineMessage.ts:202). Consumers building these inputs from the generated types cannot supply the required partition key, so update/delete on MachineMessage fail with a missing-argument error and the README where: { id } examples do not compile against the model signature. The same mismatch exists in sdk/constructive-sdk/src/remote/orm/input-types.ts.

📋 Prompt for AI Agents

In sdk/constructive-cli/src/remote/orm/input-types.ts around lines 786-794 (and the matching sdk/constructive-sdk/src/remote/orm/input-types.ts), add recordedAt: string; to both the UpdateMachineMessageInput interface and the DeleteMachineMessageInput interface, because the remote.graphql schema requires recordedAt: Datetime! on both mutations (UpdateMachineMessageInput line 2330, DeleteMachineMessageInput line 262) and the generated MachineMessageModel.update/delete (sdk/constructive-cli/src/remote/orm/models/machineMessage.ts lines 174-240) require a recordedAt composite partition key in the where and inject it into the mutation input payload. Without it the declared input types contradict the schema and the serialized request, so update/delete calls fail at runtime and README where: { id } examples will not compile.

Comment on lines +143 to +144
private connectionState: ConnectionState = 'disconnected';
private stateListeners: Set<ConnectionStateListener> = new Set();

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

Realtime connection state never transitions

RealtimeManager tracks a ConnectionState initialized to 'disconnected' that is only ever changed inside dispose() (sdk/constructive-cli/src/storage/orm/realtime.ts:234), because setConnectionState() is never wired to the underlying wsClient's connecting/connected/reconnecting lifecycle (the WsClient interface exposes only subscribe()/dispose(), line 31). As a result getConnectionState() always returns 'disconnected' even while events are delivered, and every onConnectionStateChange listener is dead until dispose; consumers gating upload/retry logic on 'connected' state misbehave and can never observe a healthy connection. The same defect exists in sdk/constructive-sdk/src/remote/orm/realtime.ts.

📋 Prompt for AI Agents

In sdk/constructive-cli/src/storage/orm/realtime.ts (and the matching sdk/constructive-sdk/src/remote/orm/realtime.ts), the private connectionState (line 143) is never updated except in dispose() (line 234). Extend the WsClient interface (or accept an optional onConnectionStateChange in RealtimeConfig) so the manager can observe the transport's connecting/connected/reconnecting states, then call this.setConnectionState() on those transitions in the constructor and remove the hook in dispose(), so getConnectionState() and onConnectionStateChange listeners reflect the real WebSocket state.

@blacksmith-sh

blacksmith-sh Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Found 4 test failures on Blacksmith runners:

Failures

Test View Logs
Export Meta Config Validation › metaschema_modules_public tables/
should include all required metaschema_modules_public tables in config
View Logs
Round-trip field name verification: snake_case → camelCase → snake_case/
every META_TABLE_CONFIG key round-trips through camelCase conversion
View Logs
Round-trip field name verification: snake_case → camelCase → snake_case/
every META_TABLE_CONFIG table name round-trips through camelCase conversion
View Logs
SQL and GraphQL flow table parity/
every override key should exist in the generated manifest config
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

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