feat: move node-type-registry to packages/ and add column-ref annotations#1043
Merged
pyramation merged 2 commits intomainfrom May 1, 2026
Merged
Conversation
…ions
- Move graphql/node-type-registry → packages/node-type-registry (platform-level
package, not graphql-specific)
- Add format: "column-ref" JSON Schema annotations to all parameter_schema
properties that reference table column names across all node types:
- Authz*: entity_field, is_published_field, published_at_field, valid_from_field,
valid_until_field, array_field, anchor_field, owner_field, obj_field, etc.
- Data*: field_name, owner_field_name, entity_field_name, target, source_fields,
parent_fk_field, role_key_field_name, condition_field, watch_fields, etc.
- Search*: field_name, source_fields, source_geom_field, source_fk_field, etc.
- Relation*: field_name, source_field_name, target_field_name
- View*: group_by_fields, field_names, primary_columns, primary_field, join_field
- Update codegen header comments to reflect new packages/ path
These annotations enable the constructive-db SQL codegen to distinguish column
references from config values, supporting generic policy column resolution for
the embedding_chunks trigger fix (issue #767).
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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
Two changes in one PR:
1. Move
graphql/node-type-registry→packages/node-type-registryThe node-type-registry is platform-level infrastructure (used by blueprints, codegen, and the SQL metaschema), not graphql-specific. Moves it alongside
packages/safegreswhere it belongs. Thepnpm-workspace.yamlalready includespackages/*, so no workspace config changes needed.2. Add
"format": "column-ref"JSON Schema annotationsEvery
parameter_schemaproperty that references a table column name now carries"format": "column-ref". This is a standard JSON Schema annotation that distinguishes column references from config values (booleans, enums, integers, table/schema names, UUIDs).Annotated across all node type categories:
entity_field,is_published_field,published_at_field,valid_from_field,valid_until_field,array_field,anchor_field,owner_field,obj_field,obj_ref_field,owned_table_key,owned_table_ref_key,this_object_keyfield_name,owner_field_name,entity_field_name,target,source_fields,parent_fk_field,fields,source_field_name,role_key_field_name,protected_field_names,condition_field,watch_fields,payload_fieldsfield_name,source_fields,source_geom_field,source_fk_field,trgm_fields,boost_recency_fieldfield_name,source_field_name,target_field_namegroup_by_fields,field_names,primary_columns,primary_field,join_field,columnsWhy: The downstream
constructive-dbSQL codegen package (PR #967) compiles these definitions into ametaschema_public.node_type_registrySQL table. Withformat: "column-ref"annotations, any SQL trigger (likeembedding_chunks) can generically discover which policy parameters are column references and clone the corresponding columns — without hardcoding knowledge of specific Authz*/Data* types. This is the key enabler for issue #767.Review & Testing Checklist for Human
node-type-registryby npm name (should be transparent sincepackage.jsonname is unchanged)format: "column-ref"annotations to confirm the right properties were annotated (column refs) and the right ones were left alone (config values like booleans, enums, UUIDs)pnpm buildinpackages/node-type-registryto verify TypeScript compilationNotes
format: "column-ref"annotation follows JSON Schema conventions —formatis the standard keyword for semantic type hintsentity_fields,source_fields), the annotation is placed on theitemsschema, not the array itselfconstructive-dbnode-type-registry codegen package needs to be regenerated to pick up the new annotationsLink to Devin session: https://app.devin.ai/sessions/20dbaaa0e6e74599842fbefe33efbc26
Requested by: @pyramation